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

Coalesce object header barrier with the final field barriers

XMLWordPrintable

      This is again surfaced during the JMM9 overhaul effort.

      In short, HotSpot emits StoreStore barrier after writing out the object headers (C1 does it explicitly, and C2 by the means of AllocateNode). If a write to final field is present in the initializer, then we also emit MemBarRelease, which is LoadStore+StoreStore. It seems redundant to have both barriers, when we can subsume the object header barrier into the final LoadStore+StoreStore.

      This is the job for high-level opimizer, but the effect is mostly visible on weakly-ordered architectures, where both StoreStore and LoadStore+StoreStore materialize.

            Unassigned Unassigned
            shade Aleksey Shipilev
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: