Flattened value type field support for C2

Tobias Hartmann tobias.hartmann at oracle.com
Fri Nov 11 11:00:40 UTC 2016


Hi,

here's my implementation of (flattened) value type field support for C2:
http://cr.openjdk.java.net/~thartmann/valhalla/vt_prototype/webrev.03/

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.

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.

Thanks,
Tobias


More information about the valhalla-dev mailing list