[lworld] RFR(M): Multiple compiler fixes and refactoring

Tobias Hartmann tobias.hartmann at oracle.com
Tue Jun 19 11:05:48 UTC 2018


Hi,

please review the following change that fixes multiple problems:
http://cr.openjdk.java.net/~thartmann/valhalla/lworld/field_access_fix/

1) We hit an assert in StateVector::do_defaultvalue with "should be value type": The assert should
only be executed if the klass is loaded.

2) We get a wrong result when deoptimizing at static getfield: The problem is that we always
increment the stack in GraphKit::make_load for the uncommon trap but the getfield for a static field
does not have a receiver on the stack.

3) We hit different asserts when inlining a method handle call because a value type argument is not
passed as ValueTypeNode. The problem is in callGenerator.cpp 'cast_argument' where we should create
a ValueTypeNode even if arg_type->higher_equal(sig_type).

4) To support load barriers, we should not directly emit LoadNodes in ValueTypeBaseNode::load but
use GraphKit::access_load_at. I've refactored all code to use a GraphKit instance. Also, we need to
support value types with non-flattened value type fields (i.e. we need to emit a null check + deopt
in that case).

Due to the null check when loading a non-flattened value type field, we can now deopt at all the
places where we load a value type from an oop (for example, when loading from a flattened value type
array, we might encounter a non-flattened value type field and need to deopt when we see null). As a
result, we have to make sure that for re-execution of the current bytecode, the arguments are still
on the stack (otherwise we'll hit the "must have enough JVMS stack to execute ..." assert). I've
fixed some of these places but would like to defer fixing the remaining issues (and adding the
corresponding tests) to another change because this one is getting quite large.

All compiler and runtime value type tests pass.

Thanks,
Tobias


More information about the valhalla-dev mailing list