| 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 2119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2130 switch (expr->yield_kind()) { | 2130 switch (expr->yield_kind()) { |
| 2131 case Yield::kSuspend: | 2131 case Yield::kSuspend: |
| 2132 // Pop value from top-of-stack slot; box result into result register. | 2132 // Pop value from top-of-stack slot; box result into result register. |
| 2133 EmitCreateIteratorResult(false); | 2133 EmitCreateIteratorResult(false); |
| 2134 __ push(result_register()); | 2134 __ push(result_register()); |
| 2135 // Fall through. | 2135 // Fall through. |
| 2136 case Yield::kInitial: { | 2136 case Yield::kInitial: { |
| 2137 Label suspend, continuation, post_runtime, resume; | 2137 Label suspend, continuation, post_runtime, resume; |
| 2138 | 2138 |
| 2139 __ b(&suspend); | 2139 __ b(&suspend); |
| 2140 | |
| 2141 __ bind(&continuation); | 2140 __ bind(&continuation); |
| 2141 __ RecordGeneratorContinuation(); |
| 2142 __ b(&resume); | 2142 __ b(&resume); |
| 2143 | 2143 |
| 2144 __ bind(&suspend); | 2144 __ bind(&suspend); |
| 2145 VisitForAccumulatorValue(expr->generator_object()); | 2145 VisitForAccumulatorValue(expr->generator_object()); |
| 2146 DCHECK(continuation.pos() > 0 && Smi::IsValid(continuation.pos())); | 2146 DCHECK(continuation.pos() > 0 && Smi::IsValid(continuation.pos())); |
| 2147 __ LoadSmiLiteral(r4, Smi::FromInt(continuation.pos())); | 2147 __ LoadSmiLiteral(r4, Smi::FromInt(continuation.pos())); |
| 2148 __ StoreP(r4, FieldMemOperand(r3, JSGeneratorObject::kContinuationOffset), | 2148 __ StoreP(r4, FieldMemOperand(r3, JSGeneratorObject::kContinuationOffset), |
| 2149 r0); | 2149 r0); |
| 2150 __ StoreP(cp, FieldMemOperand(r3, JSGeneratorObject::kContextOffset), r0); | 2150 __ StoreP(cp, FieldMemOperand(r3, JSGeneratorObject::kContextOffset), r0); |
| 2151 __ mr(r4, cp); | 2151 __ mr(r4, cp); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2204 | 2204 |
| 2205 // try { received = %yield result } | 2205 // try { received = %yield result } |
| 2206 // Shuffle the received result above a try handler and yield it without | 2206 // Shuffle the received result above a try handler and yield it without |
| 2207 // re-boxing. | 2207 // re-boxing. |
| 2208 __ bind(&l_try); | 2208 __ bind(&l_try); |
| 2209 __ pop(r3); // result | 2209 __ pop(r3); // result |
| 2210 int handler_index = NewHandlerTableEntry(); | 2210 int handler_index = NewHandlerTableEntry(); |
| 2211 EnterTryBlock(handler_index, &l_catch); | 2211 EnterTryBlock(handler_index, &l_catch); |
| 2212 const int try_block_size = TryCatch::kElementCount * kPointerSize; | 2212 const int try_block_size = TryCatch::kElementCount * kPointerSize; |
| 2213 __ push(r3); // result | 2213 __ push(r3); // result |
| 2214 |
| 2214 __ b(&l_suspend); | 2215 __ b(&l_suspend); |
| 2215 __ bind(&l_continuation); | 2216 __ bind(&l_continuation); |
| 2217 __ RecordGeneratorContinuation(); |
| 2216 __ b(&l_resume); | 2218 __ b(&l_resume); |
| 2219 |
| 2217 __ bind(&l_suspend); | 2220 __ bind(&l_suspend); |
| 2218 const int generator_object_depth = kPointerSize + try_block_size; | 2221 const int generator_object_depth = kPointerSize + try_block_size; |
| 2219 __ LoadP(r3, MemOperand(sp, generator_object_depth)); | 2222 __ LoadP(r3, MemOperand(sp, generator_object_depth)); |
| 2220 __ push(r3); // g | 2223 __ push(r3); // g |
| 2221 __ Push(Smi::FromInt(handler_index)); // handler-index | 2224 __ Push(Smi::FromInt(handler_index)); // handler-index |
| 2222 DCHECK(l_continuation.pos() > 0 && Smi::IsValid(l_continuation.pos())); | 2225 DCHECK(l_continuation.pos() > 0 && Smi::IsValid(l_continuation.pos())); |
| 2223 __ LoadSmiLiteral(r4, Smi::FromInt(l_continuation.pos())); | 2226 __ LoadSmiLiteral(r4, Smi::FromInt(l_continuation.pos())); |
| 2224 __ StoreP(r4, FieldMemOperand(r3, JSGeneratorObject::kContinuationOffset), | 2227 __ StoreP(r4, FieldMemOperand(r3, JSGeneratorObject::kContinuationOffset), |
| 2225 r0); | 2228 r0); |
| 2226 __ StoreP(cp, FieldMemOperand(r3, JSGeneratorObject::kContextOffset), r0); | 2229 __ StoreP(cp, FieldMemOperand(r3, JSGeneratorObject::kContextOffset), r0); |
| (...skipping 3353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5580 return ON_STACK_REPLACEMENT; | 5583 return ON_STACK_REPLACEMENT; |
| 5581 } | 5584 } |
| 5582 | 5585 |
| 5583 DCHECK(interrupt_address == | 5586 DCHECK(interrupt_address == |
| 5584 isolate->builtins()->OsrAfterStackCheck()->entry()); | 5587 isolate->builtins()->OsrAfterStackCheck()->entry()); |
| 5585 return OSR_AFTER_STACK_CHECK; | 5588 return OSR_AFTER_STACK_CHECK; |
| 5586 } | 5589 } |
| 5587 } // namespace internal | 5590 } // namespace internal |
| 5588 } // namespace v8 | 5591 } // namespace v8 |
| 5589 #endif // V8_TARGET_ARCH_PPC | 5592 #endif // V8_TARGET_ARCH_PPC |
| OLD | NEW |