On 11/30/2011 04:16 PM, Jochen Theodorou wrote:
Am 30.11.2011 14:26, schrieb Rémi Forax:
[...]
The VM still profile getMetaClass() so if you insert the call at
callsite instead of relying
on a method that itself call getMetaClass() you should have a narrow
profile that may
enable inlining.

I need it for the guards... which actually reminds me... assuming I have to test each parameter for its type what is the best way to do this?

one method that takes a Class and an Object and returns true if object.getClass() == clazz,
then you create a method handle on that method.
When you whant to test the class of an object, you use insertArgument to bind the class into the method handle and dropArguments to remove the arguments before the one
you want to test.

There is an example here:
http://code.google.com/p/jsr292-cookbook/source/browse/trunk/inlining-cache/src/jsr292/cookbook/icache/RT.java#56


bye Jochen


cheers,
Rémi

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