Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(893)

Unified Diff: src/x64/builtins-x64.cc

Issue 1239593003: Fix memento initialization when constructing from new call (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: addressed comment Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/mips64/builtins-mips64.cc ('k') | test/cctest/test-mementos.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « src/mips64/builtins-mips64.cc ('k') | test/cctest/test-mementos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698