OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_PPC | 7 #if V8_TARGET_ARCH_PPC |
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 2104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2115 switch (expr->yield_kind()) { | 2115 switch (expr->yield_kind()) { |
2116 case Yield::kSuspend: | 2116 case Yield::kSuspend: |
2117 // Pop value from top-of-stack slot; box result into result register. | 2117 // Pop value from top-of-stack slot; box result into result register. |
2118 EmitCreateIteratorResult(false); | 2118 EmitCreateIteratorResult(false); |
2119 __ push(result_register()); | 2119 __ push(result_register()); |
2120 // Fall through. | 2120 // Fall through. |
2121 case Yield::kInitial: { | 2121 case Yield::kInitial: { |
2122 Label suspend, continuation, post_runtime, resume; | 2122 Label suspend, continuation, post_runtime, resume; |
2123 | 2123 |
2124 __ b(&suspend); | 2124 __ b(&suspend); |
2125 | |
2126 __ bind(&continuation); | 2125 __ bind(&continuation); |
| 2126 __ RecordGeneratorContinuation(); |
2127 __ b(&resume); | 2127 __ b(&resume); |
2128 | 2128 |
2129 __ bind(&suspend); | 2129 __ bind(&suspend); |
2130 VisitForAccumulatorValue(expr->generator_object()); | 2130 VisitForAccumulatorValue(expr->generator_object()); |
2131 DCHECK(continuation.pos() > 0 && Smi::IsValid(continuation.pos())); | 2131 DCHECK(continuation.pos() > 0 && Smi::IsValid(continuation.pos())); |
2132 __ LoadSmiLiteral(r4, Smi::FromInt(continuation.pos())); | 2132 __ LoadSmiLiteral(r4, Smi::FromInt(continuation.pos())); |
2133 __ StoreP(r4, FieldMemOperand(r3, JSGeneratorObject::kContinuationOffset), | 2133 __ StoreP(r4, FieldMemOperand(r3, JSGeneratorObject::kContinuationOffset), |
2134 r0); | 2134 r0); |
2135 __ StoreP(cp, FieldMemOperand(r3, JSGeneratorObject::kContextOffset), r0); | 2135 __ StoreP(cp, FieldMemOperand(r3, JSGeneratorObject::kContextOffset), r0); |
2136 __ mr(r4, cp); | 2136 __ mr(r4, cp); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2189 | 2189 |
2190 // try { received = %yield result } | 2190 // try { received = %yield result } |
2191 // Shuffle the received result above a try handler and yield it without | 2191 // Shuffle the received result above a try handler and yield it without |
2192 // re-boxing. | 2192 // re-boxing. |
2193 __ bind(&l_try); | 2193 __ bind(&l_try); |
2194 __ pop(r3); // result | 2194 __ pop(r3); // result |
2195 int handler_index = NewHandlerTableEntry(); | 2195 int handler_index = NewHandlerTableEntry(); |
2196 EnterTryBlock(handler_index, &l_catch); | 2196 EnterTryBlock(handler_index, &l_catch); |
2197 const int try_block_size = TryCatch::kElementCount * kPointerSize; | 2197 const int try_block_size = TryCatch::kElementCount * kPointerSize; |
2198 __ push(r3); // result | 2198 __ push(r3); // result |
| 2199 |
2199 __ b(&l_suspend); | 2200 __ b(&l_suspend); |
2200 __ bind(&l_continuation); | 2201 __ bind(&l_continuation); |
| 2202 __ RecordGeneratorContinuation(); |
2201 __ b(&l_resume); | 2203 __ b(&l_resume); |
| 2204 |
2202 __ bind(&l_suspend); | 2205 __ bind(&l_suspend); |
2203 const int generator_object_depth = kPointerSize + try_block_size; | 2206 const int generator_object_depth = kPointerSize + try_block_size; |
2204 __ LoadP(r3, MemOperand(sp, generator_object_depth)); | 2207 __ LoadP(r3, MemOperand(sp, generator_object_depth)); |
2205 __ push(r3); // g | 2208 __ push(r3); // g |
2206 __ Push(Smi::FromInt(handler_index)); // handler-index | 2209 __ Push(Smi::FromInt(handler_index)); // handler-index |
2207 DCHECK(l_continuation.pos() > 0 && Smi::IsValid(l_continuation.pos())); | 2210 DCHECK(l_continuation.pos() > 0 && Smi::IsValid(l_continuation.pos())); |
2208 __ LoadSmiLiteral(r4, Smi::FromInt(l_continuation.pos())); | 2211 __ LoadSmiLiteral(r4, Smi::FromInt(l_continuation.pos())); |
2209 __ StoreP(r4, FieldMemOperand(r3, JSGeneratorObject::kContinuationOffset), | 2212 __ StoreP(r4, FieldMemOperand(r3, JSGeneratorObject::kContinuationOffset), |
2210 r0); | 2213 r0); |
2211 __ StoreP(cp, FieldMemOperand(r3, JSGeneratorObject::kContextOffset), r0); | 2214 __ StoreP(cp, FieldMemOperand(r3, JSGeneratorObject::kContextOffset), r0); |
(...skipping 3336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5548 return ON_STACK_REPLACEMENT; | 5551 return ON_STACK_REPLACEMENT; |
5549 } | 5552 } |
5550 | 5553 |
5551 DCHECK(interrupt_address == | 5554 DCHECK(interrupt_address == |
5552 isolate->builtins()->OsrAfterStackCheck()->entry()); | 5555 isolate->builtins()->OsrAfterStackCheck()->entry()); |
5553 return OSR_AFTER_STACK_CHECK; | 5556 return OSR_AFTER_STACK_CHECK; |
5554 } | 5557 } |
5555 } // namespace internal | 5558 } // namespace internal |
5556 } // namespace v8 | 5559 } // namespace v8 |
5557 #endif // V8_TARGET_ARCH_PPC | 5560 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |