122 // field and only relies on the start / end parameters. It does
123 // however return the size of the object which will be incorrect. So
124 // we have to ignore it even if we wanted to use it.
125 to_obj_array->oop_iterate_range(&_scanner, start, end);
126 }
127
128 inline void G1ParScanThreadState::dispatch_task(ScannerTask task) {
129 verify_task(task);
130 if (task.is_narrow_oop_ptr()) {
131 do_oop_evac(task.to_narrow_oop_ptr());
132 } else if (task.is_oop_ptr()) {
133 do_oop_evac(task.to_oop_ptr());
134 } else {
135 do_partial_array(task.to_partial_array_task());
136 }
137 }
138
139 void G1ParScanThreadState::steal_and_trim_queue(ScannerTasksQueueSet *task_queues) {
140 ScannerTask stolen_task;
141 while (task_queues->steal(_worker_id, stolen_task)) {
142 verify_task(stolen_task);
143 dispatch_task(stolen_task);
144
145 // We've just processed a task and we might have made
146 // available new entries on the queues. So we have to make sure
147 // we drain the queues as necessary.
148 trim_queue();
149 }
150 }
151
152 inline bool G1ParScanThreadState::needs_partial_trimming() const {
153 return !_task_queue->overflow_empty() ||
154 (_task_queue->size() > _stack_trim_upper_threshold);
155 }
156
157 inline bool G1ParScanThreadState::is_partially_trimmed() const {
158 return _task_queue->overflow_empty() &&
159 (_task_queue->size() <= _stack_trim_lower_threshold);
160 }
161
162 inline void G1ParScanThreadState::trim_queue_to_threshold(uint threshold) {
|
122 // field and only relies on the start / end parameters. It does
123 // however return the size of the object which will be incorrect. So
124 // we have to ignore it even if we wanted to use it.
125 to_obj_array->oop_iterate_range(&_scanner, start, end);
126 }
127
128 inline void G1ParScanThreadState::dispatch_task(ScannerTask task) {
129 verify_task(task);
130 if (task.is_narrow_oop_ptr()) {
131 do_oop_evac(task.to_narrow_oop_ptr());
132 } else if (task.is_oop_ptr()) {
133 do_oop_evac(task.to_oop_ptr());
134 } else {
135 do_partial_array(task.to_partial_array_task());
136 }
137 }
138
139 void G1ParScanThreadState::steal_and_trim_queue(ScannerTasksQueueSet *task_queues) {
140 ScannerTask stolen_task;
141 while (task_queues->steal(_worker_id, stolen_task)) {
142 dispatch_task(stolen_task);
143
144 // We've just processed a task and we might have made
145 // available new entries on the queues. So we have to make sure
146 // we drain the queues as necessary.
147 trim_queue();
148 }
149 }
150
151 inline bool G1ParScanThreadState::needs_partial_trimming() const {
152 return !_task_queue->overflow_empty() ||
153 (_task_queue->size() > _stack_trim_upper_threshold);
154 }
155
156 inline bool G1ParScanThreadState::is_partially_trimmed() const {
157 return _task_queue->overflow_empty() &&
158 (_task_queue->size() <= _stack_trim_lower_threshold);
159 }
160
161 inline void G1ParScanThreadState::trim_queue_to_threshold(uint threshold) {
|