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

Unified Diff: src/macro-assembler-arm.cc

Issue 13290: Fixed bug in large switch tables on arm. (Closed)
Patch Set: Addressed review comments Created 12 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 | « src/macro-assembler-arm.h ('k') | test/mjsunit/switch.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/macro-assembler-arm.cc
diff --git a/src/macro-assembler-arm.cc b/src/macro-assembler-arm.cc
index 7016145bff880ee6cf7907d3acdbae0e77e995d9..5cbeae9124c3a01c5aa2e16366b1c505cb7a6cc0 100644
--- a/src/macro-assembler-arm.cc
+++ b/src/macro-assembler-arm.cc
@@ -176,6 +176,20 @@ void MacroAssembler::Ret() {
}
+void MacroAssembler::SmiJumpTable(Register index, Vector<Label*> targets) {
+ // Empty the const pool.
+ CheckConstPool(true, true);
+ add(pc, pc, Operand(index,
+ LSL,
+ assembler::arm::Instr::kInstrSizeLog2 - kSmiTagSize));
+ BlockConstPoolBefore(pc_offset() + (targets.length() + 1) * sizeof(Instr));
+ nop(); // Jump table alignment.
+ for (int i = 0; i < targets.length(); i++) {
+ b(targets[i]);
+ }
+}
+
+
// Will clobber 4 registers: object, offset, scratch, ip. The
// register 'object' contains a heap object pointer. The heap object
// tag is shifted away.
« no previous file with comments | « src/macro-assembler-arm.h ('k') | test/mjsunit/switch.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698