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

Unified Diff: src/arm/full-codegen-arm.cc

Issue 1703012: Fix bug in the ARM full code generator for inlined count operations.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years, 8 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm/full-codegen-arm.cc
===================================================================
--- src/arm/full-codegen-arm.cc (revision 4486)
+++ src/arm/full-codegen-arm.cc (working copy)
@@ -1592,10 +1592,9 @@
// Inline smi case if we are in a loop.
Label stub_call, done;
+ int count_value = expr->op() == Token::INC ? 1 : -1;
if (loop_depth() > 0) {
- __ add(r0, r0, Operand(expr->op() == Token::INC
- ? Smi::FromInt(1)
- : Smi::FromInt(-1)));
+ __ add(r0, r0, Operand(Smi::FromInt(count_value)), SetCC);
__ b(vs, &stub_call);
// We could eliminate this smi check if we split the code at
// the first smi check before calling ToNumber.
@@ -1603,11 +1602,9 @@
__ b(eq, &done);
__ bind(&stub_call);
// Call stub. Undo operation first.
- __ sub(r0, r0, Operand(r1));
+ __ sub(r0, r0, Operand(Smi::FromInt(count_value)));
}
- __ mov(r1, Operand(expr->op() == Token::INC
- ? Smi::FromInt(1)
- : Smi::FromInt(-1)));
+ __ mov(r1, Operand(Smi::FromInt(count_value)));
GenericBinaryOpStub stub(Token::ADD, NO_OVERWRITE, r1, r0);
__ CallStub(&stub);
__ bind(&done);
« 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