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 2195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2206 // argument is always a spread. The new.target is in the accumulator. | 2206 // argument is always a spread. The new.target is in the accumulator. |
2207 // | 2207 // |
2208 void Interpreter::DoNewWithSpread(InterpreterAssembler* assembler) { | 2208 void Interpreter::DoNewWithSpread(InterpreterAssembler* assembler) { |
2209 Node* new_target = __ GetAccumulator(); | 2209 Node* new_target = __ GetAccumulator(); |
2210 Node* constructor_reg = __ BytecodeOperandReg(0); | 2210 Node* constructor_reg = __ BytecodeOperandReg(0); |
2211 Node* constructor = __ LoadRegister(constructor_reg); | 2211 Node* constructor = __ LoadRegister(constructor_reg); |
2212 Node* first_arg_reg = __ BytecodeOperandReg(1); | 2212 Node* first_arg_reg = __ BytecodeOperandReg(1); |
2213 Node* first_arg = __ RegisterLocation(first_arg_reg); | 2213 Node* first_arg = __ RegisterLocation(first_arg_reg); |
2214 Node* args_count = __ BytecodeOperandCount(2); | 2214 Node* args_count = __ BytecodeOperandCount(2); |
2215 Node* context = __ GetContext(); | 2215 Node* context = __ GetContext(); |
2216 Node* result = __ CallConstructWithSpread(constructor, context, new_target, | 2216 Node* result = __ ConstructWithSpread(constructor, context, new_target, |
2217 first_arg, args_count); | 2217 first_arg, args_count); |
2218 __ SetAccumulator(result); | 2218 __ SetAccumulator(result); |
2219 __ Dispatch(); | 2219 __ Dispatch(); |
2220 } | 2220 } |
2221 | 2221 |
2222 // New <constructor> <first_arg> <arg_count> | 2222 // New <constructor> <first_arg> <arg_count> |
2223 // | 2223 // |
2224 // Call operator new with |constructor| and the first argument in | 2224 // Call operator new with |constructor| and the first argument in |
2225 // register |first_arg| and |arg_count| arguments in subsequent | 2225 // register |first_arg| and |arg_count| arguments in subsequent |
2226 // registers. The new.target is in the accumulator. | 2226 // registers. The new.target is in the accumulator. |
2227 // | 2227 // |
2228 void Interpreter::DoNew(InterpreterAssembler* assembler) { | 2228 void Interpreter::DoNew(InterpreterAssembler* assembler) { |
2229 Node* new_target = __ GetAccumulator(); | 2229 Node* new_target = __ GetAccumulator(); |
2230 Node* constructor_reg = __ BytecodeOperandReg(0); | 2230 Node* constructor_reg = __ BytecodeOperandReg(0); |
2231 Node* constructor = __ LoadRegister(constructor_reg); | 2231 Node* constructor = __ LoadRegister(constructor_reg); |
2232 Node* first_arg_reg = __ BytecodeOperandReg(1); | 2232 Node* first_arg_reg = __ BytecodeOperandReg(1); |
2233 Node* first_arg = __ RegisterLocation(first_arg_reg); | 2233 Node* first_arg = __ RegisterLocation(first_arg_reg); |
2234 Node* args_count = __ BytecodeOperandCount(2); | 2234 Node* args_count = __ BytecodeOperandCount(2); |
2235 Node* slot_id = __ BytecodeOperandIdx(3); | 2235 Node* slot_id = __ BytecodeOperandIdx(3); |
2236 Node* type_feedback_vector = __ LoadTypeFeedbackVector(); | 2236 Node* type_feedback_vector = __ LoadTypeFeedbackVector(); |
2237 Node* context = __ GetContext(); | 2237 Node* context = __ GetContext(); |
2238 Node* result = __ CallConstruct(constructor, context, new_target, first_arg, | 2238 Node* result = __ Construct(constructor, context, new_target, first_arg, |
2239 args_count, slot_id, type_feedback_vector); | 2239 args_count, slot_id, type_feedback_vector); |
2240 __ SetAccumulator(result); | 2240 __ SetAccumulator(result); |
2241 __ Dispatch(); | 2241 __ Dispatch(); |
2242 } | 2242 } |
2243 | 2243 |
2244 // TestEqual <src> | 2244 // TestEqual <src> |
2245 // | 2245 // |
2246 // Test if the value in the <src> register equals the accumulator. | 2246 // Test if the value in the <src> register equals the accumulator. |
2247 void Interpreter::DoTestEqual(InterpreterAssembler* assembler) { | 2247 void Interpreter::DoTestEqual(InterpreterAssembler* assembler) { |
2248 DoCompareOpWithFeedback(Token::Value::EQ, assembler); | 2248 DoCompareOpWithFeedback(Token::Value::EQ, assembler); |
2249 } | 2249 } |
(...skipping 1049 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3299 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, | 3299 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, |
3300 __ SmiTag(new_state)); | 3300 __ SmiTag(new_state)); |
3301 __ SetAccumulator(old_state); | 3301 __ SetAccumulator(old_state); |
3302 | 3302 |
3303 __ Dispatch(); | 3303 __ Dispatch(); |
3304 } | 3304 } |
3305 | 3305 |
3306 } // namespace interpreter | 3306 } // namespace interpreter |
3307 } // namespace internal | 3307 } // namespace internal |
3308 } // namespace v8 | 3308 } // namespace v8 |
OLD | NEW |