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

Unified Diff: src/codegen-arm.cc

Issue 9320: Semi-weekly merge from bleeding_edge to the toiger branch. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/toiger/
Patch Set: Created 12 years, 1 month 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 | « src/codegen.cc ('k') | src/codegen-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codegen-arm.cc
===================================================================
--- src/codegen-arm.cc (revision 682)
+++ src/codegen-arm.cc (working copy)
@@ -1247,10 +1247,29 @@
ASSERT(kSmiTag == 0 && kSmiTagSize <= 2);
__ pop(r0);
+
+ // Test for a Smi value in a HeapNumber.
+ Label is_smi;
+ __ tst(r0, Operand(kSmiTagMask));
+ __ b(eq, &is_smi);
+ __ ldr(r1, MemOperand(r0, HeapObject::kMapOffset - kHeapObjectTag));
+ __ ldrb(r1, MemOperand(r1, Map::kInstanceTypeOffset - kHeapObjectTag));
+ __ cmp(r1, Operand(HEAP_NUMBER_TYPE));
+ __ b(ne, fail_label);
+ __ push(r0);
+ __ CallRuntime(Runtime::kNumberToSmi, 1);
+ __ bind(&is_smi);
+
if (min_index != 0) {
- // small positive numbers can be immediate operands.
+ // Small positive numbers can be immediate operands.
if (min_index < 0) {
- __ add(r0, r0, Operand(Smi::FromInt(-min_index)));
+ // If min_index is Smi::kMinValue, -min_index is not a Smi.
+ if (Smi::IsValid(-min_index)) {
+ __ add(r0, r0, Operand(Smi::FromInt(-min_index)));
+ } else {
+ __ add(r0, r0, Operand(Smi::FromInt(-min_index - 1)));
+ __ add(r0, r0, Operand(Smi::FromInt(1)));
+ }
} else {
__ sub(r0, r0, Operand(Smi::FromInt(min_index)));
}
@@ -1264,7 +1283,7 @@
// the pc-register at the above add.
__ stop("Unreachable: Switch table alignment");
- // table containing branch operations.
+ // Table containing branch operations.
for (int i = 0; i < range; i++) {
__ b(case_targets[i]);
}
« no previous file with comments | « src/codegen.cc ('k') | src/codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698