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 2140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2151 switch (expr->yield_kind()) { | 2151 switch (expr->yield_kind()) { |
2152 case Yield::kSuspend: | 2152 case Yield::kSuspend: |
2153 // Pop value from top-of-stack slot; box result into result register. | 2153 // Pop value from top-of-stack slot; box result into result register. |
2154 EmitCreateIteratorResult(false); | 2154 EmitCreateIteratorResult(false); |
2155 __ push(result_register()); | 2155 __ push(result_register()); |
2156 // Fall through. | 2156 // Fall through. |
2157 case Yield::kInitial: { | 2157 case Yield::kInitial: { |
2158 Label suspend, continuation, post_runtime, resume; | 2158 Label suspend, continuation, post_runtime, resume; |
2159 | 2159 |
2160 __ jmp(&suspend); | 2160 __ jmp(&suspend); |
2161 | |
2162 __ bind(&continuation); | 2161 __ bind(&continuation); |
| 2162 __ RecordGeneratorContinuation(); |
2163 __ jmp(&resume); | 2163 __ jmp(&resume); |
2164 | 2164 |
2165 __ bind(&suspend); | 2165 __ bind(&suspend); |
2166 VisitForAccumulatorValue(expr->generator_object()); | 2166 VisitForAccumulatorValue(expr->generator_object()); |
2167 DCHECK(continuation.pos() > 0 && Smi::IsValid(continuation.pos())); | 2167 DCHECK(continuation.pos() > 0 && Smi::IsValid(continuation.pos())); |
2168 __ mov(r1, Operand(Smi::FromInt(continuation.pos()))); | 2168 __ mov(r1, Operand(Smi::FromInt(continuation.pos()))); |
2169 __ str(r1, FieldMemOperand(r0, JSGeneratorObject::kContinuationOffset)); | 2169 __ str(r1, FieldMemOperand(r0, JSGeneratorObject::kContinuationOffset)); |
2170 __ str(cp, FieldMemOperand(r0, JSGeneratorObject::kContextOffset)); | 2170 __ str(cp, FieldMemOperand(r0, JSGeneratorObject::kContextOffset)); |
2171 __ mov(r1, cp); | 2171 __ mov(r1, cp); |
2172 __ RecordWriteField(r0, JSGeneratorObject::kContextOffset, r1, r2, | 2172 __ RecordWriteField(r0, JSGeneratorObject::kContextOffset, r1, r2, |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2223 | 2223 |
2224 // try { received = %yield result } | 2224 // try { received = %yield result } |
2225 // Shuffle the received result above a try handler and yield it without | 2225 // Shuffle the received result above a try handler and yield it without |
2226 // re-boxing. | 2226 // re-boxing. |
2227 __ bind(&l_try); | 2227 __ bind(&l_try); |
2228 __ pop(r0); // result | 2228 __ pop(r0); // result |
2229 int handler_index = NewHandlerTableEntry(); | 2229 int handler_index = NewHandlerTableEntry(); |
2230 EnterTryBlock(handler_index, &l_catch); | 2230 EnterTryBlock(handler_index, &l_catch); |
2231 const int try_block_size = TryCatch::kElementCount * kPointerSize; | 2231 const int try_block_size = TryCatch::kElementCount * kPointerSize; |
2232 __ push(r0); // result | 2232 __ push(r0); // result |
| 2233 |
2233 __ jmp(&l_suspend); | 2234 __ jmp(&l_suspend); |
2234 __ bind(&l_continuation); | 2235 __ bind(&l_continuation); |
| 2236 __ RecordGeneratorContinuation(); |
2235 __ jmp(&l_resume); | 2237 __ jmp(&l_resume); |
| 2238 |
2236 __ bind(&l_suspend); | 2239 __ bind(&l_suspend); |
2237 const int generator_object_depth = kPointerSize + try_block_size; | 2240 const int generator_object_depth = kPointerSize + try_block_size; |
2238 __ ldr(r0, MemOperand(sp, generator_object_depth)); | 2241 __ ldr(r0, MemOperand(sp, generator_object_depth)); |
2239 __ push(r0); // g | 2242 __ push(r0); // g |
2240 __ Push(Smi::FromInt(handler_index)); // handler-index | 2243 __ Push(Smi::FromInt(handler_index)); // handler-index |
2241 DCHECK(l_continuation.pos() > 0 && Smi::IsValid(l_continuation.pos())); | 2244 DCHECK(l_continuation.pos() > 0 && Smi::IsValid(l_continuation.pos())); |
2242 __ mov(r1, Operand(Smi::FromInt(l_continuation.pos()))); | 2245 __ mov(r1, Operand(Smi::FromInt(l_continuation.pos()))); |
2243 __ str(r1, FieldMemOperand(r0, JSGeneratorObject::kContinuationOffset)); | 2246 __ str(r1, FieldMemOperand(r0, JSGeneratorObject::kContinuationOffset)); |
2244 __ str(cp, FieldMemOperand(r0, JSGeneratorObject::kContextOffset)); | 2247 __ str(cp, FieldMemOperand(r0, JSGeneratorObject::kContextOffset)); |
2245 __ mov(r1, cp); | 2248 __ mov(r1, cp); |
(...skipping 3346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5592 DCHECK(interrupt_address == | 5595 DCHECK(interrupt_address == |
5593 isolate->builtins()->OsrAfterStackCheck()->entry()); | 5596 isolate->builtins()->OsrAfterStackCheck()->entry()); |
5594 return OSR_AFTER_STACK_CHECK; | 5597 return OSR_AFTER_STACK_CHECK; |
5595 } | 5598 } |
5596 | 5599 |
5597 | 5600 |
5598 } // namespace internal | 5601 } // namespace internal |
5599 } // namespace v8 | 5602 } // namespace v8 |
5600 | 5603 |
5601 #endif // V8_TARGET_ARCH_ARM | 5604 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |