| 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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 __ bind(&ok); | 142 __ bind(&ok); |
| 143 } | 143 } |
| 144 | 144 |
| 145 // Open a frame scope to indicate that there is a frame on the stack. The | 145 // Open a frame scope to indicate that there is a frame on the stack. The |
| 146 // MANUAL indicates that the scope shouldn't actually generate code to set up | 146 // MANUAL indicates that the scope shouldn't actually generate code to set up |
| 147 // the frame (that is done below). | 147 // the frame (that is done below). |
| 148 FrameScope frame_scope(masm_, StackFrame::MANUAL); | 148 FrameScope frame_scope(masm_, StackFrame::MANUAL); |
| 149 | 149 |
| 150 info->set_prologue_offset(masm_->pc_offset()); | 150 info->set_prologue_offset(masm_->pc_offset()); |
| 151 __ Prologue(info->IsCodePreAgingActive()); | 151 __ Prologue(info->IsCodePreAgingActive()); |
| 152 __ Push(FeedbackVector()); |
| 152 info->AddNoFrameRange(0, masm_->pc_offset()); | 153 info->AddNoFrameRange(0, masm_->pc_offset()); |
| 153 | 154 |
| 154 { Comment cmnt(masm_, "[ Allocate locals"); | 155 { Comment cmnt(masm_, "[ Allocate locals"); |
| 155 int locals_count = info->scope()->num_stack_slots(); | 156 int locals_count = info->scope()->num_stack_slots(); |
| 156 // Generators allocate locals, if any, in context slots. | 157 // Generators allocate locals, if any, in context slots. |
| 157 DCHECK(!IsGeneratorFunction(info->function()->kind()) || locals_count == 0); | 158 DCHECK(!IsGeneratorFunction(info->function()->kind()) || locals_count == 0); |
| 158 if (locals_count > 0) { | 159 if (locals_count > 0) { |
| 159 if (locals_count >= 128) { | 160 if (locals_count >= 128) { |
| 160 Label ok; | 161 Label ok; |
| 161 __ sub(r9, sp, Operand(locals_count * kPointerSize)); | 162 __ sub(r9, sp, Operand(locals_count * kPointerSize)); |
| (...skipping 1983 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2145 | 2146 |
| 2146 __ bind(&suspend); | 2147 __ bind(&suspend); |
| 2147 VisitForAccumulatorValue(expr->generator_object()); | 2148 VisitForAccumulatorValue(expr->generator_object()); |
| 2148 DCHECK(continuation.pos() > 0 && Smi::IsValid(continuation.pos())); | 2149 DCHECK(continuation.pos() > 0 && Smi::IsValid(continuation.pos())); |
| 2149 __ mov(r1, Operand(Smi::FromInt(continuation.pos()))); | 2150 __ mov(r1, Operand(Smi::FromInt(continuation.pos()))); |
| 2150 __ str(r1, FieldMemOperand(r0, JSGeneratorObject::kContinuationOffset)); | 2151 __ str(r1, FieldMemOperand(r0, JSGeneratorObject::kContinuationOffset)); |
| 2151 __ str(cp, FieldMemOperand(r0, JSGeneratorObject::kContextOffset)); | 2152 __ str(cp, FieldMemOperand(r0, JSGeneratorObject::kContextOffset)); |
| 2152 __ mov(r1, cp); | 2153 __ mov(r1, cp); |
| 2153 __ RecordWriteField(r0, JSGeneratorObject::kContextOffset, r1, r2, | 2154 __ RecordWriteField(r0, JSGeneratorObject::kContextOffset, r1, r2, |
| 2154 kLRHasBeenSaved, kDontSaveFPRegs); | 2155 kLRHasBeenSaved, kDontSaveFPRegs); |
| 2155 __ add(r1, fp, Operand(StandardFrameConstants::kExpressionsOffset)); | 2156 __ add(r1, fp, Operand(JavaScriptFrameConstants::kLocal0Offset)); |
| 2156 __ cmp(sp, r1); | 2157 __ cmp(sp, r1); |
| 2157 __ b(eq, &post_runtime); | 2158 __ b(eq, &post_runtime); |
| 2158 __ push(r0); // generator object | 2159 __ push(r0); // generator object |
| 2159 __ CallRuntime(Runtime::kSuspendJSGeneratorObject, 1); | 2160 __ CallRuntime(Runtime::kSuspendJSGeneratorObject, 1); |
| 2160 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 2161 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
| 2161 __ bind(&post_runtime); | 2162 __ bind(&post_runtime); |
| 2162 __ pop(result_register()); | 2163 __ pop(result_register()); |
| 2163 EmitReturnSequence(); | 2164 EmitReturnSequence(); |
| 2164 | 2165 |
| 2165 __ bind(&resume); | 2166 __ bind(&resume); |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2325 __ bind(&push_frame); | 2326 __ bind(&push_frame); |
| 2326 __ bl(&resume_frame); | 2327 __ bl(&resume_frame); |
| 2327 __ jmp(&done); | 2328 __ jmp(&done); |
| 2328 __ bind(&resume_frame); | 2329 __ bind(&resume_frame); |
| 2329 // lr = return address. | 2330 // lr = return address. |
| 2330 // fp = caller's frame pointer. | 2331 // fp = caller's frame pointer. |
| 2331 // pp = caller's constant pool (if FLAG_enable_ool_constant_pool), | 2332 // pp = caller's constant pool (if FLAG_enable_ool_constant_pool), |
| 2332 // cp = callee's context, | 2333 // cp = callee's context, |
| 2333 // r4 = callee's JS function. | 2334 // r4 = callee's JS function. |
| 2334 __ PushFixedFrame(r4); | 2335 __ PushFixedFrame(r4); |
| 2336 |
| 2337 // Callee's type feedback vector. |
| 2338 __ ldr(r3, FieldMemOperand(r4, JSFunction::kSharedFunctionInfoOffset)); |
| 2339 __ ldr(r3, FieldMemOperand(r3, SharedFunctionInfo::kFeedbackVectorOffset)); |
| 2340 __ push(r3); |
| 2341 |
| 2335 // Adjust FP to point to saved FP. | 2342 // Adjust FP to point to saved FP. |
| 2336 __ add(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp)); | 2343 __ add(fp, sp, |
| 2344 Operand(JavaScriptFrameConstants::kUnoptimizedFixedFrameSizeFromFp)); |
| 2337 | 2345 |
| 2338 // Load the operand stack size. | 2346 // Load the operand stack size. |
| 2339 __ ldr(r3, FieldMemOperand(r1, JSGeneratorObject::kOperandStackOffset)); | 2347 __ ldr(r3, FieldMemOperand(r1, JSGeneratorObject::kOperandStackOffset)); |
| 2340 __ ldr(r3, FieldMemOperand(r3, FixedArray::kLengthOffset)); | 2348 __ ldr(r3, FieldMemOperand(r3, FixedArray::kLengthOffset)); |
| 2341 __ SmiUntag(r3); | 2349 __ SmiUntag(r3); |
| 2342 | 2350 |
| 2343 // If we are sending a value and there is no operand stack, we can jump back | 2351 // If we are sending a value and there is no operand stack, we can jump back |
| 2344 // in directly. | 2352 // in directly. |
| 2345 if (resume_mode == JSGeneratorObject::NEXT) { | 2353 if (resume_mode == JSGeneratorObject::NEXT) { |
| 2346 Label slow_resume; | 2354 Label slow_resume; |
| (...skipping 3144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5491 | 5499 |
| 5492 DCHECK(interrupt_address == | 5500 DCHECK(interrupt_address == |
| 5493 isolate->builtins()->OsrAfterStackCheck()->entry()); | 5501 isolate->builtins()->OsrAfterStackCheck()->entry()); |
| 5494 return OSR_AFTER_STACK_CHECK; | 5502 return OSR_AFTER_STACK_CHECK; |
| 5495 } | 5503 } |
| 5496 | 5504 |
| 5497 | 5505 |
| 5498 } } // namespace v8::internal | 5506 } } // namespace v8::internal |
| 5499 | 5507 |
| 5500 #endif // V8_TARGET_ARCH_ARM | 5508 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |