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 1791 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1802 void Interpreter::DoCreateBlockContext(InterpreterAssembler* assembler) { | 1802 void Interpreter::DoCreateBlockContext(InterpreterAssembler* assembler) { |
1803 Node* index = __ BytecodeOperandIdx(0); | 1803 Node* index = __ BytecodeOperandIdx(0); |
1804 Node* scope_info = __ LoadConstantPoolEntry(index); | 1804 Node* scope_info = __ LoadConstantPoolEntry(index); |
1805 Node* closure = __ GetAccumulator(); | 1805 Node* closure = __ GetAccumulator(); |
1806 Node* context = __ GetContext(); | 1806 Node* context = __ GetContext(); |
1807 __ SetAccumulator( | 1807 __ SetAccumulator( |
1808 __ CallRuntime(Runtime::kPushBlockContext, context, scope_info, closure)); | 1808 __ CallRuntime(Runtime::kPushBlockContext, context, scope_info, closure)); |
1809 __ Dispatch(); | 1809 __ Dispatch(); |
1810 } | 1810 } |
1811 | 1811 |
| 1812 // CreateCatchContext <exception> <index> |
| 1813 // |
| 1814 // Creates a new context for a catch block with the |exception| in a register, |
| 1815 // the variable name at |index| and the closure in the accumulator. |
| 1816 void Interpreter::DoCreateCatchContext(InterpreterAssembler* assembler) { |
| 1817 Node* exception_reg = __ BytecodeOperandReg(0); |
| 1818 Node* exception = __ LoadRegister(exception_reg); |
| 1819 Node* index = __ BytecodeOperandIdx(1); |
| 1820 Node* name = __ LoadConstantPoolEntry(index); |
| 1821 Node* closure = __ GetAccumulator(); |
| 1822 Node* context = __ GetContext(); |
| 1823 __ SetAccumulator(__ CallRuntime(Runtime::kPushCatchContext, context, name, |
| 1824 exception, closure)); |
| 1825 __ Dispatch(); |
| 1826 } |
| 1827 |
1812 // CreateFunctionContext <slots> | 1828 // CreateFunctionContext <slots> |
1813 // | 1829 // |
1814 // Creates a new context with number of |slots| for the function closure. | 1830 // Creates a new context with number of |slots| for the function closure. |
1815 void Interpreter::DoCreateFunctionContext(InterpreterAssembler* assembler) { | 1831 void Interpreter::DoCreateFunctionContext(InterpreterAssembler* assembler) { |
1816 Node* closure = __ LoadRegister(Register::function_closure()); | 1832 Node* closure = __ LoadRegister(Register::function_closure()); |
1817 Node* slots = __ BytecodeOperandIdx(0); | 1833 Node* slots = __ BytecodeOperandIdx(0); |
1818 Node* context = __ GetContext(); | 1834 Node* context = __ GetContext(); |
1819 __ SetAccumulator( | 1835 __ SetAccumulator( |
1820 FastNewFunctionContextStub::Generate(assembler, closure, slots, context)); | 1836 FastNewFunctionContextStub::Generate(assembler, closure, slots, context)); |
1821 __ Dispatch(); | 1837 __ Dispatch(); |
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2264 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, | 2280 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, |
2265 __ SmiTag(new_state)); | 2281 __ SmiTag(new_state)); |
2266 __ SetAccumulator(old_state); | 2282 __ SetAccumulator(old_state); |
2267 | 2283 |
2268 __ Dispatch(); | 2284 __ Dispatch(); |
2269 } | 2285 } |
2270 | 2286 |
2271 } // namespace interpreter | 2287 } // namespace interpreter |
2272 } // namespace internal | 2288 } // namespace internal |
2273 } // namespace v8 | 2289 } // namespace v8 |
OLD | NEW |