RFR: 8352020: [CompileFramework] enable compilation for VectorAPI [v2]

Christian Hagedorn chagedorn at openjdk.org
Tue Mar 18 07:49:09 UTC 2025


On Tue, 18 Mar 2025 07:22:43 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

>> Maybe... but is this kind of magic really worth it? It would also mean that any `CompileFraework` test always compiles the `TestFramework`. And if we decide to do this, I think it would be a separate RFE, since I'm just copying from `test/hotspot/jtreg/testlibrary_tests/compile_framework/examples/IRFrameworkJavaExample.java` here ;)
>
> FYI: the issue will probably get worse over time, as there may be more and more test-library parts that are not used in the JTREG test directly, but only in the CompileFramework compiled code. I currently have a test under development where I have to write this:
> 
> /*
>  * @test
>  * @summary Test the Template Library's expression generation for the Vector API.
>  * @modules jdk.incubator.vector
>  * @modules java.base/jdk.internal.misc
>  * @library /test/lib /
>  * @compile ../../../compiler/lib/ir_framework/TestFramework.java
>  * @compile ../../../compiler/lib/generators/Generators.java
>  * @compile ../../../compiler/lib/verify/Verify.java
>  * @run driver template_library.examples.TestFuzzVectorAPI
>  */
> 
> But I'm not sure which test libraries we should always load... maybe we can address this down the road, when it really becomes cumbersome for people, and we know more what we want?

> It would also mean that any CompileFraework test always compiles the TestFramework

I don't think so, wouldn't it only load it when you call `invokeIrTest()`? So, when you only call something from the `TestFramework` class there, I think it will only be loaded and initialized when you actually call `invokeIrTest()`:


Object invokeIrTest(String className, String methodName, Object[] args) {
    TestFramework.loadClass();
    return invoke(className, methodName, args);
}



> And if we decide to do this, I think it would be a separate RFE,

Sure, that's fine. I only just noticed this when reading the comment :-)

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24082#discussion_r2000394342


More information about the hotspot-compiler-dev mailing list