Skip to content

Commit 048705c

Browse files
jckingThomas Schatzl
authored andcommitted
8300910: Remove metaprogramming/integralConstant.hpp
Reviewed-by: kbarrett, tschatzl
1 parent 544c16e commit 048705c

File tree

8 files changed

+45
-99
lines changed

8 files changed

+45
-99
lines changed

src/hotspot/share/metaprogramming/integralConstant.hpp

Lines changed: 0 additions & 59 deletions
This file was deleted.

src/hotspot/share/oops/accessBackend.hpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
#include "gc/shared/barrierSetConfig.hpp"
2929
#include "memory/allocation.hpp"
3030
#include "metaprogramming/enableIf.hpp"
31-
#include "metaprogramming/integralConstant.hpp"
3231
#include "oops/accessDecorators.hpp"
3332
#include "oops/oopsHierarchy.hpp"
3433
#include "runtime/globals.hpp"
@@ -61,7 +60,7 @@ namespace AccessInternal {
6160
};
6261

6362
template <DecoratorSet decorators, typename T>
64-
struct MustConvertCompressedOop: public IntegralConstant<bool,
63+
struct MustConvertCompressedOop: public std::integral_constant<bool,
6564
HasDecorator<decorators, INTERNAL_VALUE_IS_OOP>::value &&
6665
std::is_same<typename HeapOopType<decorators>::type, narrowOop>::value &&
6766
std::is_same<T, oop>::value> {};
@@ -86,9 +85,9 @@ namespace AccessInternal {
8685
// locking to support wide atomics or not.
8786
template <typename T>
8887
#ifdef SUPPORTS_NATIVE_CX8
89-
struct PossiblyLockedAccess: public IntegralConstant<bool, false> {};
88+
struct PossiblyLockedAccess: public std::false_type {};
9089
#else
91-
struct PossiblyLockedAccess: public IntegralConstant<bool, (sizeof(T) > 4)> {};
90+
struct PossiblyLockedAccess: public std::integral_constant<bool, (sizeof(T) > 4)> {};
9291
#endif
9392

9493
template <DecoratorSet decorators, typename T>
@@ -626,7 +625,7 @@ namespace AccessInternal {
626625
// not possible.
627626
struct PreRuntimeDispatch: AllStatic {
628627
template<DecoratorSet decorators>
629-
struct CanHardwireRaw: public IntegralConstant<
628+
struct CanHardwireRaw: public std::integral_constant<
630629
bool,
631630
!HasDecorator<decorators, INTERNAL_VALUE_IS_OOP>::value || // primitive access
632631
!HasDecorator<decorators, INTERNAL_CONVERT_COMPRESSED_OOP>::value || // don't care about compressed oops (oop* address)

src/hotspot/share/oops/accessBackend.inline.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
#include "runtime/atomic.hpp"
3535
#include "runtime/orderAccess.hpp"
3636

37+
#include <type_traits>
38+
3739
template <DecoratorSet decorators>
3840
template <DecoratorSet idecorators, typename T>
3941
inline typename EnableIf<
@@ -251,7 +253,7 @@ RawAccessBarrier<ds>::atomic_cmpxchg_maybe_locked(void* addr, T compare_value, T
251253
}
252254

253255
class RawAccessBarrierArrayCopy: public AllStatic {
254-
template<typename T> struct IsHeapWordSized: public IntegralConstant<bool, sizeof(T) == HeapWordSize> { };
256+
template<typename T> struct IsHeapWordSized: public std::integral_constant<bool, sizeof(T) == HeapWordSize> { };
255257
public:
256258
template <DecoratorSet decorators, typename T>
257259
static inline typename EnableIf<
@@ -334,7 +336,7 @@ class RawAccessBarrierArrayCopy: public AllStatic {
334336
}
335337
};
336338

337-
template<> struct RawAccessBarrierArrayCopy::IsHeapWordSized<void>: public IntegralConstant<bool, false> { };
339+
template<> struct RawAccessBarrierArrayCopy::IsHeapWordSized<void>: public std::false_type { };
338340

339341
template <DecoratorSet decorators>
340342
template <typename T>

src/hotspot/share/oops/accessDecorators.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,10 @@
2727

2828
#include "gc/shared/barrierSetConfig.hpp"
2929
#include "memory/allStatic.hpp"
30-
#include "metaprogramming/integralConstant.hpp"
3130
#include "utilities/globalDefinitions.hpp"
3231

32+
#include <type_traits>
33+
3334
// A decorator is an attribute or property that affects the way a memory access is performed in some way.
3435
// There are different groups of decorators. Some have to do with memory ordering, others to do with,
3536
// e.g. strength of references, strength of GC barriers, or whether compression should be applied or not.
@@ -41,7 +42,7 @@ typedef uint64_t DecoratorSet;
4142
// The HasDecorator trait can help at compile-time determining whether a decorator set
4243
// has an intersection with a certain other decorator set
4344
template <DecoratorSet decorators, DecoratorSet decorator>
44-
struct HasDecorator: public IntegralConstant<bool, (decorators & decorator) != 0> {};
45+
struct HasDecorator: public std::integral_constant<bool, (decorators & decorator) != 0> {};
4546

4647
// == General Decorators ==
4748
// * DECORATORS_NONE: This is the name for the empty decorator set (in absence of other decorators).

src/hotspot/share/oops/markWord.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,12 @@
2525
#ifndef SHARE_OOPS_MARKWORD_HPP
2626
#define SHARE_OOPS_MARKWORD_HPP
2727

28-
#include "metaprogramming/integralConstant.hpp"
2928
#include "metaprogramming/primitiveConversions.hpp"
3029
#include "oops/oopsHierarchy.hpp"
3130
#include "runtime/globals.hpp"
3231

32+
#include <type_traits>
33+
3334
// The markWord describes the header of an object.
3435
//
3536
// Bit-format of an object header (most significant first, big endian layout below):
@@ -248,7 +249,7 @@ class markWord {
248249

249250
// Support atomic operations.
250251
template<>
251-
struct PrimitiveConversions::Translate<markWord> : public TrueType {
252+
struct PrimitiveConversions::Translate<markWord> : public std::true_type {
252253
typedef markWord Value;
253254
typedef uintptr_t Decayed;
254255

src/hotspot/share/oops/oopHandle.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
#include "metaprogramming/primitiveConversions.hpp"
2929
#include "oops/oopsHierarchy.hpp"
3030

31+
#include <type_traits>
32+
3133
class OopStorage;
3234

3335
// Simple classes for wrapping oop and atomically accessed oop pointers
@@ -76,7 +78,7 @@ class OopHandle {
7678
// Convert OopHandle to oop*
7779

7880
template<>
79-
struct PrimitiveConversions::Translate<OopHandle> : public TrueType {
81+
struct PrimitiveConversions::Translate<OopHandle> : public std::true_type {
8082
typedef OopHandle Value;
8183
typedef oop* Decayed;
8284

src/hotspot/share/oops/oopsHierarchy.hpp

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,11 @@
2525
#ifndef SHARE_OOPS_OOPSHIERARCHY_HPP
2626
#define SHARE_OOPS_OOPSHIERARCHY_HPP
2727

28-
#include "metaprogramming/integralConstant.hpp"
2928
#include "metaprogramming/primitiveConversions.hpp"
3029
#include "utilities/globalDefinitions.hpp"
3130

31+
#include <type_traits>
32+
3233
// OBJECT hierarchy
3334
// This hierarchy is a representation hierarchy, i.e. if A is a superclass
3435
// of B, A's representation is a prefix of B's representation.
@@ -108,39 +109,39 @@ class oop {
108109
};
109110

110111
template<>
111-
struct PrimitiveConversions::Translate<oop> : public TrueType {
112+
struct PrimitiveConversions::Translate<oop> : public std::true_type {
112113
typedef oop Value;
113114
typedef oopDesc* Decayed;
114115

115116
static Decayed decay(Value x) { return x.obj(); }
116117
static Value recover(Decayed x) { return oop(x); }
117118
};
118119

119-
#define DEF_OOP(type) \
120-
class type##OopDesc; \
121-
class type##Oop : public oop { \
122-
public: \
123-
type##Oop() : oop() {} \
124-
type##Oop(const type##Oop& o) : oop(o) {} \
125-
type##Oop(const oop& o) : oop(o) {} \
126-
type##Oop(type##OopDesc* o) : oop((oopDesc*)o) {} \
127-
operator type##OopDesc* () const { return (type##OopDesc*)obj(); } \
128-
type##OopDesc* operator->() const { \
129-
return (type##OopDesc*)obj(); \
130-
} \
131-
type##Oop& operator=(const type##Oop& o) { \
132-
oop::operator=(o); \
133-
return *this; \
134-
} \
135-
}; \
136-
\
137-
template<> \
138-
struct PrimitiveConversions::Translate<type##Oop> : public TrueType { \
139-
typedef type##Oop Value; \
140-
typedef type##OopDesc* Decayed; \
141-
\
142-
static Decayed decay(Value x) { return (type##OopDesc*)x.obj(); } \
143-
static Value recover(Decayed x) { return type##Oop(x); } \
120+
#define DEF_OOP(type) \
121+
class type##OopDesc; \
122+
class type##Oop : public oop { \
123+
public: \
124+
type##Oop() : oop() {} \
125+
type##Oop(const type##Oop& o) : oop(o) {} \
126+
type##Oop(const oop& o) : oop(o) {} \
127+
type##Oop(type##OopDesc* o) : oop((oopDesc*)o) {} \
128+
operator type##OopDesc* () const { return (type##OopDesc*)obj(); } \
129+
type##OopDesc* operator->() const { \
130+
return (type##OopDesc*)obj(); \
131+
} \
132+
type##Oop& operator=(const type##Oop& o) { \
133+
oop::operator=(o); \
134+
return *this; \
135+
} \
136+
}; \
137+
\
138+
template<> \
139+
struct PrimitiveConversions::Translate<type##Oop> : public std::true_type { \
140+
typedef type##Oop Value; \
141+
typedef type##OopDesc* Decayed; \
142+
\
143+
static Decayed decay(Value x) { return (type##OopDesc*)x.obj(); } \
144+
static Value recover(Decayed x) { return type##Oop(x); } \
144145
};
145146

146147
DEF_OOP(instance);

src/hotspot/share/runtime/os.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
#define SHARE_RUNTIME_OS_HPP
2727

2828
#include "jvm_md.h"
29-
#include "metaprogramming/integralConstant.hpp"
3029
#include "runtime/osInfo.hpp"
3130
#include "utilities/exceptions.hpp"
3231
#include "utilities/ostream.hpp"

0 commit comments

Comments
 (0)