--- old/src/hotspot/share/memory/universe.cpp 2018-03-26 13:40:54.921093885 -0400 +++ new/src/hotspot/share/memory/universe.cpp 2018-03-26 13:40:54.540058684 -0400 @@ -38,6 +38,7 @@ #include "gc/shared/gcLocker.hpp" #include "gc/shared/generation.hpp" #include "gc/shared/gcTraceTime.inline.hpp" +#include "gc/shared/oopStorage.hpp" #include "gc/shared/space.hpp" #include "interpreter/interpreter.hpp" #include "logging/log.hpp" @@ -97,6 +98,7 @@ Klass* Universe::_doubleArrayKlassObj = NULL; Klass* Universe::_typeArrayKlassObjs[T_VOID+1] = { NULL /*, NULL...*/ }; Klass* Universe::_objectArrayKlassObj = NULL; +OopStorage* Universe::_vm_weak_oop_storage = NULL; oop Universe::_int_mirror = NULL; oop Universe::_float_mirror = NULL; oop Universe::_double_mirror = NULL; @@ -688,6 +690,8 @@ return status; } + Universe::initialize_oop_storage(); + Metaspace::global_initialize(); // Initialize performance counters for metaspaces @@ -1343,6 +1347,17 @@ return m; } +void Universe::initialize_oop_storage() { + _vm_weak_oop_storage = + new OopStorage("VM Weak Oop Handles", + VMWeakAlloc_lock, + VMWeakActive_lock); +} + +OopStorage* Universe::vm_weak_oop_storage() { + assert(_vm_weak_oop_storage != NULL, "Uninitialized"); + return _vm_weak_oop_storage; +} #ifdef ASSERT // Release dummy object(s) at bottom of heap