Interpreter fix - limit suspend checks
Register maps are generated only for a subset of instructions (to
limit memory consumption). The previous interpreter restructuring
was doing suspend checks at locations that had no register maps.
This CL limits suspend checks to instructions that have register
maps, and also expands that set to include foward as well as
backwards branches.
Change-Id: Ia2b2e1096efe524fdb2a5fd4be171a4216b6a3b4
diff --git a/vm/interp/Interp.c b/vm/interp/Interp.c
index 6622874..7ad3096 100644
--- a/vm/interp/Interp.c
+++ b/vm/interp/Interp.c
@@ -1639,9 +1639,13 @@
/* Suspend pending? */
if (self->interpBreak.ctl.suspendCount) {
- // Neeeded for precise GC
- dvmExportPC(pc, fp);
- dvmCheckSuspendPending(self);
+ // Are we are a safe point?
+ int flags;
+ flags = dexGetFlagsFromOpcode(dexOpcodeFromCodeUnit(*pc));
+ if (flags & VERIFY_GC_INST_MASK) {
+ dvmExportPC(pc, fp);
+ dvmCheckSuspendPending(self);
+ }
}
if (self->interpBreak.ctl.subMode & kSubModeDebuggerActive) {