Mercurial > hg > graal-jvmci-8
comparison src/share/vm/gc_implementation/g1/ptrQueue.hpp @ 1317:d4197f8d516a
6935821: G1: threads created during marking do not active their SATB queues
Summary: Newly-created threads always had the active field of their SATB queue initialized to false, even if they were created during marking. As a result, updates from threads created during a marking cycle were never enqueued and never processed. The fix includes remaining a method from active() to is_active() for readability and naming consistency.
Reviewed-by: ysr, johnc
author | tonyp |
---|---|
date | Thu, 18 Mar 2010 12:14:59 -0400 |
parents | 44f61c24ddab |
children | c18cbe5936b8 |
comparison
equal
deleted
inserted
replaced
1316:cc98cc548f51 | 1317:d4197f8d516a |
---|---|
60 PtrQueueSet* qset() { return _qset; } | 60 PtrQueueSet* qset() { return _qset; } |
61 | 61 |
62 public: | 62 public: |
63 // Initialize this queue to contain a null buffer, and be part of the | 63 // Initialize this queue to contain a null buffer, and be part of the |
64 // given PtrQueueSet. | 64 // given PtrQueueSet. |
65 PtrQueue(PtrQueueSet*, bool perm = false); | 65 PtrQueue(PtrQueueSet*, bool perm = false, bool active = false); |
66 // Release any contained resources. | 66 // Release any contained resources. |
67 void flush(); | 67 void flush(); |
68 // Calls flush() when destroyed. | 68 // Calls flush() when destroyed. |
69 ~PtrQueue() { flush(); } | 69 ~PtrQueue() { flush(); } |
70 | 70 |
98 _index = _sz; | 98 _index = _sz; |
99 } else if (b && _buf != NULL) { | 99 } else if (b && _buf != NULL) { |
100 assert(_index == _sz, "invariant: queues are empty when activated."); | 100 assert(_index == _sz, "invariant: queues are empty when activated."); |
101 } | 101 } |
102 } | 102 } |
103 | |
104 bool is_active() { return _active; } | |
103 | 105 |
104 static int byte_index_to_index(int ind) { | 106 static int byte_index_to_index(int ind) { |
105 assert((ind % oopSize) == 0, "Invariant."); | 107 assert((ind % oopSize) == 0, "Invariant."); |
106 return ind / oopSize; | 108 return ind / oopSize; |
107 } | 109 } |
255 } | 257 } |
256 | 258 |
257 bool process_completed_buffers() { return _process_completed; } | 259 bool process_completed_buffers() { return _process_completed; } |
258 void set_process_completed(bool x) { _process_completed = x; } | 260 void set_process_completed(bool x) { _process_completed = x; } |
259 | 261 |
260 bool active() { return _all_active; } | 262 bool is_active() { return _all_active; } |
261 | 263 |
262 // Set the buffer size. Should be called before any "enqueue" operation | 264 // Set the buffer size. Should be called before any "enqueue" operation |
263 // can be called. And should only be called once. | 265 // can be called. And should only be called once. |
264 void set_buffer_size(size_t sz); | 266 void set_buffer_size(size_t sz); |
265 | 267 |