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

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

Issue 113863002: [arm] Avoid unnecessary branches in array constructor stubs. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Get rid of one test by using unsigned comparisons. Created 7 years 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm/code-stubs-arm.cc
diff --git a/src/arm/code-stubs-arm.cc b/src/arm/code-stubs-arm.cc
index 4eb08a1eebb0d7b0145166244f28414b497f604c..42841f2a23e57652f9a3f52fb902253fdd990e5e 100644
--- a/src/arm/code-stubs-arm.cc
+++ b/src/arm/code-stubs-arm.cc
@@ -5705,13 +5705,10 @@ 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);
__ cmp(r3, Operand(kind));
- __ b(ne, &next);
T stub(kind);
- __ TailCallStub(&stub);
- __ bind(&next);
+ __ TailCallStub(&stub, eq);
}
// If we reached this point there is a problem.
@@ -5787,13 +5784,10 @@ 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);
__ cmp(r3, Operand(kind));
- __ b(ne, &next);
ArraySingleArgumentConstructorStub stub(kind);
- __ TailCallStub(&stub);
- __ bind(&next);
+ __ TailCallStub(&stub, eq);
}
// If we reached this point there is a problem.
@@ -5934,37 +5928,27 @@ void ArrayConstructorStub::Generate(MacroAssembler* masm) {
void InternalArrayConstructorStub::GenerateCase(
MacroAssembler* masm, ElementsKind kind) {
- Label not_zero_case, not_one_case;
- Label normal_sequence;
+ __ cmp(r0, Operand(1));
- __ tst(r0, r0);
- __ b(ne, &not_zero_case);
InternalArrayNoArgumentConstructorStub stub0(kind);
- __ TailCallStub(&stub0);
+ __ TailCallStub(&stub0, lo);
- __ bind(&not_zero_case);
- __ cmp(r0, Operand(1));
- __ b(gt, &not_one_case);
+ InternalArrayNArgumentsConstructorStub stubN(kind);
+ __ TailCallStub(&stubN, hi);
if (IsFastPackedElementsKind(kind)) {
// We might need to create a holey array
// look at the first argument
__ ldr(r3, MemOperand(sp, 0));
__ cmp(r3, Operand::Zero());
- __ b(eq, &normal_sequence);
InternalArraySingleArgumentConstructorStub
stub1_holey(GetHoleyElementsKind(kind));
- __ TailCallStub(&stub1_holey);
+ __ TailCallStub(&stub1_holey, ne);
}
- __ 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 | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698