51
51
#include " oops/oop.inline.hpp"
52
52
#include " runtime/handles.inline.hpp"
53
53
54
- template <UpdateRefsMode UPDATE_REFS>
55
54
class ShenandoahInitMarkRootsClosure : public OopClosure {
56
55
private:
57
56
ShenandoahObjToScanQueue* _queue;
@@ -60,7 +59,7 @@ class ShenandoahInitMarkRootsClosure : public OopClosure {
60
59
61
60
template <class T >
62
61
inline void do_oop_work (T* p) {
63
- ShenandoahConcurrentMark::mark_through_ref<T, UPDATE_REFS , NO_DEDUP>(p, _heap, _queue, _mark_context, false );
62
+ ShenandoahConcurrentMark::mark_through_ref<T, NONE , NO_DEDUP>(p, _heap, _queue, _mark_context, false );
64
63
}
65
64
66
65
public:
@@ -81,7 +80,6 @@ ShenandoahMarkRefsSuperClosure::ShenandoahMarkRefsSuperClosure(ShenandoahObjToSc
81
80
_weak(false )
82
81
{ }
83
82
84
- template <UpdateRefsMode UPDATE_REFS>
85
83
class ShenandoahInitMarkRootsTask : public AbstractGangTask {
86
84
private:
87
85
ShenandoahRootScanner* _rp;
@@ -101,7 +99,7 @@ class ShenandoahInitMarkRootsTask : public AbstractGangTask {
101
99
102
100
ShenandoahObjToScanQueue* q = queues->queue (worker_id);
103
101
104
- ShenandoahInitMarkRootsClosure<UPDATE_REFS> mark_cl (q);
102
+ ShenandoahInitMarkRootsClosure mark_cl (q);
105
103
do_work (heap, &mark_cl, worker_id);
106
104
}
107
105
@@ -301,15 +299,8 @@ void ShenandoahConcurrentMark::mark_roots(ShenandoahPhaseTimings::Phase root_pha
301
299
TASKQUEUE_STATS_ONLY (task_queues ()->reset_taskqueue_stats ());
302
300
task_queues ()->reserve (nworkers);
303
301
304
- if (heap->has_forwarded_objects ()) {
305
- ShenandoahInitMarkRootsTask<RESOLVE> mark_roots (&root_proc);
306
- workers->run_task (&mark_roots);
307
- } else {
308
- // No need to update references, which means the heap is stable.
309
- // Can save time not walking through forwarding pointers.
310
- ShenandoahInitMarkRootsTask<NONE> mark_roots (&root_proc);
311
- workers->run_task (&mark_roots);
312
- }
302
+ ShenandoahInitMarkRootsTask mark_roots (&root_proc);
303
+ workers->run_task (&mark_roots);
313
304
}
314
305
315
306
void ShenandoahConcurrentMark::update_roots (ShenandoahPhaseTimings::Phase root_phase) {
@@ -463,13 +454,8 @@ void ShenandoahConcurrentMark::finish_mark_from_roots(bool full_gc) {
463
454
ShenandoahPhaseTimings::full_gc_scan_conc_roots :
464
455
ShenandoahPhaseTimings::degen_gc_scan_conc_roots;
465
456
ShenandoahGCPhase gc_phase (phase);
466
- if (_heap->has_forwarded_objects ()) {
467
- ShenandoahProcessConcurrentRootsTask<ShenandoahMarkResolveRefsClosure> task (this , phase, nworkers);
468
- _heap->workers ()->run_task (&task);
469
- } else {
470
- ShenandoahProcessConcurrentRootsTask<ShenandoahMarkRefsClosure> task (this , phase, nworkers);
471
- _heap->workers ()->run_task (&task);
472
- }
457
+ ShenandoahProcessConcurrentRootsTask<ShenandoahMarkRefsClosure> task (this , phase, nworkers);
458
+ _heap->workers ()->run_task (&task);
473
459
}
474
460
475
461
// Finally mark everything else we've got in our queues during the previous steps.
0 commit comments