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

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

Issue 2067503002: [debugger] fix stepping over await calls for ignition generators. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@test
Patch Set: address comments Created 4 years, 6 months 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
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 8
9 #include "src/ast/prettyprinter.h" 9 #include "src/ast/prettyprinter.h"
10 #include "src/code-factory.h" 10 #include "src/code-factory.h"
(...skipping 1774 matching lines...) Expand 10 before | Expand all | Expand 10 after
1785 void Interpreter::DoNop(InterpreterAssembler* assembler) { __ Dispatch(); } 1785 void Interpreter::DoNop(InterpreterAssembler* assembler) { __ Dispatch(); }
1786 1786
1787 // SuspendGenerator <generator> 1787 // SuspendGenerator <generator>
1788 // 1788 //
1789 // Exports the register file and stores it into the generator. Also stores the 1789 // Exports the register file and stores it into the generator. Also stores the
1790 // current context and the state given in the accumulator into the generator. 1790 // current context and the state given in the accumulator into the generator.
1791 void Interpreter::DoSuspendGenerator(InterpreterAssembler* assembler) { 1791 void Interpreter::DoSuspendGenerator(InterpreterAssembler* assembler) {
1792 Node* generator_reg = __ BytecodeOperandReg(0); 1792 Node* generator_reg = __ BytecodeOperandReg(0);
1793 Node* generator = __ LoadRegister(generator_reg); 1793 Node* generator = __ LoadRegister(generator_reg);
1794 1794
1795 Node* debug_step = __ DebugSteppingAcrossAwait();
1796 Label if_stepping(assembler, Label::kDeferred), ok(assembler);
1797 __ BranchIf(debug_step, &if_stepping, &ok);
1798 __ Bind(&ok);
1799
1795 Node* array = 1800 Node* array =
1796 __ LoadObjectField(generator, JSGeneratorObject::kOperandStackOffset); 1801 __ LoadObjectField(generator, JSGeneratorObject::kOperandStackOffset);
1797 Node* context = __ GetContext(); 1802 Node* context = __ GetContext();
1798 Node* state = __ GetAccumulator(); 1803 Node* state = __ GetAccumulator();
1799 1804
1800 __ ExportRegisterFile(array); 1805 __ ExportRegisterFile(array);
1801 __ StoreObjectField(generator, JSGeneratorObject::kContextOffset, context); 1806 __ StoreObjectField(generator, JSGeneratorObject::kContextOffset, context);
1802 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, state); 1807 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, state);
1803 1808
1804 __ Dispatch(); 1809 __ Dispatch();
1810
1811 __ Bind(&if_stepping);
1812 {
1813 Node* context = __ GetContext();
1814 __ CallRuntime(Runtime::kDebugRecordAsyncFunction, context, generator);
1815 __ Goto(&ok);
1816 }
1805 } 1817 }
1806 1818
1807 // ResumeGenerator <generator> 1819 // ResumeGenerator <generator>
1808 // 1820 //
1809 // Imports the register file stored in the generator. Also loads the 1821 // Imports the register file stored in the generator. Also loads the
1810 // generator's state and stores it in the accumulator, before overwriting it 1822 // generator's state and stores it in the accumulator, before overwriting it
1811 // with kGeneratorExecuting. 1823 // with kGeneratorExecuting.
1812 void Interpreter::DoResumeGenerator(InterpreterAssembler* assembler) { 1824 void Interpreter::DoResumeGenerator(InterpreterAssembler* assembler) {
1813 Node* generator_reg = __ BytecodeOperandReg(0); 1825 Node* generator_reg = __ BytecodeOperandReg(0);
1814 Node* generator = __ LoadRegister(generator_reg); 1826 Node* generator = __ LoadRegister(generator_reg);
1815 1827
1816 __ ImportRegisterFile( 1828 __ ImportRegisterFile(
1817 __ LoadObjectField(generator, JSGeneratorObject::kOperandStackOffset)); 1829 __ LoadObjectField(generator, JSGeneratorObject::kOperandStackOffset));
1818 1830
1819 Node* old_state = 1831 Node* old_state =
1820 __ LoadObjectField(generator, JSGeneratorObject::kContinuationOffset); 1832 __ LoadObjectField(generator, JSGeneratorObject::kContinuationOffset);
1821 Node* new_state = __ Int32Constant(JSGeneratorObject::kGeneratorExecuting); 1833 Node* new_state = __ Int32Constant(JSGeneratorObject::kGeneratorExecuting);
1822 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, 1834 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset,
1823 __ SmiTag(new_state)); 1835 __ SmiTag(new_state));
1824 __ SetAccumulator(old_state); 1836 __ SetAccumulator(old_state);
1825 1837
1826 __ Dispatch(); 1838 __ Dispatch();
1827 } 1839 }
1828 1840
1829 } // namespace interpreter 1841 } // namespace interpreter
1830 } // namespace internal 1842 } // namespace internal
1831 } // namespace v8 1843 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698