src/share/vm/jfr/recorder/checkpoint/types/jfrTypeSetUtils.cpp

changeset 9926
d20a5f399218
parent 9858
b985cbb00e68
     1.1 --- a/src/share/vm/jfr/recorder/checkpoint/types/jfrTypeSetUtils.cpp	Fri Jun 12 02:59:56 2020 +0100
     1.2 +++ b/src/share/vm/jfr/recorder/checkpoint/types/jfrTypeSetUtils.cpp	Mon Jun 15 14:08:11 2020 +0300
     1.3 @@ -28,9 +28,11 @@
     1.4  #include "oops/oop.inline.hpp"
     1.5  #include "oops/symbol.hpp"
     1.6  
     1.7 -JfrSymbolId::JfrSymbolId() : _symbol_id_counter(0), _sym_table(new SymbolTable(this)), _cstring_table(new CStringTable(this)) {
     1.8 +JfrSymbolId::JfrSymbolId() : _symbol_id_counter(0), _sym_table(new SymbolTable(this)),
     1.9 +        _cstring_table(new CStringTable(this)), _pkg_table(new CStringTable(this)) {
    1.10    assert(_sym_table != NULL, "invariant");
    1.11    assert(_cstring_table != NULL, "invariant");
    1.12 +  assert(_pkg_table != NULL, "invariant");
    1.13    initialize();
    1.14  }
    1.15  
    1.16 @@ -52,6 +54,11 @@
    1.17    }
    1.18    assert(!_cstring_table->has_entries(), "invariant");
    1.19    _symbol_id_counter = 0;
    1.20 +  assert(_pkg_table != NULL, "invariant");
    1.21 +  if (_pkg_table->has_entries()) {
    1.22 +    _pkg_table->clear_entries();
    1.23 +  }
    1.24 +  assert(!_pkg_table->has_entries(), "invariant");
    1.25  }
    1.26  
    1.27  JfrSymbolId::~JfrSymbolId() {
    1.28 @@ -148,6 +155,12 @@
    1.29    return _cstring_table->id(str, hash);
    1.30  }
    1.31  
    1.32 +traceid JfrSymbolId::markPackage(const char* name, uintptr_t hash) {
    1.33 +  assert(name != NULL, "invariant");
    1.34 +  assert(_pkg_table != NULL, "invariant");
    1.35 +  return _pkg_table->id(name, hash);
    1.36 +}
    1.37 +
    1.38  bool JfrSymbolId::is_anonymous_klass(const Klass* k) {
    1.39    assert(k != NULL, "invariant");
    1.40    return k->oop_is_instance() && ((const InstanceKlass*)k)->is_anonymous();
    1.41 @@ -243,6 +256,10 @@
    1.42    return _symbol_id->mark(str, hash);
    1.43  }
    1.44  
    1.45 +traceid JfrArtifactSet::markPackage(const char* const name, uintptr_t hash) {
    1.46 +  return _symbol_id->markPackage(name, hash);
    1.47 +}
    1.48 +
    1.49  const JfrSymbolId::SymbolEntry* JfrArtifactSet::map_symbol(const Symbol* symbol) const {
    1.50    return _symbol_id->map_symbol(symbol);
    1.51  }

mercurial