JavaConstantPool.st
branchdevelopment
changeset 2976 a384a02381c0
parent 2817 96f3e2254489
child 2992 732f9db2a195
--- a/JavaConstantPool.st	Sat Jan 18 21:47:35 2014 +0000
+++ b/JavaConstantPool.st	Mon Jan 20 14:04:28 2014 +0000
@@ -129,6 +129,46 @@
     "Created: / 13-05-2011 / 09:05:34 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
 ! !
 
+!JavaConstantPool methodsFor:'invalidation'!
+
+invalidate 
+    "Invalidate all resolved references. Returns true if at least one ref has 
+     been invalidated, false otherwise"
+    
+    | anyInvalidated |
+
+    anyInvalidated := false.
+    self do: [:ref | 
+        (ref notNil and: [ ref isString not and: [ ref isNumber not ] ]) ifTrue: [
+            anyInvalidated := anyInvalidated | (ref invalidate)
+        ].
+    ].
+    anyInvalidated ifTrue:[ JavaVM flushCachesFor: owner  ].  
+    ^ anyInvalidated
+
+    "Created: / 20-01-2014 / 09:43:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+invalidateForClass: binaryName 
+    "Invalidate all resolved references to given class.
+     Returns true if at least one ref has been invalidated,
+     false otherwise"
+    
+    | anyInvalidated |
+
+    anyInvalidated := false.
+    self do: [:ref | 
+        (ref notNil and: [ ref isString not and: [ ref isNumber not ] ]) ifTrue: [
+            anyInvalidated := anyInvalidated 
+                    | (ref invalidateForClass: binaryName)
+        ].
+    ].
+    anyInvalidated ifTrue:[ JavaVM flushCachesFor: owner  ].
+    ^ anyInvalidated
+
+    "Created: / 08-04-2011 / 16:11:36 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
+    "Modified: / 20-01-2014 / 10:15:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
 
 !JavaConstantPool methodsFor:'printing & storing'!