| 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 2017 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2028 Expression *value, | 2028 Expression *value, |
| 2029 JSGeneratorObject::ResumeMode resume_mode) { | 2029 JSGeneratorObject::ResumeMode resume_mode) { |
| 2030 // The value stays in rax, and is ultimately read by the resumed generator, as | 2030 // The value stays in rax, and is ultimately read by the resumed generator, as |
| 2031 // if CallRuntime(Runtime::kSuspendJSGeneratorObject) returned it. Or it | 2031 // if CallRuntime(Runtime::kSuspendJSGeneratorObject) returned it. Or it |
| 2032 // is read to throw the value when the resumed generator is already closed. | 2032 // is read to throw the value when the resumed generator is already closed. |
| 2033 // rbx will hold the generator object until the activation has been resumed. | 2033 // rbx will hold the generator object until the activation has been resumed. |
| 2034 VisitForStackValue(generator); | 2034 VisitForStackValue(generator); |
| 2035 VisitForAccumulatorValue(value); | 2035 VisitForAccumulatorValue(value); |
| 2036 __ Pop(rbx); | 2036 __ Pop(rbx); |
| 2037 | 2037 |
| 2038 // Store input value into generator object. |
| 2039 __ movp(FieldOperand(rbx, JSGeneratorObject::kInputOffset), |
| 2040 result_register()); |
| 2041 __ movp(rcx, result_register()); |
| 2042 __ RecordWriteField(rbx, JSGeneratorObject::kInputOffset, rcx, rdx, |
| 2043 kDontSaveFPRegs); |
| 2044 |
| 2038 // Load suspended function and context. | 2045 // Load suspended function and context. |
| 2039 __ movp(rsi, FieldOperand(rbx, JSGeneratorObject::kContextOffset)); | 2046 __ movp(rsi, FieldOperand(rbx, JSGeneratorObject::kContextOffset)); |
| 2040 __ movp(rdi, FieldOperand(rbx, JSGeneratorObject::kFunctionOffset)); | 2047 __ movp(rdi, FieldOperand(rbx, JSGeneratorObject::kFunctionOffset)); |
| 2041 | 2048 |
| 2042 // Push receiver. | 2049 // Push receiver. |
| 2043 __ Push(FieldOperand(rbx, JSGeneratorObject::kReceiverOffset)); | 2050 __ Push(FieldOperand(rbx, JSGeneratorObject::kReceiverOffset)); |
| 2044 | 2051 |
| 2045 // Push holes for arguments to generator function. | 2052 // Push holes for arguments to generator function. |
| 2046 __ movp(rdx, FieldOperand(rdi, JSFunction::kSharedFunctionInfoOffset)); | 2053 __ movp(rdx, FieldOperand(rdi, JSFunction::kSharedFunctionInfoOffset)); |
| 2047 __ LoadSharedFunctionInfoSpecialField(rdx, rdx, | 2054 __ LoadSharedFunctionInfoSpecialField(rdx, rdx, |
| (...skipping 2703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4751 Assembler::target_address_at(call_target_address, | 4758 Assembler::target_address_at(call_target_address, |
| 4752 unoptimized_code)); | 4759 unoptimized_code)); |
| 4753 return OSR_AFTER_STACK_CHECK; | 4760 return OSR_AFTER_STACK_CHECK; |
| 4754 } | 4761 } |
| 4755 | 4762 |
| 4756 | 4763 |
| 4757 } // namespace internal | 4764 } // namespace internal |
| 4758 } // namespace v8 | 4765 } // namespace v8 |
| 4759 | 4766 |
| 4760 #endif // V8_TARGET_ARCH_X64 | 4767 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |