collection of small fixes from running runtime tests with -Xcomp

Frederic Parain frederic.parain at
Wed Mar 15 16:59:14 UTC 2017

> On Mar 14, 2017, at 12:16, Roland Westrelin <rwestrel at> wrote:
> Because of method handles, in SharedRuntime::allocate_value_types()
> using the static target is not good enough because its signature of the
> static target might differ from the signature of the actual callee. So
> instead, the runtime call is now passed the actual target which is good
> because we also probably need to do something to keep it alive.
> The bcEscapeAnalyzer.cpp fix is obvious.
> We can't use the value factory parameter mapping until the value class
> is initialized: added an assert and an uncommon trap so the assert
> doesn't fire.


Is C2 code relying on the ValueFactory_attribute used by vnew?
Vnew and this attribute are supposed to be removed in favor of the
vdefault/vwithfield solution to create values. If this is likely to cause
issues to C2, it’s time to speak up.



> Sometimes a lambda form compiled as the root of a compilation has a
> signature with object parameters but is passed a value type: so it's
> passed fields but has no way to know. This could be fixed by always
> passing value types as references when the target is a lambda form. But
> then, method handles intrinsics could get reference inputs and call a
> method that expects value types to be passed as fields. So the code in
> MethodHandles::generate_method_handle_dispatch() would need to be
> adjusted to shuffle arguments. That all sounds too complicated so
> instead I disallowed lambda form as root of compilations.
> Roland.

More information about the valhalla-dev mailing list