Skip to content
Permalink
Browse files
8265012: Shenandoah: Backout JDK-8264718
Reviewed-by: shade
  • Loading branch information
zhengyu123 committed Apr 12, 2021
1 parent be0d46c commit 125184e96f577bbc031c3eba40b185b2b728b2c7
@@ -191,13 +191,8 @@ ShenandoahMarkConcurrentRootsTask::ShenandoahMarkConcurrentRootsTask(ShenandoahO
void ShenandoahMarkConcurrentRootsTask::work(uint worker_id) {
ShenandoahConcurrentWorkerSession worker_session(worker_id);
ShenandoahObjToScanQueue* q = _queue_set->queue(worker_id);
if (ShenandoahStringDedup::is_enabled()) {
ShenandoahMarkRefsDedupClosure cl(q, _rp);
_root_scanner.roots_do(&cl, worker_id);
} else {
ShenandoahMarkRefsClosure cl(q, _rp);
_root_scanner.roots_do(&cl, worker_id);
}
ShenandoahMarkRefsClosure cl(q, _rp);
_root_scanner.roots_do(&cl, worker_id);
}

void ShenandoahConcurrentMark::mark_concurrent_roots() {
@@ -41,6 +41,11 @@ ShenandoahMarkRefsSuperClosure::ShenandoahMarkRefsSuperClosure(ShenandoahObjToSc
_weak(false)
{ }

ShenandoahInitMarkRootsClosure::ShenandoahInitMarkRootsClosure(ShenandoahObjToScanQueue* q) :
_queue(q),
_mark_context(ShenandoahHeap::heap()->marking_context()) {
}

ShenandoahMark::ShenandoahMark() :
_task_queues(ShenandoahHeap::heap()->marking_context()->task_queues()) {
}
@@ -31,6 +31,21 @@

class ShenandoahCMDrainMarkingStackClosure;

class ShenandoahInitMarkRootsClosure : public OopClosure {
private:
ShenandoahObjToScanQueue* const _queue;
ShenandoahMarkingContext* const _mark_context;

template <class T>
inline void do_oop_work(T* p);

public:
ShenandoahInitMarkRootsClosure(ShenandoahObjToScanQueue* q);

void do_oop(narrowOop* p) { do_oop_work(p); }
void do_oop(oop* p) { do_oop_work(p); }
};

// Base class for mark
// Mark class does not maintain states. Instead, mark states are
// maintained by task queues, mark bitmap and SATB buffers (concurrent mark)
@@ -39,6 +39,11 @@
#include "runtime/prefetch.inline.hpp"
#include "utilities/powerOfTwo.hpp"

template <class T>
void ShenandoahInitMarkRootsClosure::do_oop_work(T* p) {
ShenandoahMark::mark_through_ref<T, NO_DEDUP>(p, _queue, _mark_context, false);
}

template <class T>
void ShenandoahMark::do_task(ShenandoahObjToScanQueue* q, T* cl, ShenandoahLiveData* live_data, ShenandoahMarkTask* task) {
oop obj = task->obj();
@@ -33,38 +33,9 @@
#include "gc/shenandoah/shenandoahOopClosures.inline.hpp"
#include "gc/shenandoah/shenandoahReferenceProcessor.hpp"
#include "gc/shenandoah/shenandoahRootProcessor.inline.hpp"
#include "gc/shenandoah/shenandoahStringDedup.hpp"
#include "gc/shenandoah/shenandoahSTWMark.hpp"
#include "gc/shenandoah/shenandoahVerifier.hpp"

template <StringDedupMode STRING_DEDUP>
class ShenandoahInitMarkRootsClosure : public OopClosure {
private:
ShenandoahObjToScanQueue* const _queue;
ShenandoahMarkingContext* const _mark_context;

template <class T>
inline void do_oop_work(T* p);

public:
ShenandoahInitMarkRootsClosure(ShenandoahObjToScanQueue* q);

void do_oop(narrowOop* p) { do_oop_work(p); }
void do_oop(oop* p) { do_oop_work(p); }
};

template <StringDedupMode STRING_DEDUP>
ShenandoahInitMarkRootsClosure<STRING_DEDUP>::ShenandoahInitMarkRootsClosure(ShenandoahObjToScanQueue* q) :
_queue(q),
_mark_context(ShenandoahHeap::heap()->marking_context()) {
}

template <StringDedupMode STRING_DEDUP>
template <class T>
void ShenandoahInitMarkRootsClosure<STRING_DEDUP>::do_oop_work(T* p) {
ShenandoahMark::mark_through_ref<T, STRING_DEDUP>(p, _queue, _mark_context, false);
}

class ShenandoahSTWMarkTask : public AbstractGangTask {
private:
ShenandoahSTWMark* const _mark;
@@ -128,13 +99,8 @@ void ShenandoahSTWMark::mark() {
}

void ShenandoahSTWMark::mark_roots(uint worker_id) {
if (ShenandoahStringDedup::is_enabled()) {
ShenandoahInitMarkRootsClosure<ENQUEUE_DEDUP> init_mark(task_queues()->queue(worker_id));
_root_scanner.roots_do(&init_mark, worker_id);
} else {
ShenandoahInitMarkRootsClosure<NO_DEDUP> init_mark(task_queues()->queue(worker_id));
_root_scanner.roots_do(&init_mark, worker_id);
}
ShenandoahInitMarkRootsClosure init_mark(task_queues()->queue(worker_id));
_root_scanner.roots_do(&init_mark, worker_id);
}

void ShenandoahSTWMark::finish_mark(uint worker_id) {
@@ -146,3 +112,4 @@ void ShenandoahSTWMark::finish_mark(uint worker_id) {
false, // not cancellable
ShenandoahStringDedup::is_enabled());
}

1 comment on commit 125184e

@openjdk-notifier

This comment has been minimized.

Copy link

@openjdk-notifier openjdk-notifier bot commented on 125184e Apr 12, 2021

Please sign in to comment.