On 04/04/2011 12:04 AM, Jochen Theodorou wrote:
Am 03.04.2011 17:38, schrieb Kresten Krab Thorup:
So. If method handles or something else disables this optimization, or
makes it more expensive then perhaps we should consider adding a hint/
annotation to the vm saying "it may make sense to inline this". but I
would think that that is exactly the kind of assessment that the vm
can do better than static knowledge allows.

I am wondering... in what case does it *not* make sense to inline? I mean I can imagine reasons like certain limitations, but in the end... Does anyone know?

The problem is more that to optimize such case you need backpointers from
a method to all its callsites. This datastructure has a cost in memory and
in cycle to manage it and is only necessary if you have high order method
(a method that takes a lambda).
So the detection of such method is important.

I don't think the VM need a flag.
A method that takes a MethodHandle as parameter
and this method handle value doesn't escape and is invoked (invoke*)
should be optimized.

Now, Hotspot has tiered compilation, so if the high order method is hot
(or an OSR of this method). It can be compiled and also
trigger the fact that its callsites must be recorded.


bye Jochen


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