RFR: 8264395: WB_EnqueueInitializerForCompilation fails with "method holder must be initialized" when called for uninitialized class

Tobias Hartmann thartmann at openjdk.java.net
Wed Apr 28 13:23:53 UTC 2021


On Wed, 28 Apr 2021 09:39:08 GMT, Rahul Raghavan <rraghavan at openjdk.org> wrote:

> https://bugs.openjdk.java.net/browse/JDK-8264395
> 
> Reported assert failure, during compilation triggered by Whitebox API `enqueueInitializerForCompilation` method,
> is fixed by adding support to to bail out if a class not initialized yet.
> 
> Confirmed the new `compiler/whitebox/TestEnqueueInitializerForCompilation.java` test passes with the proposed `whitebox.cpp` changes and fails with reported assert without this fix.
> No issues with tier tests.

Changes requested by thartmann (Reviewer).

test/hotspot/jtreg/compiler/whitebox/TestEnqueueInitializerForCompilation.java line 27:

> 25:  * @test
> 26:  * @bug 8264395
> 27:  * @summary testing of WB::enqueueInitializerForCompilation()

Maybe change the summary to something explaining that we are testing compilation of the class initializer of a class that is not initialized yet.

test/hotspot/jtreg/compiler/whitebox/TestEnqueueInitializerForCompilation.java line 28:

> 26:  * @bug 8264395
> 27:  * @summary testing of WB::enqueueInitializerForCompilation()
> 28:  * @library /test/lib /

`/test/lib` is not required, right?

test/hotspot/jtreg/compiler/whitebox/TestEnqueueInitializerForCompilation.java line 31:

> 29:  * @build sun.hotspot.WhiteBox
> 30:  * @run driver jdk.test.lib.helpers.ClassFileInstaller sun.hotspot.WhiteBox
> 31:  * @run main/othervm/timeout=300 -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions

Why do you need a non-default timeout?

test/hotspot/jtreg/compiler/whitebox/TestEnqueueInitializerForCompilation.java line 42:

> 40: 
> 41:     public static void main(String[] args) {
> 42:         WhiteBox.getWhiteBox().enqueueInitializerForCompilation(LongWrapper.class, 4);

What if compilation level 4 (= C2) is not available?

test/hotspot/jtreg/compiler/whitebox/TestEnqueueInitializerForCompilation.java line 53:

> 51:         }
> 52: 
> 53:         static LongWrapper wrap(long val) {

`wrap` is unused. Are fields required?

-------------

PR: https://git.openjdk.java.net/jdk/pull/3757


More information about the hotspot-compiler-dev mailing list