-
Enhancement
-
Resolution: Unresolved
-
P4
-
9, 10
-
arm
In order to follow the conservative strategy in implementing Java Memory Model,
the implementations needs to emit StoreStore barrier at the end of constructor.
When there are multiple super-class constructors, we can emit the single
StoreStore barrier at the end of the last constructor, before we publish the
reference to newly constructed object.
However, as far as our compilers go, we put the StoreStore/MemBarRelease
at each constructor's exit path during the bytecode translation. Which means
that chained super constructors will have the excess barriers. We need
a pass over the code (presumably after super constructors had inlined) in
order to coalesce redundant barriers.
This has little-to-none performance effect on x86, because these barriers are reduced
to compiler-only barrier. However, on weakly ordered architectures a full-fledged
memory barrier is emitted and affects performance.
the implementations needs to emit StoreStore barrier at the end of constructor.
When there are multiple super-class constructors, we can emit the single
StoreStore barrier at the end of the last constructor, before we publish the
reference to newly constructed object.
However, as far as our compilers go, we put the StoreStore/MemBarRelease
at each constructor's exit path during the bytecode translation. Which means
that chained super constructors will have the excess barriers. We need
a pass over the code (presumably after super constructors had inlined) in
order to coalesce redundant barriers.
This has little-to-none performance effect on x86, because these barriers are reduced
to compiler-only barrier. However, on weakly ordered architectures a full-fledged
memory barrier is emitted and affects performance.
- duplicates
-
JDK-8330050 C2: Only emit one trailing barrier for chain of parent constructors.
- Closed
- relates to
-
JDK-8032481 Coalesce object header barrier with the final field barriers
- Closed
- links to
-
Review(master) openjdk/jdk/18870