8215492: Rename INTERNAL_EMPTY to something less "internal"
authorpliden
Wed, 19 Dec 2018 23:40:05 +0100
changeset 53075 747d29313e5a
parent 53074 1e213c37befa
child 53076 dd5d7ba5b539
8215492: Rename INTERNAL_EMPTY to something less "internal" Reviewed-by: kbarrett, coleenp
src/hotspot/share/gc/shared/barrierSetConfig.hpp
src/hotspot/share/oops/access.cpp
src/hotspot/share/oops/access.hpp
src/hotspot/share/oops/accessBackend.hpp
src/hotspot/share/oops/accessDecorators.hpp
src/hotspot/share/runtime/jniHandles.cpp
src/hotspot/share/runtime/jniHandles.inline.hpp
--- a/src/hotspot/share/gc/shared/barrierSetConfig.hpp	Wed Dec 19 14:08:08 2018 -0800
+++ b/src/hotspot/share/gc/shared/barrierSetConfig.hpp	Wed Dec 19 23:40:05 2018 +0100
@@ -48,11 +48,11 @@
 #ifdef SUPPORT_BARRIER_ON_PRIMITIVES
 #define ACCESS_PRIMITIVE_SUPPORT INTERNAL_BT_BARRIER_ON_PRIMITIVES
 #else
-#define ACCESS_PRIMITIVE_SUPPORT INTERNAL_EMPTY
+#define ACCESS_PRIMITIVE_SUPPORT DECORATORS_NONE
 #endif
 
 #ifdef SUPPORT_NOT_TO_SPACE_INVARIANT
-#define ACCESS_TO_SPACE_INVARIANT_SUPPORT INTERNAL_EMPTY
+#define ACCESS_TO_SPACE_INVARIANT_SUPPORT DECORATORS_NONE
 #else
 #define ACCESS_TO_SPACE_INVARIANT_SUPPORT INTERNAL_BT_TO_SPACE_INVARIANT
 #endif
--- a/src/hotspot/share/oops/access.cpp	Wed Dec 19 14:08:08 2018 -0800
+++ b/src/hotspot/share/oops/access.cpp	Wed Dec 19 23:40:05 2018 +0100
@@ -32,5 +32,5 @@
   template struct RuntimeDispatch<DecoratorFixup<decorators>::value, T, barrier_type>
 
 namespace AccessInternal {
-  INSTANTIATE_HPP_ACCESS(INTERNAL_EMPTY, oop, BARRIER_EQUALS);
+  INSTANTIATE_HPP_ACCESS(DECORATORS_NONE, oop, BARRIER_EQUALS);
 }
--- a/src/hotspot/share/oops/access.hpp	Wed Dec 19 14:08:08 2018 -0800
+++ b/src/hotspot/share/oops/access.hpp	Wed Dec 19 23:40:05 2018 +0100
@@ -92,7 +92,7 @@
 // access.inline.hpp. The accesses that are allowed through the access.hpp file
 // must be instantiated in access.cpp using the INSTANTIATE_HPP_ACCESS macro.
 
-template <DecoratorSet decorators = INTERNAL_EMPTY>
+template <DecoratorSet decorators = DECORATORS_NONE>
 class Access: public AllStatic {
   // This function asserts that if an access gets passed in a decorator outside
   // of the expected_decorators, then something is wrong. It additionally checks
@@ -272,7 +272,7 @@
   }
 
   static oop resolve(oop obj) {
-    verify_decorators<INTERNAL_EMPTY>();
+    verify_decorators<DECORATORS_NONE>();
     return AccessInternal::resolve<decorators>(obj);
   }
 
@@ -284,21 +284,21 @@
 
 // Helper for performing raw accesses (knows only of memory ordering
 // atomicity decorators as well as compressed oops)
-template <DecoratorSet decorators = INTERNAL_EMPTY>
+template <DecoratorSet decorators = DECORATORS_NONE>
 class RawAccess: public Access<AS_RAW | decorators> {};
 
 // Helper for performing normal accesses on the heap. These accesses
 // may resolve an accessor on a GC barrier set
-template <DecoratorSet decorators = INTERNAL_EMPTY>
+template <DecoratorSet decorators = DECORATORS_NONE>
 class HeapAccess: public Access<IN_HEAP | decorators> {};
 
 // Helper for performing normal accesses in roots. These accesses
 // may resolve an accessor on a GC barrier set
-template <DecoratorSet decorators = INTERNAL_EMPTY>
+template <DecoratorSet decorators = DECORATORS_NONE>
 class NativeAccess: public Access<IN_NATIVE | decorators> {};
 
 // Helper for array access.
-template <DecoratorSet decorators = INTERNAL_EMPTY>
+template <DecoratorSet decorators = DECORATORS_NONE>
 class ArrayAccess: public HeapAccess<IS_ARRAY | decorators> {
   typedef HeapAccess<IS_ARRAY | decorators> AccessT;
 public:
--- a/src/hotspot/share/oops/accessBackend.hpp	Wed Dec 19 14:08:08 2018 -0800
+++ b/src/hotspot/share/oops/accessBackend.hpp	Wed Dec 19 23:40:05 2018 +0100
@@ -1192,7 +1192,7 @@
     DecayedT decayed_value = value;
     const DecoratorSet expanded_decorators = DecoratorFixup<decorators |
                                              (HasDecorator<decorators, INTERNAL_VALUE_IS_OOP>::value ?
-                                              INTERNAL_CONVERT_COMPRESSED_OOP : INTERNAL_EMPTY)>::value;
+                                              INTERNAL_CONVERT_COMPRESSED_OOP : DECORATORS_NONE)>::value;
     PreRuntimeDispatch::store_at<expanded_decorators>(base, offset, decayed_value);
   }
 
@@ -1221,7 +1221,7 @@
     // Potentially remember if we need compressed oop awareness
     const DecoratorSet expanded_decorators = DecoratorFixup<decorators |
                                              (HasDecorator<decorators, INTERNAL_VALUE_IS_OOP>::value ?
-                                              INTERNAL_CONVERT_COMPRESSED_OOP : INTERNAL_EMPTY)>::value;
+                                              INTERNAL_CONVERT_COMPRESSED_OOP : DECORATORS_NONE)>::value;
     return PreRuntimeDispatch::load_at<expanded_decorators, DecayedT>(base, offset);
   }
 
@@ -1253,7 +1253,7 @@
     // Potentially remember that we need compressed oop awareness
     const DecoratorSet final_decorators = expanded_decorators |
                                           (HasDecorator<decorators, INTERNAL_VALUE_IS_OOP>::value ?
-                                           INTERNAL_CONVERT_COMPRESSED_OOP : INTERNAL_EMPTY);
+                                           INTERNAL_CONVERT_COMPRESSED_OOP : DECORATORS_NONE);
     return PreRuntimeDispatch::atomic_cmpxchg_at<final_decorators>(new_decayed_value, base,
                                                                    offset, compare_decayed_value);
   }
@@ -1278,7 +1278,7 @@
     // atomic_xchg is only available in SEQ_CST flavour.
     const DecoratorSet expanded_decorators = DecoratorFixup<decorators | MO_SEQ_CST |
                                              (HasDecorator<decorators, INTERNAL_VALUE_IS_OOP>::value ?
-                                              INTERNAL_CONVERT_COMPRESSED_OOP : INTERNAL_EMPTY)>::value;
+                                              INTERNAL_CONVERT_COMPRESSED_OOP : DECORATORS_NONE)>::value;
     return PreRuntimeDispatch::atomic_xchg_at<expanded_decorators>(new_decayed_value, base, offset);
   }
 
--- a/src/hotspot/share/oops/accessDecorators.hpp	Wed Dec 19 14:08:08 2018 -0800
+++ b/src/hotspot/share/oops/accessDecorators.hpp	Wed Dec 19 23:40:05 2018 +0100
@@ -43,12 +43,14 @@
 template <DecoratorSet decorators, DecoratorSet decorator>
 struct HasDecorator: public IntegralConstant<bool, (decorators & decorator) != 0> {};
 
+// == General Decorators ==
+// * DECORATORS_NONE: This is the name for the empty decorator set (in absence of other decorators).
+const DecoratorSet DECORATORS_NONE                   = UCONST64(0);
+
 // == Internal Decorators - do not use ==
-// * INTERNAL_EMPTY: This is the name for the empty decorator set (in absence of other decorators).
 // * INTERNAL_CONVERT_COMPRESSED_OOPS: This is an oop access that will require converting an oop
 //   to a narrowOop or vice versa, if UseCompressedOops is known to be set.
 // * INTERNAL_VALUE_IS_OOP: Remember that the involved access is on oop rather than primitive.
-const DecoratorSet INTERNAL_EMPTY                    = UCONST64(0);
 const DecoratorSet INTERNAL_CONVERT_COMPRESSED_OOP   = UCONST64(1) << 1;
 const DecoratorSet INTERNAL_VALUE_IS_OOP             = UCONST64(1) << 2;
 
@@ -231,13 +233,13 @@
     // If no reference strength has been picked, then strong will be picked
     static const DecoratorSet ref_strength_default = input_decorators |
       (((ON_DECORATOR_MASK & input_decorators) == 0 && (INTERNAL_VALUE_IS_OOP & input_decorators) != 0) ?
-       ON_STRONG_OOP_REF : INTERNAL_EMPTY);
+       ON_STRONG_OOP_REF : DECORATORS_NONE);
     // If no memory ordering has been picked, unordered will be picked
     static const DecoratorSet memory_ordering_default = ref_strength_default |
-      ((MO_DECORATOR_MASK & ref_strength_default) == 0 ? MO_UNORDERED : INTERNAL_EMPTY);
+      ((MO_DECORATOR_MASK & ref_strength_default) == 0 ? MO_UNORDERED : DECORATORS_NONE);
     // If no barrier strength has been picked, normal will be used
     static const DecoratorSet barrier_strength_default = memory_ordering_default |
-      ((AS_DECORATOR_MASK & memory_ordering_default) == 0 ? AS_NORMAL : INTERNAL_EMPTY);
+      ((AS_DECORATOR_MASK & memory_ordering_default) == 0 ? AS_NORMAL : DECORATORS_NONE);
     static const DecoratorSet value = barrier_strength_default | BT_BUILDTIME_DECORATORS;
   };
 
@@ -247,13 +249,13 @@
     // If no reference strength has been picked, then strong will be picked
     DecoratorSet ref_strength_default = input_decorators |
       (((ON_DECORATOR_MASK & input_decorators) == 0 && (INTERNAL_VALUE_IS_OOP & input_decorators) != 0) ?
-       ON_STRONG_OOP_REF : INTERNAL_EMPTY);
+       ON_STRONG_OOP_REF : DECORATORS_NONE);
     // If no memory ordering has been picked, unordered will be picked
     DecoratorSet memory_ordering_default = ref_strength_default |
-      ((MO_DECORATOR_MASK & ref_strength_default) == 0 ? MO_UNORDERED : INTERNAL_EMPTY);
+      ((MO_DECORATOR_MASK & ref_strength_default) == 0 ? MO_UNORDERED : DECORATORS_NONE);
     // If no barrier strength has been picked, normal will be used
     DecoratorSet barrier_strength_default = memory_ordering_default |
-      ((AS_DECORATOR_MASK & memory_ordering_default) == 0 ? AS_NORMAL : INTERNAL_EMPTY);
+      ((AS_DECORATOR_MASK & memory_ordering_default) == 0 ? AS_NORMAL : DECORATORS_NONE);
     DecoratorSet value = barrier_strength_default | BT_BUILDTIME_DECORATORS;
     return value;
   }
--- a/src/hotspot/share/runtime/jniHandles.cpp	Wed Dec 19 14:08:08 2018 -0800
+++ b/src/hotspot/share/runtime/jniHandles.cpp	Wed Dec 19 23:40:05 2018 +0100
@@ -152,7 +152,7 @@
 oop JNIHandles::resolve_external_guard(jobject handle) {
   oop result = NULL;
   if (handle != NULL) {
-    result = resolve_impl<0 /* decorators */, true /* external_guard */>(handle);
+    result = resolve_impl<DECORATORS_NONE, true /* external_guard */>(handle);
   }
   return result;
 }
--- a/src/hotspot/share/runtime/jniHandles.inline.hpp	Wed Dec 19 14:08:08 2018 -0800
+++ b/src/hotspot/share/runtime/jniHandles.inline.hpp	Wed Dec 19 23:40:05 2018 +0100
@@ -68,7 +68,7 @@
 inline oop JNIHandles::resolve(jobject handle) {
   oop result = NULL;
   if (handle != NULL) {
-    result = resolve_impl<0 /* decorators */, false /* external_guard */>(handle);
+    result = resolve_impl<DECORATORS_NONE, false /* external_guard */>(handle);
   }
   return result;
 }
@@ -89,7 +89,7 @@
 
 inline oop JNIHandles::resolve_non_null(jobject handle) {
   assert(handle != NULL, "JNI handle should not be null");
-  oop result = resolve_impl<0 /* decorators */, false /* external_guard */>(handle);
+  oop result = resolve_impl<DECORATORS_NONE, false /* external_guard */>(handle);
   assert(result != NULL, "NULL read from jni handle");
   return result;
 }