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

C2: implement late barrier elision for G1

XMLWordPrintable

      Currently, C2 can only elide pre-and post-barriers of G1 stores that follow immediately a newly allocated object. This RFE proposes analyzing C2's IR platform-dependent representation right before code emission (at PhaseOutput::perform_mach_node_analysis()) to elide barriers in stores as long as there is no safepoint poll between these and their corresponding allocations. Existing ZGC logic to perform a similar analysis can hopefully by generalized and reused.

      The additional optimization would make it possible to remove barriers e.g. in conditional stores:

      MyObject o = new MyObject();
      if (c) {
          o.myField = ..; // elidable barrier
      }

      or in array initialization stores in small loops such as this:

      Object[] a = new Object[64];
      for (int i = 0; i < a.length; i++) {
          a[i] = ..; // elidable barrier (small counted loop without safepoint polls)
      }

            rcastanedalo Roberto Castaneda Lozano
            rcastanedalo Roberto Castaneda Lozano
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: