cmsOopClosures.inline.hpp revision 935
0N/A/*
0N/A * Copyright (c) 2007 Sun Microsystems, Inc. All Rights Reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
0N/A * published by the Free Software Foundation.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
0N/A * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
0N/A * CA 95054 USA or visit www.sun.com if you need additional information or
0N/A * have any questions.
0N/A *
0N/A */
0N/A
0N/A// Trim our work_queue so its length is below max at return
0N/Ainline void Par_MarkRefsIntoAndScanClosure::trim_queue(uint max) {
0N/A while (_work_queue->size() > max) {
0N/A oop newOop;
0N/A if (_work_queue->pop_local(newOop)) {
0N/A assert(newOop->is_oop(), "Expected an oop");
0N/A assert(_bit_map->isMarked((HeapWord*)newOop),
0N/A "only grey objects on this stack");
0N/A // iterate over the oops in this oop, marking and pushing
0N/A // the ones in CMS heap (i.e. in _span).
0N/A newOop->oop_iterate(&_par_pushAndMarkClosure);
0N/A }
0N/A }
0N/A}
0N/A
935N/A#ifndef PRODUCT
935N/Avoid KlassRememberingOopClosure::check_remember_klasses() const {
935N/A assert(_should_remember_klasses == must_remember_klasses(),
935N/A "Should remember klasses in this context.");
935N/A}
935N/A#endif
935N/A
935N/Avoid KlassRememberingOopClosure::remember_klass(Klass* k) {
935N/A if (!_revisit_stack->push(oop(k))) {
0N/A fatal("Revisit stack overflow in PushOrMarkClosure");
0N/A }
935N/A check_remember_klasses();
0N/A}
0N/A
935N/Avoid Par_KlassRememberingOopClosure::remember_klass(Klass* k) {
0N/A if (!_revisit_stack->par_push(oop(k))) {
0N/A fatal("Revisit stack overflow in PushOrMarkClosure");
0N/A }
935N/A check_remember_klasses();
0N/A}
0N/A
0N/Ainline void PushOrMarkClosure::do_yield_check() {
0N/A _parent->do_yield_check();
0N/A}
0N/A
0N/Ainline void Par_PushOrMarkClosure::do_yield_check() {
0N/A _parent->do_yield_check();
0N/A}