Commit 8ced019a authored by mbrandy's avatar mbrandy Committed by Commit bot

PPC: [runtime] Introduce a proper %NewArray runtime entry.

Port ceade6cf

Original commit message:
    This adds a new %NewArray runtime entry, which constructs a new JSArray
    and does the subclassing correctly (to the same degree that %NewObject
    does currently), and also deals properly with the AllocationSite
    feedback mechanism. This runtime entry will be used by TurboFan and is
    also used as a fallback in the subclassing case in the stub currently.

R=bmeurer@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=v8:3101, v8:3330
LOG=n

Review URL: https://codereview.chromium.org/1466943002

Cr-Commit-Position: refs/heads/master@{#32180}
parent 902f264a
......@@ -5053,25 +5053,25 @@ void ArrayConstructorStub::Generate(MacroAssembler* masm) {
GenerateDispatchToArrayStub(masm, DISABLE_ALLOCATION_SITES);
__ bind(&subclassing);
__ push(r4);
__ push(r6);
// Adjust argc.
switch (argument_count()) {
case ANY:
case MORE_THAN_ONE:
__ addi(r3, r3, Operand(2));
__ ShiftLeftImm(r0, r3, Operand(kPointerSizeLog2));
__ StorePX(r4, MemOperand(sp, r0));
__ addi(r3, r3, Operand(3));
break;
case NONE:
__ li(r3, Operand(2));
__ StoreP(r4, MemOperand(sp, 0 * kPointerSize));
__ li(r3, Operand(3));
break;
case ONE:
__ li(r3, Operand(3));
__ StoreP(r4, MemOperand(sp, 1 * kPointerSize));
__ li(r3, Operand(4));
break;
}
__ JumpToExternalReference(
ExternalReference(Runtime::kArrayConstructorWithSubclassing, isolate()));
__ Push(r6, r5);
__ JumpToExternalReference(ExternalReference(Runtime::kNewArray, isolate()));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment