RFR: 8254129: IR Test Framework to support regex-based matching on the IR in JTreg compiler tests [v7]
Christian Hagedorn
chagedorn at openjdk.java.net
Mon May 3 17:42:53 UTC 2021
On Fri, 30 Apr 2021 19:02:37 GMT, Igor Ignatyev <iignatyev at openjdk.org> wrote:
>> Christian Hagedorn has updated the pull request incrementally with two additional commits since the last revision:
>>
>> - Fix XCOMP cases from old framework and turn it into new debug flag -DIgnoreCompilerControls
>> - Apply review comments: Added new Compiler annotation class for @DontCompile, changed C1 into C1_SIMPLE, refactored code for ExcludeRandom and FlipC1C2, added missing flag description in README, and some other smaller refactoring/renamings
>
> test/lib/jdk/test/lib/hotspot/ir_framework/TestFramework.java line 984:
>
>> 982: private final String hotspotPidFileName;
>> 983:
>> 984: JVMOutput(OutputAnalyzer oa, Scenario scenario, ProcessBuilder process) {
>
> instead of passing a ProcessBuilder, you can either pass a command-line or better just past prepared flags, and make it JVMOutput's (you will need a better name) responsibility for executing the process, creating OutputAnalyzer, etc.
>
> Suggestion:
>
> JVMOutput(List<String> cmds, Scenario scenario) {
> var pb = ProcessTools.createJavaProcessBuilder(cmds);
> try {
> // Calls 'main' of TestFrameworkExecution to run all specified tests with commands 'cmds'.
> // Use executeProcess instead of executeTestJvm as we have already added the JTreg VM and
> // Java options in prepareTestVMFlags().
> this.oa = ProcessTools.executeProcess(process);
> } catch (Exception e) {
> throw new TestFrameworkException("Error while executing Test VM", e);
> }
> this.cmd = pb.command();
> ...
>
>
> and then runTest will be smth like
>
> private void runTestVM(List<String> additionalFlags) {
> List<String> cmds = prepareTestVMFlags(additionalFlags);
> socket.start();
> JVMOutput output = new JVMOutput(cmds, scenario);
> ...
I did a refactoring and introduced new classes `FlagVMProcess` and `TestVMProcess`. I also did a renaming of `TestFrameworkPrepareFlags` -> `FlagVM` and `TestFrameworkExecution` -> `TestVM` to make it more clear whats going on.
-------------
PR: https://git.openjdk.java.net/jdk/pull/3508
More information about the hotspot-compiler-dev
mailing list