Skip to content

Commit e809008

Browse files
committed
8300910: Remove metaprogramming/integralConstant.hpp
Backport-of: 048705c04967d106dedc09a4cf2325a3b46ef4e7
1 parent 952d272 commit e809008

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>
@@ -611,7 +610,7 @@ namespace AccessInternal {
611610
// not possible.
612611
struct PreRuntimeDispatch: AllStatic {
613612
template<DecoratorSet decorators>
614-
struct CanHardwireRaw: public IntegralConstant<
613+
struct CanHardwireRaw: public std::integral_constant<
615614
bool,
616615
!HasDecorator<decorators, INTERNAL_VALUE_IS_OOP>::value || // primitive access
617616
!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/allocation.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):
@@ -356,7 +357,7 @@ class markWord {
356357

357358
// Support atomic operations.
358359
template<>
359-
struct PrimitiveConversions::Translate<markWord> : public TrueType {
360+
struct PrimitiveConversions::Translate<markWord> : public std::true_type {
360361
typedef markWord Value;
361362
typedef uintptr_t Decayed;
362363

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
@@ -77,7 +79,7 @@ class OopHandle {
7779
// Convert OopHandle to oop*
7880

7981
template<>
80-
struct PrimitiveConversions::Translate<OopHandle> : public TrueType {
82+
struct PrimitiveConversions::Translate<OopHandle> : public std::true_type {
8183
typedef OopHandle Value;
8284
typedef oop* Decayed;
8385

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.
@@ -107,39 +108,39 @@ class oop {
107108
};
108109

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

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

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

145146
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 "utilities/exceptions.hpp"
3130
#include "utilities/ostream.hpp"
3231
#include "utilities/macros.hpp"

0 commit comments

Comments
 (0)