Martin C. Martin wrote:


On 4/25/2010 1:18 PM, Rémi Forax wrote:

I don't think it's possible to do invalidation without the proper
support by the VM.

As I understand it, even with callsite caching the callsite has to check that the class of the receiver & arguments are the same as last time, before it can use the method from last time. So at each callsite, we need an object that records these things. When the receiver's metaclass changes, couldn't it go through all such objects and set the receiver to null or a sentinel value? They might have to be AtomicReferences in that case.

then you need mutable call site objects. I don't think that will get you somewhere in the backport.

Alternately, the object could contain a boolean "valid" field, and when the metaclass is changed, its sets it to false in all relevant objects.

yes, I was thinking the same, but for the reason above it does not work. Not if you want to avoid memory barriers for each invocation

bye blackdrag


--
Jochen "blackdrag" Theodorou
The Groovy Project Tech Lead (http://groovy.codehaus.org)
http://blackdragsview.blogspot.com/

--
You received this message because you are subscribed to the Google Groups "JVM 
Languages" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/jvm-languages?hl=en.

Reply via email to