On Jan 21, 2015, at 9:31 AM, Remi Forax <fo...@univ-mlv.fr> wrote:
> 
> in Invokers.java, I think that checkCustomized should take an Object and not 
> a MethodHandle
> exactly like getCallSiteTarget takes an Object and not a CallSite.

The use of erased types (any ref => Object) in the MH runtime is an artifact of 
bootstrapping difficulties, early in the project.  I hope it is not necessary 
any more.  That said, I agree that the pattern should be consistent.

Vladimir, would you please file a tracking bug for this cleanup, to change MH 
library functions to use stronger types instead of Object?

> in MethodHandle.java, customizationCount is declared as a byte and there is 
> no check that
> the CUSTOMIZE_THRESHOLD is not greater than 127.

Yes.  Also, the maybeCustomize method has a race condition that could cause the 
counter to wrap.  It shouldn't use "+=1" to increment; it should load the old 
counter value, test it, increment it (in a local), and then store the updated 
value.  That is also one possible place to deal with jumbo CUSTOMIZE_THRESHOLD 
values.

— John
_______________________________________________
mlvm-dev mailing list
mlvm-dev@openjdk.java.net
http://mail.openjdk.java.net/mailman/listinfo/mlvm-dev

Reply via email to