C2 support for reference fields in value types

Tobias Hartmann tobias.hartmann at oracle.com
Thu May 11 11:34:06 UTC 2017


Hi,

here's the newest version that solves all previous problems:
http://cr.openjdk.java.net/~thartmann/valhalla/vt_prototype/webrev.16/

If a value type argument is passed as fields, I'm now setting call.set_override_symbolic_info(true) which attaches the Method* to the call site. In CompiledMethod::preserve_callee_argument_oops(), I can then use the Method* to get the extended signature through the adapter. Like this, all oop fields/arguments are detected by the GC thread.

I was able to add a stress option (-XX:+FullGCALotWithValueTypes) that triggers the (now fixed) crash in the GC code deterministically.

The repo is based on JDK 10.

Best regards,
Tobias

On 05.05.2017 11:32, Tobias Hartmann wrote:
> Hi,
> 
> I updated the webrev to include tests for array fields in value types and fixed some minor issues:
> http://cr.openjdk.java.net/~thartmann/valhalla/vt_prototype/webrev.15/
> 
> Thanks,
> Tobias
> 
> On 04.05.2017 13:56, Tobias Hartmann wrote:
>> Hi Roland,
>>
>> I refactored the changes in nmethod.cpp and fixed some other issues. JPRT now passes:
>> http://cr.openjdk.java.net/~thartmann/valhalla/vt_prototype/webrev.15/
>>
>> I still need to disable the assert in ConstantPool::klass_at_impl(). In the long term, we need to find a better solution to get to the extended signature without (re-)resolving the call site in nmethod::preserve_callee_argument_oops(). I would like to push this version and then work on fixing the remaining issues.
>>
>> On 27.04.2017 17:57, Roland Westrelin wrote:
>>> Instead of indirecting through the adapter to get the extended
>>> signature, could you instead:
>>>
>>> - in gen_c2i_adapter() rather than build an OopMap with all registers,
>>> construct one that only contains live oops
>>>
>>> - then make the gc code use that oop map, maybe by not going through
>>> nmethod::preserve_callee_argument_oops() at all?
>>
>> I think that's not sufficient as we may not have an adapter frame on the stack but block while resolving the call in SharedRuntime::resolve_virtual_call_C().
>>
>> Thanks,
>> Tobias
>>


More information about the valhalla-dev mailing list