Index: src/builtins/x64/builtins-x64.cc |
diff --git a/src/builtins/x64/builtins-x64.cc b/src/builtins/x64/builtins-x64.cc |
index 1fb26bf8dd480c0dfda7707d19d983b63ff9a968..42a613ee32a0494337f61953054139cc90ce7272 100644 |
--- a/src/builtins/x64/builtins-x64.cc |
+++ b/src/builtins/x64/builtins-x64.cc |
@@ -840,7 +840,8 @@ void Builtins::Generate_InterpreterPushArgsAndCallImpl( |
} |
// static |
-void Builtins::Generate_InterpreterPushArgsAndConstruct(MacroAssembler* masm) { |
+void Builtins::Generate_InterpreterPushArgsAndConstructImpl( |
+ MacroAssembler* masm, CallableType construct_type) { |
// ----------- S t a t e ------------- |
// -- rax : the number of arguments (not including the receiver) |
// -- rdx : the new target (either the same as the constructor or |
@@ -862,8 +863,16 @@ void Builtins::Generate_InterpreterPushArgsAndConstruct(MacroAssembler* masm) { |
// Push return address in preparation for the tail-call. |
__ PushReturnAddressFrom(kScratchRegister); |
- // Call the constructor (rax, rdx, rdi passed on). |
- __ Jump(masm->isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET); |
+ if (construct_type == CallableType::kJSFunction) { |
+ // TODO(mythria): Change this when allocation site feedback is available. |
+ // ConstructFunction initializes allocation site to undefined. |
+ __ Jump(masm->isolate()->builtins()->ConstructFunction(), |
+ RelocInfo::CODE_TARGET); |
+ } else { |
+ DCHECK_EQ(construct_type, CallableType::kAny); |
+ // Call the constructor (rax, rdx, rdi passed on). |
+ __ Jump(masm->isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET); |
+ } |
} |
void Builtins::Generate_InterpreterEnterBytecodeDispatch(MacroAssembler* masm) { |