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 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "src/ast/prettyprinter.h" | 10 #include "src/ast/prettyprinter.h" |
| (...skipping 1803 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1814 // Creates a new context with number of |slots| for the function closure. | 1814 // Creates a new context with number of |slots| for the function closure. |
| 1815 void Interpreter::DoCreateFunctionContext(InterpreterAssembler* assembler) { | 1815 void Interpreter::DoCreateFunctionContext(InterpreterAssembler* assembler) { |
| 1816 Node* closure = __ LoadRegister(Register::function_closure()); | 1816 Node* closure = __ LoadRegister(Register::function_closure()); |
| 1817 Node* slots = __ BytecodeOperandIdx(0); | 1817 Node* slots = __ BytecodeOperandIdx(0); |
| 1818 Node* context = __ GetContext(); | 1818 Node* context = __ GetContext(); |
| 1819 __ SetAccumulator( | 1819 __ SetAccumulator( |
| 1820 FastNewFunctionContextStub::Generate(assembler, closure, slots, context)); | 1820 FastNewFunctionContextStub::Generate(assembler, closure, slots, context)); |
| 1821 __ Dispatch(); | 1821 __ Dispatch(); |
| 1822 } | 1822 } |
| 1823 | 1823 |
| 1824 // CreateCatchContext <exception> <index> | |
| 1825 // | |
| 1826 // Creates a new context for a catch block with the |exception| in register and | |
| 1827 // the variable name at |index| for and the closure in the accumulator. | |
|
Michael Starzinger
2016/08/18 15:00:42
nit: Stray "for" in comment.
klaasb
2016/08/18 15:21:42
Done.
| |
| 1828 void Interpreter::DoCreateCatchContext(InterpreterAssembler* assembler) { | |
| 1829 Node* exception_reg = __ BytecodeOperandReg(0); | |
| 1830 Node* exception = __ LoadRegister(exception_reg); | |
| 1831 Node* index = __ BytecodeOperandIdx(1); | |
| 1832 Node* name = __ LoadConstantPoolEntry(index); | |
| 1833 Node* closure = __ GetAccumulator(); | |
| 1834 Node* context = __ GetContext(); | |
| 1835 __ SetAccumulator(__ CallRuntime(Runtime::kPushCatchContext, context, name, | |
| 1836 exception, closure)); | |
| 1837 __ Dispatch(); | |
| 1838 } | |
| 1839 | |
| 1824 // CreateMappedArguments | 1840 // CreateMappedArguments |
| 1825 // | 1841 // |
| 1826 // Creates a new mapped arguments object. | 1842 // Creates a new mapped arguments object. |
| 1827 void Interpreter::DoCreateMappedArguments(InterpreterAssembler* assembler) { | 1843 void Interpreter::DoCreateMappedArguments(InterpreterAssembler* assembler) { |
| 1828 Node* closure = __ LoadRegister(Register::function_closure()); | 1844 Node* closure = __ LoadRegister(Register::function_closure()); |
| 1829 Node* context = __ GetContext(); | 1845 Node* context = __ GetContext(); |
| 1830 | 1846 |
| 1831 Label if_duplicate_parameters(assembler, Label::kDeferred); | 1847 Label if_duplicate_parameters(assembler, Label::kDeferred); |
| 1832 Label if_not_duplicate_parameters(assembler); | 1848 Label if_not_duplicate_parameters(assembler); |
| 1833 | 1849 |
| (...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2250 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, | 2266 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, |
| 2251 __ SmiTag(new_state)); | 2267 __ SmiTag(new_state)); |
| 2252 __ SetAccumulator(old_state); | 2268 __ SetAccumulator(old_state); |
| 2253 | 2269 |
| 2254 __ Dispatch(); | 2270 __ Dispatch(); |
| 2255 } | 2271 } |
| 2256 | 2272 |
| 2257 } // namespace interpreter | 2273 } // namespace interpreter |
| 2258 } // namespace internal | 2274 } // namespace internal |
| 2259 } // namespace v8 | 2275 } // namespace v8 |
| OLD | NEW |