OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_ARM64 | 7 #if V8_TARGET_ARCH_ARM64 |
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 5050 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5061 switch (expr->yield_kind()) { | 5061 switch (expr->yield_kind()) { |
5062 case Yield::kSuspend: | 5062 case Yield::kSuspend: |
5063 // Pop value from top-of-stack slot; box result into result register. | 5063 // Pop value from top-of-stack slot; box result into result register. |
5064 EmitCreateIteratorResult(false); | 5064 EmitCreateIteratorResult(false); |
5065 __ Push(result_register()); | 5065 __ Push(result_register()); |
5066 // Fall through. | 5066 // Fall through. |
5067 case Yield::kInitial: { | 5067 case Yield::kInitial: { |
5068 Label suspend, continuation, post_runtime, resume; | 5068 Label suspend, continuation, post_runtime, resume; |
5069 | 5069 |
5070 __ B(&suspend); | 5070 __ B(&suspend); |
5071 | |
5072 // TODO(jbramley): This label is bound here because the following code | 5071 // TODO(jbramley): This label is bound here because the following code |
5073 // looks at its pos(). Is it possible to do something more efficient here, | 5072 // looks at its pos(). Is it possible to do something more efficient here, |
5074 // perhaps using Adr? | 5073 // perhaps using Adr? |
5075 __ Bind(&continuation); | 5074 __ Bind(&continuation); |
| 5075 __ RecordGeneratorContinuation(); |
5076 __ B(&resume); | 5076 __ B(&resume); |
5077 | 5077 |
5078 __ Bind(&suspend); | 5078 __ Bind(&suspend); |
5079 VisitForAccumulatorValue(expr->generator_object()); | 5079 VisitForAccumulatorValue(expr->generator_object()); |
5080 DCHECK((continuation.pos() > 0) && Smi::IsValid(continuation.pos())); | 5080 DCHECK((continuation.pos() > 0) && Smi::IsValid(continuation.pos())); |
5081 __ Mov(x1, Smi::FromInt(continuation.pos())); | 5081 __ Mov(x1, Smi::FromInt(continuation.pos())); |
5082 __ Str(x1, FieldMemOperand(x0, JSGeneratorObject::kContinuationOffset)); | 5082 __ Str(x1, FieldMemOperand(x0, JSGeneratorObject::kContinuationOffset)); |
5083 __ Str(cp, FieldMemOperand(x0, JSGeneratorObject::kContextOffset)); | 5083 __ Str(cp, FieldMemOperand(x0, JSGeneratorObject::kContextOffset)); |
5084 __ Mov(x1, cp); | 5084 __ Mov(x1, cp); |
5085 __ RecordWriteField(x0, JSGeneratorObject::kContextOffset, x1, x2, | 5085 __ RecordWriteField(x0, JSGeneratorObject::kContextOffset, x1, x2, |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5136 | 5136 |
5137 // try { received = %yield result } | 5137 // try { received = %yield result } |
5138 // Shuffle the received result above a try handler and yield it without | 5138 // Shuffle the received result above a try handler and yield it without |
5139 // re-boxing. | 5139 // re-boxing. |
5140 __ Bind(&l_try); | 5140 __ Bind(&l_try); |
5141 __ Pop(x0); // result | 5141 __ Pop(x0); // result |
5142 int handler_index = NewHandlerTableEntry(); | 5142 int handler_index = NewHandlerTableEntry(); |
5143 EnterTryBlock(handler_index, &l_catch); | 5143 EnterTryBlock(handler_index, &l_catch); |
5144 const int try_block_size = TryCatch::kElementCount * kPointerSize; | 5144 const int try_block_size = TryCatch::kElementCount * kPointerSize; |
5145 __ Push(x0); // result | 5145 __ Push(x0); // result |
| 5146 |
5146 __ B(&l_suspend); | 5147 __ B(&l_suspend); |
5147 | |
5148 // TODO(jbramley): This label is bound here because the following code | 5148 // TODO(jbramley): This label is bound here because the following code |
5149 // looks at its pos(). Is it possible to do something more efficient here, | 5149 // looks at its pos(). Is it possible to do something more efficient here, |
5150 // perhaps using Adr? | 5150 // perhaps using Adr? |
5151 __ Bind(&l_continuation); | 5151 __ Bind(&l_continuation); |
| 5152 __ RecordGeneratorContinuation(); |
5152 __ B(&l_resume); | 5153 __ B(&l_resume); |
5153 | 5154 |
5154 __ Bind(&l_suspend); | 5155 __ Bind(&l_suspend); |
5155 const int generator_object_depth = kPointerSize + try_block_size; | 5156 const int generator_object_depth = kPointerSize + try_block_size; |
5156 __ Peek(x0, generator_object_depth); | 5157 __ Peek(x0, generator_object_depth); |
5157 __ Push(x0); // g | 5158 __ Push(x0); // g |
5158 __ Push(Smi::FromInt(handler_index)); // handler-index | 5159 __ Push(Smi::FromInt(handler_index)); // handler-index |
5159 DCHECK((l_continuation.pos() > 0) && Smi::IsValid(l_continuation.pos())); | 5160 DCHECK((l_continuation.pos() > 0) && Smi::IsValid(l_continuation.pos())); |
5160 __ Mov(x1, Smi::FromInt(l_continuation.pos())); | 5161 __ Mov(x1, Smi::FromInt(l_continuation.pos())); |
5161 __ Str(x1, FieldMemOperand(x0, JSGeneratorObject::kContinuationOffset)); | 5162 __ Str(x1, FieldMemOperand(x0, JSGeneratorObject::kContinuationOffset)); |
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5571 } | 5572 } |
5572 | 5573 |
5573 return INTERRUPT; | 5574 return INTERRUPT; |
5574 } | 5575 } |
5575 | 5576 |
5576 | 5577 |
5577 } // namespace internal | 5578 } // namespace internal |
5578 } // namespace v8 | 5579 } // namespace v8 |
5579 | 5580 |
5580 #endif // V8_TARGET_ARCH_ARM64 | 5581 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |