OSDN Git Service

Fix JIT initialization race
authorbuzbee <buzbee@google.com>
Wed, 1 May 2013 17:22:28 +0000 (10:22 -0700)
committerElliott Hughes <enh@google.com>
Wed, 1 May 2013 19:01:19 +0000 (12:01 -0700)
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 of 67985d960f5c877f86d0bba251d2d55c7a062b8d.)

Change-Id: Ic7e3a1cde2833ac78455fa5d465156b5e0896fc1

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);