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 2246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2257 // Creates a new context with number of |slots| for the function closure. | 2257 // Creates a new context with number of |slots| for the function closure. |
2258 void Interpreter::DoCreateFunctionContext(InterpreterAssembler* assembler) { | 2258 void Interpreter::DoCreateFunctionContext(InterpreterAssembler* assembler) { |
2259 Node* closure = __ LoadRegister(Register::function_closure()); | 2259 Node* closure = __ LoadRegister(Register::function_closure()); |
2260 Node* slots = __ BytecodeOperandUImm(0); | 2260 Node* slots = __ BytecodeOperandUImm(0); |
2261 Node* context = __ GetContext(); | 2261 Node* context = __ GetContext(); |
2262 __ SetAccumulator( | 2262 __ SetAccumulator( |
2263 FastNewFunctionContextStub::Generate(assembler, closure, slots, context)); | 2263 FastNewFunctionContextStub::Generate(assembler, closure, slots, context)); |
2264 __ Dispatch(); | 2264 __ Dispatch(); |
2265 } | 2265 } |
2266 | 2266 |
| 2267 // CreateEvalContext <slots> |
| 2268 // |
| 2269 // Creates a new context with number of |slots| for an eval closure. |
| 2270 void Interpreter::DoCreateEvalContext(InterpreterAssembler* assembler) { |
| 2271 Node* closure = __ LoadRegister(Register::function_closure()); |
| 2272 Node* slots = __ BytecodeOperandUImm(0); |
| 2273 Node* context = __ GetContext(); |
| 2274 __ SetAccumulator( |
| 2275 FastNewEvalContextStub::Generate(assembler, closure, slots, context)); |
| 2276 __ Dispatch(); |
| 2277 } |
| 2278 |
2267 // CreateWithContext <register> <scope_info_idx> | 2279 // CreateWithContext <register> <scope_info_idx> |
2268 // | 2280 // |
2269 // Creates a new context with the ScopeInfo at |scope_info_idx| for a | 2281 // Creates a new context with the ScopeInfo at |scope_info_idx| for a |
2270 // with-statement with the object in |register| and the closure in the | 2282 // with-statement with the object in |register| and the closure in the |
2271 // accumulator. | 2283 // accumulator. |
2272 void Interpreter::DoCreateWithContext(InterpreterAssembler* assembler) { | 2284 void Interpreter::DoCreateWithContext(InterpreterAssembler* assembler) { |
2273 Node* reg_index = __ BytecodeOperandReg(0); | 2285 Node* reg_index = __ BytecodeOperandReg(0); |
2274 Node* object = __ LoadRegister(reg_index); | 2286 Node* object = __ LoadRegister(reg_index); |
2275 Node* scope_info_idx = __ BytecodeOperandIdx(1); | 2287 Node* scope_info_idx = __ BytecodeOperandIdx(1); |
2276 Node* scope_info = __ LoadConstantPoolEntry(scope_info_idx); | 2288 Node* scope_info = __ LoadConstantPoolEntry(scope_info_idx); |
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2683 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, | 2695 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, |
2684 __ SmiTag(new_state)); | 2696 __ SmiTag(new_state)); |
2685 __ SetAccumulator(old_state); | 2697 __ SetAccumulator(old_state); |
2686 | 2698 |
2687 __ Dispatch(); | 2699 __ Dispatch(); |
2688 } | 2700 } |
2689 | 2701 |
2690 } // namespace interpreter | 2702 } // namespace interpreter |
2691 } // namespace internal | 2703 } // namespace internal |
2692 } // namespace v8 | 2704 } // namespace v8 |
OLD | NEW |