Skip to content

Commit

Permalink
8300264: Remove metaprogramming/isPointer.hpp
Browse files Browse the repository at this point in the history
Backport-of: eba87a0ee0410f61ae764293986ecc162f48c707
  • Loading branch information
gdams committed Jul 9, 2024
1 parent 9b39fff commit 5d5ca9c
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 104 deletions.
40 changes: 0 additions & 40 deletions src/hotspot/share/metaprogramming/isPointer.hpp

This file was deleted.

3 changes: 1 addition & 2 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/isPointer.hpp"
#include "metaprogramming/isSame.hpp"
#include "oops/accessDecorators.hpp"
#include "oops/oopsHierarchy.hpp"
Expand Down Expand Up @@ -1077,7 +1076,7 @@ namespace AccessInternal {
// If this fails to compile, then you have sent in something that is
// not recognized as a valid primitive type to a primitive Access function.
STATIC_ASSERT((HasDecorator<decorators, INTERNAL_VALUE_IS_OOP>::value || // oops have already been validated
(IsPointer<T>::value || std::is_integral<T>::value) ||
(std::is_pointer<T>::value || std::is_integral<T>::value) ||
std::is_floating_point<T>::value)); // not allowed primitive type
}

Expand Down
15 changes: 7 additions & 8 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/isPointer.hpp"
#include "metaprogramming/isSame.hpp"
#include "metaprogramming/isSigned.hpp"
#include "metaprogramming/primitiveConversions.hpp"
Expand Down Expand Up @@ -506,7 +505,7 @@ template<typename T, typename PlatformOp>
struct Atomic::LoadImpl<
T,
PlatformOp,
typename EnableIf<std::is_integral<T>::value || IsPointer<T>::value>::type>
typename EnableIf<std::is_integral<T>::value || std::is_pointer<T>::value>::type>
{
T operator()(T const volatile* dest) const {
// Forward to the platform handler for the size of T.
Expand Down Expand Up @@ -623,28 +622,28 @@ struct Atomic::PlatformStore {

template<typename D>
inline void Atomic::inc(D volatile* dest, atomic_memory_order order) {
STATIC_ASSERT(IsPointer<D>::value || std::is_integral<D>::value);
using I = std::conditional_t<IsPointer<D>::value, ptrdiff_t, D>;
STATIC_ASSERT(std::is_pointer<D>::value || std::is_integral<D>::value);
using I = std::conditional_t<std::is_pointer<D>::value, ptrdiff_t, D>;
Atomic::add(dest, I(1), order);
}

template<typename D>
inline void Atomic::dec(D volatile* dest, atomic_memory_order order) {
STATIC_ASSERT(IsPointer<D>::value || std::is_integral<D>::value);
using I = std::conditional_t<IsPointer<D>::value, ptrdiff_t, D>;
STATIC_ASSERT(std::is_pointer<D>::value || std::is_integral<D>::value);
using I = std::conditional_t<std::is_pointer<D>::value, ptrdiff_t, D>;
// Assumes two's complement integer representation.
#pragma warning(suppress: 4146)
Atomic::add(dest, I(-1), order);
}

template<typename D, typename I>
inline D Atomic::sub(D volatile* dest, I sub_value, atomic_memory_order order) {
STATIC_ASSERT(IsPointer<D>::value || std::is_integral<D>::value);
STATIC_ASSERT(std::is_pointer<D>::value || std::is_integral<D>::value);
STATIC_ASSERT(std::is_integral<I>::value);
// If D is a pointer type, use [u]intptr_t as the addend type,
// matching signedness of I. Otherwise, use D as the addend type.
using PI = std::conditional_t<IsSigned<I>::value, intptr_t, uintptr_t>;
using AddendType = std::conditional_t<IsPointer<D>::value, PI, D>;
using AddendType = std::conditional_t<std::is_pointer<D>::value, PI, D>;
// Only allow conversions that can't change the value.
STATIC_ASSERT(IsSigned<I>::value == IsSigned<AddendType>::value);
STATIC_ASSERT(sizeof(I) <= sizeof(AddendType));
Expand Down
4 changes: 3 additions & 1 deletion src/hotspot/share/utilities/concurrentHashTable.inline.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
#include "utilities/numberSeq.hpp"
#include "utilities/spinYield.hpp"

#include <type_traits>

// 2^30 = 1G buckets
#define SIZE_BIG_LOG2 30
// 2^5 = 32 buckets
Expand Down Expand Up @@ -499,7 +501,7 @@ inline void ConcurrentHashTable<CONFIG, F>::
Bucket* prefetch_bucket = (bucket_it+1) < stop_idx ?
table->get_bucket(bucket_it+1) : NULL;

if (!HaveDeletables<IsPointer<VALUE>::value, EVALUATE_FUNC>::
if (!HaveDeletables<std::is_pointer<VALUE>::value, EVALUATE_FUNC>::
have_deletable(bucket, eval_f, prefetch_bucket)) {
// Nothing to remove in this bucket.
continue;
Expand Down
53 changes: 0 additions & 53 deletions test/hotspot/gtest/metaprogramming/test_isPointer.cpp

This file was deleted.

1 comment on commit 5d5ca9c

@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.