| 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 2436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2447 __ Dispatch(); | 2447 __ Dispatch(); |
| 2448 } | 2448 } |
| 2449 | 2449 |
| 2450 // CreateFunctionContext <slots> | 2450 // CreateFunctionContext <slots> |
| 2451 // | 2451 // |
| 2452 // Creates a new context with number of |slots| for the function closure. | 2452 // Creates a new context with number of |slots| for the function closure. |
| 2453 void Interpreter::DoCreateFunctionContext(InterpreterAssembler* assembler) { | 2453 void Interpreter::DoCreateFunctionContext(InterpreterAssembler* assembler) { |
| 2454 Node* closure = __ LoadRegister(Register::function_closure()); | 2454 Node* closure = __ LoadRegister(Register::function_closure()); |
| 2455 Node* slots = __ BytecodeOperandUImm(0); | 2455 Node* slots = __ BytecodeOperandUImm(0); |
| 2456 Node* context = __ GetContext(); | 2456 Node* context = __ GetContext(); |
| 2457 __ SetAccumulator(FastNewFunctionContextStub::Generate( | 2457 ConstructorBuiltinsAssembler constructor_assembler(assembler->state()); |
| 2458 assembler, closure, slots, context, FUNCTION_SCOPE)); | 2458 __ SetAccumulator(constructor_assembler.EmitFastNewFunctionContext( |
| 2459 closure, slots, context, FUNCTION_SCOPE)); |
| 2459 __ Dispatch(); | 2460 __ Dispatch(); |
| 2460 } | 2461 } |
| 2461 | 2462 |
| 2462 // CreateEvalContext <slots> | 2463 // CreateEvalContext <slots> |
| 2463 // | 2464 // |
| 2464 // Creates a new context with number of |slots| for an eval closure. | 2465 // Creates a new context with number of |slots| for an eval closure. |
| 2465 void Interpreter::DoCreateEvalContext(InterpreterAssembler* assembler) { | 2466 void Interpreter::DoCreateEvalContext(InterpreterAssembler* assembler) { |
| 2466 Node* closure = __ LoadRegister(Register::function_closure()); | 2467 Node* closure = __ LoadRegister(Register::function_closure()); |
| 2467 Node* slots = __ BytecodeOperandUImm(0); | 2468 Node* slots = __ BytecodeOperandUImm(0); |
| 2468 Node* context = __ GetContext(); | 2469 Node* context = __ GetContext(); |
| 2469 __ SetAccumulator(FastNewFunctionContextStub::Generate( | 2470 ConstructorBuiltinsAssembler constructor_assembler(assembler->state()); |
| 2470 assembler, closure, slots, context, EVAL_SCOPE)); | 2471 __ SetAccumulator(constructor_assembler.EmitFastNewFunctionContext( |
| 2472 closure, slots, context, EVAL_SCOPE)); |
| 2471 __ Dispatch(); | 2473 __ Dispatch(); |
| 2472 } | 2474 } |
| 2473 | 2475 |
| 2474 // CreateWithContext <register> <scope_info_idx> | 2476 // CreateWithContext <register> <scope_info_idx> |
| 2475 // | 2477 // |
| 2476 // Creates a new context with the ScopeInfo at |scope_info_idx| for a | 2478 // Creates a new context with the ScopeInfo at |scope_info_idx| for a |
| 2477 // with-statement with the object in |register| and the closure in the | 2479 // with-statement with the object in |register| and the closure in the |
| 2478 // accumulator. | 2480 // accumulator. |
| 2479 void Interpreter::DoCreateWithContext(InterpreterAssembler* assembler) { | 2481 void Interpreter::DoCreateWithContext(InterpreterAssembler* assembler) { |
| 2480 Node* reg_index = __ BytecodeOperandReg(0); | 2482 Node* reg_index = __ BytecodeOperandReg(0); |
| (...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2906 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, | 2908 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, |
| 2907 __ SmiTag(new_state)); | 2909 __ SmiTag(new_state)); |
| 2908 __ SetAccumulator(old_state); | 2910 __ SetAccumulator(old_state); |
| 2909 | 2911 |
| 2910 __ Dispatch(); | 2912 __ Dispatch(); |
| 2911 } | 2913 } |
| 2912 | 2914 |
| 2913 } // namespace interpreter | 2915 } // namespace interpreter |
| 2914 } // namespace internal | 2916 } // namespace internal |
| 2915 } // namespace v8 | 2917 } // namespace v8 |
| OLD | NEW |