Flattened value type field support for C2
zoltan.majo at oracle.com
Tue Nov 15 16:36:38 UTC 2016
On 11/11/2016 12:00 PM, Tobias Hartmann wrote:
> here's my implementation of (flattened) value type field support for C2:
> The patch contains the following changes:
> - Support for flattened value type fields in regular objects and value types
> - field list in ciInstanceKlass now contains flattened value type fields (recursively)
> - fixed instanceOopDesc::contains_field_offset() to account for different alignment of value type fields
> - fixed alias analysis to support value type fields
> - fixed deoptimization to correctly reassign flattened value type fields
> - Improved ValueKlass::first_field_offset() to not iterate over all fields but compute the offset
> - Improved ValueTypeNode::make_scalar_in_safepoints() and added support for value type fields
> - Added new tests, increased coverage of existing tests and fixed test bench to support product builds
> - Lots of refactoring, added more comments and more asserts
> I also tried to make it more clear/explicit in the code that ciValueKlass translates between the following field indexes:
> 1) Value type factory parameter index: The index of the value type factory parameter that corresponds to a field index 2) in the valueKlass. The value of that field can be obtained by the value input edge of the ValueTypeNode in C2 IR with the same index.
> 2) Field index in the valueKlass.
your change looks good to me -- thank you for the clarifications off-line!
I've spotted a small issue with ValueTypeTestBench.java at line 547:
You might have left that in by accident.
> I'll write up a more detailed documentation in the next days.
> Please have a look at the code and let me know if you spot any problems.
More information about the valhalla-dev