< prev index next >
src/share/vm/gc_implementation/shenandoah/shenandoahConcurrentMark.hpp
Print this page
rev 10662 : [backport] Improve liveness count during marking
rev 10663 : [backport] StringDedupMode enum for closures/method templates
rev 10668 : [backport] Cleanup buffered queue handling
rev 10669 : [backport] Clean up dead code
rev 10690 : [backport] Cleanup header files and forward declarations
rev 10693 : [backport] Handle update_refs, class_unload, ref_proc in ShConcMark better
rev 10694 : [backport] Common liveness cache in ShHeap
rev 10695 : [backport] Inline/rename confusingly named methods in ShConcurrentMark
rev 10696 : [backport] Sort ShenandoahConcurrentMark methods/fields into logical groups
rev 10706 : [backport] Make Shenandoah to use ShenandoahOWST only
rev 10715 : [backport] Cleanup up superfluous newlines
rev 10772 : [backport] Update copyrights
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2013, 2015, Red Hat, Inc. and/or its affiliates.
+ * Copyright (c) 2013, 2018, Red Hat, Inc. All rights reserved.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
@@ -23,36 +23,27 @@
#ifndef SHARE_VM_GC_SHENANDOAH_SHENANDOAHCONCURRENTMARK_HPP
#define SHARE_VM_GC_SHENANDOAH_SHENANDOAHCONCURRENTMARK_HPP
#include "utilities/taskqueue.hpp"
-#include "utilities/workgroup.hpp"
+#include "gc_implementation/shenandoah/shenandoahOopClosures.hpp"
#include "gc_implementation/shenandoah/shenandoahTaskqueue.hpp"
#include "gc_implementation/shenandoah/shenandoahPhaseTimings.hpp"
class ShenandoahStrDedupQueue;
class ShenandoahConcurrentMark: public CHeapObj<mtGC> {
-
private:
ShenandoahHeap* _heap;
-
- // The per-worker-thread work queues
ShenandoahObjToScanQueueSet* _task_queues;
- ShenandoahSharedFlag _claimed_codecache;
-
- // Used for buffering per-region liveness data.
- // Needed since ShenandoahHeapRegion uses atomics to update liveness.
- //
- // The array has max-workers elements, each of which is an array of
- // jushort * max_regions. The choice of jushort is not accidental:
- // there is a tradeoff between static/dynamic footprint that translates
- // into cache pressure (which is already high during marking), and
- // too many atomic updates. size_t/jint is too large, jbyte is too small.
- jushort** _liveness_local;
+public:
+ void initialize(uint workers);
+ void cancel();
+// ---------- Marking loop and tasks
+//
private:
template <class T>
inline void do_task(ShenandoahObjToScanQueue* q, T* cl, jushort* live_data, ShenandoahMarkTask* task);
template <class T>
@@ -60,76 +51,60 @@
template <class T>
inline void do_chunked_array(ShenandoahObjToScanQueue* q, T* cl, oop array, int chunk, int pow);
inline void count_liveness(jushort* live_data, oop obj);
- inline void count_liveness_humongous(oop obj);
- // Actual mark loop with closures set up
template <class T, bool CANCELLABLE>
- void mark_loop_work(T* cl, jushort* live_data, uint worker_id, ParallelTaskTerminator *t);
+ void mark_loop_work(T* cl, jushort* live_data, uint worker_id, ShenandoahTaskTerminator *t);
template <bool CANCELLABLE>
- void mark_loop_prework(uint worker_id, ParallelTaskTerminator *terminator, ReferenceProcessor *rp,
- bool class_unload, bool update_refs, bool strdedup);
+ void mark_loop_prework(uint worker_id, ShenandoahTaskTerminator *terminator, ReferenceProcessor *rp, bool strdedup);
public:
- // Mark loop entry.
- // Translates dynamic arguments to template parameters with progressive currying.
- void mark_loop(uint worker_id, ParallelTaskTerminator* terminator, ReferenceProcessor *rp,
- bool cancellable,
- bool class_unload, bool update_refs, bool strdedup) {
+ void mark_loop(uint worker_id, ShenandoahTaskTerminator* terminator, ReferenceProcessor *rp,
+ bool cancellable, bool strdedup) {
if (cancellable) {
- mark_loop_prework<true>(worker_id, terminator, rp, class_unload, update_refs, strdedup);
+ mark_loop_prework<true>(worker_id, terminator, rp, strdedup);
} else {
- mark_loop_prework<false>(worker_id, terminator, rp, class_unload, update_refs, strdedup);
+ mark_loop_prework<false>(worker_id, terminator, rp, strdedup);
}
}
- // We need to do this later when the heap is already created.
- void initialize(uint workers);
-
- bool process_references() const;
- bool unload_classes() const;
-
- bool claim_codecache();
- void clear_claim_codecache();
-
- template<class T, UpdateRefsMode UPDATE_REFS>
- static inline void mark_through_ref(T* p, ShenandoahHeap* heap, ShenandoahObjToScanQueue* q, ShenandoahMarkingContext* const mark_context);
-
- template<class T, UpdateRefsMode UPDATE_REFS, bool STRING_DEDUP>
+ template<class T, UpdateRefsMode UPDATE_REFS, StringDedupMode STRING_DEDUP>
static inline void mark_through_ref(T* p, ShenandoahHeap* heap, ShenandoahObjToScanQueue* q, ShenandoahMarkingContext* const mark_context, ShenandoahStrDedupQueue* dq = NULL);
void mark_from_roots();
+ void finish_mark_from_roots(bool full_gc);
- // Prepares unmarked root objects by marking them and putting
- // them into the marking task queue.
- void init_mark_roots();
void mark_roots(ShenandoahPhaseTimings::Phase root_phase);
void update_roots(ShenandoahPhaseTimings::Phase root_phase);
- void shared_finish_mark_from_roots(bool full_gc);
- void finish_mark_from_roots();
- // Those are only needed public because they're called from closures.
-
- inline bool try_queue(ShenandoahObjToScanQueue* q, ShenandoahMarkTask &task);
-
- ShenandoahObjToScanQueue* get_queue(uint worker_id);
- void clear_queue(ShenandoahObjToScanQueue *q);
-
- ShenandoahObjToScanQueueSet* task_queues() { return _task_queues;}
-
- jushort* get_liveness(uint worker_id);
-
- void cancel();
+// ---------- Weak references
+//
+private:
+ void weak_refs_work(bool full_gc);
+ void weak_refs_work_doit(bool full_gc);
+public:
void preclean_weak_refs();
- void concurrent_scan_code_roots(uint worker_id, ReferenceProcessor* rp, bool update_ref);
+// ---------- Concurrent code cache
+//
private:
+ ShenandoahSharedFlag _claimed_codecache;
+
+public:
+ void concurrent_scan_code_roots(uint worker_id, ReferenceProcessor* rp);
+ bool claim_codecache();
+ void clear_claim_codecache();
+
+// ---------- Helpers
+// Used from closures, need to be public
+//
+public:
+ ShenandoahObjToScanQueue* get_queue(uint worker_id);
+ ShenandoahObjToScanQueueSet* task_queues() { return _task_queues; }
- void weak_refs_work(bool full_gc);
- void weak_refs_work_doit(bool full_gc);
};
#endif // SHARE_VM_GC_SHENANDOAH_SHENANDOAHCONCURRENTMARK_HPP
< prev index next >