RFR: 8374435: "assert(addp->is_AddP()) failed: must be AddP" failed intermittently when running tools/jpackage/share/AsyncTest.java with ZGC

Christian Hagedorn chagedorn at openjdk.org
Tue Jan 13 08:04:26 UTC 2026


On Mon, 12 Jan 2026 19:32:53 GMT, Quan Anh Mai <qamai at openjdk.org> wrote:

> Hi,
> 
> This PR fixes the assert in `ConnectionGraph::get_addp_base` during escape analysis. The issue here is that, after splitting a `Load` through a `Phi`, we try to adjust the `ConnectionGraph` as the split creates new nodes. As we visit each input of `data_phi`, we fail to take into consideration the possibility that the input can be folded to a `Load` but not from an `AddP`. This is the case for `Object::getClass`, as we load the `OopHandle` from the `Klass` object, then load the class mirror from that `OopHandle`.
> 
> Since we are loading from raw memory, the base is not a scalar replaceable Java object. Similar to the case below, we are done processing this input.
> 
> Please take a look and leave your reviews, thanks a lot.

Two small comments, otherwise, the fix looks good to me, thanks!

src/hotspot/share/opto/escape.cpp line 1090:

> 1088:       //
> 1089:       // In this case, o1 is folded to o.getClass() which is a Load but not from an AddP, but from
> 1090:       // an OopHandle that is loaded from the Klass of o.

Nice summary!

test/hotspot/jtreg/compiler/escapeAnalysis/Test8374435.java line 32:

> 30:  * @summary assert during escape analysis when splitting a Load through a Phi does not result in a
> 31:  *          Phi of Loads
> 32:  * @run main/othervm -XX:-UseOnStackReplacement -XX:-UseCompressedOops ${test.main.class}

The JBS title mentions ZGC but it seems it's not required. Can you update the title?

test/hotspot/jtreg/compiler/escapeAnalysis/Test8374435.java line 34:

> 32:  * @run main/othervm -XX:-UseOnStackReplacement -XX:-UseCompressedOops ${test.main.class}
> 33:  */
> 34: public class Test8374435 {

Can you rename the test into something more descriptive?

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

Marked as reviewed by chagedorn (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/29177#pullrequestreview-3654349551
PR Review Comment: https://git.openjdk.org/jdk/pull/29177#discussion_r2685285856
PR Review Comment: https://git.openjdk.org/jdk/pull/29177#discussion_r2685260071
PR Review Comment: https://git.openjdk.org/jdk/pull/29177#discussion_r2685257634


More information about the hotspot-compiler-dev mailing list