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 #if V8_TARGET_ARCH_X64 | 5 #if V8_TARGET_ARCH_X64 |
6 | 6 |
7 #include "src/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 1755 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1766 STATIC_ASSERT(JSGeneratorObject::kNext < JSGeneratorObject::kReturn); | 1766 STATIC_ASSERT(JSGeneratorObject::kNext < JSGeneratorObject::kReturn); |
1767 STATIC_ASSERT(JSGeneratorObject::kThrow > JSGeneratorObject::kReturn); | 1767 STATIC_ASSERT(JSGeneratorObject::kThrow > JSGeneratorObject::kReturn); |
1768 __ SmiCompare(rbx, Smi::FromInt(JSGeneratorObject::kReturn)); | 1768 __ SmiCompare(rbx, Smi::FromInt(JSGeneratorObject::kReturn)); |
1769 __ j(less, &resume); | 1769 __ j(less, &resume); |
1770 __ Push(result_register()); | 1770 __ Push(result_register()); |
1771 __ j(greater, &exception); | 1771 __ j(greater, &exception); |
1772 EmitCreateIteratorResult(true); | 1772 EmitCreateIteratorResult(true); |
1773 EmitUnwindAndReturn(); | 1773 EmitUnwindAndReturn(); |
1774 | 1774 |
1775 __ bind(&exception); | 1775 __ bind(&exception); |
1776 __ CallRuntime(Runtime::kThrow); | 1776 __ CallRuntime(expr->rethrow_on_exception() ? Runtime::kReThrow |
| 1777 : Runtime::kThrow); |
1777 | 1778 |
1778 __ bind(&suspend); | 1779 __ bind(&suspend); |
1779 OperandStackDepthIncrement(1); // Not popped on this path. | 1780 OperandStackDepthIncrement(1); // Not popped on this path. |
1780 VisitForAccumulatorValue(expr->generator_object()); | 1781 VisitForAccumulatorValue(expr->generator_object()); |
1781 DCHECK(continuation.pos() > 0 && Smi::IsValid(continuation.pos())); | 1782 DCHECK(continuation.pos() > 0 && Smi::IsValid(continuation.pos())); |
1782 __ Move(FieldOperand(rax, JSGeneratorObject::kContinuationOffset), | 1783 __ Move(FieldOperand(rax, JSGeneratorObject::kContinuationOffset), |
1783 Smi::FromInt(continuation.pos())); | 1784 Smi::FromInt(continuation.pos())); |
1784 __ movp(FieldOperand(rax, JSGeneratorObject::kContextOffset), rsi); | 1785 __ movp(FieldOperand(rax, JSGeneratorObject::kContextOffset), rsi); |
1785 __ movp(rcx, rsi); | 1786 __ movp(rcx, rsi); |
1786 __ RecordWriteField(rax, JSGeneratorObject::kContextOffset, rcx, rdx, | 1787 __ RecordWriteField(rax, JSGeneratorObject::kContextOffset, rcx, rdx, |
(...skipping 1871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3658 DCHECK_EQ( | 3659 DCHECK_EQ( |
3659 isolate->builtins()->OnStackReplacement()->entry(), | 3660 isolate->builtins()->OnStackReplacement()->entry(), |
3660 Assembler::target_address_at(call_target_address, unoptimized_code)); | 3661 Assembler::target_address_at(call_target_address, unoptimized_code)); |
3661 return ON_STACK_REPLACEMENT; | 3662 return ON_STACK_REPLACEMENT; |
3662 } | 3663 } |
3663 | 3664 |
3664 } // namespace internal | 3665 } // namespace internal |
3665 } // namespace v8 | 3666 } // namespace v8 |
3666 | 3667 |
3667 #endif // V8_TARGET_ARCH_X64 | 3668 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |