8227653: Add VM Global OopStorage
authorkbarrett
Thu, 18 Jul 2019 14:57:32 -0400
changeset 55740 b3ff56f955c8
parent 55739 ba2bd51ce67e
child 55741 880266b6e5b3
8227653: Add VM Global OopStorage Summary: Replaced conditional JVMCI global storage with VM global storage. Reviewed-by: tschatzl, lfoltan, kvn
src/hotspot/share/classfile/systemDictionary.cpp
src/hotspot/share/classfile/systemDictionary.hpp
src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp
src/hotspot/share/gc/g1/g1GCPhaseTimes.hpp
src/hotspot/share/gc/g1/g1RootProcessor.cpp
src/hotspot/share/gc/g1/g1RootProcessor.hpp
src/hotspot/share/gc/parallel/pcTasks.cpp
src/hotspot/share/gc/parallel/pcTasks.hpp
src/hotspot/share/gc/parallel/psMarkSweep.cpp
src/hotspot/share/gc/parallel/psParallelCompact.cpp
src/hotspot/share/gc/parallel/psScavenge.cpp
src/hotspot/share/gc/parallel/psTasks.cpp
src/hotspot/share/gc/parallel/psTasks.hpp
src/hotspot/share/gc/shared/genCollectedHeap.cpp
src/hotspot/share/gc/shared/genCollectedHeap.hpp
src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.cpp
src/hotspot/share/gc/z/zRootsIterator.cpp
src/hotspot/share/gc/z/zRootsIterator.hpp
src/hotspot/share/jfr/leakprofiler/chains/rootSetClosure.cpp
src/hotspot/share/jfr/leakprofiler/checkpoint/rootResolver.cpp
src/hotspot/share/jvmci/jvmci.cpp
src/hotspot/share/jvmci/jvmci.hpp
src/hotspot/share/prims/jvmtiTagMap.cpp
src/hotspot/share/runtime/mutex.hpp
src/hotspot/share/runtime/mutexLocker.cpp
src/hotspot/share/runtime/mutexLocker.hpp
src/hotspot/share/runtime/serviceThread.cpp
--- a/src/hotspot/share/classfile/systemDictionary.cpp	Wed Jul 17 08:33:38 2019 -0400
+++ b/src/hotspot/share/classfile/systemDictionary.cpp	Thu Jul 18 14:57:32 2019 -0400
@@ -114,6 +114,7 @@
 
 const int defaultProtectionDomainCacheSize = 1009;
 
+OopStorage* SystemDictionary::_vm_global_oop_storage = NULL;
 OopStorage* SystemDictionary::_vm_weak_oop_storage = NULL;
 
 
@@ -1844,7 +1845,7 @@
   return unloading_occurred;
 }
 
-void SystemDictionary::oops_do(OopClosure* f) {
+void SystemDictionary::oops_do(OopClosure* f, bool include_handles) {
   f->do_oop(&_java_system_loader);
   f->do_oop(&_java_platform_loader);
   f->do_oop(&_system_loader_lock_obj);
@@ -1852,6 +1853,10 @@
 
   // Visit extra methods
   invoke_method_table()->oops_do(f);
+
+  if (include_handles) {
+    vm_global_oop_storage()->oops_do(f);
+  }
 }
 
 // CDS: scan and relocate all classes referenced by _well_known_klasses[].
@@ -2893,12 +2898,22 @@
 }
 
 void SystemDictionary::initialize_oop_storage() {
+  _vm_global_oop_storage =
+    new OopStorage("VM Global Oop Handles",
+                   VMGlobalAlloc_lock,
+                   VMGlobalActive_lock);
+
   _vm_weak_oop_storage =
     new OopStorage("VM Weak Oop Handles",
                    VMWeakAlloc_lock,
                    VMWeakActive_lock);
 }
 
+OopStorage* SystemDictionary::vm_global_oop_storage() {
+  assert(_vm_global_oop_storage != NULL, "Uninitialized");
+  return _vm_global_oop_storage;
+}
+
 OopStorage* SystemDictionary::vm_weak_oop_storage() {
   assert(_vm_weak_oop_storage != NULL, "Uninitialized");
   return _vm_weak_oop_storage;
--- a/src/hotspot/share/classfile/systemDictionary.hpp	Wed Jul 17 08:33:38 2019 -0400
+++ b/src/hotspot/share/classfile/systemDictionary.hpp	Thu Jul 18 14:57:32 2019 -0400
@@ -348,7 +348,9 @@
   static bool do_unloading(GCTimer* gc_timer);
 
   // Applies "f->do_oop" to all root oops in the system dictionary.
-  static void oops_do(OopClosure* f);
+  // If include_handles is true (the default), then the handles in the
+  // storage object returned by vm_global_oop_storage() are included.
+  static void oops_do(OopClosure* f, bool include_handles = true);
 
   // System loader lock
   static oop system_loader_lock()           { return _system_loader_lock_obj; }
@@ -563,7 +565,8 @@
   // ProtectionDomain cache
   static ProtectionDomainCacheTable*   _pd_cache_table;
 
-  // VM weak OopStorage object.
+  // VM OopStorage objects.
+  static OopStorage*             _vm_global_oop_storage;
   static OopStorage*             _vm_weak_oop_storage;
 
 protected:
@@ -621,6 +624,7 @@
   }
 
   static void initialize_oop_storage();
+  static OopStorage* vm_global_oop_storage();
   static OopStorage* vm_weak_oop_storage();
 
 protected:
--- a/src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp	Wed Jul 17 08:33:38 2019 -0400
+++ b/src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp	Thu Jul 18 14:57:32 2019 -0400
@@ -61,7 +61,6 @@
   _gc_par_phases[CLDGRoots] = new WorkerDataArray<double>(max_gc_threads, "CLDG Roots (ms):");
   _gc_par_phases[JVMTIRoots] = new WorkerDataArray<double>(max_gc_threads, "JVMTI Roots (ms):");
   AOT_ONLY(_gc_par_phases[AOTCodeRoots] = new WorkerDataArray<double>(max_gc_threads, "AOT Root Scan (ms):");)
-  JVMCI_ONLY(_gc_par_phases[JVMCIRoots] = new WorkerDataArray<double>(max_gc_threads, "JVMCI Root Scan (ms):");)
   _gc_par_phases[CMRefRoots] = new WorkerDataArray<double>(max_gc_threads, "CM RefProcessor Roots (ms):");
   _gc_par_phases[WaitForStrongCLD] = new WorkerDataArray<double>(max_gc_threads, "Wait For Strong CLD (ms):");
   _gc_par_phases[WeakCLDRoots] = new WorkerDataArray<double>(max_gc_threads, "Weak CLD Roots (ms):");
@@ -563,7 +562,6 @@
       "CLDGRoots",
       "JVMTIRoots",
       AOT_ONLY("AOTCodeRoots" COMMA)
-      JVMCI_ONLY("JVMCIRoots" COMMA)
       "CMRefRoots",
       "WaitForStrongCLD",
       "WeakCLDRoots",
--- a/src/hotspot/share/gc/g1/g1GCPhaseTimes.hpp	Wed Jul 17 08:33:38 2019 -0400
+++ b/src/hotspot/share/gc/g1/g1GCPhaseTimes.hpp	Thu Jul 18 14:57:32 2019 -0400
@@ -56,7 +56,6 @@
     CLDGRoots,
     JVMTIRoots,
     AOT_ONLY(AOTCodeRoots COMMA)
-    JVMCI_ONLY(JVMCIRoots COMMA)
     CMRefRoots,
     WaitForStrongCLD,
     WeakCLDRoots,
--- a/src/hotspot/share/gc/g1/g1RootProcessor.cpp	Wed Jul 17 08:33:38 2019 -0400
+++ b/src/hotspot/share/gc/g1/g1RootProcessor.cpp	Thu Jul 18 14:57:32 2019 -0400
@@ -44,9 +44,6 @@
 #include "runtime/mutex.hpp"
 #include "services/management.hpp"
 #include "utilities/macros.hpp"
-#if INCLUDE_JVMCI
-#include "jvmci/jvmci.hpp"
-#endif
 
 void G1RootProcessor::worker_has_discovered_all_strong_classes() {
   assert(ClassUnloadingWithConcurrentMark, "Currently only needed when doing G1 Class Unloading");
@@ -261,15 +258,6 @@
   }
 #endif
 
-#if INCLUDE_JVMCI
-  if (EnableJVMCI) {
-    G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::JVMCIRoots, worker_i);
-    if (_process_strong_tasks.try_claim_task(G1RP_PS_JVMCI_oops_do)) {
-      JVMCI::oops_do(strong_roots);
-    }
-  }
-#endif
-
   {
     G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::SystemDictionaryRoots, worker_i);
     if (_process_strong_tasks.try_claim_task(G1RP_PS_SystemDictionary_oops_do)) {
--- a/src/hotspot/share/gc/g1/g1RootProcessor.hpp	Wed Jul 17 08:33:38 2019 -0400
+++ b/src/hotspot/share/gc/g1/g1RootProcessor.hpp	Thu Jul 18 14:57:32 2019 -0400
@@ -64,7 +64,6 @@
     G1RP_PS_jvmti_oops_do,
     G1RP_PS_CodeCache_oops_do,
     AOT_ONLY(G1RP_PS_aot_oops_do COMMA)
-    JVMCI_ONLY(G1RP_PS_JVMCI_oops_do COMMA)
     G1RP_PS_refProcessor_oops_do,
     // Leave this one last.
     G1RP_PS_NumElements
--- a/src/hotspot/share/gc/parallel/pcTasks.cpp	Wed Jul 17 08:33:38 2019 -0400
+++ b/src/hotspot/share/gc/parallel/pcTasks.cpp	Thu Jul 18 14:57:32 2019 -0400
@@ -46,9 +46,6 @@
 #include "runtime/vmThread.hpp"
 #include "services/management.hpp"
 #include "utilities/stack.inline.hpp"
-#if INCLUDE_JVMCI
-#include "jvmci/jvmci.hpp"
-#endif
 
 //
 // ThreadRootsMarkingTask
@@ -124,12 +121,6 @@
       AOTLoader::oops_do(&mark_and_push_closure);
       break;
 
-#if INCLUDE_JVMCI
-    case jvmci:
-      JVMCI::oops_do(&mark_and_push_closure);
-      break;
-#endif
-
     default:
       fatal("Unknown root type");
   }
--- a/src/hotspot/share/gc/parallel/pcTasks.hpp	Wed Jul 17 08:33:38 2019 -0400
+++ b/src/hotspot/share/gc/parallel/pcTasks.hpp	Thu Jul 18 14:57:32 2019 -0400
@@ -99,7 +99,6 @@
     system_dictionary     = 7,
     class_loader_data     = 8,
     code_cache            = 9
-    JVMCI_ONLY(COMMA jvmci = 10)
   };
  private:
   RootType _root_type;
--- a/src/hotspot/share/gc/parallel/psMarkSweep.cpp	Wed Jul 17 08:33:38 2019 -0400
+++ b/src/hotspot/share/gc/parallel/psMarkSweep.cpp	Thu Jul 18 14:57:32 2019 -0400
@@ -524,7 +524,6 @@
     // Do not treat nmethods as strong roots for mark/sweep, since we can unload them.
     //ScavengableNMethods::scavengable_nmethods_do(CodeBlobToOopClosure(mark_and_push_closure()));
     AOT_ONLY(AOTLoader::oops_do(mark_and_push_closure());)
-    JVMCI_ONLY(JVMCI::oops_do(mark_and_push_closure());)
   }
 
   // Flush marking stack.
@@ -620,8 +619,6 @@
   CodeCache::blobs_do(&adjust_from_blobs);
   AOT_ONLY(AOTLoader::oops_do(adjust_pointer_closure());)
 
-  JVMCI_ONLY(JVMCI::oops_do(adjust_pointer_closure());)
-
   ref_processor()->weak_oops_do(adjust_pointer_closure());
   PSScavenge::reference_processor()->weak_oops_do(adjust_pointer_closure());
 
--- a/src/hotspot/share/gc/parallel/psParallelCompact.cpp	Wed Jul 17 08:33:38 2019 -0400
+++ b/src/hotspot/share/gc/parallel/psParallelCompact.cpp	Thu Jul 18 14:57:32 2019 -0400
@@ -2127,7 +2127,6 @@
     q->enqueue(new MarkFromRootsTask(MarkFromRootsTask::class_loader_data));
     q->enqueue(new MarkFromRootsTask(MarkFromRootsTask::jvmti));
     q->enqueue(new MarkFromRootsTask(MarkFromRootsTask::code_cache));
-    JVMCI_ONLY(q->enqueue(new MarkFromRootsTask(MarkFromRootsTask::jvmci));)
 
     if (active_gc_threads > 1) {
       for (uint j = 0; j < active_gc_threads; j++) {
@@ -2217,8 +2216,6 @@
   CodeCache::blobs_do(&adjust_from_blobs);
   AOT_ONLY(AOTLoader::oops_do(&oop_closure);)
 
-  JVMCI_ONLY(JVMCI::oops_do(&oop_closure);)
-
   ref_processor()->weak_oops_do(&oop_closure);
   // Roots were visited so references into the young gen in roots
   // may have been scanned.  Process them also.
--- a/src/hotspot/share/gc/parallel/psScavenge.cpp	Wed Jul 17 08:33:38 2019 -0400
+++ b/src/hotspot/share/gc/parallel/psScavenge.cpp	Thu Jul 18 14:57:32 2019 -0400
@@ -379,7 +379,6 @@
       q->enqueue(new ScavengeRootsTask(ScavengeRootsTask::class_loader_data));
       q->enqueue(new ScavengeRootsTask(ScavengeRootsTask::jvmti));
       q->enqueue(new ScavengeRootsTask(ScavengeRootsTask::code_cache));
-      JVMCI_ONLY(q->enqueue(new ScavengeRootsTask(ScavengeRootsTask::jvmci));)
 
       TaskTerminator terminator(active_workers,
                                 (TaskQueueSetSuper*) promotion_manager->stack_array_depth());
--- a/src/hotspot/share/gc/parallel/psTasks.cpp	Wed Jul 17 08:33:38 2019 -0400
+++ b/src/hotspot/share/gc/parallel/psTasks.cpp	Thu Jul 18 14:57:32 2019 -0400
@@ -44,9 +44,6 @@
 #include "runtime/thread.hpp"
 #include "runtime/vmThread.hpp"
 #include "services/management.hpp"
-#if INCLUDE_JVMCI
-#include "jvmci/jvmci.hpp"
-#endif
 
 //
 // ScavengeRootsTask
@@ -106,12 +103,6 @@
       }
       break;
 
-#if INCLUDE_JVMCI
-    case jvmci:
-      JVMCI::oops_do(&roots_closure);
-      break;
-#endif
-
     default:
       fatal("Unknown root type");
   }
--- a/src/hotspot/share/gc/parallel/psTasks.hpp	Wed Jul 17 08:33:38 2019 -0400
+++ b/src/hotspot/share/gc/parallel/psTasks.hpp	Thu Jul 18 14:57:32 2019 -0400
@@ -61,7 +61,6 @@
     management            = 7,
     jvmti                 = 8,
     code_cache            = 9
-    JVMCI_ONLY(COMMA jvmci = 10)
   };
  private:
   RootType _root_type;
--- a/src/hotspot/share/gc/shared/genCollectedHeap.cpp	Wed Jul 17 08:33:38 2019 -0400
+++ b/src/hotspot/share/gc/shared/genCollectedHeap.cpp	Thu Jul 18 14:57:32 2019 -0400
@@ -861,11 +861,6 @@
     AOTLoader::oops_do(strong_roots);
   }
 #endif
-#if INCLUDE_JVMCI
-  if (EnableJVMCI && _process_strong_tasks->try_claim_task(GCH_PS_jvmci_oops_do)) {
-    JVMCI::oops_do(strong_roots);
-  }
-#endif
   if (_process_strong_tasks->try_claim_task(GCH_PS_SystemDictionary_oops_do)) {
     SystemDictionary::oops_do(strong_roots);
   }
--- a/src/hotspot/share/gc/shared/genCollectedHeap.hpp	Wed Jul 17 08:33:38 2019 -0400
+++ b/src/hotspot/share/gc/shared/genCollectedHeap.hpp	Thu Jul 18 14:57:32 2019 -0400
@@ -114,7 +114,6 @@
     GCH_PS_jvmti_oops_do,
     GCH_PS_CodeCache_oops_do,
     AOT_ONLY(GCH_PS_aot_oops_do COMMA)
-    JVMCI_ONLY(GCH_PS_jvmci_oops_do COMMA)
     GCH_PS_younger_gens,
     // Leave this one last.
     GCH_PS_NumElements
--- a/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.cpp	Wed Jul 17 08:33:38 2019 -0400
+++ b/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.cpp	Thu Jul 18 14:57:32 2019 -0400
@@ -52,11 +52,16 @@
   }
 }
 
+// Default the second argument for SD::oops_do.
+static void system_dictionary_oops_do(OopClosure* cl) {
+  SystemDictionary::oops_do(cl);
+}
+
 ShenandoahSerialRoots::ShenandoahSerialRoots() :
   _universe_root(&Universe::oops_do, ShenandoahPhaseTimings::UniverseRoots),
   _object_synchronizer_root(&ObjectSynchronizer::oops_do, ShenandoahPhaseTimings::ObjectSynchronizerRoots),
   _management_root(&Management::oops_do, ShenandoahPhaseTimings::ManagementRoots),
-  _system_dictionary_root(&SystemDictionary::oops_do, ShenandoahPhaseTimings::SystemDictionaryRoots),
+  _system_dictionary_root(&system_dictionary_oops_do, ShenandoahPhaseTimings::SystemDictionaryRoots),
   _jvmti_root(&JvmtiExport::oops_do, ShenandoahPhaseTimings::JVMTIRoots) {
 }
 
--- a/src/hotspot/share/gc/z/zRootsIterator.cpp	Wed Jul 17 08:33:38 2019 -0400
+++ b/src/hotspot/share/gc/z/zRootsIterator.cpp	Thu Jul 18 14:57:32 2019 -0400
@@ -69,6 +69,7 @@
 static const ZStatSubPhase ZSubPhaseConcurrentRoots("Concurrent Roots");
 static const ZStatSubPhase ZSubPhaseConcurrentRootsTeardown("Concurrent Roots Teardown");
 static const ZStatSubPhase ZSubPhaseConcurrentRootsJNIHandles("Concurrent Roots JNIHandles");
+static const ZStatSubPhase ZSubPhaseConcurrentRootsVMHandles("Concurrent Roots VMHandles");
 static const ZStatSubPhase ZSubPhaseConcurrentRootsClassLoaderDataGraph("Concurrent Roots ClassLoaderDataGraph");
 
 static const ZStatSubPhase ZSubPhasePauseWeakRootsSetup("Pause Weak Roots Setup");
@@ -231,7 +232,8 @@
 
 void ZRootsIterator::do_system_dictionary(ZRootsIteratorClosure* cl) {
   ZStatTimer timer(ZSubPhasePauseRootsSystemDictionary);
-  SystemDictionary::oops_do(cl);
+  // Handles are processed via _vm_handles.
+  SystemDictionary::oops_do(cl, false /* include_handles */);
 }
 
 void ZRootsIterator::do_threads(ZRootsIteratorClosure* cl) {
@@ -264,8 +266,10 @@
 
 ZConcurrentRootsIterator::ZConcurrentRootsIterator(int cld_claim) :
     _jni_handles_iter(JNIHandles::global_handles()),
+    _vm_handles_iter(SystemDictionary::vm_global_oop_storage()),
     _cld_claim(cld_claim),
     _jni_handles(this),
+    _vm_handles(this),
     _class_loader_data_graph(this) {
   ZStatTimer timer(ZSubPhaseConcurrentRootsSetup);
 }
@@ -279,6 +283,11 @@
   _jni_handles_iter.oops_do(cl);
 }
 
+void ZConcurrentRootsIterator::do_vm_handles(ZRootsIteratorClosure* cl) {
+  ZStatTimer timer(ZSubPhaseConcurrentRootsVMHandles);
+  _vm_handles_iter.oops_do(cl);
+}
+
 void ZConcurrentRootsIterator::do_class_loader_data_graph(ZRootsIteratorClosure* cl) {
   ZStatTimer timer(ZSubPhaseConcurrentRootsClassLoaderDataGraph);
   CLDToOopClosure cld_cl(cl, _cld_claim);
@@ -288,6 +297,7 @@
 void ZConcurrentRootsIterator::oops_do(ZRootsIteratorClosure* cl) {
   ZStatTimer timer(ZSubPhaseConcurrentRoots);
   _jni_handles.oops_do(cl);
+  _vm_handles.oops_do(cl),
   _class_loader_data_graph.oops_do(cl);
 }
 
--- a/src/hotspot/share/gc/z/zRootsIterator.hpp	Wed Jul 17 08:33:38 2019 -0400
+++ b/src/hotspot/share/gc/z/zRootsIterator.hpp	Thu Jul 18 14:57:32 2019 -0400
@@ -112,12 +112,15 @@
 class ZConcurrentRootsIterator {
 private:
   ZOopStorageIterator        _jni_handles_iter;
+  ZOopStorageIterator        _vm_handles_iter;
   int                        _cld_claim;
 
   void do_jni_handles(ZRootsIteratorClosure* cl);
+  void do_vm_handles(ZRootsIteratorClosure* cl);
   void do_class_loader_data_graph(ZRootsIteratorClosure* cl);
 
   ZParallelOopsDo<ZConcurrentRootsIterator, &ZConcurrentRootsIterator::do_jni_handles>             _jni_handles;
+  ZParallelOopsDo<ZConcurrentRootsIterator, &ZConcurrentRootsIterator::do_vm_handles>              _vm_handles;
   ZParallelOopsDo<ZConcurrentRootsIterator, &ZConcurrentRootsIterator::do_class_loader_data_graph> _class_loader_data_graph;
 
 public:
--- a/src/hotspot/share/jfr/leakprofiler/chains/rootSetClosure.cpp	Wed Jul 17 08:33:38 2019 -0400
+++ b/src/hotspot/share/jfr/leakprofiler/chains/rootSetClosure.cpp	Thu Jul 18 14:57:32 2019 -0400
@@ -42,9 +42,6 @@
 #include "runtime/thread.hpp"
 #include "services/management.hpp"
 #include "utilities/align.hpp"
-#if INCLUDE_JVMCI
-#include "jvmci/jvmci.hpp"
-#endif
 
 template <typename Delegate>
 RootSetClosure<Delegate>::RootSetClosure(Delegate* delegate) : _delegate(delegate) {}
@@ -96,7 +93,6 @@
   Management::oops_do(this);
   StringTable::oops_do(this);
   AOTLoader::oops_do(this);
-  JVMCI_ONLY(JVMCI::oops_do(this);)
 }
 
 template class RootSetClosure<BFSClosure>;
--- a/src/hotspot/share/jfr/leakprofiler/checkpoint/rootResolver.cpp	Wed Jul 17 08:33:38 2019 -0400
+++ b/src/hotspot/share/jfr/leakprofiler/checkpoint/rootResolver.cpp	Thu Jul 18 14:57:32 2019 -0400
@@ -41,9 +41,6 @@
 #include "runtime/vframe_hp.hpp"
 #include "services/management.hpp"
 #include "utilities/growableArray.hpp"
-#if INCLUDE_JVMCI
-#include "jvmci/jvmci.hpp"
-#endif
 
 class ReferenceLocateClosure : public OopClosure {
  protected:
@@ -106,7 +103,6 @@
   bool do_management_roots();
   bool do_string_table_roots();
   bool do_aot_loader_roots();
-  JVMCI_ONLY(bool do_jvmci_roots();)
 
   bool do_roots();
 
@@ -193,15 +189,6 @@
   return rcl.complete();
 }
 
-#if INCLUDE_JVMCI
-bool ReferenceToRootClosure::do_jvmci_roots() {
-  assert(!complete(), "invariant");
-  ReferenceLocateClosure rcl(_callback, OldObjectRoot::_jvmci, OldObjectRoot::_type_undetermined, NULL);
-  JVMCI::oops_do(&rcl);
-  return rcl.complete();
-}
-#endif
-
 bool ReferenceToRootClosure::do_roots() {
   assert(!complete(), "invariant");
   assert(OldObjectRoot::_system_undetermined == _info._system, "invariant");
@@ -252,13 +239,6 @@
     return true;
   }
 
-#if INCLUDE_JVMCI
-  if (do_jvmci_roots()) {
-   _complete = true;
-    return true;
-  }
-#endif
-
   return false;
 }
 
--- a/src/hotspot/share/jvmci/jvmci.cpp	Wed Jul 17 08:33:38 2019 -0400
+++ b/src/hotspot/share/jvmci/jvmci.cpp	Thu Jul 18 14:57:32 2019 -0400
@@ -24,7 +24,7 @@
 #include "precompiled.hpp"
 #include "classfile/systemDictionary.hpp"
 #include "gc/shared/collectedHeap.hpp"
-#include "gc/shared/oopStorage.inline.hpp"
+#include "gc/shared/oopStorage.hpp"
 #include "jvmci/jvmci.hpp"
 #include "jvmci/jvmciJavaClasses.hpp"
 #include "jvmci/jvmciRuntime.hpp"
