On Tue, 31 Mar 2026 07:12:30 GMT, Tobias Hartmann <[email protected]> wrote:

> If Valhalla is enabled, we need to load the prototype header on allocations: 
> https://github.com/openjdk/valhalla/blob/2c6b468f488147e6851a719e7cd821773c29a8ea/src/hotspot/share/opto/callnode.cpp#L2030-L2032
> 
> This load should be folded, if possible. I enabled the corresponding 
> optimization in `LoadNode::Value` and also had to adjust the code in 
> `AndLNode::Ideal` to account for the load now being folded. Since this code 
> is becoming increasingly complex, I filed 
> [JDK-8381388](https://bugs.openjdk.org/browse/JDK-8381388) to simplify it by 
> implementing the mark word test as a macro node.
> 
> I also removed the unused`ciKlass::prototype_header_offset`.
> 
> Thanks,
> Tobias

Looks good, thanks!

src/hotspot/share/opto/mulnode.cpp line 852:

> 850:   }
> 851: 
> 852:   // Search for GraphKit::mark_word_test patterns and fold the test if 
> the result is statically known

Some comments or graph sketch on the expected patterns would help but to 
understand the code better but since we are planning to refactor this anyways, 
feel free to do that later.

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

Marked as reviewed by chagedorn (Committer).

PR Review: 
https://git.openjdk.org/valhalla/pull/2281#pullrequestreview-4035856644
PR Review Comment: 
https://git.openjdk.org/valhalla/pull/2281#discussion_r3014546641

Reply via email to