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