Mercurial > hg > truffle
comparison src/share/vm/memory/referenceProcessor.hpp @ 14521:29ccc4cbabca
Merge
author | Gilles Duboscq <duboscq@ssw.jku.at> |
---|---|
date | Wed, 12 Mar 2014 13:30:08 +0100 |
parents | d8041d695d19 |
children | 4ca6dc0799b6 |
comparison
equal
deleted
inserted
replaced
14520:f84115370178 | 14521:29ccc4cbabca |
---|---|
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 BarrierSet* _bs; // Cached copy of BarrierSet. | |
239 bool _enqueuing_is_done; // true if all weak references enqueued | 241 bool _enqueuing_is_done; // true if all weak references enqueued |
240 bool _processing_is_mt; // true during phases when | 242 bool _processing_is_mt; // true during phases when |
241 // reference processing is MT. | 243 // reference processing is MT. |
242 uint _next_id; // round-robin mod _num_q counter in | 244 uint _next_id; // round-robin mod _num_q counter in |
243 // support of work distribution | 245 // support of work distribution |
379 | 381 |
380 void enqueue_discovered_reflists(HeapWord* pending_list_addr, AbstractRefProcTaskExecutor* task_executor); | 382 void enqueue_discovered_reflists(HeapWord* pending_list_addr, AbstractRefProcTaskExecutor* task_executor); |
381 | 383 |
382 protected: | 384 protected: |
383 // Set the 'discovered' field of the given reference to | 385 // Set the 'discovered' field of the given reference to |
384 // the given value - emitting barriers depending upon | 386 // the given value - emitting post barriers depending upon |
385 // the value of _discovered_list_needs_barrier. | 387 // the value of _discovered_list_needs_post_barrier. |
386 void set_discovered(oop ref, oop value); | 388 void set_discovered(oop ref, oop value); |
387 | 389 |
388 // "Preclean" the given discovered reference list | 390 // "Preclean" the given discovered reference list |
389 // by removing references with strongly reachable referents. | 391 // by removing references with strongly reachable referents. |
390 // Currently used in support of CMS only. | 392 // Currently used in support of CMS only. |
418 | 420 |
419 // Update (advance) the soft ref master clock field. | 421 // Update (advance) the soft ref master clock field. |
420 void update_soft_ref_master_clock(); | 422 void update_soft_ref_master_clock(); |
421 | 423 |
422 public: | 424 public: |
423 // constructor | |
424 ReferenceProcessor(): | |
425 _span((HeapWord*)NULL, (HeapWord*)NULL), | |
426 _discovered_refs(NULL), | |
427 _discoveredSoftRefs(NULL), _discoveredWeakRefs(NULL), | |
428 _discoveredFinalRefs(NULL), _discoveredPhantomRefs(NULL), | |
429 _discovering_refs(false), | |
430 _discovery_is_atomic(true), | |
431 _enqueuing_is_done(false), | |
432 _discovery_is_mt(false), | |
433 _discovered_list_needs_barrier(false), | |
434 _bs(NULL), | |
435 _is_alive_non_header(NULL), | |
436 _num_q(0), | |
437 _max_num_q(0), | |
438 _processing_is_mt(false), | |
439 _next_id(0) | |
440 { } | |
441 | |
442 // Default parameters give you a vanilla reference processor. | 425 // Default parameters give you a vanilla reference processor. |
443 ReferenceProcessor(MemRegion span, | 426 ReferenceProcessor(MemRegion span, |
444 bool mt_processing = false, uint mt_processing_degree = 1, | 427 bool mt_processing = false, uint mt_processing_degree = 1, |
445 bool mt_discovery = false, uint mt_discovery_degree = 1, | 428 bool mt_discovery = false, uint mt_discovery_degree = 1, |
446 bool atomic_discovery = true, | 429 bool atomic_discovery = true, |
447 BoolObjectClosure* is_alive_non_header = NULL, | 430 BoolObjectClosure* is_alive_non_header = NULL, |
448 bool discovered_list_needs_barrier = false); | 431 bool discovered_list_needs_post_barrier = false); |
449 | 432 |
450 // RefDiscoveryPolicy values | 433 // RefDiscoveryPolicy values |
451 enum DiscoveryPolicy { | 434 enum DiscoveryPolicy { |
452 ReferenceBasedDiscovery = 0, | 435 ReferenceBasedDiscovery = 0, |
453 ReferentBasedDiscovery = 1, | 436 ReferentBasedDiscovery = 1, |
492 | 475 |
493 // Whether we are in a phase when _processing_ is MT. | 476 // Whether we are in a phase when _processing_ is MT. |
494 bool processing_is_mt() const { return _processing_is_mt; } | 477 bool processing_is_mt() const { return _processing_is_mt; } |
495 void set_mt_processing(bool mt) { _processing_is_mt = mt; } | 478 void set_mt_processing(bool mt) { _processing_is_mt = mt; } |
496 | 479 |
497 // whether all enqueuing of weak references is complete | 480 // whether all enqueueing of weak references is complete |
498 bool enqueuing_is_done() { return _enqueuing_is_done; } | 481 bool enqueuing_is_done() { return _enqueuing_is_done; } |
499 void set_enqueuing_is_done(bool v) { _enqueuing_is_done = v; } | 482 void set_enqueuing_is_done(bool v) { _enqueuing_is_done = v; } |
500 | 483 |
501 // iterate over oops | 484 // iterate over oops |
502 void weak_oops_do(OopClosure* f); // weak roots | 485 void weak_oops_do(OopClosure* f); // weak roots |