< prev index next >

src/hotspot/share/memory/universe.cpp

Print this page

        

@@ -36,10 +36,11 @@
 #include "gc/shared/collectedHeap.inline.hpp"
 #include "gc/shared/gcArguments.hpp"
 #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"
 #include "logging/logStream.hpp"
 #include "memory/filemap.hpp"

@@ -95,10 +96,11 @@
 Klass* Universe::_longArrayKlassObj                 = NULL;
 Klass* Universe::_singleArrayKlassObj               = NULL;
 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;
 oop Universe::_byte_mirror                            = NULL;
 oop Universe::_bool_mirror                            = NULL;

@@ -686,10 +688,12 @@
   jint status = Universe::initialize_heap();
   if (status != JNI_OK) {
     return status;
   }
 
+  Universe::initialize_oop_storage();
+
   Metaspace::global_initialize();
 
   // Initialize performance counters for metaspaces
   MetaspaceCounters::initialize_performance_counters();
   CompressedClassSpaceCounters::initialize_performance_counters();

@@ -1341,10 +1345,21 @@
   Method* m = ik->method_with_idnum(method_idnum());
   assert(m != NULL, "sanity check");
   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
 bool Universe::release_fullgc_alot_dummy() {
   MutexLocker ml(FullGCALot_lock);
< prev index next >