src/JavaRef2.st
branchjk_new_structure
changeset 1711 38b4f702653e
parent 1461 34a9c99d0295
child 1728 0d275432230d
--- a/src/JavaRef2.st	Fri Sep 28 20:08:13 2012 +0000
+++ b/src/JavaRef2.st	Fri Sep 28 21:02:13 2012 +0000
@@ -178,6 +178,20 @@
 
     "Created: / 09-02-2012 / 23:08:15 / mh <hlopik@gmail.com>"
     "Modified: / 10-04-2012 / 09:31:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+markMethodsAsUnchecked
+    "Clear checked flag on all owner's method. This is called
+     after a reference is resolved so next time the method
+     is executed, the JIT compiler will try again to compile them"
+
+    constantPool owner methodsDo:[:mthd|
+        mthd isJavaMethod ifTrue:[
+            mthd checked: false
+        ].
+    ].
+
+    "Created: / 28-09-2012 / 22:57:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !JavaRef2 methodsFor:'queries'!
@@ -239,12 +253,15 @@
      Hides implementation details of the way of dealing with invalidation etc. User should not need to call anything
      else."
     
-    self isResolved ifFalse: [ self findResolvedValue: doClassInit ].
+    self isResolved ifFalse: [ 
+        self findResolvedValue: doClassInit.
+        self markMethodsAsUnchecked.
+    ].
     ^ valueCache.
 
     "Created: / 08-04-2011 / 11:30:21 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
     "Created: / 09-02-2012 / 23:08:15 / mh <hlopik@gmail.com>"
-    "Modified (comment): / 28-02-2012 / 22:12:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 28-09-2012 / 22:55:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 updateClassRefsFrom: oldOwner to: newOwner