RFR: 8337221: CompileFramework: test library to conveniently compile java and jasm sources for fuzzing [v5]

Emanuel Peter epeter at openjdk.org
Mon Sep 16 13:00:22 UTC 2024


On Mon, 16 Sep 2024 08:27:24 GMT, Christian Hagedorn <chagedorn at openjdk.org> wrote:

>> Emanuel Peter has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   make SourceCode package private
>
> test/hotspot/jtreg/compiler/lib/compile_framework/CompileFramework.java line 110:
> 
>> 108:     }
>> 109: 
>> 110:     private void compileJasmSources(List<SourceCode> jasmSources) {
> 
> The `compileJasmSources()/compileJasmFiles()` and `compileJavaSources()/compileJavaFiles()` method seem to be very specific to whether it's a Java or Jasm file. I'm wondering if we could do the following:
> 
> - Make class `SourceCode` an interface and create two implementing classes `JavaSourceCode` and `JasmSourceCode`.
> - Move the `compileJasm/JavaSources()/compileJasm/JavaFiles()` to the corresponding classes (the interface method could be `compile()`).
> - This allows us to get ride of the `enum` as well in `SourceCode`. The interface could look like this:
> 
> interface SourceCode {
>     void compile();
>     String code();
>     String fileExtension();
>     String className();
>     String filePathName(); // Could probably just provide the current implementation as default
> }
> 
> I have not thought it through completely and I might be missing some things - but might be worth a shot :-)

The offline discussion was quite fruitful, I'll do it another way now.

> test/hotspot/jtreg/compiler/lib/compile_framework/CompileFramework.java line 123:
> 
>> 121: 
>> 122:     private void compileJasmFiles(List<Path> paths) {
>> 123:         // Compile JASM files with asmtools.jar, shipped with jtreg.
> 
> Can be moved to be a method comment instead.

ok

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20184#discussion_r1761094476
PR Review Comment: https://git.openjdk.org/jdk/pull/20184#discussion_r1761093782


More information about the hotspot-compiler-dev mailing list