[lworld] Initial C2 support for LWorld value types

Tobias Hartmann tobias.hartmann at oracle.com
Wed Apr 4 13:04:38 UTC 2018


I implemented basic C2 support for LWorld value types. All compiler and runtime tests (with -Xcomp)
now pass, except for ValueTypeArray.java because LWorld arrays are not yet supported and
TestIntrinsics.java because some C2 intrinsics still need to be fixed. For now, C2 code deoptimizes
if a value type argument or field is NULL (also, if we try to cast NULL to a value type).


Gory details:
- Added uncommon traps at method entry, field loading and checkcast if value type is null (for now,
explicit null checks are used but this can be easily changed to use implicit ones)
- Modified C2's type system to make value types a subtype of java.lang.Object (similar to how we
handle arrays) and handle "mixtures"
- Fixed merging of value types and (Object) oops by allocating value type in the source block
- Fixed missing support for adding a new merge path during parsing
- Added support for non-flattenable value type fields (loads should not return the default value)
- Added TestLWorld.java which tests LWorld value types with C2 (more work needed to inc. coverage)
- Fixed lots of whitespace/tabs/indentation errors in the runtime tests and re-enabled -Xcomp

Although this work is far from being done, I think it's stable enough to be pushed so Roland can
continue while I'm on vacation until April 24.


More information about the valhalla-dev mailing list