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