Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8283566: G1: Improve G1BarrierSet::enqueue performance #7921

Closed
wants to merge 7 commits into from
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/hotspot/share/gc/g1/g1BarrierSet.hpp
Original file line number Diff line number Diff line change
@@ -58,8 +58,8 @@ class G1BarrierSet: public CardTableBarrierSet {
// Add "pre_val" to a set of objects that may have been disconnected from the
// pre-marking object graph. Prefer the version that takes location, as it
// can avoid touching the heap unnecessarily.
template <class T> static void enqueue(T* dst);
static void enqueue_oop(oop pre_val);
template <class T> static void enqueue_loc(T* dst);
static void enqueue(oop pre_val);

static void enqueue_if_weak(DecoratorSet decorators, oop value);

8 changes: 4 additions & 4 deletions src/hotspot/share/gc/g1/g1BarrierSet.inline.hpp
Original file line number Diff line number Diff line change
@@ -34,7 +34,7 @@
#include "oops/compressedOops.inline.hpp"
#include "oops/oop.hpp"

inline void G1BarrierSet::enqueue_oop(oop pre_val) {
inline void G1BarrierSet::enqueue(oop pre_val) {
// Nulls should have been already filtered.
assert(oopDesc::is_oop(pre_val, true), "Error");

@@ -46,7 +46,7 @@ inline void G1BarrierSet::enqueue_oop(oop pre_val) {
}

template <class T>
inline void G1BarrierSet::enqueue(T* dst) {
inline void G1BarrierSet::enqueue_loc(T* dst) {
G1SATBMarkQueueSet& queue_set = G1BarrierSet::satb_mark_queue_set();
if (!queue_set.is_active()) return;

@@ -64,7 +64,7 @@ inline void G1BarrierSet::write_ref_field_pre(T* field) {
return;
}

enqueue(field);
enqueue_loc(field);
}

template <DecoratorSet decorators, typename T>
@@ -86,7 +86,7 @@ inline void G1BarrierSet::enqueue_if_weak(DecoratorSet decorators, oop value) {
const bool needs_enqueue = (!peek && !on_strong_oop_ref);

if (needs_enqueue && value != NULL) {
enqueue_oop(value);
enqueue(value);
}
}

2 changes: 1 addition & 1 deletion src/hotspot/share/gc/g1/g1CollectedHeap.cpp
Original file line number Diff line number Diff line change
@@ -2279,7 +2279,7 @@ void G1CollectedHeap::object_iterate_parallel(ObjectClosure* cl, uint worker_id,
}

void G1CollectedHeap::keep_alive(oop obj) {
G1BarrierSet::enqueue_oop(obj);
G1BarrierSet::enqueue(obj);
}

void G1CollectedHeap::heap_region_iterate(HeapRegionClosure* cl) const {