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

Assert in layout_helper_log2_element_size(jint) compares bits instead of bytes

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P5 P5
    • 10
    • 9, 10
    • hotspot
    • b21

      The assert compares l2esz with LogBitsPerLong but the log2 element size is in bytes not bits:

      diff -r b22f7604ed47 src/share/vm/oops/klass.hpp
      --- a/src/share/vm/oops/klass.hpp Mon May 15 11:44:07 2017 +0200
      +++ b/src/share/vm/oops/klass.hpp Thu May 18 09:22:53 2017 +0200
      @@ -366,7 +366,7 @@
         static int layout_helper_log2_element_size(jint lh) {
           assert(lh < (jint)_lh_neutral_value, "must be array");
           int l2esz = (lh >> _lh_log2_element_size_shift) & _lh_log2_element_size_mask;
      - assert(l2esz <= LogBitsPerLong,
      + assert(l2esz <= LogBytesPerLong,
                  "sanity. l2esz: 0x%x for lh: 0x%x", (uint)l2esz, (uint)lh);
           return l2esz;
         }

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

              Created:
              Updated:
              Resolved: