Index: src/x64/builtins-x64.cc |
diff --git a/src/x64/builtins-x64.cc b/src/x64/builtins-x64.cc |
index c59d3ba78fbd557467904af73bba72810fb9521f..64e132b8933f9d35d4b85d9bb254e31e6325064b 100644 |
--- a/src/x64/builtins-x64.cc |
+++ b/src/x64/builtins-x64.cc |
@@ -116,12 +116,9 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm, |
{ |
FrameScope scope(masm, StackFrame::CONSTRUCT); |
- if (create_memento) { |
- __ AssertUndefinedOrAllocationSite(rbx); |
- __ Push(rbx); |
- } |
- |
// Preserve the incoming parameters on the stack. |
+ __ AssertUndefinedOrAllocationSite(rbx); |
+ __ Push(rbx); |
__ Integer32ToSmi(rax, rax); |
__ Push(rax); |
__ Push(rdi); |
@@ -254,7 +251,8 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm, |
__ Move(Operand(rsi, AllocationMemento::kMapOffset), |
factory->allocation_memento_map()); |
// Get the cell or undefined. |
- __ movp(rdx, Operand(rsp, kPointerSize*2)); |
+ __ movp(rdx, Operand(rsp, 3 * kPointerSize)); |
+ __ AssertUndefinedOrAllocationSite(rdx); |
__ movp(Operand(rsi, AllocationMemento::kAllocationSiteOffset), rdx); |
} else { |
__ InitializeFieldsWithFiller(rcx, rdi, rdx); |
@@ -420,12 +418,14 @@ void Builtins::Generate_JSConstructStubForDerived(MacroAssembler* masm) { |
// -- rbx: allocation site or undefined |
// -- rdx: original constructor |
// ----------------------------------- |
- // TODO(dslomov): support pretenuring |
- CHECK(!FLAG_pretenuring_call_new); |
{ |
FrameScope frame_scope(masm, StackFrame::CONSTRUCT); |
+ // Preserve allocation site. |
+ __ AssertUndefinedOrAllocationSite(rbx); |
+ __ Push(rbx); |
+ |
// Store a smi-tagged arguments count on the stack. |
__ Integer32ToSmi(rax, rax); |
__ Push(rax); |