comparison src/share/vm/memory/referenceProcessor.hpp @ 14351:2cff20331ca2

8031703: Missing post-barrier in ReferenceProcessor Reviewed-by: tonyp, tschatzl
author pliden
date Thu, 06 Feb 2014 14:12:43 +0100
parents 63a4eb8bcd23
children d8041d695d19
comparison
equal deleted inserted replaced
14350:990d7aa2f325 14351:2cff20331ca2
97 oop _next; 97 oop _next;
98 HeapWord* _referent_addr; 98 HeapWord* _referent_addr;
99 oop _referent; 99 oop _referent;
100 OopClosure* _keep_alive; 100 OopClosure* _keep_alive;
101 BoolObjectClosure* _is_alive; 101 BoolObjectClosure* _is_alive;
102 bool _discovered_list_needs_post_barrier;
102 103
103 DEBUG_ONLY( 104 DEBUG_ONLY(
104 oop _first_seen; // cyclic linked list check 105 oop _first_seen; // cyclic linked list check
105 ) 106 )
106 107
110 ) 111 )
111 112
112 public: 113 public:
113 inline DiscoveredListIterator(DiscoveredList& refs_list, 114 inline DiscoveredListIterator(DiscoveredList& refs_list,
114 OopClosure* keep_alive, 115 OopClosure* keep_alive,
115 BoolObjectClosure* is_alive): 116 BoolObjectClosure* is_alive,
117 bool discovered_list_needs_post_barrier = false):
116 _refs_list(refs_list), 118 _refs_list(refs_list),
117 _prev_next(refs_list.adr_head()), 119 _prev_next(refs_list.adr_head()),
118 _prev(NULL), 120 _prev(NULL),
119 _ref(refs_list.head()), 121 _ref(refs_list.head()),
120 #ifdef ASSERT 122 #ifdef ASSERT
124 _processed(0), 126 _processed(0),
125 _removed(0), 127 _removed(0),
126 #endif 128 #endif
127 _next(NULL), 129 _next(NULL),
128 _keep_alive(keep_alive), 130 _keep_alive(keep_alive),
129 _is_alive(is_alive) 131 _is_alive(is_alive),
132 _discovered_list_needs_post_barrier(discovered_list_needs_post_barrier)
130 { } 133 { }
131 134
132 // End Of List. 135 // End Of List.
133 inline bool has_next() const { return _ref != NULL; } 136 inline bool has_next() const { return _ref != NULL; }
134 137
226 bool _discovery_is_atomic; // if discovery is atomic wrt 229 bool _discovery_is_atomic; // if discovery is atomic wrt
227 // other collectors in configuration 230 // other collectors in configuration
228 bool _discovery_is_mt; // true if reference discovery is MT. 231 bool _discovery_is_mt; // true if reference discovery is MT.
229 232
230 // If true, setting "next" field of a discovered refs list requires 233 // If true, setting "next" field of a discovered refs list requires
231 // write barrier(s). (Must be true if used in a collector in which 234 // write post barrier. (Must be true if used in a collector in which
232 // elements of a discovered list may be moved during discovery: for 235 // elements of a discovered list may be moved during discovery: for
233 // example, a collector like Garbage-First that moves objects during a 236 // example, a collector like Garbage-First that moves objects during a
234 // long-term concurrent marking phase that does weak reference 237 // long-term concurrent marking phase that does weak reference
235 // discovery.) 238 // discovery.)
236 bool _discovered_list_needs_barrier; 239 bool _discovered_list_needs_post_barrier;
237 240
238 bool _enqueuing_is_done; // true if all weak references enqueued 241 bool _enqueuing_is_done; // true if all weak references enqueued
239 bool _processing_is_mt; // true during phases when 242 bool _processing_is_mt; // true during phases when
240 // reference processing is MT. 243 // reference processing is MT.
241 uint _next_id; // round-robin mod _num_q counter in 244 uint _next_id; // round-robin mod _num_q counter in
378 381
379 void enqueue_discovered_reflists(HeapWord* pending_list_addr, AbstractRefProcTaskExecutor* task_executor); 382 void enqueue_discovered_reflists(HeapWord* pending_list_addr, AbstractRefProcTaskExecutor* task_executor);
380 383
381 protected: 384 protected:
382 // Set the 'discovered' field of the given reference to 385 // Set the 'discovered' field of the given reference to
383 // the given value - emitting barriers depending upon 386 // the given value - emitting post barriers depending upon
384 // the value of _discovered_list_needs_barrier. 387 // the value of _discovered_list_needs_post_barrier.
385 void set_discovered(oop ref, oop value); 388 void set_discovered(oop ref, oop value);
386 389
387 // "Preclean" the given discovered reference list 390 // "Preclean" the given discovered reference list
388 // by removing references with strongly reachable referents. 391 // by removing references with strongly reachable referents.
389 // Currently used in support of CMS only. 392 // Currently used in support of CMS only.
423 ReferenceProcessor(MemRegion span, 426 ReferenceProcessor(MemRegion span,
424 bool mt_processing = false, uint mt_processing_degree = 1, 427 bool mt_processing = false, uint mt_processing_degree = 1,
425 bool mt_discovery = false, uint mt_discovery_degree = 1, 428 bool mt_discovery = false, uint mt_discovery_degree = 1,
426 bool atomic_discovery = true, 429 bool atomic_discovery = true,
427 BoolObjectClosure* is_alive_non_header = NULL, 430 BoolObjectClosure* is_alive_non_header = NULL,
428 bool discovered_list_needs_barrier = false); 431 bool discovered_list_needs_post_barrier = false);
429 432
430 // RefDiscoveryPolicy values 433 // RefDiscoveryPolicy values
431 enum DiscoveryPolicy { 434 enum DiscoveryPolicy {
432 ReferenceBasedDiscovery = 0, 435 ReferenceBasedDiscovery = 0,
433 ReferentBasedDiscovery = 1, 436 ReferentBasedDiscovery = 1,