Reviewers: dstence, michael_dawson, Michael Lippautz,
Description:
PPC: Fix memento initialization when constructing from new call
Port 3285e3bf071a2575a827c5b29fe389a72dbf8966
Original commit message
Additionally, push the allocation site or undefined independently
of creating a memento to preserve a fixed size for the construct
frames.
[email protected], [email protected], [email protected]
BUG=
Please review this at https://codereview.chromium.org/1229163005/
Base URL: https://chromium.googlesource.com/v8/v8.git@master
Affected files (+8, -12 lines):
M src/ppc/builtins-ppc.cc
Index: src/ppc/builtins-ppc.cc
diff --git a/src/ppc/builtins-ppc.cc b/src/ppc/builtins-ppc.cc
index
b17ebab135ff6785ed53f6dec43e47829c9ed73e..e38dff4eac2dbd954cdb0237b2a3efb7ee443297
100644
--- a/src/ppc/builtins-ppc.cc
+++ b/src/ppc/builtins-ppc.cc
@@ -328,14 +328,10 @@ static void
Generate_JSConstructStubHelper(MacroAssembler* masm,
{
FrameAndConstantPoolScope scope(masm, StackFrame::CONSTRUCT);
- if (create_memento) {
- __ AssertUndefinedOrAllocationSite(r5, r7);
- __ push(r5);
- }
-
// Preserve the incoming parameters on the stack.
+ __ AssertUndefinedOrAllocationSite(r5, r7);
__ SmiTag(r3);
- __ Push(r3, r4, r6);
+ __ Push(r5, r3, r4, r6);
// Try to allocate the object without transitioning into C code. If
any of
// the preconditions is not met, the code bails out to the runtime
call.
@@ -470,7 +466,8 @@ static void
Generate_JSConstructStubHelper(MacroAssembler* masm,
__ LoadRoot(r10, Heap::kAllocationMementoMapRootIndex);
__ StoreP(r10, MemOperand(r8, AllocationMemento::kMapOffset));
// Load the AllocationSite
- __ LoadP(r10, MemOperand(sp, 2 * kPointerSize));
+ __ LoadP(r10, MemOperand(sp, 3 * kPointerSize));
+ __ AssertUndefinedOrAllocationSite(r10, r3);
__ StoreP(r10,
MemOperand(r8,
AllocationMemento::kAllocationSiteOffset));
__ addi(r8, r8, Operand(AllocationMemento::kAllocationSiteOffset +
@@ -654,12 +651,11 @@ void
Builtins::Generate_JSConstructStubForDerived(MacroAssembler* masm) {
// -- sp[...]: constructor arguments
// -----------------------------------
- // TODO(dslomov): support pretenuring
- CHECK(!FLAG_pretenuring_call_new);
-
{
FrameAndConstantPoolScope scope(masm, StackFrame::CONSTRUCT);
+ __ AssertUndefinedOrAllocationSite(r5, r7);
+
// Smi-tagged arguments count.
__ mr(r7, r3);
__ SmiTag(r7, SetRC);
@@ -667,8 +663,8 @@ void
Builtins::Generate_JSConstructStubForDerived(MacroAssembler* masm) {
// receiver is the hole.
__ LoadRoot(ip, Heap::kTheHoleValueRootIndex);
- // smi arguments count, new.target, receiver
- __ Push(r7, r6, ip);
+ // allocation site, smi arguments count, new.target, receiver
+ __ Push(r5, r7, r6, ip);
// Set up pointer to last argument.
__ addi(r5, fp, Operand(StandardFrameConstants::kCallerSPOffset));
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.