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

Cleanup KlassObj and klassOop names after the PermGen removal

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 23
    • None
    • hotspot
    • None
    • b18

      We have a few places that uses the terms KlassObj and klassOop when referring to Klasses. This is old code from before the PermGen removal, when Klasses also were Java objects.

      These names tripped me up when I was reading the heap heapInspection.cpp and first though we were mixing the klass mirror objects and klass pointers in the hash code calculation:

         // An aligned reference address (typically the least
         // address in the perm gen) used for hashing klass
         // objects.
         HeapWord* _ref;
      ...
      _ref = (HeapWord*) Universe::boolArrayKlassObj();
      ...
      uint KlassInfoTable::hash(const Klass* p) {
        return (uint)(((uintptr_t)p - (uintptr_t)_ref) >> 2);
      }

      I propose that we rename these functions (and stop casting the Klass* to a (HeapWord*)).

            stefank Stefan Karlsson
            stefank Stefan Karlsson
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: