On Sun, 24 May 2026 16:50:24 GMT, Quan Anh Mai <[email protected]> wrote:

> it makes the compiler not try expanding a value object subfield, unless the 
> field is loaded

Do you mean "unless the field is **flattened**"?

> It also means that, we have no choice but stopping flattening at this level, 
> because going even 1 level deeper may lead to issues in extreme cases, as a 
> value object can have hundreds of leaf fields

But since we know the layout(s) statically, couldn't we just set a 
limit/threshold on the number of fields that get scalarized or on the depth?

src/hotspot/share/opto/castnode.cpp line 225:

> 223: }
> 224: 
> 225: Node* ConstraintCastNode::ideal_inline_type_node(PhaseGVN* phase) {

The name of this method is a bit misleading.

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

PR Review: 
https://git.openjdk.org/valhalla/pull/2474#pullrequestreview-4361295545
PR Review Comment: 
https://git.openjdk.org/valhalla/pull/2474#discussion_r3301796967

Reply via email to