Fix chaining offset mis-calculation for translations w/ large switch statements.
Bug: 2369821
There are 12 bytes of additional code after the 65th chaining cell. So if a
switch statement with more than that many cases is translated by the JIT, it
will run fine until the next unchaining event, which will patch the wrong code
and lead to all kinds of unexpected crashes.
diff --git a/vm/compiler/codegen/arm/ArchUtility.c b/vm/compiler/codegen/arm/ArchUtility.c
index d8cac49..20b3f85 100644
--- a/vm/compiler/codegen/arm/ArchUtility.c
+++ b/vm/compiler/codegen/arm/ArchUtility.c
@@ -244,6 +244,9 @@
/* Handle pseudo-ops individually, and all regular insns as a group */
switch(lir->opCode) {
+ case kArmChainingCellBottom:
+ LOGD("-------- end of chaining cells (0x%04x)\n", offset);
+ break;
case kArmPseudoBarrier:
LOGD("-------- BARRIER");
break;