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

SymbolPropertyTable creates an extra OopHandle per entry

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 16
    • 16
    • hotspot
    • None
    • b08

        SymbolPropertyEntry* new_entry(unsigned int hash, Symbol* symbol, intptr_t symbol_mode) {
          SymbolPropertyEntry* entry = (SymbolPropertyEntry*) Hashtable<Symbol*, mtSymbol>::new_entry(hash, symbol);
          // Hashtable with Symbol* literal must increment and decrement refcount.
          symbol->increment_refcount();
          entry->set_symbol_mode(symbol_mode);
          entry->set_method(NULL);
          entry->set_method_type(NULL);
          return entry;
        }

      Since the SymbolPropertyEntry constructor isn't called, the fields need to be explicitly zeroed.

      void SymbolPropertyEntry::set_method_type(oop p) {
        _method_type = OopHandle(OopStorageSet::vm_global(), p);
      }

      set_method_type creates a new OopHandle for NULL. There's an test when it's called in SystemDictionary that the value of the oop is NULL but not that the entry is_empty(), so there we call this again and create another OopHandle.

      I found this because I also added an assert to the assignment operator to prevent leaking OopHandles. This was [~eosterlund] 's idea from reviewing JDK-8249768 (which doesn't leak OopHandles).

            coleenp Coleen Phillimore
            coleenp Coleen Phillimore
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: