< prev index next >

src/hotspot/share/gc/shared/oopStorageSet.cpp

Print this page
@@ -23,10 +23,12 @@
   */
  
  #include "precompiled.hpp"
  #include "gc/shared/oopStorage.hpp"
  #include "gc/shared/oopStorageSet.hpp"
+ #include "prims/resolvedMethodTable.hpp"
+ #include "classfile/stringTable.hpp"
  #include "runtime/mutex.hpp"
  #include "runtime/os.hpp"
  #include "utilities/debug.hpp"
  #include "utilities/globalDefinitions.hpp"
  #include "utilities/macros.hpp"

@@ -40,24 +42,25 @@
    char name[256];
    os::snprintf(name, sizeof(name), "%s %s lock", storage_name, kind);
    return new PaddedMutex(rank, name, true, Mutex::_safepoint_check_never);
  }
  
- static OopStorage* make_oopstorage(const char* name) {
+ static OopStorage* make_oopstorage(const char* name, OopStorage::NotificationFunction f = NULL) {
    Mutex* alloc = make_oopstorage_mutex(name, "alloc", Mutex::oopstorage);
    Mutex* active = make_oopstorage_mutex(name, "active", Mutex::oopstorage - 1);
-   return new OopStorage(name, alloc, active);
+   return new OopStorage(name, alloc, active, f);
  }
  
  void OopStorageSet::initialize() {
    storages[jni_global_index]        = make_oopstorage("JNI global");
    storages[vm_global_index]         = make_oopstorage("VM global");
    storages[jni_weak_index]          = make_oopstorage("JNI weak");
    storages[vm_weak_index]           = make_oopstorage("VM weak");
-   storages[string_table_weak_index] = make_oopstorage("StringTable weak");
+   storages[string_table_weak_index] =
+       make_oopstorage("StringTable weak", &StringTable::gc_notification);
    storages[resolved_method_table_weak_index] =
-     make_oopstorage("ResolvedMethodTable weak");
+       make_oopstorage("ResolvedMethodTable weak", &ResolvedMethodTable::gc_notification);
  
    // Ensure we have all of them.
    STATIC_ASSERT(all_count == 6);
    assert(storages[singular_index] == NULL, "postcondition");
  #ifdef ASSERT
< prev index next >