@@ -58,9 +58,7 @@
 }
 
 void JVMCI::initialize_globals() {
-  _object_handles = new OopStorage("JVMCI Global Oop Handles",
-                                   JVMCIGlobalAlloc_lock,
-                                   JVMCIGlobalActive_lock);
+  _object_handles = SystemDictionary::vm_global_oop_storage();
   _metadata_handles = MetadataHandleBlock::allocate_block();
   if (UseJVMCINativeLibrary) {
     // There are two runtimes.
@@ -115,12 +113,6 @@
   _metadata_handles->chain_free_list(handle);
 }
 
-void JVMCI::oops_do(OopClosure* f) {
-  if (_object_handles != NULL) {
-    _object_handles->oops_do(f);
-  }
-}
-
 void JVMCI::metadata_do(void f(Metadata*)) {
   if (_metadata_handles != NULL) {
     _metadata_handles->metadata_do(f);
--- a/src/hotspot/share/jvmci/jvmci.hpp	Wed Jul 17 08:33:38 2019 -0400
+++ b/src/hotspot/share/jvmci/jvmci.hpp	Thu Jul 18 14:57:32 2019 -0400
@@ -74,8 +74,6 @@
 
   static void metadata_do(void f(Metadata*));
 
-  static void oops_do(OopClosure* f);
-
   static void shutdown();
 
   static bool shutdown_called();
--- a/src/hotspot/share/prims/jvmtiTagMap.cpp	Wed Jul 17 08:33:38 2019 -0400
+++ b/src/hotspot/share/prims/jvmtiTagMap.cpp	Thu Jul 18 14:57:32 2019 -0400
@@ -63,9 +63,6 @@
 #if INCLUDE_ZGC
 #include "gc/z/zGlobals.hpp"
 #endif
-#if INCLUDE_JVMCI
-#include "jvmci/jvmci.hpp"
-#endif
 
 // JvmtiTagHashmapEntry
 //
@@ -3042,14 +3039,6 @@
     return false;
   }
 
-#if INCLUDE_JVMCI
-  blk.set_kind(JVMTI_HEAP_REFERENCE_OTHER);
-  JVMCI::oops_do(&blk);
-  if (blk.stopped()) {
-    return false;
-  }
-#endif
-
   return true;
 }
 
--- a/src/hotspot/share/runtime/mutex.hpp	Wed Jul 17 08:33:38 2019 -0400
+++ b/src/hotspot/share/runtime/mutex.hpp	Thu Jul 18 14:57:32 2019 -0400
@@ -64,8 +64,8 @@
        tty            = access         +   2,
        special        = tty            +   1,
        suspend_resume = special        +   1,
-       vmweak         = suspend_resume +   2,
-       leaf           = vmweak         +   2,
+       oopstorage     = suspend_resume +   2,
+       leaf           = oopstorage     +   2,
        safepoint      = leaf           +  10,
        barrier        = safepoint      +   1,
        nonleaf        = barrier        +   1,
--- a/src/hotspot/share/runtime/mutexLocker.cpp	Wed Jul 17 08:33:38 2019 -0400
+++ b/src/hotspot/share/runtime/mutexLocker.cpp	Thu Jul 18 14:57:32 2019 -0400
@@ -53,6 +53,8 @@
 Mutex*   StringTableWeakAlloc_lock    = NULL;
 Mutex*   StringTableWeakActive_lock   = NULL;
 Mutex*   JNIHandleBlockFreeList_lock  = NULL;
+Mutex*   VMGlobalAlloc_lock           = NULL;
+Mutex*   VMGlobalActive_lock          = NULL;
 Mutex*   VMWeakAlloc_lock             = NULL;
 Mutex*   VMWeakActive_lock            = NULL;
 Mutex*   ResolvedMethodTableWeakAlloc_lock  = NULL;
@@ -161,8 +163,6 @@
 
 #if INCLUDE_JVMCI
 Monitor* JVMCI_lock                   = NULL;
-Mutex*   JVMCIGlobalAlloc_lock        = NULL;
-Mutex*   JVMCIGlobalActive_lock       = NULL;
 #endif
 
 
@@ -216,14 +216,17 @@
   def(CGC_lock                     , PaddedMonitor, special,     true,  Monitor::_safepoint_check_never);      // coordinate between fore- and background GC
   def(STS_lock                     , PaddedMonitor, leaf,        true,  Monitor::_safepoint_check_never);
 
-  def(VMWeakAlloc_lock             , PaddedMutex  , vmweak,      true,  Monitor::_safepoint_check_never);
-  def(VMWeakActive_lock            , PaddedMutex  , vmweak-1,    true,  Monitor::_safepoint_check_never);
+  def(VMGlobalAlloc_lock           , PaddedMutex  , oopstorage,  true,  Monitor::_safepoint_check_never);
+  def(VMGlobalActive_lock          , PaddedMutex  , oopstorage-1,true,  Monitor::_safepoint_check_never);
+
+  def(VMWeakAlloc_lock             , PaddedMutex  , oopstorage,  true,  Monitor::_safepoint_check_never);
+  def(VMWeakActive_lock            , PaddedMutex  , oopstorage-1,true,  Monitor::_safepoint_check_never);
 
-  def(StringTableWeakAlloc_lock    , PaddedMutex  , vmweak,      true,  Monitor::_safepoint_check_never);
-  def(StringTableWeakActive_lock   , PaddedMutex  , vmweak-1,    true,  Monitor::_safepoint_check_never);
+  def(StringTableWeakAlloc_lock    , PaddedMutex  , oopstorage,  true,  Monitor::_safepoint_check_never);
+  def(StringTableWeakActive_lock   , PaddedMutex  , oopstorage-1,true,  Monitor::_safepoint_check_never);
 
-  def(ResolvedMethodTableWeakAlloc_lock    , PaddedMutex  , vmweak,      true,  Monitor::_safepoint_check_never);
-  def(ResolvedMethodTableWeakActive_lock   , PaddedMutex  , vmweak-1,    true,  Monitor::_safepoint_check_never);
+  def(ResolvedMethodTableWeakAlloc_lock    , PaddedMutex  , oopstorage,   true,  Monitor::_safepoint_check_never);
+  def(ResolvedMethodTableWeakActive_lock   , PaddedMutex  , oopstorage-1, true,  Monitor::_safepoint_check_never);
 
   def(FullGCCount_lock             , PaddedMonitor, leaf,        true,  Monitor::_safepoint_check_never);      // in support of ExplicitGCInvokesConcurrent
   if (UseG1GC) {
@@ -356,8 +359,6 @@
 
 #if INCLUDE_JVMCI
   def(JVMCI_lock                   , PaddedMonitor, nonleaf+2,   true,  Monitor::_safepoint_check_always);
-  def(JVMCIGlobalAlloc_lock        , PaddedMutex  , nonleaf,     true,  Monitor::_safepoint_check_never);
-  def(JVMCIGlobalActive_lock       , PaddedMutex  , nonleaf-1,   true,  Monitor::_safepoint_check_never);
 #endif
   def(DumpTimeTable_lock           , PaddedMutex  , leaf,        true,  Monitor::_safepoint_check_never);
 #endif // INCLUDE_CDS
--- a/src/hotspot/share/runtime/mutexLocker.hpp	Wed Jul 17 08:33:38 2019 -0400
+++ b/src/hotspot/share/runtime/mutexLocker.hpp	Thu Jul 18 14:57:32 2019 -0400
@@ -46,6 +46,8 @@
 extern Mutex*   StringTableWeakAlloc_lock;       // StringTable weak storage allocate list lock
 extern Mutex*   StringTableWeakActive_lock;      // STringTable weak storage active list lock
 extern Mutex*   JNIHandleBlockFreeList_lock;     // a lock on the JNI handle block free list
+extern Mutex*   VMGlobalAlloc_lock;              // VM Global Handles storage allocate list lock
+extern Mutex*   VMGlobalActive_lock;             // VM Global Handles storage active list lock
 extern Mutex*   VMWeakAlloc_lock;                // VM Weak Handles storage allocate list lock
 extern Mutex*   VMWeakActive_lock;               // VM Weak Handles storage active list lock
 extern Mutex*   ResolvedMethodTableWeakAlloc_lock;  // ResolvedMethodTable weak storage allocate list
@@ -157,8 +159,6 @@
 
 #if INCLUDE_JVMCI
 extern Monitor* JVMCI_lock;                      // Monitor to control initialization of JVMCI
-extern Mutex*   JVMCIGlobalAlloc_lock;           // JVMCI global storage allocate list lock
-extern Mutex*   JVMCIGlobalActive_lock;          // JVMCI global storage active list lock
 #endif
 
 // A MutexLocker provides mutual exclusion with respect to a given mutex
--- a/src/hotspot/share/runtime/serviceThread.cpp	Wed Jul 17 08:33:38 2019 -0400
+++ b/src/hotspot/share/runtime/serviceThread.cpp	Thu Jul 18 14:57:32 2019 -0400
@@ -94,6 +94,7 @@
     JNIHandles::global_handles(),
     JNIHandles::weak_global_handles(),
     StringTable::weak_storage(),
+    SystemDictionary::vm_global_oop_storage(),
     SystemDictionary::vm_weak_oop_storage()
   };
   const size_t oopstorage_count = ARRAY_SIZE(oopstorages);