On Tue, 5 May 2026 21:54:43 GMT, Serguei Spitsyn <[email protected]> wrote:

>> test/hotspot/jtreg/serviceability/jvmti/valhalla/VMObjectAllocValue/VMObjectAllocValueTest.java
>>  line 48:
>> 
>>> 46:         MethodType mt = MethodType.methodType(void.class, String.class);
>>> 47:         MethodHandle mh = 
>>> publicLookup.findConstructor(VMObjectAllocValueTest.class, mt);
>>> 48:         mh.invoke("str");
>> 
>> I assume the constructor is invoked in this way to make sure it isn't 
>> flattened. You should add some comments to explain that.
>
> There is no need in flattening. I've borrowed this part from another 
> `VMObjectAlloc` test. My understanding is it is needed to trigger a JVMTI 
> `VMObjectAlloc` event because NEW bytecode in Java code would not trigger it.

Ok. I think a comment explaining that would be useful

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

PR Review Comment: 
https://git.openjdk.org/valhalla/pull/2386#discussion_r3191852220

Reply via email to