On Wed, 4 Feb 2026 13:39:34 GMT, Quan Anh Mai <[email protected]> wrote:

>> src/hotspot/share/opto/parse1.cpp line 667:
>> 
>>> 665:       improved_type = improved_type->join_speculative(t)->is_ptr();
>>> 666:       if (improved_type != t) {
>>> 667:         Node* cast = _gvn.transform(new CheckCastPPNode(control(), 
>>> parm, improved_type, 
>>> ConstraintCastNode::DependencyType::NonFloatingNarrowing));
>> 
>> Can't we use default `FloatingNarrowing` here?
>
> Thanks for your speedy review. Theoretically, it makes more sense since this 
> speculation comes with the method invocation, and a method invocation does 
> not float. Practically, it does not make any difference because this 
> speculation should only be practiced when we are the top-most method. In that 
> case, there is no where else to hoist to so it makes no difference whether 
> the cast is floating. I have added a comment explaining why this speculation 
> only makes sense when we are the top-most method.

That makes sense, thanks for the details.

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

PR Review Comment: 
https://git.openjdk.org/valhalla/pull/2030#discussion_r2764095594

Reply via email to