8152846: Creation of ModuleEntryTable Investigate Need For OrderAccess::storestore()
authorhseigel
Wed, 06 Apr 2016 07:37:15 -0400
changeset 37415 35df58edb348
parent 37412 d5f8d53af5ec
child 37416 9f905b8b3718
8152846: Creation of ModuleEntryTable Investigate Need For OrderAccess::storestore() Summary: Remove the unneeded OrderAccess::storestore() call Reviewed-by: acorn, coleenp
hotspot/src/share/vm/classfile/classLoaderData.cpp
--- a/hotspot/src/share/vm/classfile/classLoaderData.cpp	Wed Apr 06 10:50:19 2016 +0300
+++ b/hotspot/src/share/vm/classfile/classLoaderData.cpp	Wed Apr 06 07:37:15 2016 -0400
@@ -373,13 +373,10 @@
   // Lazily create the package entry table at first request.
   if (_packages == NULL) {
     MutexLockerEx m1(metaspace_lock(), Mutex::_no_safepoint_check_flag);
-    // Check again if _packages has been allocated while we were getting this lock.
-    if (_packages != NULL) {
-      return _packages;
+    // Check if _packages got allocated while we were waiting for this lock.
+    if (_packages == NULL) {
+      _packages = new PackageEntryTable(PackageEntryTable::_packagetable_entry_size);
     }
-    // Ensure _packages is stable, since it is examined without a lock
-    OrderAccess::storestore();
-    _packages = new PackageEntryTable(PackageEntryTable::_packagetable_entry_size);
   }
   return _packages;
 }