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 2154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2165 switch (expr->yield_kind()) { | 2165 switch (expr->yield_kind()) { |
2166 case Yield::kSuspend: | 2166 case Yield::kSuspend: |
2167 // Pop value from top-of-stack slot; box result into result register. | 2167 // Pop value from top-of-stack slot; box result into result register. |
2168 EmitCreateIteratorResult(false); | 2168 EmitCreateIteratorResult(false); |
2169 __ push(result_register()); | 2169 __ push(result_register()); |
2170 // Fall through. | 2170 // Fall through. |
2171 case Yield::kInitial: { | 2171 case Yield::kInitial: { |
2172 Label suspend, continuation, post_runtime, resume; | 2172 Label suspend, continuation, post_runtime, resume; |
2173 | 2173 |
2174 __ jmp(&suspend); | 2174 __ jmp(&suspend); |
2175 | |
2176 __ bind(&continuation); | 2175 __ bind(&continuation); |
| 2176 __ RecordGeneratorContinuation(); |
2177 __ jmp(&resume); | 2177 __ jmp(&resume); |
2178 | 2178 |
2179 __ bind(&suspend); | 2179 __ bind(&suspend); |
2180 VisitForAccumulatorValue(expr->generator_object()); | 2180 VisitForAccumulatorValue(expr->generator_object()); |
2181 DCHECK(continuation.pos() > 0 && Smi::IsValid(continuation.pos())); | 2181 DCHECK(continuation.pos() > 0 && Smi::IsValid(continuation.pos())); |
2182 __ mov(r1, Operand(Smi::FromInt(continuation.pos()))); | 2182 __ mov(r1, Operand(Smi::FromInt(continuation.pos()))); |
2183 __ str(r1, FieldMemOperand(r0, JSGeneratorObject::kContinuationOffset)); | 2183 __ str(r1, FieldMemOperand(r0, JSGeneratorObject::kContinuationOffset)); |
2184 __ str(cp, FieldMemOperand(r0, JSGeneratorObject::kContextOffset)); | 2184 __ str(cp, FieldMemOperand(r0, JSGeneratorObject::kContextOffset)); |
2185 __ mov(r1, cp); | 2185 __ mov(r1, cp); |
2186 __ RecordWriteField(r0, JSGeneratorObject::kContextOffset, r1, r2, | 2186 __ RecordWriteField(r0, JSGeneratorObject::kContextOffset, r1, r2, |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2237 | 2237 |
2238 // try { received = %yield result } | 2238 // try { received = %yield result } |
2239 // Shuffle the received result above a try handler and yield it without | 2239 // Shuffle the received result above a try handler and yield it without |
2240 // re-boxing. | 2240 // re-boxing. |
2241 __ bind(&l_try); | 2241 __ bind(&l_try); |
2242 __ pop(r0); // result | 2242 __ pop(r0); // result |
2243 int handler_index = NewHandlerTableEntry(); | 2243 int handler_index = NewHandlerTableEntry(); |
2244 EnterTryBlock(handler_index, &l_catch); | 2244 EnterTryBlock(handler_index, &l_catch); |
2245 const int try_block_size = TryCatch::kElementCount * kPointerSize; | 2245 const int try_block_size = TryCatch::kElementCount * kPointerSize; |
2246 __ push(r0); // result | 2246 __ push(r0); // result |
| 2247 |
2247 __ jmp(&l_suspend); | 2248 __ jmp(&l_suspend); |
2248 __ bind(&l_continuation); | 2249 __ bind(&l_continuation); |
| 2250 __ RecordGeneratorContinuation(); |
2249 __ jmp(&l_resume); | 2251 __ jmp(&l_resume); |
| 2252 |
2250 __ bind(&l_suspend); | 2253 __ bind(&l_suspend); |
2251 const int generator_object_depth = kPointerSize + try_block_size; | 2254 const int generator_object_depth = kPointerSize + try_block_size; |
2252 __ ldr(r0, MemOperand(sp, generator_object_depth)); | 2255 __ ldr(r0, MemOperand(sp, generator_object_depth)); |
2253 __ push(r0); // g | 2256 __ push(r0); // g |
2254 __ Push(Smi::FromInt(handler_index)); // handler-index | 2257 __ Push(Smi::FromInt(handler_index)); // handler-index |
2255 DCHECK(l_continuation.pos() > 0 && Smi::IsValid(l_continuation.pos())); | 2258 DCHECK(l_continuation.pos() > 0 && Smi::IsValid(l_continuation.pos())); |
2256 __ mov(r1, Operand(Smi::FromInt(l_continuation.pos()))); | 2259 __ mov(r1, Operand(Smi::FromInt(l_continuation.pos()))); |
2257 __ str(r1, FieldMemOperand(r0, JSGeneratorObject::kContinuationOffset)); | 2260 __ str(r1, FieldMemOperand(r0, JSGeneratorObject::kContinuationOffset)); |
2258 __ str(cp, FieldMemOperand(r0, JSGeneratorObject::kContextOffset)); | 2261 __ str(cp, FieldMemOperand(r0, JSGeneratorObject::kContextOffset)); |
2259 __ mov(r1, cp); | 2262 __ mov(r1, cp); |
(...skipping 3363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5623 DCHECK(interrupt_address == | 5626 DCHECK(interrupt_address == |
5624 isolate->builtins()->OsrAfterStackCheck()->entry()); | 5627 isolate->builtins()->OsrAfterStackCheck()->entry()); |
5625 return OSR_AFTER_STACK_CHECK; | 5628 return OSR_AFTER_STACK_CHECK; |
5626 } | 5629 } |
5627 | 5630 |
5628 | 5631 |
5629 } // namespace internal | 5632 } // namespace internal |
5630 } // namespace v8 | 5633 } // namespace v8 |
5631 | 5634 |
5632 #endif // V8_TARGET_ARCH_ARM | 5635 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |