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

Unified Diff: src/ppc/code-stubs-ppc.cc

Issue 2410183002: PPC/s390: [stubs] Simplify the ArrayConstructorStub. (Closed)
Patch Set: Created 4 years, 2 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 | « no previous file | src/s390/code-stubs-s390.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ppc/code-stubs-ppc.cc
diff --git a/src/ppc/code-stubs-ppc.cc b/src/ppc/code-stubs-ppc.cc
index 803e0050da24d09aa5ac709b517463942a004b42..11d565531456e96b7a11e0de005a0850bbd33eb1 100644
--- a/src/ppc/code-stubs-ppc.cc
+++ b/src/ppc/code-stubs-ppc.cc
@@ -1881,14 +1881,13 @@ void CallICStub::HandleArrayCase(MacroAssembler* masm, Label* miss) {
__ cmp(r4, r8);
__ bne(miss);
- __ mov(r3, Operand(arg_count()));
-
// Increment the call count for monomorphic function calls.
IncrementCallCount(masm, r5, r6, r0);
__ mr(r5, r7);
__ mr(r6, r4);
- ArrayConstructorStub stub(masm->isolate(), arg_count());
+ __ mov(r3, Operand(arg_count()));
+ ArrayConstructorStub stub(masm->isolate());
__ TailCallStub(&stub);
}
@@ -3862,30 +3861,19 @@ void CommonArrayConstructorStub::GenerateStubsAheadOfTime(Isolate* isolate) {
void ArrayConstructorStub::GenerateDispatchToArrayStub(
MacroAssembler* masm, AllocationSiteOverrideMode mode) {
- if (argument_count() == ANY) {
- Label not_zero_case, not_one_case;
- __ cmpi(r3, Operand::Zero());
- __ bne(&not_zero_case);
- CreateArrayDispatch<ArrayNoArgumentConstructorStub>(masm, mode);
+ Label not_zero_case, not_one_case;
+ __ cmpi(r3, Operand::Zero());
+ __ bne(&not_zero_case);
+ CreateArrayDispatch<ArrayNoArgumentConstructorStub>(masm, mode);
- __ bind(&not_zero_case);
- __ cmpi(r3, Operand(1));
- __ bgt(&not_one_case);
- CreateArrayDispatchOneArgument(masm, mode);
+ __ bind(&not_zero_case);
+ __ cmpi(r3, Operand(1));
+ __ bgt(&not_one_case);
+ CreateArrayDispatchOneArgument(masm, mode);
- __ bind(&not_one_case);
- ArrayNArgumentsConstructorStub stub(masm->isolate());
- __ TailCallStub(&stub);
- } else if (argument_count() == NONE) {
- CreateArrayDispatch<ArrayNoArgumentConstructorStub>(masm, mode);
- } else if (argument_count() == ONE) {
- CreateArrayDispatchOneArgument(masm, mode);
- } else if (argument_count() == MORE_THAN_ONE) {
- ArrayNArgumentsConstructorStub stub(masm->isolate());
- __ TailCallStub(&stub);
- } else {
- UNREACHABLE();
- }
+ __ bind(&not_one_case);
+ ArrayNArgumentsConstructorStub stub(masm->isolate());
+ __ TailCallStub(&stub);
}
@@ -3937,23 +3925,9 @@ void ArrayConstructorStub::Generate(MacroAssembler* masm) {
GenerateDispatchToArrayStub(masm, DISABLE_ALLOCATION_SITES);
__ bind(&subclassing);
- switch (argument_count()) {
- case ANY:
- case MORE_THAN_ONE:
- __ ShiftLeftImm(r0, r3, Operand(kPointerSizeLog2));
- __ StorePX(r4, MemOperand(sp, r0));
- __ addi(r3, r3, Operand(3));
- break;
- case NONE:
- __ StoreP(r4, MemOperand(sp, 0 * kPointerSize));
- __ li(r3, Operand(3));
- break;
- case ONE:
- __ StoreP(r4, MemOperand(sp, 1 * kPointerSize));
- __ li(r3, Operand(4));
- break;
- }
-
+ __ ShiftLeftImm(r0, r3, Operand(kPointerSizeLog2));
+ __ StorePX(r4, MemOperand(sp, r0));
+ __ addi(r3, r3, Operand(3));
__ Push(r6, r5);
__ JumpToExternalReference(ExternalReference(Runtime::kNewArray, isolate()));
}
« no previous file with comments | « no previous file | src/s390/code-stubs-s390.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698