Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
8266519: Cleanup resolve() leftovers from BarrierSet et al
Backport-of: 7eccbd4fde58ea36d6a21a2c4ffa3bc5d0b38c10
  • Loading branch information
shipilev committed Nov 22, 2022
1 parent 5125320 commit 24ac347
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 41 deletions.
4 changes: 0 additions & 4 deletions src/hotspot/share/gc/shared/barrierSet.hpp
Expand Up @@ -310,10 +310,6 @@ class BarrierSet: public CHeapObj<mtGC> {
static void clone_in_heap(oop src, oop dst, size_t size) {
Raw::clone(src, dst, size);
}

static oop resolve(oop obj) {
return Raw::resolve(obj);
}
};
};

Expand Down
1 change: 0 additions & 1 deletion src/hotspot/share/oops/access.hpp
Expand Up @@ -57,7 +57,6 @@
// * atomic_xchg_at: Atomically swap a new value at an internal pointer address if previous value matched the compared value.
// * arraycopy: Copy data from one heap array to another heap array. The ArrayAccess class has convenience functions for this.
// * clone: Clone the contents of an object to a newly allocated object.
// * resolve: Resolve a stable to-space invariant oop that is guaranteed not to relocate its payload until a subsequent thread transition.
//
// == IMPLEMENTATION ==
// Each access goes through the following steps in a template pipeline.
Expand Down
14 changes: 0 additions & 14 deletions src/hotspot/share/oops/access.inline.hpp
Expand Up @@ -200,13 +200,6 @@ namespace AccessInternal {
}
};

template <class GCBarrierType, DecoratorSet decorators>
struct PostRuntimeDispatch<GCBarrierType, BARRIER_RESOLVE, decorators>: public AllStatic {
static oop access_barrier(oop obj) {
return GCBarrierType::resolve(obj);
}
};

// Resolving accessors with barriers from the barrier set happens in two steps.
// 1. Expand paths with runtime-decorators, e.g. is UseCompressedOops on or off.
// 2. Expand paths for each BarrierSet available in the system.
Expand Down Expand Up @@ -354,13 +347,6 @@ namespace AccessInternal {
_clone_func = function;
function(src, dst, size);
}

template <DecoratorSet decorators, typename T>
oop RuntimeDispatch<decorators, T, BARRIER_RESOLVE>::resolve_init(oop obj) {
func_t function = BarrierResolver<decorators, func_t, BARRIER_RESOLVE>::resolve_barrier();
_resolve_func = function;
return function(obj);
}
}

#endif // SHARE_OOPS_ACCESS_INLINE_HPP
23 changes: 1 addition & 22 deletions src/hotspot/share/oops/accessBackend.hpp
Expand Up @@ -63,8 +63,7 @@ namespace AccessInternal {
BARRIER_ATOMIC_XCHG,
BARRIER_ATOMIC_XCHG_AT,
BARRIER_ARRAYCOPY,
BARRIER_CLONE,
BARRIER_RESOLVE
BARRIER_CLONE
};

template <DecoratorSet decorators, typename T>
Expand Down Expand Up @@ -114,7 +113,6 @@ namespace AccessInternal {
arrayOop dst_obj, size_t dst_offset_in_bytes, T* dst_raw,
size_t length);
typedef void (*clone_func_t)(oop src, oop dst, size_t size);
typedef oop (*resolve_func_t)(oop obj);
};

template <DecoratorSet decorators>
Expand All @@ -141,7 +139,6 @@ namespace AccessInternal {
ACCESS_GENERATE_ACCESS_FUNCTION(BARRIER_ATOMIC_XCHG_AT, atomic_xchg_at_func_t);
ACCESS_GENERATE_ACCESS_FUNCTION(BARRIER_ARRAYCOPY, arraycopy_func_t);
ACCESS_GENERATE_ACCESS_FUNCTION(BARRIER_CLONE, clone_func_t);
ACCESS_GENERATE_ACCESS_FUNCTION(BARRIER_RESOLVE, resolve_func_t);
#undef ACCESS_GENERATE_ACCESS_FUNCTION

template <DecoratorSet decorators, typename T, BarrierType barrier_type>
Expand Down Expand Up @@ -391,8 +388,6 @@ class RawAccessBarrier: public AllStatic {
size_t length);

static void clone(oop src, oop dst, size_t size);

static oop resolve(oop obj) { return obj; }
};

// Below is the implementation of the first 4 steps of the template pipeline:
Expand Down Expand Up @@ -574,18 +569,6 @@ namespace AccessInternal {
}
};

template <DecoratorSet decorators, typename T>
struct RuntimeDispatch<decorators, T, BARRIER_RESOLVE>: AllStatic {
typedef typename AccessFunction<decorators, T, BARRIER_RESOLVE>::type func_t;
static func_t _resolve_func;

static oop resolve_init(oop obj);

static inline oop resolve(oop obj) {
return _resolve_func(obj);
}
};

// Initialize the function pointers to point to the resolving function.
template <DecoratorSet decorators, typename T>
typename AccessFunction<decorators, T, BARRIER_STORE>::type
Expand Down Expand Up @@ -627,10 +610,6 @@ namespace AccessInternal {
typename AccessFunction<decorators, T, BARRIER_CLONE>::type
RuntimeDispatch<decorators, T, BARRIER_CLONE>::_clone_func = &clone_init;

template <DecoratorSet decorators, typename T>
typename AccessFunction<decorators, T, BARRIER_RESOLVE>::type
RuntimeDispatch<decorators, T, BARRIER_RESOLVE>::_resolve_func = &resolve_init;

// Step 3: Pre-runtime dispatching.
// The PreRuntimeDispatch class is responsible for filtering the barrier strength
// decorators. That is, for AS_RAW, it hardwires the accesses without a runtime
Expand Down

1 comment on commit 24ac347

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