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

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

Issue 107003008: MIPS: Avoid unnecessary branches in array constructor stubs. (Closed) Base URL: https://github.com/v8/v8.git@gbl
Patch Set: Created 6 years, 12 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/mips/macro-assembler-mips.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mips/code-stubs-mips.cc
diff --git a/src/mips/code-stubs-mips.cc b/src/mips/code-stubs-mips.cc
index 61e05f8fc8da57c3b18fd7a2a105ca3fc87b0e97..97ef020af5775649cb795488b16ecd604ec533a9 100644
--- a/src/mips/code-stubs-mips.cc
+++ b/src/mips/code-stubs-mips.cc
@@ -5683,12 +5683,9 @@ static void CreateArrayDispatch(MacroAssembler* masm,
int last_index = GetSequenceIndexFromFastElementsKind(
TERMINAL_FAST_ELEMENTS_KIND);
for (int i = 0; i <= last_index; ++i) {
- Label next;
ElementsKind kind = GetFastElementsKindFromSequenceIndex(i);
- __ Branch(&next, ne, a3, Operand(kind));
T stub(kind);
- __ TailCallStub(&stub);
- __ bind(&next);
+ __ TailCallStub(&stub, eq, a3, Operand(kind));
}
// If we reached this point there is a problem.
@@ -5764,12 +5761,9 @@ static void CreateArrayDispatchOneArgument(MacroAssembler* masm,
int last_index = GetSequenceIndexFromFastElementsKind(
TERMINAL_FAST_ELEMENTS_KIND);
for (int i = 0; i <= last_index; ++i) {
- Label next;
ElementsKind kind = GetFastElementsKindFromSequenceIndex(i);
- __ Branch(&next, ne, a3, Operand(kind));
ArraySingleArgumentConstructorStub stub(kind);
- __ TailCallStub(&stub);
- __ bind(&next);
+ __ TailCallStub(&stub, eq, a3, Operand(kind));
}
// If we reached this point there is a problem.
@@ -5911,34 +5905,25 @@ void ArrayConstructorStub::Generate(MacroAssembler* masm) {
void InternalArrayConstructorStub::GenerateCase(
MacroAssembler* masm, ElementsKind kind) {
- Label not_zero_case, not_one_case;
- Label normal_sequence;
- __ Branch(&not_zero_case, ne, a0, Operand(zero_reg));
InternalArrayNoArgumentConstructorStub stub0(kind);
- __ TailCallStub(&stub0);
+ __ TailCallStub(&stub0, lo, a0, Operand(1));
- __ bind(&not_zero_case);
- __ Branch(&not_one_case, gt, a0, Operand(1));
+ InternalArrayNArgumentsConstructorStub stubN(kind);
+ __ TailCallStub(&stubN, hi, a0, Operand(1));
if (IsFastPackedElementsKind(kind)) {
// We might need to create a holey array
// look at the first argument.
__ lw(at, MemOperand(sp, 0));
- __ Branch(&normal_sequence, eq, at, Operand(zero_reg));
InternalArraySingleArgumentConstructorStub
stub1_holey(GetHoleyElementsKind(kind));
- __ TailCallStub(&stub1_holey);
+ __ TailCallStub(&stub1_holey, ne, at, Operand(zero_reg));
}
- __ bind(&normal_sequence);
InternalArraySingleArgumentConstructorStub stub1(kind);
__ TailCallStub(&stub1);
-
- __ bind(&not_one_case);
- InternalArrayNArgumentsConstructorStub stubN(kind);
- __ TailCallStub(&stubN);
}
« no previous file with comments | « no previous file | src/mips/macro-assembler-mips.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698