Fix an invoke-interface bug that manifests itself with thread state warnings.
r12 is a scratch register and apparently gcc 4.4 starts to actively use it in
dvmFindInterfaceMethodInCache, the very function that the original live value
is being protected around. This results in useless values setup in the chaining
cell and increases the chances to patch the cell (thus the suspend-all
requests).
Add verbose names for new JIT-related suspend reasons.
With all these changes, the thread state warning will still occur but much less
frequently.
bug 2194174.
diff --git a/vm/Thread.c b/vm/Thread.c
index 7ca3dc7..55e27f6 100644
--- a/vm/Thread.c
+++ b/vm/Thread.c
@@ -521,6 +521,10 @@
case SUSPEND_FOR_DEBUG: return "debug";
case SUSPEND_FOR_DEBUG_EVENT: return "debug-event";
case SUSPEND_FOR_STACK_DUMP: return "stack-dump";
+#if defined(WITH_JIT)
+ case SUSPEND_FOR_TBL_RESIZE: return "table-resize";
+ case SUSPEND_FOR_IC_PATCH: return "inline-cache-patch";
+#endif
default: return "UNKNOWN";
}
}
@@ -559,6 +563,9 @@
*
* Could be the debugger telling us to resume at roughly
* the same time we're posting an event.
+ *
+ * Could be two app threads both want to patch predicted
+ * chaining cells around the same time.
*/
LOGI("threadid=%d ODD: want thread-suspend lock (%s:%s),"
" it's held, no suspend pending\n",