1 /*
2 * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
235 }
236
237 if (!_task_queue->push(obj)) {
238 // The local task queue looks full. We need to push some entries
239 // to the global stack.
240
241 if (_cm->verbose_medium()) {
242 gclog_or_tty->print_cr("[%u] task queue overflow, "
243 "moving entries to the global stack",
244 _worker_id);
245 }
246 move_entries_to_global_stack();
247
248 // this should succeed since, even if we overflow the global
249 // stack, we should have definitely removed some entries from the
250 // local queue. So, there must be space on it.
251 bool success = _task_queue->push(obj);
252 assert(success, "invariant");
253 }
254
255 statsOnly( int tmp_size = _task_queue->size();
256 if (tmp_size > _local_max_size) {
257 _local_max_size = tmp_size;
258 }
259 ++_local_pushes );
260 }
261
262 // This determines whether the method below will check both the local
263 // and global fingers when determining whether to push on the stack a
264 // gray object (value 1) or whether it will only check the global one
265 // (value 0). The tradeoffs are that the former will be a bit more
266 // accurate and possibly push less on the stack, but it might also be
267 // a little bit slower.
268
269 #define _CHECK_BOTH_FINGERS_ 1
270
271 inline void CMTask::deal_with_reference(oop obj) {
272 if (_cm->verbose_high()) {
273 gclog_or_tty->print_cr("[%u] we're dealing with reference = "PTR_FORMAT,
274 _worker_id, p2i((void*) obj));
275 }
|
1 /*
2 * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
235 }
236
237 if (!_task_queue->push(obj)) {
238 // The local task queue looks full. We need to push some entries
239 // to the global stack.
240
241 if (_cm->verbose_medium()) {
242 gclog_or_tty->print_cr("[%u] task queue overflow, "
243 "moving entries to the global stack",
244 _worker_id);
245 }
246 move_entries_to_global_stack();
247
248 // this should succeed since, even if we overflow the global
249 // stack, we should have definitely removed some entries from the
250 // local queue. So, there must be space on it.
251 bool success = _task_queue->push(obj);
252 assert(success, "invariant");
253 }
254
255 statsOnly( size_t tmp_size = (size_t)_task_queue->size();
256 if (tmp_size > _local_max_size) {
257 _local_max_size = tmp_size;
258 }
259 ++_local_pushes );
260 }
261
262 // This determines whether the method below will check both the local
263 // and global fingers when determining whether to push on the stack a
264 // gray object (value 1) or whether it will only check the global one
265 // (value 0). The tradeoffs are that the former will be a bit more
266 // accurate and possibly push less on the stack, but it might also be
267 // a little bit slower.
268
269 #define _CHECK_BOTH_FINGERS_ 1
270
271 inline void CMTask::deal_with_reference(oop obj) {
272 if (_cm->verbose_high()) {
273 gclog_or_tty->print_cr("[%u] we're dealing with reference = "PTR_FORMAT,
274 _worker_id, p2i((void*) obj));
275 }
|