Skip to content

Commit

Permalink
8299479: Remove metaprogramming/decay.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 11, 2023
1 parent ddca2b9 commit 10a747c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 104 deletions.
42 changes: 0 additions & 42 deletions src/hotspot/share/metaprogramming/decay.hpp

This file was deleted.

29 changes: 14 additions & 15 deletions src/hotspot/share/oops/accessBackend.hpp
Expand Up @@ -28,7 +28,6 @@
#include "gc/shared/barrierSetConfig.hpp"
#include "memory/allocation.hpp"
#include "metaprogramming/conditional.hpp"
#include "metaprogramming/decay.hpp"
#include "metaprogramming/enableIf.hpp"
#include "metaprogramming/integralConstant.hpp"
#include "metaprogramming/isIntegral.hpp"
Expand Down Expand Up @@ -429,7 +428,7 @@ namespace AccessInternal {
// to compile, as desired.
template <typename T>
struct OopOrNarrowOop: AllStatic {
typedef typename OopOrNarrowOopInternal<typename Decay<T>::type>::type type;
typedef typename OopOrNarrowOopInternal<std::decay_t<T>>::type type;
};

inline void* field_addr(oop base, ptrdiff_t byte_offset) {
Expand Down Expand Up @@ -1102,8 +1101,8 @@ namespace AccessInternal {
template <DecoratorSet decorators, typename P, typename T>
inline void store(P* addr, T value) {
verify_types<decorators, T>();
typedef typename Decay<P>::type DecayedP;
typedef typename Decay<T>::type DecayedT;
using DecayedP = std::decay_t<P>;
using DecayedT = std::decay_t<T>;
DecayedT decayed_value = value;
// If a volatile address is passed in but no memory ordering decorator,
// set the memory ordering to MO_RELAXED by default.
Expand All @@ -1116,7 +1115,7 @@ namespace AccessInternal {
template <DecoratorSet decorators, typename T>
inline void store_at(oop base, ptrdiff_t offset, T value) {
verify_types<decorators, T>();
typedef typename Decay<T>::type DecayedT;
using DecayedT = std::decay_t<T>;
DecayedT decayed_value = value;
const DecoratorSet expanded_decorators = DecoratorFixup<decorators |
(HasDecorator<decorators, INTERNAL_VALUE_IS_OOP>::value ?
Expand All @@ -1127,10 +1126,10 @@ namespace AccessInternal {
template <DecoratorSet decorators, typename P, typename T>
inline T load(P* addr) {
verify_types<decorators, T>();
typedef typename Decay<P>::type DecayedP;
using DecayedP = std::decay_t<P>;
typedef typename Conditional<HasDecorator<decorators, INTERNAL_VALUE_IS_OOP>::value,
typename OopOrNarrowOop<T>::type,
typename Decay<T>::type>::type DecayedT;
std::decay_t<T>>::type DecayedT;
// If a volatile address is passed in but no memory ordering decorator,
// set the memory ordering to MO_RELAXED by default.
const DecoratorSet expanded_decorators = DecoratorFixup<
Expand All @@ -1144,7 +1143,7 @@ namespace AccessInternal {
verify_types<decorators, T>();
typedef typename Conditional<HasDecorator<decorators, INTERNAL_VALUE_IS_OOP>::value,
typename OopOrNarrowOop<T>::type,
typename Decay<T>::type>::type DecayedT;
std::decay_t<T>>::type DecayedT;
// Expand the decorators (figure out sensible defaults)
// Potentially remember if we need compressed oop awareness
const DecoratorSet expanded_decorators = DecoratorFixup<decorators |
Expand All @@ -1156,8 +1155,8 @@ namespace AccessInternal {
template <DecoratorSet decorators, typename P, typename T>
inline T atomic_cmpxchg(P* addr, T compare_value, T new_value) {
verify_types<decorators, T>();
typedef typename Decay<P>::type DecayedP;
typedef typename Decay<T>::type DecayedT;
using DecayedP = std::decay_t<P>;
using DecayedT = std::decay_t<T>;
DecayedT new_decayed_value = new_value;
DecayedT compare_decayed_value = compare_value;
const DecoratorSet expanded_decorators = DecoratorFixup<
Expand All @@ -1171,7 +1170,7 @@ namespace AccessInternal {
template <DecoratorSet decorators, typename T>
inline T atomic_cmpxchg_at(oop base, ptrdiff_t offset, T compare_value, T new_value) {
verify_types<decorators, T>();
typedef typename Decay<T>::type DecayedT;
using DecayedT = std::decay_t<T>;
DecayedT new_decayed_value = new_value;
DecayedT compare_decayed_value = compare_value;
// Determine default memory ordering
Expand All @@ -1189,8 +1188,8 @@ namespace AccessInternal {
template <DecoratorSet decorators, typename P, typename T>
inline T atomic_xchg(P* addr, T new_value) {
verify_types<decorators, T>();
typedef typename Decay<P>::type DecayedP;
typedef typename Decay<T>::type DecayedT;
using DecayedP = std::decay_t<P>;
using DecayedT = std::decay_t<T>;
DecayedT new_decayed_value = new_value;
// atomic_xchg is only available in SEQ_CST flavour.
const DecoratorSet expanded_decorators = DecoratorFixup<decorators | MO_SEQ_CST>::value;
Expand All @@ -1201,7 +1200,7 @@ namespace AccessInternal {
template <DecoratorSet decorators, typename T>
inline T atomic_xchg_at(oop base, ptrdiff_t offset, T new_value) {
verify_types<decorators, T>();
typedef typename Decay<T>::type DecayedT;
using DecayedT = std::decay_t<T>;
DecayedT new_decayed_value = new_value;
// atomic_xchg is only available in SEQ_CST flavour.
const DecoratorSet expanded_decorators = DecoratorFixup<decorators | MO_SEQ_CST |
Expand All @@ -1217,7 +1216,7 @@ namespace AccessInternal {
STATIC_ASSERT((HasDecorator<decorators, INTERNAL_VALUE_IS_OOP>::value ||
(IsSame<T, void>::value || IsIntegral<T>::value) ||
std::is_floating_point<T>::value)); // arraycopy allows type erased void elements
typedef typename Decay<T>::type DecayedT;
using DecayedT = std::decay_t<T>;
const DecoratorSet expanded_decorators = DecoratorFixup<decorators | IS_ARRAY | IN_HEAP>::value;
return arraycopy_reduce_types<expanded_decorators>(src_obj, src_offset_in_bytes, const_cast<DecayedT*>(src_raw),
dst_obj, dst_offset_in_bytes, const_cast<DecayedT*>(dst_raw),
Expand Down
47 changes: 0 additions & 47 deletions test/hotspot/gtest/metaprogramming/test_decay.cpp

This file was deleted.

1 comment on commit 10a747c

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