Skip to content
Permalink
Browse files
8254573: Shenandoah: Streamline/inline native-LRB entry point
Reviewed-by: shade
  • Loading branch information
rkennke committed Oct 12, 2020
1 parent a6c23b7 commit 6620b617a7f29e2e2d6185d6a40dd643a50070f3
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 38 deletions.
@@ -179,39 +179,6 @@ void ShenandoahBarrierSet::on_thread_detach(Thread *thread) {
}
}

oop ShenandoahBarrierSet::load_reference_barrier_native(oop obj, oop* load_addr) {
return load_reference_barrier_native_impl(obj, load_addr);
}

oop ShenandoahBarrierSet::load_reference_barrier_native(oop obj, narrowOop* load_addr) {
return load_reference_barrier_native_impl(obj, load_addr);
}

template <class T>
oop ShenandoahBarrierSet::load_reference_barrier_native_impl(oop obj, T* load_addr) {
if (CompressedOops::is_null(obj)) {
return NULL;
}

ShenandoahMarkingContext* const marking_context = _heap->marking_context();
if (_heap->is_concurrent_weak_root_in_progress() && !marking_context->is_marked(obj)) {
Thread* thr = Thread::current();
if (thr->is_Java_thread()) {
return NULL;
} else {
return obj;
}
}

oop fwd = load_reference_barrier_not_null(obj);
if (ShenandoahSelfFixing && load_addr != NULL && fwd != obj) {
// Since we are here and we know the load address, update the reference.
ShenandoahHeap::cas_oop(fwd, load_addr, obj);
}

return fwd;
}

void ShenandoahBarrierSet::clone_barrier_runtime(oop src) {
if (_heap->has_forwarded_objects() || (ShenandoahStoreValEnqueueBarrier && _heap->is_concurrent_mark_in_progress())) {
clone_barrier(src);
@@ -93,8 +93,8 @@ class ShenandoahBarrierSet: public BarrierSet {
template <class T>
inline oop load_reference_barrier_mutator(oop obj, T* load_addr);

oop load_reference_barrier_native(oop obj, oop* load_addr);
oop load_reference_barrier_native(oop obj, narrowOop* load_addr);
template <class T>
inline oop load_reference_barrier_native(oop obj, T* load_addr);

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

oop load_reference_barrier_impl(oop obj);

template <class T>
oop load_reference_barrier_native_impl(oop obj, T* load_addr);

inline bool need_bulk_update(HeapWord* dst);
public:
// Callbacks for runtime accesses.
@@ -76,6 +76,31 @@ inline oop ShenandoahBarrierSet::load_reference_barrier_mutator(oop obj, T* load
return fwd;
}

template <class T>
inline oop ShenandoahBarrierSet::load_reference_barrier_native(oop obj, T* load_addr) {
if (CompressedOops::is_null(obj)) {
return NULL;
}

ShenandoahMarkingContext* const marking_context = _heap->marking_context();
if (_heap->is_concurrent_weak_root_in_progress() && !marking_context->is_marked(obj)) {
Thread* thr = Thread::current();
if (thr->is_Java_thread()) {
return NULL;
} else {
return obj;
}
}

oop fwd = load_reference_barrier_not_null(obj);
if (ShenandoahSelfFixing && load_addr != NULL && fwd != obj) {
// Since we are here and we know the load address, update the reference.
ShenandoahHeap::cas_oop(fwd, load_addr, obj);
}

return fwd;
}

inline void ShenandoahBarrierSet::enqueue(oop obj) {
assert(obj != NULL, "checked by caller");
assert(_satb_mark_queue_set.is_active(), "only get here when SATB active");

1 comment on commit 6620b61

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented on 6620b61 Oct 12, 2020

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.