Longjumps considered inexpensive...until they aren't
forax at univ-mlv.fr
Thu Jun 5 00:11:55 PDT 2008
John Rose a écrit :
> On Jun 4, 2008, at 6:15 PM, Rémi Forax wrote:
>> I've sketched a prototype that enable to force inlining at Java
>> Level using a
>> new method of sun.misc.Unsafe.
>> I think it's a better solution than using an annotation (or an
>> because it's more flexible.
> True. Annotations are *almost* what we want for passing this sort of
> information around, except that they must be known at javac time (or
> apt time).
> As we refactor the way the JVM loads things, we should consider
> allowing partial class files which contribute annotations to
> previously loaded classes. That way we wouldn't have to re-invent
> class schema decorations yet another time.
> For now, we have been using the compiler oracle mechanism as a way of
> tagging methods to the compilers...
>> It seems to works on a small test.
> Yes, that's the right experiment to do... But I think the
> information should be passed through compilerOracle.cpp, which
> already has a "inline" directive. If that is not the right thing,
> perhaps we want a new command ("force_inline") or, better, an option
> (see the "option" command).
The problem of compilerOracle (my first attempt was to use it)
is that it works because there is not much directive in the file.
It allows wildcards (prefix or suffix) so all entries are matched
each time the runtime want to know if it can inline a method.
Futhermore, compilerOracle only offers a hint
at least with c1, INLINE_LEVEL, INLINE_SIZE etc have a
higher priority than compilerOracle inline directive (should_inline).
> -- John
More information about the mlvm-dev