RFR: 8261137: Optimization of Box nodes in uncommon_trap [v4]
Vladimir Kozlov
kvn at openjdk.java.net
Fri Feb 12 05:36:39 UTC 2021
On Fri, 12 Feb 2021 04:48:06 GMT, Igor Veresov <iveresov at openjdk.org> wrote:
> Also, I don't know if EA can handle a case when an Integer that is coming from an allocation and from a valueOf() are both inputs to a phi.
>
> ```
> Integer i = p ? new Integer(i1) : Integer.valueOf(i2);
> deopt();
> int use = i.intValue();
> ```
>
> If it does, then we'd need to force materialization.
Currently C2 EA can't scalarize merged allocations. So this is not an issue for now but may be in a future. Also C2 does not replace valueOf() with scalar node - it inlines it. As result you have branches with allocation and load from cache.
Only this patch propose to use scalar node for valueOf() for the first time in C2. But it is replaced only in case it is directly referenced by debug info (no Phi or other nodes in between). So I think it is safe if we use AutoBoxObjectValue for it.
-------------
PR: https://git.openjdk.java.net/jdk/pull/2401
More information about the hotspot-compiler-dev
mailing list