41 #include "utilities/macros.hpp"
42 #ifdef COMPILER1
43 #include "gc/g1/c1/g1BarrierSetC1.hpp"
44 #endif
45 #ifdef COMPILER2
46 #include "gc/g1/c2/g1BarrierSetC2.hpp"
47 #endif
48
49 class G1BarrierSetC1;
50 class G1BarrierSetC2;
51
52 G1BarrierSet::G1BarrierSet(G1CardTable* card_table) :
53 CardTableBarrierSet(make_barrier_set_assembler<G1BarrierSetAssembler>(),
54 make_barrier_set_c1<G1BarrierSetC1>(),
55 make_barrier_set_c2<G1BarrierSetC2>(),
56 card_table,
57 BarrierSet::FakeRtti(BarrierSet::G1BarrierSet)),
58 _satb_mark_queue_buffer_allocator("SATB Buffer Allocator", G1SATBBufferSize),
59 _dirty_card_queue_buffer_allocator("DC Buffer Allocator", G1UpdateBufferSize),
60 _satb_mark_queue_set(),
61 _dirty_card_queue_set()
62 {}
63
64 void G1BarrierSet::enqueue(oop pre_val) {
65 // Nulls should have been already filtered.
66 assert(oopDesc::is_oop(pre_val, true), "Error");
67 G1ThreadLocalData::satb_mark_queue(Thread::current()).enqueue(pre_val);
68 }
69
70 template <class T> void
71 G1BarrierSet::write_ref_array_pre_work(T* dst, size_t count) {
72 if (!_satb_mark_queue_set.is_active()) return;
73 T* elem_ptr = dst;
74 for (size_t i = 0; i < count; i++, elem_ptr++) {
75 T heap_oop = RawAccess<>::oop_load(elem_ptr);
76 if (!CompressedOops::is_null(heap_oop)) {
77 enqueue(CompressedOops::decode_not_null(heap_oop));
78 }
79 }
80 }
81
|
41 #include "utilities/macros.hpp"
42 #ifdef COMPILER1
43 #include "gc/g1/c1/g1BarrierSetC1.hpp"
44 #endif
45 #ifdef COMPILER2
46 #include "gc/g1/c2/g1BarrierSetC2.hpp"
47 #endif
48
49 class G1BarrierSetC1;
50 class G1BarrierSetC2;
51
52 G1BarrierSet::G1BarrierSet(G1CardTable* card_table) :
53 CardTableBarrierSet(make_barrier_set_assembler<G1BarrierSetAssembler>(),
54 make_barrier_set_c1<G1BarrierSetC1>(),
55 make_barrier_set_c2<G1BarrierSetC2>(),
56 card_table,
57 BarrierSet::FakeRtti(BarrierSet::G1BarrierSet)),
58 _satb_mark_queue_buffer_allocator("SATB Buffer Allocator", G1SATBBufferSize),
59 _dirty_card_queue_buffer_allocator("DC Buffer Allocator", G1UpdateBufferSize),
60 _satb_mark_queue_set(),
61 _dirty_card_queue_set(),
62 _shared_dirty_card_queue(&_dirty_card_queue_set)
63 {}
64
65 void G1BarrierSet::enqueue(oop pre_val) {
66 // Nulls should have been already filtered.
67 assert(oopDesc::is_oop(pre_val, true), "Error");
68 G1ThreadLocalData::satb_mark_queue(Thread::current()).enqueue(pre_val);
69 }
70
71 template <class T> void
72 G1BarrierSet::write_ref_array_pre_work(T* dst, size_t count) {
73 if (!_satb_mark_queue_set.is_active()) return;
74 T* elem_ptr = dst;
75 for (size_t i = 0; i < count; i++, elem_ptr++) {
76 T heap_oop = RawAccess<>::oop_load(elem_ptr);
77 if (!CompressedOops::is_null(heap_oop)) {
78 enqueue(CompressedOops::decode_not_null(heap_oop));
79 }
80 }
81 }
82
|