22 *
23 */
24
25 #ifndef SHARE_VM_GC_IMPLEMENTATION_G1_G1SATBCARDTABLEMODREFBS_HPP
26 #define SHARE_VM_GC_IMPLEMENTATION_G1_G1SATBCARDTABLEMODREFBS_HPP
27
28 #include "memory/cardTableModRefBS.hpp"
29 #include "memory/memRegion.hpp"
30 #include "oops/oop.inline.hpp"
31 #include "utilities/macros.hpp"
32
33 #if INCLUDE_ALL_GCS
34
35 class DirtyCardQueueSet;
36
37 // This barrier is specialized to use a logging barrier to support
38 // snapshot-at-the-beginning marking.
39
40 class G1SATBCardTableModRefBS: public CardTableModRefBSForCTRS {
41 public:
42 // Add "pre_val" to a set of objects that may have been disconnected from the
43 // pre-marking object graph.
44 static void enqueue(oop pre_val);
45
46 G1SATBCardTableModRefBS(MemRegion whole_heap,
47 int max_covered_regions);
48
49 bool is_a(BarrierSet::Name bsn) {
50 return bsn == BarrierSet::G1SATBCT || CardTableModRefBS::is_a(bsn);
51 }
52
53 virtual bool has_write_ref_pre_barrier() { return true; }
54
55 // This notes that we don't need to access any BarrierSet data
56 // structures, so this can be called from a static context.
57 template <class T> static void write_ref_field_pre_static(T* field, oop newVal) {
58 T heap_oop = oopDesc::load_heap_oop(field);
59 if (!oopDesc::is_null(heap_oop)) {
60 enqueue(oopDesc::decode_heap_oop(heap_oop));
61 }
|
22 *
23 */
24
25 #ifndef SHARE_VM_GC_IMPLEMENTATION_G1_G1SATBCARDTABLEMODREFBS_HPP
26 #define SHARE_VM_GC_IMPLEMENTATION_G1_G1SATBCARDTABLEMODREFBS_HPP
27
28 #include "memory/cardTableModRefBS.hpp"
29 #include "memory/memRegion.hpp"
30 #include "oops/oop.inline.hpp"
31 #include "utilities/macros.hpp"
32
33 #if INCLUDE_ALL_GCS
34
35 class DirtyCardQueueSet;
36
37 // This barrier is specialized to use a logging barrier to support
38 // snapshot-at-the-beginning marking.
39
40 class G1SATBCardTableModRefBS: public CardTableModRefBSForCTRS {
41 public:
42 void g1_dirty_young(const MemRegion& mr);
43
44 // Add "pre_val" to a set of objects that may have been disconnected from the
45 // pre-marking object graph.
46 static void enqueue(oop pre_val);
47
48 G1SATBCardTableModRefBS(MemRegion whole_heap,
49 int max_covered_regions);
50
51 bool is_a(BarrierSet::Name bsn) {
52 return bsn == BarrierSet::G1SATBCT || CardTableModRefBS::is_a(bsn);
53 }
54
55 virtual bool has_write_ref_pre_barrier() { return true; }
56
57 // This notes that we don't need to access any BarrierSet data
58 // structures, so this can be called from a static context.
59 template <class T> static void write_ref_field_pre_static(T* field, oop newVal) {
60 T heap_oop = oopDesc::load_heap_oop(field);
61 if (!oopDesc::is_null(heap_oop)) {
62 enqueue(oopDesc::decode_heap_oop(heap_oop));
63 }
|