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 1777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1788 Node* tenured_raw = __ Word32And( | 1788 Node* tenured_raw = __ Word32And( |
1789 flags, __ Int32Constant(CreateClosureFlags::PretenuredBit::kMask)); | 1789 flags, __ Int32Constant(CreateClosureFlags::PretenuredBit::kMask)); |
1790 Node* tenured = __ SmiTag(tenured_raw); | 1790 Node* tenured = __ SmiTag(tenured_raw); |
1791 Node* result = __ CallRuntime(Runtime::kInterpreterNewClosure, context, | 1791 Node* result = __ CallRuntime(Runtime::kInterpreterNewClosure, context, |
1792 shared, tenured); | 1792 shared, tenured); |
1793 __ SetAccumulator(result); | 1793 __ SetAccumulator(result); |
1794 __ Dispatch(); | 1794 __ Dispatch(); |
1795 } | 1795 } |
1796 } | 1796 } |
1797 | 1797 |
| 1798 // CreateBlockContext <index> |
| 1799 // |
| 1800 // Creates a new block context with the scope info constant at |index| and the |
| 1801 // closure in the accumulator. |
| 1802 void Interpreter::DoCreateBlockContext(InterpreterAssembler* assembler) { |
| 1803 Node* index = __ BytecodeOperandIdx(0); |
| 1804 Node* scope_info = __ LoadConstantPoolEntry(index); |
| 1805 Node* closure = __ GetAccumulator(); |
| 1806 Node* context = __ GetContext(); |
| 1807 __ SetAccumulator( |
| 1808 __ CallRuntime(Runtime::kPushBlockContext, context, scope_info, closure)); |
| 1809 __ Dispatch(); |
| 1810 } |
| 1811 |
1798 // CreateFunctionContext <slots> | 1812 // CreateFunctionContext <slots> |
1799 // | 1813 // |
1800 // 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. |
1801 void Interpreter::DoCreateFunctionContext(InterpreterAssembler* assembler) { | 1815 void Interpreter::DoCreateFunctionContext(InterpreterAssembler* assembler) { |
1802 Node* closure = __ LoadRegister(Register::function_closure()); | 1816 Node* closure = __ LoadRegister(Register::function_closure()); |
1803 Node* slots = __ BytecodeOperandIdx(0); | 1817 Node* slots = __ BytecodeOperandIdx(0); |
1804 Node* context = __ GetContext(); | 1818 Node* context = __ GetContext(); |
1805 __ SetAccumulator( | 1819 __ SetAccumulator( |
1806 FastNewFunctionContextStub::Generate(assembler, closure, slots, context)); | 1820 FastNewFunctionContextStub::Generate(assembler, closure, slots, context)); |
1807 __ Dispatch(); | 1821 __ Dispatch(); |
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2236 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, | 2250 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, |
2237 __ SmiTag(new_state)); | 2251 __ SmiTag(new_state)); |
2238 __ SetAccumulator(old_state); | 2252 __ SetAccumulator(old_state); |
2239 | 2253 |
2240 __ Dispatch(); | 2254 __ Dispatch(); |
2241 } | 2255 } |
2242 | 2256 |
2243 } // namespace interpreter | 2257 } // namespace interpreter |
2244 } // namespace internal | 2258 } // namespace internal |
2245 } // namespace v8 | 2259 } // namespace v8 |
OLD | NEW |