| OLD | NEW | 
|---|
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. | 
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be | 
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. | 
| 4 | 4 | 
| 5 #include "src/v8.h" | 5 #include "src/v8.h" | 
| 6 | 6 | 
| 7 #if V8_TARGET_ARCH_ARM | 7 #if V8_TARGET_ARCH_ARM | 
| 8 | 8 | 
| 9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" | 
| 10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" | 
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 89 | 89 | 
| 90 | 90 | 
| 91 // Generate code for a JS function.  On entry to the function the receiver | 91 // Generate code for a JS function.  On entry to the function the receiver | 
| 92 // and arguments have been pushed on the stack left to right.  The actual | 92 // and arguments have been pushed on the stack left to right.  The actual | 
| 93 // argument count matches the formal parameter count expected by the | 93 // argument count matches the formal parameter count expected by the | 
| 94 // function. | 94 // function. | 
| 95 // | 95 // | 
| 96 // The live registers are: | 96 // The live registers are: | 
| 97 //   o r1: the JS function object being called (i.e., ourselves) | 97 //   o r1: the JS function object being called (i.e., ourselves) | 
| 98 //   o cp: our context | 98 //   o cp: our context | 
| 99 //   o pp: our caller's constant pool pointer (if FLAG_enable_ool_constant_pool) | 99 //   o pp: our caller's constant pool pointer (if enabled) | 
| 100 //   o fp: our caller's frame pointer | 100 //   o fp: our caller's frame pointer | 
| 101 //   o sp: stack pointer | 101 //   o sp: stack pointer | 
| 102 //   o lr: return address | 102 //   o lr: return address | 
| 103 // | 103 // | 
| 104 // The function builds a JS frame.  Please see JavaScriptFrameConstants in | 104 // The function builds a JS frame.  Please see JavaScriptFrameConstants in | 
| 105 // frames-arm.h for its layout. | 105 // frames-arm.h for its layout. | 
| 106 void FullCodeGenerator::Generate() { | 106 void FullCodeGenerator::Generate() { | 
| 107   CompilationInfo* info = info_; | 107   CompilationInfo* info = info_; | 
| 108   handler_table_ = | 108   handler_table_ = | 
| 109       Handle<HandlerTable>::cast(isolate()->factory()->NewFixedArray( | 109       Handle<HandlerTable>::cast(isolate()->factory()->NewFixedArray( | 
| (...skipping 2167 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 2277 | 2277 | 
| 2278   // Enter a new JavaScript frame, and initialize its slots as they were when | 2278   // Enter a new JavaScript frame, and initialize its slots as they were when | 
| 2279   // the generator was suspended. | 2279   // the generator was suspended. | 
| 2280   Label resume_frame, done; | 2280   Label resume_frame, done; | 
| 2281   __ bind(&push_frame); | 2281   __ bind(&push_frame); | 
| 2282   __ bl(&resume_frame); | 2282   __ bl(&resume_frame); | 
| 2283   __ jmp(&done); | 2283   __ jmp(&done); | 
| 2284   __ bind(&resume_frame); | 2284   __ bind(&resume_frame); | 
| 2285   // lr = return address. | 2285   // lr = return address. | 
| 2286   // fp = caller's frame pointer. | 2286   // fp = caller's frame pointer. | 
| 2287   // pp = caller's constant pool (if FLAG_enable_ool_constant_pool), | 2287   // pp = caller's constant pool (if FLAG_enable_embedded_constant_pool), | 
| 2288   // cp = callee's context, | 2288   // cp = callee's context, | 
| 2289   // r4 = callee's JS function. | 2289   // r4 = callee's JS function. | 
| 2290   __ PushFixedFrame(r4); | 2290   __ PushFixedFrame(r4); | 
| 2291   // Adjust FP to point to saved FP. | 2291   // Adjust FP to point to saved FP. | 
| 2292   __ add(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp)); | 2292   __ add(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp)); | 
| 2293 | 2293 | 
| 2294   // Load the operand stack size. | 2294   // Load the operand stack size. | 
| 2295   __ ldr(r3, FieldMemOperand(r1, JSGeneratorObject::kOperandStackOffset)); | 2295   __ ldr(r3, FieldMemOperand(r1, JSGeneratorObject::kOperandStackOffset)); | 
| 2296   __ ldr(r3, FieldMemOperand(r3, FixedArray::kLengthOffset)); | 2296   __ ldr(r3, FieldMemOperand(r3, FixedArray::kLengthOffset)); | 
| 2297   __ SmiUntag(r3); | 2297   __ SmiUntag(r3); | 
| 2298 | 2298 | 
| 2299   // If we are sending a value and there is no operand stack, we can jump back | 2299   // If we are sending a value and there is no operand stack, we can jump back | 
| 2300   // in directly. | 2300   // in directly. | 
| 2301   if (resume_mode == JSGeneratorObject::NEXT) { | 2301   if (resume_mode == JSGeneratorObject::NEXT) { | 
| 2302     Label slow_resume; | 2302     Label slow_resume; | 
| 2303     __ cmp(r3, Operand(0)); | 2303     __ cmp(r3, Operand(0)); | 
| 2304     __ b(ne, &slow_resume); | 2304     __ b(ne, &slow_resume); | 
| 2305     __ ldr(r3, FieldMemOperand(r4, JSFunction::kCodeEntryOffset)); | 2305     __ ldr(r3, FieldMemOperand(r4, JSFunction::kCodeEntryOffset)); | 
| 2306 | 2306 | 
| 2307     { ConstantPoolUnavailableScope constant_pool_unavailable(masm_); | 2307     { ConstantPoolUnavailableScope constant_pool_unavailable(masm_); | 
| 2308       if (FLAG_enable_ool_constant_pool) { | 2308       if (FLAG_enable_embedded_constant_pool) { | 
| 2309         // Load the new code object's constant pool pointer. | 2309         // Load the new code object's constant pool pointer. | 
| 2310         __ ldr(pp, | 2310         __ LoadConstantPoolPointerRegisterFromCodeTargetAddress(r3); | 
| 2311                MemOperand(r3, Code::kConstantPoolOffset - Code::kHeaderSize)); |  | 
| 2312       } | 2311       } | 
| 2313 | 2312 | 
| 2314       __ ldr(r2, FieldMemOperand(r1, JSGeneratorObject::kContinuationOffset)); | 2313       __ ldr(r2, FieldMemOperand(r1, JSGeneratorObject::kContinuationOffset)); | 
| 2315       __ SmiUntag(r2); | 2314       __ SmiUntag(r2); | 
| 2316       __ add(r3, r3, r2); | 2315       __ add(r3, r3, r2); | 
| 2317       __ mov(r2, Operand(Smi::FromInt(JSGeneratorObject::kGeneratorExecuting))); | 2316       __ mov(r2, Operand(Smi::FromInt(JSGeneratorObject::kGeneratorExecuting))); | 
| 2318       __ str(r2, FieldMemOperand(r1, JSGeneratorObject::kContinuationOffset)); | 2317       __ str(r2, FieldMemOperand(r1, JSGeneratorObject::kContinuationOffset)); | 
| 2319       __ Jump(r3); | 2318       __ Jump(r3); | 
| 2320     } | 2319     } | 
| 2321     __ bind(&slow_resume); | 2320     __ bind(&slow_resume); | 
| (...skipping 3046 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 5368   __ SmiUntag(r1); | 5367   __ SmiUntag(r1); | 
| 5369   __ add(pc, r1, Operand(masm_->CodeObject())); | 5368   __ add(pc, r1, Operand(masm_->CodeObject())); | 
| 5370 } | 5369 } | 
| 5371 | 5370 | 
| 5372 | 5371 | 
| 5373 #undef __ | 5372 #undef __ | 
| 5374 | 5373 | 
| 5375 | 5374 | 
| 5376 static Address GetInterruptImmediateLoadAddress(Address pc) { | 5375 static Address GetInterruptImmediateLoadAddress(Address pc) { | 
| 5377   Address load_address = pc - 2 * Assembler::kInstrSize; | 5376   Address load_address = pc - 2 * Assembler::kInstrSize; | 
| 5378   if (!FLAG_enable_ool_constant_pool) { | 5377   if (!FLAG_enable_embedded_constant_pool) { | 
| 5379     DCHECK(Assembler::IsLdrPcImmediateOffset(Memory::int32_at(load_address))); | 5378     DCHECK(Assembler::IsLdrPcImmediateOffset(Memory::int32_at(load_address))); | 
| 5380   } else if (Assembler::IsLdrPpRegOffset(Memory::int32_at(load_address))) { | 5379   } else if (Assembler::IsLdrPpRegOffset(Memory::int32_at(load_address))) { | 
| 5381     // This is an extended constant pool lookup. | 5380     // This is an extended constant pool lookup. | 
| 5382     if (CpuFeatures::IsSupported(ARMv7)) { | 5381     if (CpuFeatures::IsSupported(ARMv7)) { | 
| 5383       load_address -= 2 * Assembler::kInstrSize; | 5382       load_address -= 2 * Assembler::kInstrSize; | 
| 5384       DCHECK(Assembler::IsMovW(Memory::int32_at(load_address))); | 5383       DCHECK(Assembler::IsMovW(Memory::int32_at(load_address))); | 
| 5385       DCHECK(Assembler::IsMovT( | 5384       DCHECK(Assembler::IsMovT( | 
| 5386           Memory::int32_at(load_address + Assembler::kInstrSize))); | 5385           Memory::int32_at(load_address + Assembler::kInstrSize))); | 
| 5387     } else { | 5386     } else { | 
| 5388       load_address -= 4 * Assembler::kInstrSize; | 5387       load_address -= 4 * Assembler::kInstrSize; | 
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 5508 | 5507 | 
| 5509   DCHECK(interrupt_address == | 5508   DCHECK(interrupt_address == | 
| 5510          isolate->builtins()->OsrAfterStackCheck()->entry()); | 5509          isolate->builtins()->OsrAfterStackCheck()->entry()); | 
| 5511   return OSR_AFTER_STACK_CHECK; | 5510   return OSR_AFTER_STACK_CHECK; | 
| 5512 } | 5511 } | 
| 5513 | 5512 | 
| 5514 | 5513 | 
| 5515 } }  // namespace v8::internal | 5514 } }  // namespace v8::internal | 
| 5516 | 5515 | 
| 5517 #endif  // V8_TARGET_ARCH_ARM | 5516 #endif  // V8_TARGET_ARCH_ARM | 
| OLD | NEW | 
|---|