Skip to content

Commit 6620b61

Browse files
committed
8254573: Shenandoah: Streamline/inline native-LRB entry point
Reviewed-by: shade
1 parent a6c23b7 commit 6620b61

File tree

3 files changed

+27
-38
lines changed

3 files changed

+27
-38
lines changed

src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.cpp

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -179,39 +179,6 @@ void ShenandoahBarrierSet::on_thread_detach(Thread *thread) {
179179
}
180180
}
181181

182-
oop ShenandoahBarrierSet::load_reference_barrier_native(oop obj, oop* load_addr) {
183-
return load_reference_barrier_native_impl(obj, load_addr);
184-
}
185-
186-
oop ShenandoahBarrierSet::load_reference_barrier_native(oop obj, narrowOop* load_addr) {
187-
return load_reference_barrier_native_impl(obj, load_addr);
188-
}
189-
190-
template <class T>
191-
oop ShenandoahBarrierSet::load_reference_barrier_native_impl(oop obj, T* load_addr) {
192-
if (CompressedOops::is_null(obj)) {
193-
return NULL;
194-
}
195-
196-
ShenandoahMarkingContext* const marking_context = _heap->marking_context();
197-
if (_heap->is_concurrent_weak_root_in_progress() && !marking_context->is_marked(obj)) {
198-
Thread* thr = Thread::current();
199-
if (thr->is_Java_thread()) {
200-
return NULL;
201-
} else {
202-
return obj;
203-
}
204-
}
205-
206-
oop fwd = load_reference_barrier_not_null(obj);
207-
if (ShenandoahSelfFixing && load_addr != NULL && fwd != obj) {
208-
// Since we are here and we know the load address, update the reference.
209-
ShenandoahHeap::cas_oop(fwd, load_addr, obj);
210-
}
211-
212-
return fwd;
213-
}
214-
215182
void ShenandoahBarrierSet::clone_barrier_runtime(oop src) {
216183
if (_heap->has_forwarded_objects() || (ShenandoahStoreValEnqueueBarrier && _heap->is_concurrent_mark_in_progress())) {
217184
clone_barrier(src);

src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.hpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ class ShenandoahBarrierSet: public BarrierSet {
9393
template <class T>
9494
inline oop load_reference_barrier_mutator(oop obj, T* load_addr);
9595

96-
oop load_reference_barrier_native(oop obj, oop* load_addr);
97-
oop load_reference_barrier_native(oop obj, narrowOop* load_addr);
96+
template <class T>
97+
inline oop load_reference_barrier_native(oop obj, T* load_addr);
9898

9999
private:
100100
template <class T>
@@ -113,9 +113,6 @@ class ShenandoahBarrierSet: public BarrierSet {
113113

114114
oop load_reference_barrier_impl(oop obj);
115115

116-
template <class T>
117-
oop load_reference_barrier_native_impl(oop obj, T* load_addr);
118-
119116
inline bool need_bulk_update(HeapWord* dst);
120117
public:
121118
// Callbacks for runtime accesses.

src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.inline.hpp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,31 @@ inline oop ShenandoahBarrierSet::load_reference_barrier_mutator(oop obj, T* load
7676
return fwd;
7777
}
7878

79+
template <class T>
80+
inline oop ShenandoahBarrierSet::load_reference_barrier_native(oop obj, T* load_addr) {
81+
if (CompressedOops::is_null(obj)) {
82+
return NULL;
83+
}
84+
85+
ShenandoahMarkingContext* const marking_context = _heap->marking_context();
86+
if (_heap->is_concurrent_weak_root_in_progress() && !marking_context->is_marked(obj)) {
87+
Thread* thr = Thread::current();
88+
if (thr->is_Java_thread()) {
89+
return NULL;
90+
} else {
91+
return obj;
92+
}
93+
}
94+
95+
oop fwd = load_reference_barrier_not_null(obj);
96+
if (ShenandoahSelfFixing && load_addr != NULL && fwd != obj) {
97+
// Since we are here and we know the load address, update the reference.
98+
ShenandoahHeap::cas_oop(fwd, load_addr, obj);
99+
}
100+
101+
return fwd;
102+
}
103+
79104
inline void ShenandoahBarrierSet::enqueue(oop obj) {
80105
assert(obj != NULL, "checked by caller");
81106
assert(_satb_mark_queue_set.is_active(), "only get here when SATB active");

0 commit comments

Comments
 (0)