Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
9f220f4
8327012
eme64 Mar 13, 2024
5f8e5bf
test4
eme64 Mar 13, 2024
5041f64
initializing store capturing: test stub
eme64 Apr 24, 2024
dfa5da2
more tests, WIP
eme64 Apr 25, 2024
125f970
fix & extra tests
rwestrel Mar 19, 2025
71fd831
whitespace
rwestrel Apr 10, 2025
a4031f3
TestIterativeEA fix
rwestrel Apr 10, 2025
c32e453
Update test/hotspot/jtreg/compiler/macronodes/TestEliminationOfAlloca…
rwestrel Apr 24, 2025
082dcb5
Update src/hotspot/share/opto/multnode.hpp
rwestrel Apr 24, 2025
7139deb
Update src/hotspot/share/opto/escape.cpp
rwestrel Apr 24, 2025
469d8a5
Update src/hotspot/share/opto/multnode.hpp
rwestrel Apr 24, 2025
1639264
Update test/hotspot/jtreg/compiler/macronodes/TestInitializingStoreCa…
rwestrel Apr 24, 2025
377a8d7
Update test/hotspot/jtreg/compiler/macronodes/TestEliminationOfAlloca…
rwestrel Apr 24, 2025
a32b1d2
Update src/hotspot/share/opto/escape.cpp
rwestrel Apr 24, 2025
7afc47e
Update src/hotspot/share/opto/escape.cpp
rwestrel Apr 24, 2025
17517ae
review
rwestrel Apr 24, 2025
f22471c
review
rwestrel Apr 24, 2025
a401bed
review
rwestrel Apr 25, 2025
624d69e
review
rwestrel Apr 25, 2025
6134c97
review
rwestrel May 5, 2025
6a01123
more
rwestrel May 9, 2025
a76430b
more
rwestrel May 9, 2025
9f3b9cf
more
rwestrel May 12, 2025
02b43b7
more
rwestrel May 12, 2025
50e9437
more
rwestrel May 12, 2025
23035e0
more
rwestrel May 13, 2025
80d562a
more
rwestrel May 13, 2025
d5a2738
more
rwestrel May 14, 2025
af8480c
typo
rwestrel May 15, 2025
080638c
Merge branch 'master' into JDK-8327963
rwestrel May 15, 2025
616678f
Merge branch 'master' into JDK-8327963
rwestrel May 21, 2025
2a451c6
new test
rwestrel May 21, 2025
a6c6c04
new test tweak
rwestrel May 21, 2025
43c6f82
review
rwestrel May 22, 2025
c0a8ad2
Update src/hotspot/share/opto/library_call.cpp
rwestrel Jun 3, 2025
4b656f2
Merge branch 'master' into JDK-8327963
rwestrel Jun 3, 2025
24ff0e2
lambda clean up
rwestrel Jun 3, 2025
c189a7a
lambda return
rwestrel Jun 3, 2025
69c6e50
more
rwestrel Jun 4, 2025
3b5b54a
more
rwestrel Jun 5, 2025
ec9f278
Merge branch 'master' into JDK-8327963
rwestrel Aug 26, 2025
f528ce8
more
rwestrel Aug 27, 2025
fc13578
more
rwestrel Aug 28, 2025
b066f3c
Merge branch 'master' into JDK-8327963
rwestrel Sep 9, 2025
b701d03
more
rwestrel Sep 9, 2025
c64d68c
Update test/hotspot/jtreg/compiler/macronodes/TestEliminationOfAlloca…
rwestrel Sep 22, 2025
0ff5c45
Update src/hotspot/share/opto/multnode.hpp
rwestrel Sep 22, 2025
46972dc
Update src/hotspot/share/opto/multnode.hpp
rwestrel Sep 22, 2025
917ea91
Update src/hotspot/share/opto/graphKit.cpp
rwestrel Sep 22, 2025
2207487
Update src/hotspot/share/opto/graphKit.cpp
rwestrel Sep 22, 2025
f871390
Update src/hotspot/share/opto/macro.cpp
rwestrel Sep 22, 2025
6ea8c81
Update src/hotspot/share/opto/macro.cpp
rwestrel Sep 22, 2025
9fd8dc1
review
rwestrel Sep 22, 2025
f12efbc
Roberto's patches
rwestrel Sep 29, 2025
48257c9
review
rwestrel Sep 29, 2025
b5ac753
Merge branch 'master' into JDK-8327963
rwestrel Oct 28, 2025
957be06
review
rwestrel Oct 28, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/hotspot/share/opto/macro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1603,7 +1603,9 @@ void PhaseMacroExpand::expand_initialize_membar(AllocateNode* alloc, InitializeN
// No InitializeNode or no stores captured by zeroing
// elimination. Simply add the MemBarStoreStore after object
// initialization.
// See comment below in this if's other branch that explains why a raw memory MemBar is good enough.
// See comment below in this if's other branch that explains why a raw memory MemBar is good enough. If init is
// null, this allocation does have an InitializeNode but this logic can't locate it (see comment in
// PhaseMacroExpand::initialize_object()).
MemBarNode* mb = MemBarNode::make(C, Op_MemBarStoreStore, Compile::AliasIdxRaw);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the same argument as below apply for relaxing the scope of this memory barrier? Please clarify in a similar comment for this case (if the same argument applies, a reference to the comment below would be enough).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding the comment. A follow-up question: the full comment below makes the argument that re-ordering by the compiler can't happen by construction because a later Store that publishes the just allocated object reference is indirectly control dependent on the Initialize node. However, in this case, there may be no such Initialize node (init == nullptr || init->req() < InitializeNode::RawStores). I assume the memory barrier relaxation is still OK in this scenario because we cannot have later, publishing stores of the allocated object reference? That is, if there exists such a store then there must necessarily exist an Initialize node? Or is there any other reason I am missing? It would be good to clarify this point in the comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated the comment. Can you have a look?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the clarification and the pointer to the comment in initialize_object, that helps.

transform_later(mb);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,9 @@ private static boolean isPhi(Node n) {
}

private static boolean isProj(Node n) {
return hasName(n, "Proj") || hasName(n, "MachProj");
return hasName(n, "Proj") ||
hasName(n, "MachProj") ||
hasName(n, "NarrowMemProj");
}

private static boolean isParm(Node n) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ split(and([matches("name", "Parm|MachProj"),

// Combine single-input nodes.
combine(anyNode, matches("name", "Proj|IfFalse|IfTrue|JProj|MachProj|JumpProj|CatchProj|Parm"));
combine(anyNode, matches("name", "NarrowMemProj"), ["N"]);
combine(anyNode, matches("name", "SCMemProj"), ["SCM"]);
combine(matches("name", "SubTypeCheck|Cmp.*"), matches("name", "Bool"), ["[dump_spec]"]);
combine(anyNode, matches("name", "Decode(N|NarrowPtr|NKlass)"), ["DC"]);
Expand Down
10 changes: 7 additions & 3 deletions test/hotspot/jtreg/compiler/escapeAnalysis/TestIterativeEA.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,13 @@ public static void main(String[] args) throws Exception {
System.out.println(analyzer.getOutput());

analyzer.shouldHaveExitValue(0);
analyzer.shouldContain("++++ Eliminated: 26 Allocate");
analyzer.shouldContain("++++ Eliminated: 51 Allocate");
analyzer.shouldContain("++++ Eliminated: 84 Allocate");
analyzer.shouldMatch(
"(?s)" + // Let .* also match line terminators.
"Eliminated: \\d+ Allocate" +
".*" +
"Eliminated: \\d+ Allocate" +
".*" +
"Eliminated: \\d+ Allocate");
}

static class A {
Expand Down