OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/interpreter/interpreter.h" | 5 #include "src/interpreter/interpreter.h" |
6 | 6 |
7 #include <fstream> | 7 #include <fstream> |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "src/ast/prettyprinter.h" | 10 #include "src/ast/prettyprinter.h" |
(...skipping 2748 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2759 | 2759 |
2760 Node* offset = __ SmiTag(__ BytecodeOffset()); | 2760 Node* offset = __ SmiTag(__ BytecodeOffset()); |
2761 __ StoreObjectField(generator, JSGeneratorObject::kInputOrDebugPosOffset, | 2761 __ StoreObjectField(generator, JSGeneratorObject::kInputOrDebugPosOffset, |
2762 offset); | 2762 offset); |
2763 | 2763 |
2764 __ Dispatch(); | 2764 __ Dispatch(); |
2765 | 2765 |
2766 __ Bind(&if_stepping); | 2766 __ Bind(&if_stepping); |
2767 { | 2767 { |
2768 Node* context = __ GetContext(); | 2768 Node* context = __ GetContext(); |
2769 __ CallRuntime(Runtime::kDebugRecordAsyncFunction, context, generator); | 2769 __ CallRuntime(Runtime::kDebugRecordGenerator, context, generator); |
2770 __ Goto(&ok); | 2770 __ Goto(&ok); |
2771 } | 2771 } |
2772 } | 2772 } |
2773 | 2773 |
2774 // ResumeGenerator <generator> | 2774 // ResumeGenerator <generator> |
2775 // | 2775 // |
2776 // Imports the register file stored in the generator. Also loads the | 2776 // Imports the register file stored in the generator. Also loads the |
2777 // generator's state and stores it in the accumulator, before overwriting it | 2777 // generator's state and stores it in the accumulator, before overwriting it |
2778 // with kGeneratorExecuting. | 2778 // with kGeneratorExecuting. |
2779 void Interpreter::DoResumeGenerator(InterpreterAssembler* assembler) { | 2779 void Interpreter::DoResumeGenerator(InterpreterAssembler* assembler) { |
2780 Node* generator_reg = __ BytecodeOperandReg(0); | 2780 Node* generator_reg = __ BytecodeOperandReg(0); |
2781 Node* generator = __ LoadRegister(generator_reg); | 2781 Node* generator = __ LoadRegister(generator_reg); |
2782 | 2782 |
2783 __ ImportRegisterFile( | 2783 __ ImportRegisterFile( |
2784 __ LoadObjectField(generator, JSGeneratorObject::kOperandStackOffset)); | 2784 __ LoadObjectField(generator, JSGeneratorObject::kOperandStackOffset)); |
2785 | 2785 |
2786 Node* old_state = | 2786 Node* old_state = |
2787 __ LoadObjectField(generator, JSGeneratorObject::kContinuationOffset); | 2787 __ LoadObjectField(generator, JSGeneratorObject::kContinuationOffset); |
2788 Node* new_state = __ Int32Constant(JSGeneratorObject::kGeneratorExecuting); | 2788 Node* new_state = __ Int32Constant(JSGeneratorObject::kGeneratorExecuting); |
2789 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, | 2789 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, |
2790 __ SmiTag(new_state)); | 2790 __ SmiTag(new_state)); |
2791 __ SetAccumulator(old_state); | 2791 __ SetAccumulator(old_state); |
2792 | 2792 |
2793 __ Dispatch(); | 2793 __ Dispatch(); |
2794 } | 2794 } |
2795 | 2795 |
2796 } // namespace interpreter | 2796 } // namespace interpreter |
2797 } // namespace internal | 2797 } // namespace internal |
2798 } // namespace v8 | 2798 } // namespace v8 |
OLD | NEW |