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