Index: src/interpreter/interpreter.cc |
diff --git a/src/interpreter/interpreter.cc b/src/interpreter/interpreter.cc |
index 5de68769036f43095b6ac6f6db9db18a07c51a1c..39c20e24ad4367111b2491f02d224dd5a2fad9ba 100644 |
--- a/src/interpreter/interpreter.cc |
+++ b/src/interpreter/interpreter.cc |
@@ -1178,14 +1178,15 @@ void Interpreter::DoCallJSRuntimeWide(InterpreterAssembler* assembler) { |
void Interpreter::DoCallConstruct(InterpreterAssembler* assembler) { |
Callable ic = CodeFactory::InterpreterPushArgsAndConstruct(isolate_); |
+ Node* new_target = __ GetAccumulator(); |
Node* constructor_reg = __ BytecodeOperandReg(0); |
Node* constructor = __ LoadRegister(constructor_reg); |
Node* first_arg_reg = __ BytecodeOperandReg(1); |
Node* first_arg = __ RegisterLocation(first_arg_reg); |
Node* args_count = __ BytecodeOperandCount(2); |
Node* context = __ GetContext(); |
- Node* result = __ CallConstruct(constructor, context, constructor, first_arg, |
- args_count); |
+ Node* result = |
+ __ CallConstruct(constructor, context, new_target, first_arg, args_count); |
__ SetAccumulator(result); |
__ Dispatch(); |
} |
@@ -1195,6 +1196,7 @@ void Interpreter::DoCallConstruct(InterpreterAssembler* assembler) { |
// |
// Call operator new with |constructor| and the first argument in |
// register |first_arg| and |arg_count| arguments in subsequent |
+// registers. The new.target is in the accumulator. |
// |
void Interpreter::DoNew(InterpreterAssembler* assembler) { |
DoCallConstruct(assembler); |
@@ -1205,6 +1207,7 @@ void Interpreter::DoNew(InterpreterAssembler* assembler) { |
// |
// Call operator new with |constructor| and the first argument in |
// register |first_arg| and |arg_count| arguments in subsequent |
+// registers. The new.target is in the accumulator. |
// |
void Interpreter::DoNewWide(InterpreterAssembler* assembler) { |
DoCallConstruct(assembler); |