JDK-8073358 : memory fences for fields are present in code even though object has been lifted into registers
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 9,10
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • CPU: aarch64
  • Submitted: 2015-02-17
  • Updated: 2018-10-05
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdUnresolved
Related Reports
Relates :  
Description
Some memory fences (MemBar nodes) are apparently left behind after a non-escaping object is scalarized.  The report is here (look for "close but not cigar"):

http://mail.openjdk.java.net/pipermail/hotspot-dev/2015-February/017194.html

Perhaps the memory barriers inserted into constructor calls by Parse::do_exits should be gated on whether the object has escaped or not.
Comments
There is code in MemBarNode::Ideal() which eliminates membars for scalarized object. There may be some exceptions but it general it should work. If it does not - it is bug.
17-02-2015