Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(515)

Side by Side Diff: src/interpreter/interpreter.cc

Issue 2519853002: [debugger] step-next across yield should not leave the generator. (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/debug/debug.cc ('k') | src/runtime/runtime.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « src/debug/debug.cc ('k') | src/runtime/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698