Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8369166

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

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P3 P3
    • repo-valhalla
    • repo-valhalla
    • 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.

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

              Created:
              Updated: