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 2167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2178 __ Dispatch(); | 2178 __ Dispatch(); |
2179 } | 2179 } |
2180 | 2180 |
2181 // New <constructor> <first_arg> <arg_count> | 2181 // New <constructor> <first_arg> <arg_count> |
2182 // | 2182 // |
2183 // Call operator new with |constructor| and the first argument in | 2183 // Call operator new with |constructor| and the first argument in |
2184 // register |first_arg| and |arg_count| arguments in subsequent | 2184 // register |first_arg| and |arg_count| arguments in subsequent |
2185 // registers. The new.target is in the accumulator. | 2185 // registers. The new.target is in the accumulator. |
2186 // | 2186 // |
2187 void Interpreter::DoNew(InterpreterAssembler* assembler) { | 2187 void Interpreter::DoNew(InterpreterAssembler* assembler) { |
2188 Callable ic = CodeFactory::InterpreterPushArgsAndConstruct(isolate_); | |
2189 Node* new_target = __ GetAccumulator(); | 2188 Node* new_target = __ GetAccumulator(); |
2190 Node* constructor_reg = __ BytecodeOperandReg(0); | 2189 Node* constructor_reg = __ BytecodeOperandReg(0); |
2191 Node* constructor = __ LoadRegister(constructor_reg); | 2190 Node* constructor = __ LoadRegister(constructor_reg); |
2192 Node* first_arg_reg = __ BytecodeOperandReg(1); | 2191 Node* first_arg_reg = __ BytecodeOperandReg(1); |
2193 Node* first_arg = __ RegisterLocation(first_arg_reg); | 2192 Node* first_arg = __ RegisterLocation(first_arg_reg); |
2194 Node* args_count = __ BytecodeOperandCount(2); | 2193 Node* args_count = __ BytecodeOperandCount(2); |
2195 Node* slot_id = __ BytecodeOperandIdx(3); | 2194 Node* slot_id = __ BytecodeOperandIdx(3); |
2196 Node* type_feedback_vector = __ LoadTypeFeedbackVector(); | 2195 Node* type_feedback_vector = __ LoadTypeFeedbackVector(); |
2197 Node* context = __ GetContext(); | 2196 Node* context = __ GetContext(); |
2198 Node* result = __ CallConstruct(constructor, context, new_target, first_arg, | 2197 Node* result = __ CallConstruct(constructor, context, new_target, first_arg, |
(...skipping 1052 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3251 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, | 3250 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, |
3252 __ SmiTag(new_state)); | 3251 __ SmiTag(new_state)); |
3253 __ SetAccumulator(old_state); | 3252 __ SetAccumulator(old_state); |
3254 | 3253 |
3255 __ Dispatch(); | 3254 __ Dispatch(); |
3256 } | 3255 } |
3257 | 3256 |
3258 } // namespace interpreter | 3257 } // namespace interpreter |
3259 } // namespace internal | 3258 } // namespace internal |
3260 } // namespace v8 | 3259 } // namespace v8 |
OLD | NEW |