Skip to content

Commit

Permalink
8300260: Remove metaprogramming/isSame.hpp
Browse files Browse the repository at this point in the history
Reviewed-by: tschatzl, kbarrett
  • Loading branch information
jcking authored and Kim Barrett committed Jan 21, 2023
1 parent a6c2a2a commit c8dd758
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 109 deletions.
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 @@ -1211,7 +1210,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 @@ -791,8 +790,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
24 changes: 13 additions & 11 deletions src/hotspot/share/utilities/devirtualizer.inline.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
#include "oops/access.inline.hpp"
#include "utilities/debug.hpp"

#include <type_traits>

// Implementation of the non-virtual do_oop dispatch.
//
// The same implementation is used for do_metadata, do_klass, and do_cld.
Expand Down Expand Up @@ -73,16 +75,16 @@
// 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 @@ -94,13 +96,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 @@ -113,13 +115,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 @@ -132,13 +134,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 All @@ -151,13 +153,13 @@ void Devirtualizer::do_cld(OopClosureType* closure, ClassLoaderData* cld) {
// Implementation of the non-virtual do_derived_oop dispatch.

template <typename Receiver, typename Base, typename DerivedOopClosureType>
static typename EnableIf<IsSame<Receiver, Base>::value, void>::type
static typename EnableIf<std::is_same<Receiver, Base>::value, void>::type
call_do_derived_oop(void (Receiver::*)(oop*, derived_pointer*), void (Base::*)(oop*, derived_pointer*), DerivedOopClosureType* closure, oop* base, derived_pointer* derived) {
closure->do_derived_oop(base, derived);
}

template <typename Receiver, typename Base, typename DerivedOopClosureType>
static typename EnableIf<!IsSame<Receiver, Base>::value, void>::type
static typename EnableIf<!std::is_same<Receiver, Base>::value, void>::type
call_do_derived_oop(void (Receiver::*)(oop*, derived_pointer*), void (Base::*)(oop*, derived_pointer*), DerivedOopClosureType* closure, oop* base, derived_pointer* derived) {
closure->DerivedOopClosureType::do_derived_oop(base, derived);
}
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

1 comment on commit c8dd758

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.