RFR: 8287385: Suppress superficial unstable_if traps

Xin Liu xliu at openjdk.org
Mon Aug 1 18:49:54 UTC 2022


On Fri, 29 Jul 2022 22:40:33 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:

> Note, instead of just `return 5;` in my example there could be following code which use `j` extensively which could be replaced with constant `5`.

I understand your concern. I added a test about [it](https://github.com/openjdk/jdk/pull/9601/files#diff-07cbdb131cb1c92cc765d0f4e1e95a1bb2af1c46c8f11977c3c64fb700e6e592R85). I added a look-ahead function for this case.  `unstable_if_merge` returns false when it sees that parser is going to merge a constant node. That will prevent from clobbering constant propagation.  Like I mentioned before, this is a workaround but not a solution because real constant propagation (PhaseCCP) happens after parser. I can't detect all cases. 

GraphKit::gen_checkcast is about bytecode `checkcast` and `aastore`. The reason of uncommon_trap that it generates is either `Reason_array_check` or `Reason_class_check`. I am still trying to understand the connection between my change and it.

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

PR: https://git.openjdk.org/jdk/pull/9601


More information about the hotspot-compiler-dev mailing list