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 2006 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2017 // Creates a new context with number of |slots| for the function closure. | 2017 // Creates a new context with number of |slots| for the function closure. |
2018 void Interpreter::DoCreateFunctionContext(InterpreterAssembler* assembler) { | 2018 void Interpreter::DoCreateFunctionContext(InterpreterAssembler* assembler) { |
2019 Node* closure = __ LoadRegister(Register::function_closure()); | 2019 Node* closure = __ LoadRegister(Register::function_closure()); |
2020 Node* slots = __ BytecodeOperandIdx(0); | 2020 Node* slots = __ BytecodeOperandIdx(0); |
2021 Node* context = __ GetContext(); | 2021 Node* context = __ GetContext(); |
2022 __ SetAccumulator( | 2022 __ SetAccumulator( |
2023 FastNewFunctionContextStub::Generate(assembler, closure, slots, context)); | 2023 FastNewFunctionContextStub::Generate(assembler, closure, slots, context)); |
2024 __ Dispatch(); | 2024 __ Dispatch(); |
2025 } | 2025 } |
2026 | 2026 |
2027 // CreateWithContext <register> | 2027 // CreateWithContext <register> <scope_info_idx> |
2028 // | 2028 // |
2029 // Creates a new context for a with-statement with the object in |register| and | 2029 // Creates a new context with the ScopeInfo at |scope_info_idx| for a |
2030 // the closure in the accumulator. | 2030 // with-statement with the object in |register| and the closure in the |
| 2031 // accumulator. |
2031 void Interpreter::DoCreateWithContext(InterpreterAssembler* assembler) { | 2032 void Interpreter::DoCreateWithContext(InterpreterAssembler* assembler) { |
2032 Node* reg_index = __ BytecodeOperandReg(0); | 2033 Node* reg_index = __ BytecodeOperandReg(0); |
2033 Node* object = __ LoadRegister(reg_index); | 2034 Node* object = __ LoadRegister(reg_index); |
| 2035 Node* scope_info_idx = __ BytecodeOperandIdx(1); |
| 2036 Node* scope_info = __ LoadConstantPoolEntry(scope_info_idx); |
2034 Node* closure = __ GetAccumulator(); | 2037 Node* closure = __ GetAccumulator(); |
2035 Node* context = __ GetContext(); | 2038 Node* context = __ GetContext(); |
2036 __ SetAccumulator( | 2039 __ SetAccumulator(__ CallRuntime(Runtime::kPushWithContext, context, object, |
2037 __ CallRuntime(Runtime::kPushWithContext, context, object, closure)); | 2040 scope_info, closure)); |
2038 __ Dispatch(); | 2041 __ Dispatch(); |
2039 } | 2042 } |
2040 | 2043 |
2041 // CreateMappedArguments | 2044 // CreateMappedArguments |
2042 // | 2045 // |
2043 // Creates a new mapped arguments object. | 2046 // Creates a new mapped arguments object. |
2044 void Interpreter::DoCreateMappedArguments(InterpreterAssembler* assembler) { | 2047 void Interpreter::DoCreateMappedArguments(InterpreterAssembler* assembler) { |
2045 Node* closure = __ LoadRegister(Register::function_closure()); | 2048 Node* closure = __ LoadRegister(Register::function_closure()); |
2046 Node* context = __ GetContext(); | 2049 Node* context = __ GetContext(); |
2047 | 2050 |
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2467 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, | 2470 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, |
2468 __ SmiTag(new_state)); | 2471 __ SmiTag(new_state)); |
2469 __ SetAccumulator(old_state); | 2472 __ SetAccumulator(old_state); |
2470 | 2473 |
2471 __ Dispatch(); | 2474 __ Dispatch(); |
2472 } | 2475 } |
2473 | 2476 |
2474 } // namespace interpreter | 2477 } // namespace interpreter |
2475 } // namespace internal | 2478 } // namespace internal |
2476 } // namespace v8 | 2479 } // namespace v8 |
OLD | NEW |