On Wed, 5 Aug 2026 12:02:11 GMT, Yasumasa Suenaga <[email protected]> wrote:

> We can see following errors when we run `make test` with 
> `JTREG="VALUE_CLASS_PLUGIN=true;VM_OPTIONS=--enable-preview"`:
> 
> TestInstanceKlassSize
> 
>  stderr: [Exception in thread "main" java.lang.UnsupportedClassVersionError:
>  Preview features are not enabled for jdk/test/whitebox/WhiteBox (class file
>  version 72.65535). Try running with '--enable-preview'
>         at java.base/java.lang.ClassLoader.findBootstrapClass(Native Method)
>         at java.base/java.lang.ClassLoader.findBootstrapClassOrNull(ClassLoa
> der.java:1244)
>         at java.base/java.lang.System$1.findBootstrapClassOrNull(System.java
> :2068)
>         at java.base/jdk.internal.loader.ClassLoaders$BootClassLoader.loadCl
> assOrNull(ClassLoaders.java:138)
>         at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(
> BuiltinClassLoader.java:639)
>         at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(
> BuiltinClassLoader.java:615)
>         at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(
> BuiltinClassLoader.java:639)
>         at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(
> BuiltinClassLoader.java:615)
>         at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Builti
> nClassLoader.java:578)
>         at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:502)
>         at TestInstanceKlassSize.<clinit>(TestInstanceKlassSize.java:65)
> ]
>  exitValue = 1
> 
> java.lang.RuntimeException: Expected to get exit value of [0], exit value is
> : [1]
>         at jdk.test.lib.process.OutputAnalyzer.shouldHaveExitValue(OutputAna
> lyzer.java:602)
>         at TestInstanceKlassSize.startMeWithArgs(TestInstanceKlassSize.java:
> 100)
>         at TestInstanceKlassSize.main(TestInstanceKlassSize.java:152)
>         at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(
> DirectMethodHandleAccessor.java:104)
>         at java.base/java.lang.reflect.Method.invoke(Method.java:583)
>         at com.sun.javatest.regtest.agent.MainMethodHelper.executeModernMain
> Class(MainMethodHelper.java:55)
>         at com.sun.javatest.regtest.agent.MainWrapper$MainTask.run(MainWrapp
> er.java:138)
>         at java.base/java.lang.Thread.run(Thread.java:1527)
> 
> 
> TestInstanceKlassSizeForInterface
> 
>  stderr: [Exception in thread "main" java.lang.UnsupportedClassVersionError: 
> Preview features are not enabled for jdk/test/whitebox/WhiteBox (class file 
> version 72.65535). Try running with '--enable-preview'
>         at java.base/java.lang.ClassLoader.findBootstrapClass(Native Method)
> ...

I think it is fine to pass --enable-preview to 
createLimitedTestJavaProcessBuilder() in this case. it is a special situation. 
It's not like you are passing GC choice or -Xcomp.

None of the SA tests use  @jdk.test.lib.valueclass.AsValueClass, so I don't 
really see a point in running them with VALUE_CLASS_PLUGIN.

SA has limitations w.r.t. value objects and some functionality is not 
supported. For example:


hsdb> inspect 0x00000000ffd137c0
instance of Oop for IndentityClass @ 0x00000000ffd137c0 (size = 32)
_mark: 1 _metadata._compressed_klass: InstanceKlass for IndentityClass
p1: ** BAD OOP 10201 **
p2: ** BAD OOP 10503 **


p1 is Point(1,2) and p2 is Point(3,5), and Point has byte fields. SA does not 
know how to interpret flattened/inlined value objects and treats them as oops, 
so it just looks like a bad oop to SA. There are similar issues with flattened 
arrays and there are issues with how value objects are represented in heap 
dumps. See the following CRs:

[JDK-8247507](https://bugs.openjdk.org/browse/JDK-8247507) SA: 
MetadataField.java needs to support inlined fields
[JDK-8381336](https://bugs.openjdk.org/browse/JDK-8381336) SA FlatArray support 
is incomplete
[JDK-8381370](https://bugs.openjdk.org/browse/JDK-8381370) SA is not writing 
out flattened fields to the hprof file

The following is the Valhalla CSR that covers serviceability support:

[JDK-8383266](https://bugs.openjdk.org/browse/JDK-8383266) Serviceability 
implementation of value objects

For SA it says:

> SA will not support preview mode. Note that SA will still launch in preview 
> mode and likely for the most part work, but there are no plans to address 
> issues that only reproduce while in preview mode.

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

PR Comment: https://git.openjdk.org/jdk/pull/32210#issuecomment-5207133574

Reply via email to