On Wed, 21 Jan 2026 04:31:41 GMT, Serguei Spitsyn <[email protected]> wrote:

>> Alex Menkov has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   space
>
> src/jdk.jdi/share/classes/com/sun/tools/jdi/ObjectReferenceImpl.java line 170:
> 
>> 168:                     throw exc.toJDIException();
>> 169:                 }
>> 170:             }
> 
> Nit: The lines 164, 177 can be simplified a little bit with move of the 
> renamed `vm.canUseIsSameObject()` check equivalent to the `isValueClass()`.

If Valhalla is not supported on the target VM, there is no way for 
isValueClass() or isValueObject() to ever return true. If Valhalla is 
supported, they can return true, and we have to assume that JDWP and the debug 
agent support Valhalla also. We can't have Valhalla support in the JVM and not 
also have it in JDWP and the debug agent. The debugger/JDI will break if 
isValueObject() returns false for a value object.

> src/jdk.jdi/share/classes/com/sun/tools/jdi/VirtualMachineImpl.java line 841:
> 
>> 839:         return versionInfo().jdwpMajor >= 27;
>> 840:     }
>> 841: 
> 
> Nit: We may want to generalize this with something like 
> 'maySupportValueClasses()'.

I'm not so sure this API is really even needed. I don't believe the current 
calls to it are valid.

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

PR Review Comment: 
https://git.openjdk.org/valhalla/pull/1834#discussion_r2710939565
PR Review Comment: 
https://git.openjdk.org/valhalla/pull/1834#discussion_r2710942102

Reply via email to