[lworld] RFR: 8288135: [lworld] Implement HotSpot flag -XX:+EnablePrimitiveClasses [v11]
Mandy Chung
mchung at openjdk.org
Wed Oct 5 18:55:39 UTC 2022
On Wed, 5 Oct 2022 06:22:29 GMT, David Simms <dsimms at openjdk.org> wrote:
>> test/jdk/java/lang/invoke/VarHandles/X-VarHandleTestMethodHandleAccess.java.template line 29:
>>
>>> 27: * @test
>>> 28: * @compile -XDenablePrimitiveClasses Point.java Value.java VarHandleTestMethodHandleAccess$Type$.java
>>> 29: * @run testng/othervm -XX:+EnableValhalla -XX:+EnablePrimitiveClasses -Diters=2000 VarHandleTestMethodHandleAccess$Type$
>>
>> X-VarHandleTestXXX.java.template changes look wrong and maybe merge issue. These files were updated recently.
>>
>> For VarHandles tests, you only need to modify X-VarHandleTestXXX.java.template files to add `-XX:+EnablePrimitiveClasses` flag and then run `test/jdk/java/lang/invoke/VarHandles/generate-vh-tests.sh` that will regenerate the `test/jdk/java/lang/invoke/VarHandles/VarHandle*` tests.
>
> So the problem here is SPP. AFAIK, SPP doesn't support boolean expressions, and `X-VarHandleTestMethodHandleAccess.java.template` refers to both `Value` and `Point `.
>
> I'm sure there are reasons why the build systems' C preprocessor isn't being used, at build time, and we remove generated source from the repository, but that feels out of scope for this change.
I think there may be confusion due to the name `Value`. Both `Point` and `Value` class are value classes. `-KValue` implies using primitive class. That was done in LW1 or LW2 before the value objects JEP.
It's on my TODO to update these tests for value objects.
It is okay to remove `if[Point]` case that was added to reduce `iters` from 20000 to 2000. If you want to remove `if[Point]`, use `-Diters=20000` instead.
Suggestion:
* @run testng/othervm -XX:+EnableValhalla -XX:+EnablePrimitiveClasses -Diters=20000 VarHandleTestMethodHandleAccess$Type$
-------------
PR: https://git.openjdk.org/valhalla/pull/727
More information about the valhalla-dev
mailing list