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 2401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2412 __ Dispatch(); | 2412 __ Dispatch(); |
2413 } | 2413 } |
2414 | 2414 |
2415 // CreateFunctionContext <slots> | 2415 // CreateFunctionContext <slots> |
2416 // | 2416 // |
2417 // Creates a new context with number of |slots| for the function closure. | 2417 // Creates a new context with number of |slots| for the function closure. |
2418 void Interpreter::DoCreateFunctionContext(InterpreterAssembler* assembler) { | 2418 void Interpreter::DoCreateFunctionContext(InterpreterAssembler* assembler) { |
2419 Node* closure = __ LoadRegister(Register::function_closure()); | 2419 Node* closure = __ LoadRegister(Register::function_closure()); |
2420 Node* slots = __ BytecodeOperandUImm(0); | 2420 Node* slots = __ BytecodeOperandUImm(0); |
2421 Node* context = __ GetContext(); | 2421 Node* context = __ GetContext(); |
2422 __ SetAccumulator( | 2422 __ SetAccumulator(FastNewFunctionContextStub::Generate( |
2423 FastNewFunctionContextStub::Generate(assembler, closure, slots, context)); | 2423 assembler, closure, slots, context, FUNCTION_SCOPE)); |
2424 __ Dispatch(); | 2424 __ Dispatch(); |
2425 } | 2425 } |
2426 | 2426 |
| 2427 // CreateEvalContext <slots> |
| 2428 // |
| 2429 // Creates a new context with number of |slots| for an eval closure. |
| 2430 void Interpreter::DoCreateEvalContext(InterpreterAssembler* assembler) { |
| 2431 Node* closure = __ LoadRegister(Register::function_closure()); |
| 2432 Node* slots = __ BytecodeOperandUImm(0); |
| 2433 Node* context = __ GetContext(); |
| 2434 __ SetAccumulator(FastNewFunctionContextStub::Generate( |
| 2435 assembler, closure, slots, context, EVAL_SCOPE)); |
| 2436 __ Dispatch(); |
| 2437 } |
| 2438 |
2427 // CreateWithContext <register> <scope_info_idx> | 2439 // CreateWithContext <register> <scope_info_idx> |
2428 // | 2440 // |
2429 // Creates a new context with the ScopeInfo at |scope_info_idx| for a | 2441 // Creates a new context with the ScopeInfo at |scope_info_idx| for a |
2430 // with-statement with the object in |register| and the closure in the | 2442 // with-statement with the object in |register| and the closure in the |
2431 // accumulator. | 2443 // accumulator. |
2432 void Interpreter::DoCreateWithContext(InterpreterAssembler* assembler) { | 2444 void Interpreter::DoCreateWithContext(InterpreterAssembler* assembler) { |
2433 Node* reg_index = __ BytecodeOperandReg(0); | 2445 Node* reg_index = __ BytecodeOperandReg(0); |
2434 Node* object = __ LoadRegister(reg_index); | 2446 Node* object = __ LoadRegister(reg_index); |
2435 Node* scope_info_idx = __ BytecodeOperandIdx(1); | 2447 Node* scope_info_idx = __ BytecodeOperandIdx(1); |
2436 Node* scope_info = __ LoadConstantPoolEntry(scope_info_idx); | 2448 Node* scope_info = __ LoadConstantPoolEntry(scope_info_idx); |
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2860 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, | 2872 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, |
2861 __ SmiTag(new_state)); | 2873 __ SmiTag(new_state)); |
2862 __ SetAccumulator(old_state); | 2874 __ SetAccumulator(old_state); |
2863 | 2875 |
2864 __ Dispatch(); | 2876 __ Dispatch(); |
2865 } | 2877 } |
2866 | 2878 |
2867 } // namespace interpreter | 2879 } // namespace interpreter |
2868 } // namespace internal | 2880 } // namespace internal |
2869 } // namespace v8 | 2881 } // namespace v8 |
OLD | NEW |