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

C2: dump barrier information for all Mach nodes

XMLWordPrintable

    • b20

      Dump GC-specific barrier information (via BarrierSetC2::dump_barrier_data()) for all Mach nodes, not just MachType ones. This makes it possible to e.g. write IR tests that verify barrier properties of CompareAndSwap/WeakCompareAndSwap implementations, which do not necessarily inherit from MachTypeNode. See an example of such tests here (ongoing implementation of JDK-8322295):
      https://github.com/robcasloz/jdk/blob/e9b3c2a4cb5dd80d85af8320e559acea5920b2ff/test/hotspot/jtreg/compiler/gcbarriers/TestG1BarrierGeneration.java#L283-L292.

      The attached program illustrates the missing barrier info (a "barrier(strong)" field):

      $ java -Xbatch -XX:+UseZGC -XX:+ZGenerational -XX:CompileOnly=Example::testCompareAndSwap -XX:CompileCommand=PrintIdealPhase,Example::testCompareAndSwap,FINAL_CODE Example.java | grep zCompareAndSwapP

       R10 37 zCompareAndSwapP === 28 35 38 54 22 41 [[ 40 42 36 27 56 25 ]] !jvms: VarHandleReferences$FieldInstanceReadWrite::compareAndSet @ bci:44 (line 180) VarHandleGuards::guard_LLL_Z @ bci:50 (line 68) Example::testCompareAndSwap @ bci:6 (line 20)

        1. Example.java
          0.9 kB
          Roberto Castaneda Lozano

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

              Created:
              Updated:
              Resolved: