Skip to content

Commit cb50d3b

Browse files
committed
8230808: Remove Access::equals()
Reviewed-by: tschatzl, shade
1 parent 0848c76 commit cb50d3b

File tree

6 files changed

+3
-105
lines changed

6 files changed

+3
-105
lines changed

src/hotspot/share/gc/shared/barrierSet.hpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -314,10 +314,6 @@ class BarrierSet: public CHeapObj<mtGC> {
314314
static oop resolve(oop obj) {
315315
return Raw::resolve(obj);
316316
}
317-
318-
static bool equals(oop o1, oop o2) {
319-
return Raw::equals(o1, o2);
320-
}
321317
};
322318
};
323319

src/hotspot/share/oops/access.cpp

Lines changed: 0 additions & 36 deletions
This file was deleted.

src/hotspot/share/oops/access.hpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@
5858
// * arraycopy: Copy data from one heap array to another heap array. The ArrayAccess class has convenience functions for this.
5959
// * clone: Clone the contents of an object to a newly allocated object.
6060
// * resolve: Resolve a stable to-space invariant oop that is guaranteed not to relocate its payload until a subsequent thread transition.
61-
// * equals: Object equality, e.g. when different copies of the same objects are in use (from-space vs. to-space)
6261
//
6362
// == IMPLEMENTATION ==
6463
// Each access goes through the following steps in a template pipeline.
@@ -275,11 +274,6 @@ class Access: public AllStatic {
275274
verify_decorators<DECORATORS_NONE>();
276275
return AccessInternal::resolve<decorators>(obj);
277276
}
278-
279-
static bool equals(oop o1, oop o2) {
280-
verify_decorators<AS_RAW>();
281-
return AccessInternal::equals<decorators>(o1, o2);
282-
}
283277
};
284278

285279
// Helper for performing raw accesses (knows only of memory ordering

src/hotspot/share/oops/access.inline.hpp

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -206,13 +206,6 @@ namespace AccessInternal {
206206
}
207207
};
208208

209-
template <class GCBarrierType, DecoratorSet decorators>
210-
struct PostRuntimeDispatch<GCBarrierType, BARRIER_EQUALS, decorators>: public AllStatic {
211-
static bool access_barrier(oop o1, oop o2) {
212-
return GCBarrierType::equals(o1, o2);
213-
}
214-
};
215-
216209
// Resolving accessors with barriers from the barrier set happens in two steps.
217210
// 1. Expand paths with runtime-decorators, e.g. is UseCompressedOops on or off.
218211
// 2. Expand paths for each BarrierSet available in the system.
@@ -367,13 +360,6 @@ namespace AccessInternal {
367360
_resolve_func = function;
368361
return function(obj);
369362
}
370-
371-
template <DecoratorSet decorators, typename T>
372-
bool RuntimeDispatch<decorators, T, BARRIER_EQUALS>::equals_init(oop o1, oop o2) {
373-
func_t function = BarrierResolver<decorators, func_t, BARRIER_EQUALS>::resolve_barrier();
374-
_equals_func = function;
375-
return function(o1, o2);
376-
}
377363
}
378364

379365
#endif // SHARE_OOPS_ACCESS_INLINE_HPP

src/hotspot/share/oops/accessBackend.hpp

Lines changed: 1 addition & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,7 @@ namespace AccessInternal {
6464
BARRIER_ATOMIC_XCHG_AT,
6565
BARRIER_ARRAYCOPY,
6666
BARRIER_CLONE,
67-
BARRIER_RESOLVE,
68-
BARRIER_EQUALS
67+
BARRIER_RESOLVE
6968
};
7069

7170
template <DecoratorSet decorators, typename T>
@@ -116,7 +115,6 @@ namespace AccessInternal {
116115
size_t length);
117116
typedef void (*clone_func_t)(oop src, oop dst, size_t size);
118117
typedef oop (*resolve_func_t)(oop obj);
119-
typedef bool (*equals_func_t)(oop o1, oop o2);
120118
};
121119

122120
template <DecoratorSet decorators>
@@ -144,7 +142,6 @@ namespace AccessInternal {
144142
ACCESS_GENERATE_ACCESS_FUNCTION(BARRIER_ARRAYCOPY, arraycopy_func_t);
145143
ACCESS_GENERATE_ACCESS_FUNCTION(BARRIER_CLONE, clone_func_t);
146144
ACCESS_GENERATE_ACCESS_FUNCTION(BARRIER_RESOLVE, resolve_func_t);
147-
ACCESS_GENERATE_ACCESS_FUNCTION(BARRIER_EQUALS, equals_func_t);
148145
#undef ACCESS_GENERATE_ACCESS_FUNCTION
149146

150147
template <DecoratorSet decorators, typename T, BarrierType barrier_type>
@@ -410,8 +407,6 @@ class RawAccessBarrier: public AllStatic {
410407
static void clone(oop src, oop dst, size_t size);
411408

412409
static oop resolve(oop obj) { return obj; }
413-
414-
static bool equals(oop o1, oop o2) { return (void*)o1 == (void*)o2; }
415410
};
416411

417412
// Below is the implementation of the first 4 steps of the template pipeline:
@@ -605,18 +600,6 @@ namespace AccessInternal {
605600
}
606601
};
607602

