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 2595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2951 // safe to write to the context register. | 2952 // safe to write to the context register. |
2952 __ push(r0); | 2953 __ push(r0); |
2953 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 2954 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
2954 __ CallRuntime(Runtime::kTraceExit, 1); | 2955 __ CallRuntime(Runtime::kTraceExit, 1); |
2955 } | 2956 } |
2956 if (info()->saves_caller_doubles()) { | 2957 if (info()->saves_caller_doubles()) { |
2957 RestoreCallerDoubles(); | 2958 RestoreCallerDoubles(); |
2958 } | 2959 } |
2959 int no_frame_start = -1; | 2960 int no_frame_start = -1; |
2960 if (NeedsEagerFrame()) { | 2961 if (NeedsEagerFrame()) { |
2961 __ mov(sp, fp); | 2962 no_frame_start = masm_->LeaveFrame(StackFrame::JAVA_SCRIPT); |
2962 no_frame_start = masm_->pc_offset(); | |
2963 __ ldm(ia_w, sp, fp.bit() | lr.bit()); | |
2964 } | 2963 } |
2965 if (instr->has_constant_parameter_count()) { | 2964 if (instr->has_constant_parameter_count()) { |
2966 int parameter_count = ToInteger32(instr->constant_parameter_count()); | 2965 int parameter_count = ToInteger32(instr->constant_parameter_count()); |
2967 int32_t sp_delta = (parameter_count + 1) * kPointerSize; | 2966 int32_t sp_delta = (parameter_count + 1) * kPointerSize; |
2968 if (sp_delta != 0) { | 2967 if (sp_delta != 0) { |
2969 __ add(sp, sp, Operand(sp_delta)); | 2968 __ add(sp, sp, Operand(sp_delta)); |
2970 } | 2969 } |
2971 } else { | 2970 } else { |
2972 Register reg = ToRegister(instr->parameter_count()); | 2971 Register reg = ToRegister(instr->parameter_count()); |
2973 // The argument count parameter is a smi | 2972 // The argument count parameter is a smi |
(...skipping 2902 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5876 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); | 5875 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); |
5877 __ ldr(result, FieldMemOperand(scratch, | 5876 __ ldr(result, FieldMemOperand(scratch, |
5878 FixedArray::kHeaderSize - kPointerSize)); | 5877 FixedArray::kHeaderSize - kPointerSize)); |
5879 __ bind(&done); | 5878 __ bind(&done); |
5880 } | 5879 } |
5881 | 5880 |
5882 | 5881 |
5883 #undef __ | 5882 #undef __ |
5884 | 5883 |
5885 } } // namespace v8::internal | 5884 } } // namespace v8::internal |
OLD | NEW |