OSDN Git Service

Fix JIT initialization race
authorbuzbee <buzbee@google.com>
Wed, 1 May 2013 17:22:28 +0000 (10:22 -0700)
committerAndy McFadden <fadden@android.com>
Thu, 2 May 2013 22:01:21 +0000 (22:01 +0000)
See b/8767735 Slow thread in thread spin test

A race exists in thread creation/JIT initialization that can
leave the JIT permanantly disabled for a thread (typically
the first interpreter thread).

(cherry-pick from master If6fcac93a229edf068eb02ceceb374e3dc284b78)

Change-Id: I120af6f753984d63d43122ea30db102bd1d5cc63

vm/interp/Interp.cpp

index a37e134..fa77523 100644 (file)
@@ -1669,6 +1669,9 @@ void dvmInitializeInterpBreak(Thread* thread)
     if (gDvm.debuggerActive) {
         dvmEnableSubMode(thread, kSubModeDebuggerActive);
     }
+#if defined(WITH_JIT)
+    dvmJitUpdateThreadStateSingle(thread);
+#endif
 #if 0
     // Debugging stress mode - force checkBefore
     dvmEnableSubMode(thread, kSubModeCheckAlways);