src/hotspot/share/oops/weakHandle.cpp
changeset 57828 35db8fba55f9
parent 54511 fbfcebad8e66
--- a/src/hotspot/share/oops/weakHandle.cpp	Wed Aug 21 16:19:17 2019 -0400
+++ b/src/hotspot/share/oops/weakHandle.cpp	Wed Aug 21 18:42:30 2019 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,26 +23,24 @@
  */
 
 #include "precompiled.hpp"
-#include "classfile/systemDictionary.hpp"
-#include "classfile/stringTable.hpp"
 #include "gc/shared/oopStorage.hpp"
+#include "gc/shared/oopStorageSet.hpp"
 #include "oops/access.inline.hpp"
 #include "oops/oop.hpp"
 #include "oops/weakHandle.inline.hpp"
-#include "prims/resolvedMethodTable.hpp"
 #include "utilities/debug.hpp"
 #include "utilities/ostream.hpp"
 
 template <> OopStorage* WeakHandle<vm_class_loader_data>::get_storage() {
-  return SystemDictionary::vm_weak_oop_storage();
+  return OopStorageSet::vm_weak();
 }
 
 template <> OopStorage* WeakHandle<vm_string_table_data>::get_storage() {
-  return StringTable::weak_storage();
+  return OopStorageSet::string_table_weak();
 }
 
 template <> OopStorage* WeakHandle<vm_resolved_method_table_data>::get_storage() {
-  return ResolvedMethodTable::weak_storage();
+  return OopStorageSet::resolved_method_table_weak();
 }
 
 template <WeakHandleType T>
@@ -50,7 +48,9 @@
   assert(obj() != NULL, "no need to create weak null oop");
   oop* oop_addr = get_storage()->allocate();
   if (oop_addr == NULL) {
-    vm_exit_out_of_memory(sizeof(oop*), OOM_MALLOC_ERROR, "Unable to create new weak oop handle in OopStorage");
+    vm_exit_out_of_memory(sizeof(oop*), OOM_MALLOC_ERROR,
+                          "Unable to create new weak oop handle in OopStorage %s",
+                          get_storage()->name());
   }
   // Create WeakHandle with address returned and store oop into it.
   NativeAccess<ON_PHANTOM_OOP_REF>::oop_store(oop_addr, obj());