| 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 2181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2192 Node* args_count = __ Int32Sub(receiver_args_count, receiver_count); | 2192 Node* args_count = __ Int32Sub(receiver_args_count, receiver_count); |
| 2193 Node* context = __ GetContext(); | 2193 Node* context = __ GetContext(); |
| 2194 | 2194 |
| 2195 // Call into Runtime function CallWithSpread which does everything. | 2195 // Call into Runtime function CallWithSpread which does everything. |
| 2196 Node* result = | 2196 Node* result = |
| 2197 __ CallJSWithSpread(callable, context, receiver_arg, args_count); | 2197 __ CallJSWithSpread(callable, context, receiver_arg, args_count); |
| 2198 __ SetAccumulator(result); | 2198 __ SetAccumulator(result); |
| 2199 __ Dispatch(); | 2199 __ Dispatch(); |
| 2200 } | 2200 } |
| 2201 | 2201 |
| 2202 // NewWithSpread <first_arg> <arg_count> | 2202 // ConstructWithSpread <first_arg> <arg_count> |
| 2203 // | 2203 // |
| 2204 // Call the constructor in |constructor| with the first argument in register | 2204 // Call the constructor in |constructor| with the first argument in register |
| 2205 // |first_arg| and |arg_count| arguments in subsequent registers. The final | 2205 // |first_arg| and |arg_count| arguments in subsequent registers. The final |
| 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::DoConstructWithSpread(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 = __ CallConstructWithSpread(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 // Construct <constructor> <first_arg> <arg_count> |
| 2223 // | 2223 // |
| 2224 // Call operator new with |constructor| and the first argument in | 2224 // Call operator construct 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::DoConstruct(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 = __ CallConstruct(constructor, context, new_target, first_arg, |
| (...skipping 1060 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 |