Chromium Code Reviews| 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 | 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 1773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1784 // No operation. | 1784 // No operation. |
| 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 Node* context = __ GetContext(); | |
| 1795 | |
| 1796 Node* debug_is_active = __ DebuggerIsActive(); | |
| 1797 Label if_debugging(assembler), debugger_done(assembler); | |
|
rmcilroy
2016/06/14 06:23:11
Please make if_debugging deferred. (It's the only
Yang
2016/06/14 09:17:02
Done. However, I think we always build a frame for
rmcilroy
2016/06/14 10:00:22
We do on ia32 due to lack of registers, but not on
| |
| 1798 __ BranchIf(debug_is_active, &if_debugging, &debugger_done); | |
| 1799 __ Bind(&if_debugging); | |
| 1800 { | |
| 1801 __ CallRuntime(Runtime::kDebugRecordAsyncFunction, context, generator); | |
|
caitp (gmail)
2016/06/13 13:38:13
Is it possible to know at this point in the interp
Yang
2016/06/13 13:42:26
We could expand a bit more and load the function o
| |
| 1802 __ Goto(&debugger_done); | |
| 1803 } | |
| 1804 __ Bind(&debugger_done); | |
| 1794 | 1805 |
| 1795 Node* array = | 1806 Node* array = |
| 1796 __ LoadObjectField(generator, JSGeneratorObject::kOperandStackOffset); | 1807 __ LoadObjectField(generator, JSGeneratorObject::kOperandStackOffset); |
| 1797 Node* context = __ GetContext(); | |
| 1798 Node* state = __ GetAccumulator(); | 1808 Node* state = __ GetAccumulator(); |
| 1799 | 1809 |
| 1800 __ ExportRegisterFile(array); | 1810 __ ExportRegisterFile(array); |
| 1801 __ StoreObjectField(generator, JSGeneratorObject::kContextOffset, context); | 1811 __ StoreObjectField(generator, JSGeneratorObject::kContextOffset, context); |
| 1802 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, state); | 1812 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, state); |
| 1803 | 1813 |
| 1804 __ Dispatch(); | 1814 __ Dispatch(); |
| 1805 } | 1815 } |
| 1806 | 1816 |
| 1807 // ResumeGenerator <generator> | 1817 // ResumeGenerator <generator> |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 1822 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, | 1832 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, |
| 1823 __ SmiTag(new_state)); | 1833 __ SmiTag(new_state)); |
| 1824 __ SetAccumulator(old_state); | 1834 __ SetAccumulator(old_state); |
| 1825 | 1835 |
| 1826 __ Dispatch(); | 1836 __ Dispatch(); |
| 1827 } | 1837 } |
| 1828 | 1838 |
| 1829 } // namespace interpreter | 1839 } // namespace interpreter |
| 1830 } // namespace internal | 1840 } // namespace internal |
| 1831 } // namespace v8 | 1841 } // namespace v8 |
| OLD | NEW |