Mercurial > hg > truffle
comparison src/share/vm/gc_implementation/g1/g1ParScanThreadState.hpp @ 20504:6948da6d7c13
8052172: Evacuation failure handling in G1 does not evacuate all objects if -XX:-G1DeferredRSUpdate is set
Summary: Remove -XX:-G1DeferredRSUpdate functionality as it is racy. During evacuation failure handling, threads where evacuation failure handling occurred may try to add remembered sets to regions which remembered sets are currently being scanned. The iterator to handle the remembered set scan does not support addition of entries during scan and so may skip valid references.
Reviewed-by: iveresov, brutisso, mgerdin
author | tschatzl |
---|---|
date | Tue, 30 Sep 2014 09:44:36 +0200 |
parents | 227a9e5e4b4a |
children |
comparison
equal
deleted
inserted
replaced
20503:fa56205f142c | 20504:6948da6d7c13 |
---|---|
80 void add_to_undo_waste(size_t waste) { _undo_waste += waste; } | 80 void add_to_undo_waste(size_t waste) { _undo_waste += waste; } |
81 | 81 |
82 DirtyCardQueue& dirty_card_queue() { return _dcq; } | 82 DirtyCardQueue& dirty_card_queue() { return _dcq; } |
83 G1SATBCardTableModRefBS* ctbs() { return _ct_bs; } | 83 G1SATBCardTableModRefBS* ctbs() { return _ct_bs; } |
84 | 84 |
85 template <class T> inline void immediate_rs_update(HeapRegion* from, T* p, int tid); | 85 public: |
86 | 86 G1ParScanThreadState(G1CollectedHeap* g1h, uint queue_num, ReferenceProcessor* rp); |
87 template <class T> void deferred_rs_update(HeapRegion* from, T* p, int tid) { | 87 ~G1ParScanThreadState(); |
88 | |
89 ageTable* age_table() { return &_age_table; } | |
90 | |
91 #ifdef ASSERT | |
92 bool queue_is_empty() const { return _refs->is_empty(); } | |
93 | |
94 bool verify_ref(narrowOop* ref) const; | |
95 bool verify_ref(oop* ref) const; | |
96 bool verify_task(StarTask ref) const; | |
97 #endif // ASSERT | |
98 | |
99 template <class T> void push_on_queue(T* ref) { | |
100 assert(verify_ref(ref), "sanity"); | |
101 _refs->push(ref); | |
102 } | |
103 | |
104 template <class T> void update_rs(HeapRegion* from, T* p, int tid) { | |
88 // If the new value of the field points to the same region or | 105 // If the new value of the field points to the same region or |
89 // is the to-space, we don't need to include it in the Rset updates. | 106 // is the to-space, we don't need to include it in the Rset updates. |
90 if (!from->is_in_reserved(oopDesc::load_decode_heap_oop(p)) && !from->is_survivor()) { | 107 if (!from->is_in_reserved(oopDesc::load_decode_heap_oop(p)) && !from->is_survivor()) { |
91 size_t card_index = ctbs()->index_for(p); | 108 size_t card_index = ctbs()->index_for(p); |
92 // If the card hasn't been added to the buffer, do it. | 109 // If the card hasn't been added to the buffer, do it. |
93 if (ctbs()->mark_card_deferred(card_index)) { | 110 if (ctbs()->mark_card_deferred(card_index)) { |
94 dirty_card_queue().enqueue((jbyte*)ctbs()->byte_for_index(card_index)); | 111 dirty_card_queue().enqueue((jbyte*)ctbs()->byte_for_index(card_index)); |
95 } | 112 } |
96 } | 113 } |
97 } | 114 } |
98 | |
99 public: | |
100 G1ParScanThreadState(G1CollectedHeap* g1h, uint queue_num, ReferenceProcessor* rp); | |
101 ~G1ParScanThreadState(); | |
102 | |
103 ageTable* age_table() { return &_age_table; } | |
104 | |
105 #ifdef ASSERT | |
106 bool queue_is_empty() const { return _refs->is_empty(); } | |
107 | |
108 bool verify_ref(narrowOop* ref) const; | |
109 bool verify_ref(oop* ref) const; | |
110 bool verify_task(StarTask ref) const; | |
111 #endif // ASSERT | |
112 | |
113 template <class T> void push_on_queue(T* ref) { | |
114 assert(verify_ref(ref), "sanity"); | |
115 _refs->push(ref); | |
116 } | |
117 | |
118 template <class T> inline void update_rs(HeapRegion* from, T* p, int tid); | |
119 | |
120 public: | 115 public: |
121 | 116 |
122 void set_evac_failure_closure(OopsInHeapRegionClosure* evac_failure_cl) { | 117 void set_evac_failure_closure(OopsInHeapRegionClosure* evac_failure_cl) { |
123 _evac_failure_cl = evac_failure_cl; | 118 _evac_failure_cl = evac_failure_cl; |
124 } | 119 } |