[lworld] Avoid final field barriers at the end of constructors for strict fields

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Unresolved
    • Priority: P3
    • repo-valhalla
    • Affects Version/s: repo-valhalla
    • Component/s: hotspot

      JDK-8367785 added a barrier to the beginning of java.lang.Object::<init> for strict fields. Now if the field is strict and *final*, we will also add barriers to the end of the constructors:
      https://github.com/openjdk/valhalla/blob/274d56076260a490ed52df29373216617ddf73ef/src/hotspot/share/c1/c1_GraphBuilder.cpp#L1645-L1652

      https://github.com/openjdk/valhalla/blob/274d56076260a490ed52df29373216617ddf73ef/src/hotspot/share/opto/parse1.cpp#L1092-L1099

      I think those barriers can be omitted because the object can only escape after j.l.Object::<init> for strict fields.

            Assignee:
            Unassigned
            Reporter:
            Tobias Hartmann
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: