Skip to content

Commit

Permalink
8300260: Remove metaprogramming/isSame.hpp
Browse files Browse the repository at this point in the history
Reviewed-by: mbaesken
Backport-of: c8dd7583a92082bcd2a4dfd5429889e7f0a44050
  • Loading branch information
gdams committed Jul 9, 2024
1 parent 3069e3e commit f9acc53
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 107 deletions.
20 changes: 11 additions & 9 deletions src/hotspot/share/memory/iterator.inline.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
#include "oops/typeArrayKlass.inline.hpp"
#include "utilities/debug.hpp"

#include <type_traits>

// Defaults to strong claiming.
inline MetadataVisitingOopIterateClosure::MetadataVisitingOopIterateClosure(ReferenceDiscoverer* rd) :
ClaimMetadataVisitingOopIterateClosure(ClassLoaderData::_claim_strong, rd) {}
Expand Down Expand Up @@ -94,16 +96,16 @@ inline void ClaimMetadataVisitingOopIterateClosure::do_klass(Klass* k) {
// p - The oop (or narrowOop) field to pass to the closure

template <typename T, typename Receiver, typename Base, typename OopClosureType>
static typename EnableIf<IsSame<Receiver, Base>::value, void>::type
static typename EnableIf<std::is_same<Receiver, Base>::value, void>::type
call_do_oop(void (Receiver::*)(T*), void (Base::*)(T*), OopClosureType* closure, T* p) {
closure->do_oop(p);
}

template <typename T, typename Receiver, typename Base, typename OopClosureType>
static typename EnableIf<!IsSame<Receiver, Base>::value, void>::type
static typename EnableIf<!std::is_same<Receiver, Base>::value, void>::type
call_do_oop(void (Receiver::*)(T*), void (Base::*)(T*), OopClosureType* closure, T* p) {
// Sanity check
STATIC_ASSERT((!IsSame<OopClosureType, OopIterateClosure>::value));
STATIC_ASSERT((!std::is_same<OopClosureType, OopIterateClosure>::value));
closure->OopClosureType::do_oop(p);
}

Expand All @@ -115,13 +117,13 @@ inline void Devirtualizer::do_oop(OopClosureType* closure, T* p) {
// Implementation of the non-virtual do_metadata dispatch.

template <typename Receiver, typename Base, typename OopClosureType>
static typename EnableIf<IsSame<Receiver, Base>::value, bool>::type
static typename EnableIf<std::is_same<Receiver, Base>::value, bool>::type
call_do_metadata(bool (Receiver::*)(), bool (Base::*)(), OopClosureType* closure) {
return closure->do_metadata();
}

template <typename Receiver, typename Base, typename OopClosureType>
static typename EnableIf<!IsSame<Receiver, Base>::value, bool>::type
static typename EnableIf<!std::is_same<Receiver, Base>::value, bool>::type
call_do_metadata(bool (Receiver::*)(), bool (Base::*)(), OopClosureType* closure) {
return closure->OopClosureType::do_metadata();
}
Expand All @@ -134,13 +136,13 @@ inline bool Devirtualizer::do_metadata(OopClosureType* closure) {
// Implementation of the non-virtual do_klass dispatch.

template <typename Receiver, typename Base, typename OopClosureType>
static typename EnableIf<IsSame<Receiver, Base>::value, void>::type
static typename EnableIf<std::is_same<Receiver, Base>::value, void>::type
call_do_klass(void (Receiver::*)(Klass*), void (Base::*)(Klass*), OopClosureType* closure, Klass* k) {
closure->do_klass(k);
}

template <typename Receiver, typename Base, typename OopClosureType>
static typename EnableIf<!IsSame<Receiver, Base>::value, void>::type
static typename EnableIf<!std::is_same<Receiver, Base>::value, void>::type
call_do_klass(void (Receiver::*)(Klass*), void (Base::*)(Klass*), OopClosureType* closure, Klass* k) {
closure->OopClosureType::do_klass(k);
}
Expand All @@ -153,13 +155,13 @@ inline void Devirtualizer::do_klass(OopClosureType* closure, Klass* k) {
// Implementation of the non-virtual do_cld dispatch.

template <typename Receiver, typename Base, typename OopClosureType>
static typename EnableIf<IsSame<Receiver, Base>::value, void>::type
static typename EnableIf<std::is_same<Receiver, Base>::value, void>::type
call_do_cld(void (Receiver::*)(ClassLoaderData*), void (Base::*)(ClassLoaderData*), OopClosureType* closure, ClassLoaderData* cld) {
closure->do_cld(cld);
}

template <typename Receiver, typename Base, typename OopClosureType>
static typename EnableIf<!IsSame<Receiver, Base>::value, void>::type
static typename EnableIf<!std::is_same<Receiver, Base>::value, void>::type
call_do_cld(void (Receiver::*)(ClassLoaderData*), void (Base::*)(ClassLoaderData*), OopClosureType* closure, ClassLoaderData* cld) {
closure->OopClosureType::do_cld(cld);
}
Expand Down
38 changes: 0 additions & 38 deletions src/hotspot/share/metaprogramming/isSame.hpp

This file was deleted.

7 changes: 3 additions & 4 deletions src/hotspot/share/oops/accessBackend.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#include "memory/allocation.hpp"
#include "metaprogramming/enableIf.hpp"
#include "metaprogramming/integralConstant.hpp"
#include "metaprogramming/isSame.hpp"
#include "oops/accessDecorators.hpp"
#include "oops/oopsHierarchy.hpp"
#include "runtime/globals.hpp"
Expand Down Expand Up @@ -64,8 +63,8 @@ namespace AccessInternal {
template <DecoratorSet decorators, typename T>
struct MustConvertCompressedOop: public IntegralConstant<bool,
HasDecorator<decorators, INTERNAL_VALUE_IS_OOP>::value &&
IsSame<typename HeapOopType<decorators>::type, narrowOop>::value &&
IsSame<T, oop>::value> {};
std::is_same<typename HeapOopType<decorators>::type, narrowOop>::value &&
std::is_same<T, oop>::value> {};

// This metafunction returns an appropriate oop type if the value is oop-like
// and otherwise returns the same type T.
Expand Down Expand Up @@ -1196,7 +1195,7 @@ namespace AccessInternal {
arrayOop dst_obj, size_t dst_offset_in_bytes, T* dst_raw,
size_t length) {
STATIC_ASSERT((HasDecorator<decorators, INTERNAL_VALUE_IS_OOP>::value ||
(IsSame<T, void>::value || std::is_integral<T>::value) ||
(std::is_same<T, void>::value || std::is_integral<T>::value) ||
std::is_floating_point<T>::value)); // arraycopy allows type erased void elements
using DecayedT = std::decay_t<T>;
const DecoratorSet expanded_decorators = DecoratorFixup<decorators | IS_ARRAY | IN_HEAP>::value;
Expand Down
5 changes: 2 additions & 3 deletions src/hotspot/share/runtime/atomic.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@

#include "memory/allocation.hpp"
#include "metaprogramming/enableIf.hpp"
#include "metaprogramming/isSame.hpp"
#include "metaprogramming/isSigned.hpp"
#include "metaprogramming/primitiveConversions.hpp"
#include "runtime/orderAccess.hpp"
Expand Down Expand Up @@ -999,8 +998,8 @@ template<typename D, typename U, typename T>
struct Atomic::CmpxchgImpl<
D*, U*, T*,
typename EnableIf<Atomic::IsPointerConvertible<T*, D*>::value &&
IsSame<std::remove_cv_t<D>,
std::remove_cv_t<U>>::value>::type>
std::is_same<std::remove_cv_t<D>,
std::remove_cv_t<U>>::value>::type>
{
D* operator()(D* volatile* dest, U* compare_value, T* exchange_value,
atomic_memory_order order) const {
Expand Down
51 changes: 0 additions & 51 deletions test/hotspot/gtest/metaprogramming/test_isSame.cpp

This file was deleted.

1 change: 0 additions & 1 deletion test/hotspot/gtest/metaprogramming/test_isSigned.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

#include "precompiled.hpp"
#include "memory/allocation.hpp"
#include "metaprogramming/isSame.hpp"
#include "metaprogramming/isSigned.hpp"
#include "utilities/debug.hpp"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

#include "precompiled.hpp"
#include "memory/allocation.hpp"
#include "metaprogramming/isSame.hpp"
#include "metaprogramming/primitiveConversions.hpp"
#include "unittest.hpp"
#include "utilities/debug.hpp"
Expand Down

0 comments on commit f9acc53

Please sign in to comment.