comparison src/share/vm/memory/referenceProcessor.hpp @ 4014:bf2d2b8b1726

7095243: Disambiguate ReferenceProcessor::_discoveredSoftRefs Summary: Add a new, separate, pointer to the base of the array of discovered reference lists and use this new pointer in places where we iterate over the entire array. Reviewed-by: ysr, brutisso
author johnc
date Mon, 17 Oct 2011 09:57:41 -0700
parents d1bdeef3e3e2
children 441e946dc1af
comparison
equal deleted inserted replaced
4013:074f0252cc13 4014:bf2d2b8b1726
253 253
254 // The active MT'ness degree of the queues below 254 // The active MT'ness degree of the queues below
255 int _num_q; 255 int _num_q;
256 // The maximum MT'ness degree of the queues below 256 // The maximum MT'ness degree of the queues below
257 int _max_num_q; 257 int _max_num_q;
258 // Arrays of lists of oops, one per thread 258
259 // Master array of discovered oops
260 DiscoveredList* _discovered_refs;
261
262 // Arrays of lists of oops, one per thread (pointers into master array above)
259 DiscoveredList* _discoveredSoftRefs; 263 DiscoveredList* _discoveredSoftRefs;
260 DiscoveredList* _discoveredWeakRefs; 264 DiscoveredList* _discoveredWeakRefs;
261 DiscoveredList* _discoveredFinalRefs; 265 DiscoveredList* _discoveredFinalRefs;
262 DiscoveredList* _discoveredPhantomRefs; 266 DiscoveredList* _discoveredPhantomRefs;
263 267
265 static int number_of_subclasses_of_ref() { return (REF_PHANTOM - REF_OTHER); } 269 static int number_of_subclasses_of_ref() { return (REF_PHANTOM - REF_OTHER); }
266 270
267 int num_q() { return _num_q; } 271 int num_q() { return _num_q; }
268 int max_num_q() { return _max_num_q; } 272 int max_num_q() { return _max_num_q; }
269 void set_active_mt_degree(int v) { _num_q = v; } 273 void set_active_mt_degree(int v) { _num_q = v; }
270 DiscoveredList* discovered_soft_refs() { return _discoveredSoftRefs; } 274
275 DiscoveredList* discovered_refs() { return _discovered_refs; }
271 276
272 ReferencePolicy* setup_policy(bool always_clear) { 277 ReferencePolicy* setup_policy(bool always_clear) {
273 _current_soft_ref_policy = always_clear ? 278 _current_soft_ref_policy = always_clear ?
274 _always_clear_soft_ref_policy : _default_soft_ref_policy; 279 _always_clear_soft_ref_policy : _default_soft_ref_policy;
275 _current_soft_ref_policy->setup(); // snapshot the policy threshold 280 _current_soft_ref_policy->setup(); // snapshot the policy threshold
409 414
410 public: 415 public:
411 // constructor 416 // constructor
412 ReferenceProcessor(): 417 ReferenceProcessor():
413 _span((HeapWord*)NULL, (HeapWord*)NULL), 418 _span((HeapWord*)NULL, (HeapWord*)NULL),
419 _discovered_refs(NULL),
414 _discoveredSoftRefs(NULL), _discoveredWeakRefs(NULL), 420 _discoveredSoftRefs(NULL), _discoveredWeakRefs(NULL),
415 _discoveredFinalRefs(NULL), _discoveredPhantomRefs(NULL), 421 _discoveredFinalRefs(NULL), _discoveredPhantomRefs(NULL),
416 _discovering_refs(false), 422 _discovering_refs(false),
417 _discovery_is_atomic(true), 423 _discovery_is_atomic(true),
418 _enqueuing_is_done(false), 424 _enqueuing_is_done(false),