608-
template <DecoratorSet decorators, typename T>
609-
struct RuntimeDispatch<decorators, T, BARRIER_EQUALS>: AllStatic {
610-
typedef typename AccessFunction<decorators, T, BARRIER_EQUALS>::type func_t;
611-
static func_t _equals_func;
612-
613-
static bool equals_init(oop o1, oop o2);
614-
615-
static inline bool equals(oop o1, oop o2) {
616-
return _equals_func(o1, o2);
617-
}
618-
};
619-
620603
// Initialize the function pointers to point to the resolving function.
621604
template <DecoratorSet decorators, typename T>
622605
typename AccessFunction<decorators, T, BARRIER_STORE>::type
@@ -662,10 +645,6 @@ namespace AccessInternal {
662645
typename AccessFunction<decorators, T, BARRIER_RESOLVE>::type
663646
RuntimeDispatch<decorators, T, BARRIER_RESOLVE>::_resolve_func = &resolve_init;
664647

665-
template <DecoratorSet decorators, typename T>
666-
typename AccessFunction<decorators, T, BARRIER_EQUALS>::type
667-
RuntimeDispatch<decorators, T, BARRIER_EQUALS>::_equals_func = &equals_init;
668-
669648
// Step 3: Pre-runtime dispatching.
670649
// The PreRuntimeDispatch class is responsible for filtering the barrier strength
671650
// decorators. That is, for AS_RAW, it hardwires the accesses without a runtime
@@ -996,21 +975,6 @@ namespace AccessInternal {
996975
resolve(oop obj) {
997976
return RuntimeDispatch<decorators, oop, BARRIER_RESOLVE>::resolve(obj);
998977
}
999-
1000-
template <DecoratorSet decorators>
1001-
inline static typename EnableIf<
1002-
HasDecorator<decorators, AS_RAW>::value || HasDecorator<decorators, INTERNAL_BT_TO_SPACE_INVARIANT>::value, bool>::type
1003-
equals(oop o1, oop o2) {
1004-
typedef RawAccessBarrier<decorators & RAW_DECORATOR_MASK> Raw;
1005-
return Raw::equals(o1, o2);
1006-
}
1007-
1008-
template <DecoratorSet decorators>
1009-
inline static typename EnableIf<
1010-
!HasDecorator<decorators, AS_RAW>::value && !HasDecorator<decorators, INTERNAL_BT_TO_SPACE_INVARIANT>::value, bool>::type
1011-
equals(oop o1, oop o2) {
1012-
return RuntimeDispatch<decorators, oop, BARRIER_EQUALS>::equals(o1, o2);
1013-
}
1014978
};
1015979

1016980
// Step 2: Reduce types.
@@ -1309,12 +1273,6 @@ namespace AccessInternal {
13091273
return PreRuntimeDispatch::resolve<expanded_decorators>(obj);
13101274
}
13111275

1312-
template <DecoratorSet decorators>
1313-
inline bool equals(oop o1, oop o2) {
1314-
const DecoratorSet expanded_decorators = DecoratorFixup<decorators>::value;
1315-
return PreRuntimeDispatch::equals<expanded_decorators>(o1, o2);
1316-
}
1317-
13181276
// Infer the type that should be returned from an Access::oop_load.
13191277
template <typename P, DecoratorSet decorators>
13201278
class OopLoadProxy: public StackObj {

src/hotspot/share/oops/oop.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,9 @@ class oopDesc {
150150
}
151151
}
152152

153-
inline static bool equals(oop o1, oop o2) { return Access<>::equals(o1, o2); }
153+
inline static bool equals(oop o1, oop o2) { return equals_raw(o1, o2); }
154154

155-
inline static bool equals_raw(oop o1, oop o2) { return RawAccess<>::equals(o1, o2); }
155+
inline static bool equals_raw(oop o1, oop o2) { return o1 == o2; }
156156

157157
// Access to fields in a instanceOop through these methods.
158158
template <DecoratorSet decorator>

0 commit comments

Comments
 (0)