couple questions on method handle combinators

Roland Westrelin rwestrel at
Mon Jun 12 18:46:00 UTC 2017

Hi Paul,

> The GWT forms contain some special profiling logic for the boolean
> branch and AFAICT counting forms for target invocation (of either
> branch) are created to block the JIT inlining until they have been
> called enough times. I believe for this logic to work correctly it
> requires execution in the interpreter, otherwise the LF update may not
> be visible, since final fields are trusted to be stable, once C2 gets
> hold if it it will think it constant. Vladimir will know much more
> than I.

AFAICT, that logic only keeps track of frequencies and so the invoke
target is only constant if one of the branch is never taken.

> This might all be getting in the way of what you want to achieve. It
> may be better for you to generate explicit byte code for that which
> you want to test (similar to that of recent tests David added).

In the code shape that I'm interested in, return values must be passed
as __Value which is only used by lambda forms. Also, if that code shape
is never used in practice then there's nothing to optimize.


More information about the valhalla-dev mailing list