RFR: 8305142: Can't bootstrap ctw.jar

Xin Liu xliu at openjdk.org
Wed Mar 29 15:49:12 UTC 2023


On Wed, 29 Mar 2023 07:17:23 GMT, Xin Liu <xliu at openjdk.org> wrote:

> This patch add a few add-exports so CTW can access those internal packages of java.base module.
> 
> make succeeds and ctw.jar is generated as expected.

Yes, those are all compile-time errors.  I don't think CTW itself uses them in runtime.

CtwRunner.java is yet another driver. I verify that using the following script. 

➜  jdk git:(JDK-8305142) cat ctw.sh
#!/bin/bash

DIST=test/hotspot/jtreg/testlibrary/ctw/dist

java \
        -Dtest.jdk=${JAVA_HOME}  \
        -Dtest.vm.opts="-Xbootclasspath/a:${DIST}/wb.jar" \
        -XX:-UseCounterDecay -Xbatch "-XX:CompileCommand=exclude,java/lang/invoke/MethodHandle.*" -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:${DIST}/wb.jar  \
        -cp $DIST/ctw.jar sun.hotspot.tools.ctw.CtwRunner $@

it works fine. My conclusion is it doesn't need those symbols in runtime. 

sh ./ctw.sh modules:java.base 0 100
CompileCommand: exclude java/lang/invoke/MethodHandle.* bool exclude = true
Compiling 100 classes (of 7396 total classes) starting at 0 and ending at 100
For random generator using seed: 6656142999236136158
To re-run test with same seed value please add "-Djdk.test.lib.random.seed=6656142999236136158" to command line.
Command line: [/local/home/xxinliu/Devel/jdk/build/linux-x86_64-server-release/images/jdk/bin/java -cp test/hotspot/jtreg/testlibrary/ctw/dist/ctw.jar -Xbootclasspath/a:test/hotspot/jtreg/testlibrary/ctw/dist/wb.jar @/local/home/xxinliu/Devel/jdk/modules_java_base_0.cmd ]
modules_java_base_0 1715114783ms START : [/local/home/xxinliu/Devel/jdk/build/linux-x86_64-server-release/images/jdk/bin/java -cp test/hotspot/jtreg/testlibrary/ctw/dist/ctw.jar -Xbootclasspath/a:test/hotspot/jtreg/testlibrary/ctw/dist/wb.jar @/local/home/xxinliu/Devel/jdk/modules_java_base_0.cmd]
cout/cerr are redirected to modules_java_base_0
modules_java_base_0 1715117836ms END : exit code = 0
Executed CTW for all 100 classes in modules:java.base(at /local/home/xxinliu/Devel/jdk/build/linux-x86_64-server-release/images/jdk/lib/modules)

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

PR Comment: https://git.openjdk.org/jdk/pull/13220#issuecomment-1488871358


More information about the hotspot-compiler-dev mailing list