RFR(S): 8190935: [MVT] TestMinimalValueTypes fails with ClassCastException

Tobias Hartmann tobias.hartmann at oracle.com
Thu Nov 30 14:56:28 UTC 2017


Hi,

please review the following patch:
https://bugs.openjdk.java.net/browse/JDK-8190935
http://cr.openjdk.java.net/~thartmann/8190935/webrev.00/

The following compile time check in Parse::do_vunbox() is too strong:
624   if (target_vcc_klass == NULL || !source_type->klass()->is_subclass_of(target_vcc_klass)) {

If source_type is java.lang.Object, we will always throw a ClassCastException although the dynamic type could be
target_vcc_klass. I've fixed and refactored both vbox and vunbox.

I've increased the warmup iterations of two tests to trigger this problem deterministically. I've also improved the
ClassCastException regex to catch the case when C2 optimizes an exception throwing path with a fast throw (see logic in
GraphKit::builtin_throw()), i.e. when no uncommon trap is emitted.

I've also added a missing case to sharedRuntime_x86_64.cpp which is triggered by nmethod::print_nmethod_labels() ->
SharedRuntime::java_calling_convention() when using hsdis because T_VALUETYPE may be used in the signature.

All tests pass.

Thanks,
Tobias



More information about the valhalla-dev mailing list