| 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_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
| 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 1728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1739 STATIC_ASSERT(JSGeneratorObject::kNext < JSGeneratorObject::kReturn); | 1739 STATIC_ASSERT(JSGeneratorObject::kNext < JSGeneratorObject::kReturn); |
| 1740 STATIC_ASSERT(JSGeneratorObject::kThrow > JSGeneratorObject::kReturn); | 1740 STATIC_ASSERT(JSGeneratorObject::kThrow > JSGeneratorObject::kReturn); |
| 1741 __ cmp(ebx, Immediate(Smi::FromInt(JSGeneratorObject::kReturn))); | 1741 __ cmp(ebx, Immediate(Smi::FromInt(JSGeneratorObject::kReturn))); |
| 1742 __ j(less, &resume); | 1742 __ j(less, &resume); |
| 1743 __ Push(result_register()); | 1743 __ Push(result_register()); |
| 1744 __ j(greater, &exception); | 1744 __ j(greater, &exception); |
| 1745 EmitCreateIteratorResult(true); | 1745 EmitCreateIteratorResult(true); |
| 1746 EmitUnwindAndReturn(); | 1746 EmitUnwindAndReturn(); |
| 1747 | 1747 |
| 1748 __ bind(&exception); | 1748 __ bind(&exception); |
| 1749 __ CallRuntime(Runtime::kThrow); | 1749 __ CallRuntime(expr->rethrow_on_exception() ? Runtime::kReThrow |
| 1750 : Runtime::kThrow); |
| 1750 | 1751 |
| 1751 __ bind(&suspend); | 1752 __ bind(&suspend); |
| 1752 OperandStackDepthIncrement(1); // Not popped on this path. | 1753 OperandStackDepthIncrement(1); // Not popped on this path. |
| 1753 VisitForAccumulatorValue(expr->generator_object()); | 1754 VisitForAccumulatorValue(expr->generator_object()); |
| 1754 DCHECK(continuation.pos() > 0 && Smi::IsValid(continuation.pos())); | 1755 DCHECK(continuation.pos() > 0 && Smi::IsValid(continuation.pos())); |
| 1755 __ mov(FieldOperand(eax, JSGeneratorObject::kContinuationOffset), | 1756 __ mov(FieldOperand(eax, JSGeneratorObject::kContinuationOffset), |
| 1756 Immediate(Smi::FromInt(continuation.pos()))); | 1757 Immediate(Smi::FromInt(continuation.pos()))); |
| 1757 __ mov(FieldOperand(eax, JSGeneratorObject::kContextOffset), esi); | 1758 __ mov(FieldOperand(eax, JSGeneratorObject::kContextOffset), esi); |
| 1758 __ mov(ecx, esi); | 1759 __ mov(ecx, esi); |
| 1759 __ RecordWriteField(eax, JSGeneratorObject::kContextOffset, ecx, edx, | 1760 __ RecordWriteField(eax, JSGeneratorObject::kContextOffset, ecx, edx, |
| (...skipping 1908 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3668 isolate->builtins()->OnStackReplacement()->entry(), | 3669 isolate->builtins()->OnStackReplacement()->entry(), |
| 3669 Assembler::target_address_at(call_target_address, unoptimized_code)); | 3670 Assembler::target_address_at(call_target_address, unoptimized_code)); |
| 3670 return ON_STACK_REPLACEMENT; | 3671 return ON_STACK_REPLACEMENT; |
| 3671 } | 3672 } |
| 3672 | 3673 |
| 3673 | 3674 |
| 3674 } // namespace internal | 3675 } // namespace internal |
| 3675 } // namespace v8 | 3676 } // namespace v8 |
| 3676 | 3677 |
| 3677 #endif // V8_TARGET_ARCH_IA32 | 3678 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |