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_MIPS | 7 #if V8_TARGET_ARCH_MIPS |
8 | 8 |
9 // Note on Mips implementation: | 9 // Note on Mips implementation: |
10 // | 10 // |
(...skipping 2147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2158 switch (expr->yield_kind()) { | 2158 switch (expr->yield_kind()) { |
2159 case Yield::kSuspend: | 2159 case Yield::kSuspend: |
2160 // Pop value from top-of-stack slot; box result into result register. | 2160 // Pop value from top-of-stack slot; box result into result register. |
2161 EmitCreateIteratorResult(false); | 2161 EmitCreateIteratorResult(false); |
2162 __ push(result_register()); | 2162 __ push(result_register()); |
2163 // Fall through. | 2163 // Fall through. |
2164 case Yield::kInitial: { | 2164 case Yield::kInitial: { |
2165 Label suspend, continuation, post_runtime, resume; | 2165 Label suspend, continuation, post_runtime, resume; |
2166 | 2166 |
2167 __ jmp(&suspend); | 2167 __ jmp(&suspend); |
2168 | |
2169 __ bind(&continuation); | 2168 __ bind(&continuation); |
| 2169 __ RecordGeneratorContinuation(); |
2170 __ jmp(&resume); | 2170 __ jmp(&resume); |
2171 | 2171 |
2172 __ bind(&suspend); | 2172 __ bind(&suspend); |
2173 VisitForAccumulatorValue(expr->generator_object()); | 2173 VisitForAccumulatorValue(expr->generator_object()); |
2174 DCHECK(continuation.pos() > 0 && Smi::IsValid(continuation.pos())); | 2174 DCHECK(continuation.pos() > 0 && Smi::IsValid(continuation.pos())); |
2175 __ li(a1, Operand(Smi::FromInt(continuation.pos()))); | 2175 __ li(a1, Operand(Smi::FromInt(continuation.pos()))); |
2176 __ sw(a1, FieldMemOperand(v0, JSGeneratorObject::kContinuationOffset)); | 2176 __ sw(a1, FieldMemOperand(v0, JSGeneratorObject::kContinuationOffset)); |
2177 __ sw(cp, FieldMemOperand(v0, JSGeneratorObject::kContextOffset)); | 2177 __ sw(cp, FieldMemOperand(v0, JSGeneratorObject::kContextOffset)); |
2178 __ mov(a1, cp); | 2178 __ mov(a1, cp); |
2179 __ RecordWriteField(v0, JSGeneratorObject::kContextOffset, a1, a2, | 2179 __ RecordWriteField(v0, JSGeneratorObject::kContextOffset, a1, a2, |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2230 | 2230 |
2231 // try { received = %yield result } | 2231 // try { received = %yield result } |
2232 // Shuffle the received result above a try handler and yield it without | 2232 // Shuffle the received result above a try handler and yield it without |
2233 // re-boxing. | 2233 // re-boxing. |
2234 __ bind(&l_try); | 2234 __ bind(&l_try); |
2235 __ pop(a0); // result | 2235 __ pop(a0); // result |
2236 int handler_index = NewHandlerTableEntry(); | 2236 int handler_index = NewHandlerTableEntry(); |
2237 EnterTryBlock(handler_index, &l_catch); | 2237 EnterTryBlock(handler_index, &l_catch); |
2238 const int try_block_size = TryCatch::kElementCount * kPointerSize; | 2238 const int try_block_size = TryCatch::kElementCount * kPointerSize; |
2239 __ push(a0); // result | 2239 __ push(a0); // result |
| 2240 |
2240 __ jmp(&l_suspend); | 2241 __ jmp(&l_suspend); |
2241 __ bind(&l_continuation); | 2242 __ bind(&l_continuation); |
| 2243 __ RecordGeneratorContinuation(); |
2242 __ mov(a0, v0); | 2244 __ mov(a0, v0); |
2243 __ jmp(&l_resume); | 2245 __ jmp(&l_resume); |
| 2246 |
2244 __ bind(&l_suspend); | 2247 __ bind(&l_suspend); |
2245 const int generator_object_depth = kPointerSize + try_block_size; | 2248 const int generator_object_depth = kPointerSize + try_block_size; |
2246 __ lw(a0, MemOperand(sp, generator_object_depth)); | 2249 __ lw(a0, MemOperand(sp, generator_object_depth)); |
2247 __ push(a0); // g | 2250 __ push(a0); // g |
2248 __ Push(Smi::FromInt(handler_index)); // handler-index | 2251 __ Push(Smi::FromInt(handler_index)); // handler-index |
2249 DCHECK(l_continuation.pos() > 0 && Smi::IsValid(l_continuation.pos())); | 2252 DCHECK(l_continuation.pos() > 0 && Smi::IsValid(l_continuation.pos())); |
2250 __ li(a1, Operand(Smi::FromInt(l_continuation.pos()))); | 2253 __ li(a1, Operand(Smi::FromInt(l_continuation.pos()))); |
2251 __ sw(a1, FieldMemOperand(a0, JSGeneratorObject::kContinuationOffset)); | 2254 __ sw(a1, FieldMemOperand(a0, JSGeneratorObject::kContinuationOffset)); |
2252 __ sw(cp, FieldMemOperand(a0, JSGeneratorObject::kContextOffset)); | 2255 __ sw(cp, FieldMemOperand(a0, JSGeneratorObject::kContextOffset)); |
2253 __ mov(a1, cp); | 2256 __ mov(a1, cp); |
(...skipping 3327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5581 reinterpret_cast<uint32_t>( | 5584 reinterpret_cast<uint32_t>( |
5582 isolate->builtins()->OsrAfterStackCheck()->entry())); | 5585 isolate->builtins()->OsrAfterStackCheck()->entry())); |
5583 return OSR_AFTER_STACK_CHECK; | 5586 return OSR_AFTER_STACK_CHECK; |
5584 } | 5587 } |
5585 | 5588 |
5586 | 5589 |
5587 } // namespace internal | 5590 } // namespace internal |
5588 } // namespace v8 | 5591 } // namespace v8 |
5589 | 5592 |
5590 #endif // V8_TARGET_ARCH_MIPS | 5593 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |