8054492: compiler/intrinsics/classcast/NullCheckDroppingsTest.java is an invalid test

Andrew Haley aph at redhat.com
Mon May 18 13:56:48 UTC 2015


This test has been failing with a failed assertion:

Exception in thread "main" java.lang.AssertionError: void NullCheckDroppingsTest.testVarClassCast(java.lang.String) was not deoptimized
	at NullCheckDroppingsTest.checkDeoptimization(NullCheckDroppingsTest.java:331)
	at NullCheckDroppingsTest.runTest(NullCheckDroppingsTest.java:309)
	at NullCheckDroppingsTest.main(NullCheckDroppingsTest.java:125)

It seems that the reason for the failure is that the nmethod for a
deoptimized method (testVarClassCast) is not removed.  This is
perfectly correct because when testVarClassCast() was trapped, it was
with an action of Deoptimization::Action_maybe_recompile.  When this
occurs, a method is not marked as dead and continues to be invoked, so
the test WhiteBox.isMethodCompiled() will still return true.

Therefore, I think this code in checkDeoptimization is incorrect:

        // Check deoptimization event (intrinsic Class.cast() works).
        if (WHITE_BOX.isMethodCompiled(method) == deopt) {
            throw new AssertionError(method + " was" + (deopt ? " not" : "") + " deoptimized");
        }

We either need some code in WhiteBox to check for a deoptimization
event properly or we should just remove this altogether.

So, thoughts?  Just delete the check?

Andrew.


More information about the hotspot-compiler-dev mailing list