couple questions on method handle combinators

Paul Sandoz paul.sandoz at
Mon Jun 12 19:27:22 UTC 2017

> On 12 Jun 2017, at 11:46, Roland Westrelin <rwestrel at> wrote:
> 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.

I don’t fully understand it and would need to write some tests and look out compiler output.

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

Ah, i missed that aspect.

I suppose there is nothing stopping you generating byte code referring to __Value in method sigs.

To investigate further i think we need to write a separate smaller GWT test for both values and refs. I can write such a test if that helps? and may want be useful for MH analysis.


> Also, if that code shape
> is never used in practice then there's nothing to optimize.
> Roland.

More information about the valhalla-dev mailing list