8075247: Cleanup specialized_oop_closures.hpp
authorstefank
Tue, 17 Mar 2015 14:18:52 +0100
changeset 29688 2a0cad173059
parent 29687 281ffb2398cd
child 29689 dc72789f83ae
8075247: Cleanup specialized_oop_closures.hpp Reviewed-by: mgerdin, brutisso, tschatzl
hotspot/src/share/vm/gc_implementation/g1/g1OopClosures.hpp
hotspot/src/share/vm/gc_implementation/g1/g1_specialized_oop_closures.hpp
hotspot/src/share/vm/gc_implementation/g1/heapRegion.hpp
hotspot/src/share/vm/memory/specialized_oop_closures.hpp
hotspot/src/share/vm/oops/instanceClassLoaderKlass.cpp
hotspot/src/share/vm/oops/instanceClassLoaderKlass.hpp
hotspot/src/share/vm/oops/instanceKlass.cpp
hotspot/src/share/vm/oops/instanceKlass.hpp
hotspot/src/share/vm/oops/instanceMirrorKlass.cpp
hotspot/src/share/vm/oops/instanceMirrorKlass.hpp
hotspot/src/share/vm/oops/instanceRefKlass.cpp
hotspot/src/share/vm/oops/instanceRefKlass.hpp
hotspot/src/share/vm/oops/objArrayKlass.cpp
hotspot/src/share/vm/oops/objArrayOop.cpp
hotspot/src/share/vm/oops/objArrayOop.hpp
hotspot/src/share/vm/precompiled/precompiled.hpp
--- a/hotspot/src/share/vm/gc_implementation/g1/g1OopClosures.hpp	Tue Mar 17 13:23:49 2015 +0100
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1OopClosures.hpp	Tue Mar 17 14:18:52 2015 +0100
@@ -109,6 +109,18 @@
   template <class T> void do_klass_barrier(T* p, oop new_obj);
 };
 
+enum G1Barrier {
+  G1BarrierNone,
+  G1BarrierEvac,
+  G1BarrierKlass
+};
+
+enum G1Mark {
+  G1MarkNone,
+  G1MarkFromRoot,
+  G1MarkPromotedFromRoot
+};
+
 template <G1Barrier barrier, G1Mark do_mark_object>
 class G1ParCopyClosure : public G1ParCopyHelper {
 private:
--- a/hotspot/src/share/vm/gc_implementation/g1/g1_specialized_oop_closures.hpp	Tue Mar 17 13:23:49 2015 +0100
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1_specialized_oop_closures.hpp	Tue Mar 17 14:18:52 2015 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2015, 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
@@ -30,23 +30,8 @@
 // non-virtually, using a mechanism defined in this file.  Extend these
 // macros in the obvious way to add specializations for new closures.
 
-enum G1Barrier {
-  G1BarrierNone,
-  G1BarrierEvac,
-  G1BarrierKlass
-};
-
-enum G1Mark {
-  G1MarkNone,
-  G1MarkFromRoot,
-  G1MarkPromotedFromRoot
-};
-
 // Forward declarations.
 
-template<G1Barrier barrier, G1Mark do_mark_object>
-class G1ParCopyClosure;
-
 class G1ParScanClosure;
 class G1ParPushHeapRSClosure;
 
@@ -61,26 +46,16 @@
 class G1InvokeIfNotTriggeredClosure;
 class G1UpdateRSOrPushRefOopClosure;
 
-#ifdef FURTHER_SPECIALIZED_OOP_OOP_ITERATE_CLOSURES
-#error "FURTHER_SPECIALIZED_OOP_OOP_ITERATE_CLOSURES already defined."
-#endif
-
-#define FURTHER_SPECIALIZED_OOP_OOP_ITERATE_CLOSURES(f) \
-      f(G1ParScanClosure,_nv)                           \
-      f(G1ParPushHeapRSClosure,_nv)                     \
-      f(FilterIntoCSClosure,_nv)                        \
-      f(FilterOutOfRegionClosure,_nv)                   \
-      f(G1CMOopClosure,_nv)                             \
-      f(G1RootRegionScanClosure,_nv)                    \
-      f(G1Mux2Closure,_nv)                              \
-      f(G1TriggerClosure,_nv)                           \
-      f(G1InvokeIfNotTriggeredClosure,_nv)              \
+#define SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_G1(f) \
+      f(G1ParScanClosure,_nv)                      \
+      f(G1ParPushHeapRSClosure,_nv)                \
+      f(FilterIntoCSClosure,_nv)                   \
+      f(FilterOutOfRegionClosure,_nv)              \
+      f(G1CMOopClosure,_nv)                        \
+      f(G1RootRegionScanClosure,_nv)               \
+      f(G1Mux2Closure,_nv)                         \
+      f(G1TriggerClosure,_nv)                      \
+      f(G1InvokeIfNotTriggeredClosure,_nv)         \
       f(G1UpdateRSOrPushRefOopClosure,_nv)
 
-#ifdef FURTHER_SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES
-#error "FURTHER_SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES already defined."
-#endif
-
-#define FURTHER_SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES(f)
-
 #endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1_SPECIALIZED_OOP_CLOSURES_HPP
--- a/hotspot/src/share/vm/gc_implementation/g1/heapRegion.hpp	Tue Mar 17 13:23:49 2015 +0100
+++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegion.hpp	Tue Mar 17 14:18:52 2015 +0100
@@ -27,7 +27,6 @@
 
 #include "gc_implementation/g1/g1AllocationContext.hpp"
 #include "gc_implementation/g1/g1BlockOffsetTable.hpp"
-#include "gc_implementation/g1/g1_specialized_oop_closures.hpp"
 #include "gc_implementation/g1/heapRegionType.hpp"
 #include "gc_implementation/g1/survRateGroup.hpp"
 #include "gc_implementation/shared/ageTable.hpp"
--- a/hotspot/src/share/vm/memory/specialized_oop_closures.hpp	Tue Mar 17 13:23:49 2015 +0100
+++ b/hotspot/src/share/vm/memory/specialized_oop_closures.hpp	Tue Mar 17 14:18:52 2015 +0100
@@ -69,12 +69,6 @@
 // This is split into several because of a Visual C++ 6.0 compiler bug
 // where very long macros cause the compiler to crash
 
-// Some other heap might define further specialized closures.
-#ifndef FURTHER_SPECIALIZED_OOP_OOP_ITERATE_CLOSURES
-#define FURTHER_SPECIALIZED_OOP_OOP_ITERATE_CLOSURES(f) \
-        /* None */
-#endif
-
 #define SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_S(f)       \
   f(ScanClosure,_nv)                                    \
   f(FastScanClosure,_nv)                                \
@@ -94,7 +88,7 @@
   SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_P(f)
 
 #if INCLUDE_ALL_GCS
-#define SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_2(f)       \
+#define SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_CMS(f)     \
   f(MarkRefsIntoAndScanClosure,_nv)                     \
   f(Par_MarkRefsIntoAndScanClosure,_nv)                 \
   f(PushAndMarkClosure,_nv)                             \
@@ -102,8 +96,13 @@
   f(PushOrMarkClosure,_nv)                              \
   f(Par_PushOrMarkClosure,_nv)                          \
   f(CMSKeepAliveClosure,_nv)                            \
-  f(CMSInnerParMarkAndPushClosure,_nv)                  \
-  FURTHER_SPECIALIZED_OOP_OOP_ITERATE_CLOSURES(f)
+  f(CMSInnerParMarkAndPushClosure,_nv)
+#endif
+
+#if INCLUDE_ALL_GCS
+#define SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_2(f)       \
+  SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_CMS(f)           \
+  SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_G1(f)
 #else  // INCLUDE_ALL_GCS
 #define SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_2(f)
 #endif // INCLUDE_ALL_GCS
@@ -144,13 +143,6 @@
 // The "root_class" is the most general class to define; this may be
 // "OopClosure" in some applications and "OopsInGenClosure" in others.
 
-
-// Some other heap might define further specialized closures.
-#ifndef FURTHER_SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES
-#define FURTHER_SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES(f) \
-        /* None */
-#endif
-
 #define SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES_YOUNG_S(f) \
   f(ScanClosure,_nv)                                     \
   f(FastScanClosure,_nv)
@@ -158,8 +150,7 @@
 #if INCLUDE_ALL_GCS
 #define SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES_YOUNG_P(f) \
   f(ParScanWithBarrierClosure,_nv)                       \
-  f(ParScanWithoutBarrierClosure,_nv)                    \
-  FURTHER_SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES(f)
+  f(ParScanWithoutBarrierClosure,_nv)
 #else  // INCLUDE_ALL_GCS
 #define SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES_YOUNG_P(f)
 #endif // INCLUDE_ALL_GCS
--- a/hotspot/src/share/vm/oops/instanceClassLoaderKlass.cpp	Tue Mar 17 13:23:49 2015 +0100
+++ b/hotspot/src/share/vm/oops/instanceClassLoaderKlass.cpp	Tue Mar 17 14:18:52 2015 +0100
@@ -30,6 +30,7 @@
 #include "memory/genOopClosures.inline.hpp"
 #include "memory/iterator.inline.hpp"
 #include "memory/oopFactory.hpp"
+#include "memory/specialized_oop_closures.hpp"
 #include "oops/instanceKlass.hpp"
 #include "oops/instanceClassLoaderKlass.hpp"
 #include "oops/instanceMirrorKlass.hpp"
--- a/hotspot/src/share/vm/oops/instanceClassLoaderKlass.hpp	Tue Mar 17 13:23:49 2015 +0100
+++ b/hotspot/src/share/vm/oops/instanceClassLoaderKlass.hpp	Tue Mar 17 14:18:52 2015 +0100
@@ -25,6 +25,7 @@
 #ifndef SHARE_VM_OOPS_INSTANCECLASSLOADERKLASS_HPP
 #define SHARE_VM_OOPS_INSTANCECLASSLOADERKLASS_HPP
 
+#include "memory/specialized_oop_closures.hpp"
 #include "oops/instanceKlass.hpp"
 #include "utilities/macros.hpp"
 
--- a/hotspot/src/share/vm/oops/instanceKlass.cpp	Tue Mar 17 13:23:49 2015 +0100
+++ b/hotspot/src/share/vm/oops/instanceKlass.cpp	Tue Mar 17 14:18:52 2015 +0100
@@ -38,6 +38,7 @@
 #include "memory/iterator.inline.hpp"
 #include "memory/metadataFactory.hpp"
 #include "memory/oopFactory.hpp"
+#include "memory/specialized_oop_closures.hpp"
 #include "oops/fieldStreams.hpp"
 #include "oops/instanceClassLoaderKlass.hpp"
 #include "oops/instanceKlass.hpp"
--- a/hotspot/src/share/vm/oops/instanceKlass.hpp	Tue Mar 17 13:23:49 2015 +0100
+++ b/hotspot/src/share/vm/oops/instanceKlass.hpp	Tue Mar 17 14:18:52 2015 +0100
@@ -27,6 +27,7 @@
 
 #include "classfile/classLoaderData.hpp"
 #include "memory/referenceType.hpp"
+#include "memory/specialized_oop_closures.hpp"
 #include "oops/annotations.hpp"
 #include "oops/constMethod.hpp"
 #include "oops/fieldInfo.hpp"
--- a/hotspot/src/share/vm/oops/instanceMirrorKlass.cpp	Tue Mar 17 13:23:49 2015 +0100
+++ b/hotspot/src/share/vm/oops/instanceMirrorKlass.cpp	Tue Mar 17 14:18:52 2015 +0100
@@ -30,6 +30,7 @@
 #include "memory/genOopClosures.inline.hpp"
 #include "memory/iterator.inline.hpp"
 #include "memory/oopFactory.hpp"
+#include "memory/specialized_oop_closures.hpp"
 #include "oops/instanceKlass.hpp"
 #include "oops/instanceMirrorKlass.hpp"
 #include "oops/instanceOop.hpp"
--- a/hotspot/src/share/vm/oops/instanceMirrorKlass.hpp	Tue Mar 17 13:23:49 2015 +0100
+++ b/hotspot/src/share/vm/oops/instanceMirrorKlass.hpp	Tue Mar 17 14:18:52 2015 +0100
@@ -26,6 +26,7 @@
 #define SHARE_VM_OOPS_INSTANCEMIRRORKLASS_HPP
 
 #include "classfile/systemDictionary.hpp"
+#include "memory/specialized_oop_closures.hpp"
 #include "oops/instanceKlass.hpp"
 #include "runtime/handles.hpp"
 #include "utilities/macros.hpp"
--- a/hotspot/src/share/vm/oops/instanceRefKlass.cpp	Tue Mar 17 13:23:49 2015 +0100
+++ b/hotspot/src/share/vm/oops/instanceRefKlass.cpp	Tue Mar 17 14:18:52 2015 +0100
@@ -30,6 +30,7 @@
 #include "gc_interface/collectedHeap.inline.hpp"
 #include "memory/genCollectedHeap.hpp"
 #include "memory/genOopClosures.inline.hpp"
+#include "memory/specialized_oop_closures.hpp"
 #include "oops/instanceRefKlass.hpp"
 #include "oops/oop.inline.hpp"
 #include "utilities/preserveException.hpp"
--- a/hotspot/src/share/vm/oops/instanceRefKlass.hpp	Tue Mar 17 13:23:49 2015 +0100
+++ b/hotspot/src/share/vm/oops/instanceRefKlass.hpp	Tue Mar 17 14:18:52 2015 +0100
@@ -25,6 +25,7 @@
 #ifndef SHARE_VM_OOPS_INSTANCEREFKLASS_HPP
 #define SHARE_VM_OOPS_INSTANCEREFKLASS_HPP
 
+#include "memory/specialized_oop_closures.hpp"
 #include "oops/instanceKlass.hpp"
 #include "utilities/macros.hpp"
 
--- a/hotspot/src/share/vm/oops/objArrayKlass.cpp	Tue Mar 17 13:23:49 2015 +0100
+++ b/hotspot/src/share/vm/oops/objArrayKlass.cpp	Tue Mar 17 14:18:52 2015 +0100
@@ -32,6 +32,7 @@
 #include "memory/iterator.inline.hpp"
 #include "memory/metadataFactory.hpp"
 #include "memory/resourceArea.hpp"
+#include "memory/specialized_oop_closures.hpp"
 #include "memory/universe.inline.hpp"
 #include "oops/instanceKlass.hpp"
 #include "oops/klass.inline.hpp"
--- a/hotspot/src/share/vm/oops/objArrayOop.cpp	Tue Mar 17 13:23:49 2015 +0100
+++ b/hotspot/src/share/vm/oops/objArrayOop.cpp	Tue Mar 17 14:18:52 2015 +0100
@@ -23,6 +23,7 @@
  */
 
 #include "precompiled.hpp"
+#include "memory/specialized_oop_closures.hpp"
 #include "oops/objArrayKlass.hpp"
 #include "oops/objArrayOop.hpp"
 #include "oops/oop.inline.hpp"
--- a/hotspot/src/share/vm/oops/objArrayOop.hpp	Tue Mar 17 13:23:49 2015 +0100
+++ b/hotspot/src/share/vm/oops/objArrayOop.hpp	Tue Mar 17 14:18:52 2015 +0100
@@ -25,6 +25,7 @@
 #ifndef SHARE_VM_OOPS_OBJARRAYOOP_HPP
 #define SHARE_VM_OOPS_OBJARRAYOOP_HPP
 
+#include "memory/specialized_oop_closures.hpp"
 #include "oops/arrayOop.hpp"
 
 // An objArrayOop is an array containing oops.
--- a/hotspot/src/share/vm/precompiled/precompiled.hpp	Tue Mar 17 13:23:49 2015 +0100
+++ b/hotspot/src/share/vm/precompiled/precompiled.hpp	Tue Mar 17 14:18:52 2015 +0100
@@ -136,7 +136,6 @@
 # include "memory/sharedHeap.hpp"
 # include "memory/space.hpp"
 # include "memory/space.inline.hpp"
-# include "memory/specialized_oop_closures.hpp"
 # include "memory/threadLocalAllocBuffer.hpp"
 # include "memory/threadLocalAllocBuffer.inline.hpp"
 # include "memory/universe.hpp"
@@ -310,7 +309,6 @@
 # include "gc_implementation/g1/g1BlockOffsetTable.inline.hpp"
 # include "gc_implementation/g1/g1OopClosures.hpp"
 # include "gc_implementation/g1/g1_globals.hpp"
-# include "gc_implementation/g1/g1_specialized_oop_closures.hpp"
 # include "gc_implementation/g1/ptrQueue.hpp"
 # include "gc_implementation/g1/satbQueue.hpp"
 # include "gc_implementation/parNew/parOopClosures.hpp"