See https://github.com/openjdk/jdk/pull/18505#discussion_r1556115517
We can eliminate barriers when its precedence is a non-escaping object. These barriers are optimized away in https://github.com/openjdk/jdk/blob/70944ca54ad0090c734bb5b3082beb33450c4877/src/hotspot/share/opto/escape.cpp#L3165-L3179 and https://github.com/openjdk/jdk/blob/70944ca54ad0090c734bb5b3082beb33450c4877/src/hotspot/share/opto/memnode.cpp#L3433-L3441. They are the same optimization as far as I can tell. The optimizations in https://github.com/openjdk/jdk/blob/70944ca54ad0090c734bb5b3082beb33450c4877/src/hotspot/share/opto/macro.cpp#L556 might also be unifyable. It would be much clearer if these optimizations were all done in the same place.
We can eliminate barriers when its precedence is a non-escaping object. These barriers are optimized away in https://github.com/openjdk/jdk/blob/70944ca54ad0090c734bb5b3082beb33450c4877/src/hotspot/share/opto/escape.cpp#L3165-L3179 and https://github.com/openjdk/jdk/blob/70944ca54ad0090c734bb5b3082beb33450c4877/src/hotspot/share/opto/memnode.cpp#L3433-L3441. They are the same optimization as far as I can tell. The optimizations in https://github.com/openjdk/jdk/blob/70944ca54ad0090c734bb5b3082beb33450c4877/src/hotspot/share/opto/macro.cpp#L556 might also be unifyable. It would be much clearer if these optimizations were all done in the same place.
- relates to
-
JDK-8300148 Consider using a StoreStore barrier instead of Release barrier on ctor exit
- Resolved