| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 | 138 |
| 139 #ifdef DEBUG | 139 #ifdef DEBUG |
| 140 if (strlen(FLAG_stop_at) > 0 && | 140 if (strlen(FLAG_stop_at) > 0 && |
| 141 info_->function()->name()->IsUtf8EqualTo(CStrVector(FLAG_stop_at))) { | 141 info_->function()->name()->IsUtf8EqualTo(CStrVector(FLAG_stop_at))) { |
| 142 __ stop("stop_at"); | 142 __ stop("stop_at"); |
| 143 } | 143 } |
| 144 #endif | 144 #endif |
| 145 | 145 |
| 146 // r1: Callee's JS function. | 146 // r1: Callee's JS function. |
| 147 // cp: Callee's context. | 147 // cp: Callee's context. |
| 148 // pp: Callee's constant pool pointer (if FLAG_enable_ool_constant_pool) |
| 148 // fp: Caller's frame pointer. | 149 // fp: Caller's frame pointer. |
| 149 // lr: Caller's pc. | 150 // lr: Caller's pc. |
| 150 | 151 |
| 151 // Strict mode functions and builtins need to replace the receiver | 152 // Strict mode functions and builtins need to replace the receiver |
| 152 // with undefined when called as functions (without an explicit | 153 // with undefined when called as functions (without an explicit |
| 153 // receiver object). r5 is zero for method calls and non-zero for | 154 // receiver object). r5 is zero for method calls and non-zero for |
| 154 // function calls. | 155 // function calls. |
| 155 if (!info_->is_classic_mode() || info_->is_native()) { | 156 if (!info_->is_classic_mode() || info_->is_native()) { |
| 156 __ cmp(r5, Operand::Zero()); | 157 __ cmp(r5, Operand::Zero()); |
| 157 int receiver_offset = scope()->num_parameters() * kPointerSize; | 158 int receiver_offset = scope()->num_parameters() * kPointerSize; |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 "-------------------- Deferred %s --------------------", | 274 "-------------------- Deferred %s --------------------", |
| 274 code->instruction_index(), | 275 code->instruction_index(), |
| 275 code->instr()->hydrogen_value()->id(), | 276 code->instr()->hydrogen_value()->id(), |
| 276 code->instr()->Mnemonic()); | 277 code->instr()->Mnemonic()); |
| 277 __ bind(code->entry()); | 278 __ bind(code->entry()); |
| 278 if (NeedsDeferredFrame()) { | 279 if (NeedsDeferredFrame()) { |
| 279 Comment(";;; Build frame"); | 280 Comment(";;; Build frame"); |
| 280 ASSERT(!frame_is_built_); | 281 ASSERT(!frame_is_built_); |
| 281 ASSERT(info()->IsStub()); | 282 ASSERT(info()->IsStub()); |
| 282 frame_is_built_ = true; | 283 frame_is_built_ = true; |
| 283 __ stm(db_w, sp, cp.bit() | fp.bit() | lr.bit()); | 284 __ PushFixedFrame(); |
| 284 __ mov(scratch0(), Operand(Smi::FromInt(StackFrame::STUB))); | 285 __ mov(scratch0(), Operand(Smi::FromInt(StackFrame::STUB))); |
| 285 __ push(scratch0()); | 286 __ push(scratch0()); |
| 286 __ add(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp)); | 287 __ add(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp)); |
| 287 Comment(";;; Deferred code"); | 288 Comment(";;; Deferred code"); |
| 288 } | 289 } |
| 289 code->Generate(); | 290 code->Generate(); |
| 290 if (NeedsDeferredFrame()) { | 291 if (NeedsDeferredFrame()) { |
| 291 Comment(";;; Destroy frame"); | 292 Comment(";;; Destroy frame"); |
| 292 ASSERT(frame_is_built_); | 293 ASSERT(frame_is_built_); |
| 293 __ pop(ip); | 294 __ pop(ip); |
| 294 __ ldm(ia_w, sp, cp.bit() | fp.bit() | lr.bit()); | 295 __ PopFixedFrame(); |
| 295 frame_is_built_ = false; | 296 frame_is_built_ = false; |
| 296 } | 297 } |
| 297 __ jmp(code->exit()); | 298 __ jmp(code->exit()); |
| 298 } | 299 } |
| 299 } | 300 } |
| 300 | 301 |
| 301 // Force constant pool emission at the end of the deferred code to make | 302 // Force constant pool emission at the end of the deferred code to make |
| 302 // sure that no constant pools are emitted after. | 303 // sure that no constant pools are emitted after. |
| 303 masm()->CheckConstPool(true, false); | 304 masm()->CheckConstPool(true, false); |
| 304 | 305 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 335 } else { | 336 } else { |
| 336 Comment(";;; jump table entry %d: deoptimization bailout %d.", i, id); | 337 Comment(";;; jump table entry %d: deoptimization bailout %d.", i, id); |
| 337 } | 338 } |
| 338 if (deopt_jump_table_[i].needs_frame) { | 339 if (deopt_jump_table_[i].needs_frame) { |
| 339 ASSERT(!info()->saves_caller_doubles()); | 340 ASSERT(!info()->saves_caller_doubles()); |
| 340 __ mov(ip, Operand(ExternalReference::ForDeoptEntry(entry))); | 341 __ mov(ip, Operand(ExternalReference::ForDeoptEntry(entry))); |
| 341 if (needs_frame.is_bound()) { | 342 if (needs_frame.is_bound()) { |
| 342 __ b(&needs_frame); | 343 __ b(&needs_frame); |
| 343 } else { | 344 } else { |
| 344 __ bind(&needs_frame); | 345 __ bind(&needs_frame); |
| 345 __ stm(db_w, sp, cp.bit() | fp.bit() | lr.bit()); | 346 __ PushFixedFrame(); |
| 346 // This variant of deopt can only be used with stubs. Since we don't | 347 // This variant of deopt can only be used with stubs. Since we don't |
| 347 // have a function pointer to install in the stack frame that we're | 348 // have a function pointer to install in the stack frame that we're |
| 348 // building, install a special marker there instead. | 349 // building, install a special marker there instead. |
| 349 ASSERT(info()->IsStub()); | 350 ASSERT(info()->IsStub()); |
| 350 __ mov(scratch0(), Operand(Smi::FromInt(StackFrame::STUB))); | 351 __ mov(scratch0(), Operand(Smi::FromInt(StackFrame::STUB))); |
| 351 __ push(scratch0()); | 352 __ push(scratch0()); |
| 352 __ add(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp)); | 353 __ add(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp)); |
| 353 __ mov(lr, Operand(pc), LeaveCC, al); | 354 __ mov(lr, Operand(pc), LeaveCC, al); |
| 354 __ mov(pc, ip); | 355 __ mov(pc, ip); |
| 355 } | 356 } |
| (...skipping 2601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2957 // safe to write to the context register. | 2958 // safe to write to the context register. |
| 2958 __ push(r0); | 2959 __ push(r0); |
| 2959 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 2960 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
| 2960 __ CallRuntime(Runtime::kTraceExit, 1); | 2961 __ CallRuntime(Runtime::kTraceExit, 1); |
| 2961 } | 2962 } |
| 2962 if (info()->saves_caller_doubles()) { | 2963 if (info()->saves_caller_doubles()) { |
| 2963 RestoreCallerDoubles(); | 2964 RestoreCallerDoubles(); |
| 2964 } | 2965 } |
| 2965 int no_frame_start = -1; | 2966 int no_frame_start = -1; |
| 2966 if (NeedsEagerFrame()) { | 2967 if (NeedsEagerFrame()) { |
| 2967 __ mov(sp, fp); | |
| 2968 no_frame_start = masm_->pc_offset(); | 2968 no_frame_start = masm_->pc_offset(); |
| 2969 __ ldm(ia_w, sp, fp.bit() | lr.bit()); | 2969 __ LeaveFrame(StackFrame::JAVA_SCRIPT); |
| 2970 } | 2970 } |
| 2971 if (instr->has_constant_parameter_count()) { | 2971 if (instr->has_constant_parameter_count()) { |
| 2972 int parameter_count = ToInteger32(instr->constant_parameter_count()); | 2972 int parameter_count = ToInteger32(instr->constant_parameter_count()); |
| 2973 int32_t sp_delta = (parameter_count + 1) * kPointerSize; | 2973 int32_t sp_delta = (parameter_count + 1) * kPointerSize; |
| 2974 if (sp_delta != 0) { | 2974 if (sp_delta != 0) { |
| 2975 __ add(sp, sp, Operand(sp_delta)); | 2975 __ add(sp, sp, Operand(sp_delta)); |
| 2976 } | 2976 } |
| 2977 } else { | 2977 } else { |
| 2978 Register reg = ToRegister(instr->parameter_count()); | 2978 Register reg = ToRegister(instr->parameter_count()); |
| 2979 // The argument count parameter is a smi | 2979 // The argument count parameter is a smi |
| (...skipping 2898 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5878 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); | 5878 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); |
| 5879 __ ldr(result, FieldMemOperand(scratch, | 5879 __ ldr(result, FieldMemOperand(scratch, |
| 5880 FixedArray::kHeaderSize - kPointerSize)); | 5880 FixedArray::kHeaderSize - kPointerSize)); |
| 5881 __ bind(&done); | 5881 __ bind(&done); |
| 5882 } | 5882 } |
| 5883 | 5883 |
| 5884 | 5884 |
| 5885 #undef __ | 5885 #undef __ |
| 5886 | 5886 |
| 5887 } } // namespace v8::internal | 5887 } } // namespace v8::internal |
| OLD | NEW |