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

Shenandoah: Re-shuffle GC state enum for better encoding

XMLWordPrintable

    • gc

      Currently, we have weird code generation in aarch64 Shenandoah barriers, e.g.:

        // Check for heap stability
        if (is_strong) {
          __ tbz(rscratch2, ShenandoahHeap::HAS_FORWARDED_BITPOS, heap_stable);
        } else {
          Label lrb;
          __ tbnz(rscratch2, ShenandoahHeap::WEAK_ROOTS_BITPOS, lrb);
          __ tbz(rscratch2, ShenandoahHeap::HAS_FORWARDED_BITPOS, heap_stable);
          __ bind(lrb);
        }

      The double-test in the weak-path could be avoided by doing something like:
        __ andb(rscratch2, rscratch2, ShenandoahHeap::WEAK_ROOTS | ShenandoahHeap::HAS_FORWARDED);
        __ cbz(done);

      However, the two constants together makes 17, and this can not be encoded as immediate in aarch64. Re-ordering the GC state enum such that the two constants are adjacent would likely solve this.

            xpeng Xiaolong Peng
            rkennke Roman Kennke
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: