duke@435: /* coleenp@4037: * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. duke@435: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. duke@435: * duke@435: * This code is free software; you can redistribute it and/or modify it duke@435: * under the terms of the GNU General Public License version 2 only, as duke@435: * published by the Free Software Foundation. duke@435: * duke@435: * This code is distributed in the hope that it will be useful, but WITHOUT duke@435: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or duke@435: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License duke@435: * version 2 for more details (a copy is included in the LICENSE file that duke@435: * accompanied this code). duke@435: * duke@435: * You should have received a copy of the GNU General Public License version duke@435: * 2 along with this work; if not, write to the Free Software Foundation, duke@435: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. duke@435: * trims@1907: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA trims@1907: * or visit www.oracle.com if you need additional information or have any trims@1907: * questions. duke@435: * duke@435: */ duke@435: stefank@2314: #ifndef SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSOOPCLOSURES_INLINE_HPP stefank@2314: #define SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSOOPCLOSURES_INLINE_HPP stefank@2314: stefank@2314: #include "gc_implementation/concurrentMarkSweep/cmsOopClosures.hpp" stefank@2314: #include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp" coleenp@4037: #include "oops/oop.inline.hpp" stefank@2314: duke@435: // Trim our work_queue so its length is below max at return duke@435: inline void Par_MarkRefsIntoAndScanClosure::trim_queue(uint max) { duke@435: while (_work_queue->size() > max) { duke@435: oop newOop; duke@435: if (_work_queue->pop_local(newOop)) { duke@435: assert(newOop->is_oop(), "Expected an oop"); duke@435: assert(_bit_map->isMarked((HeapWord*)newOop), duke@435: "only grey objects on this stack"); duke@435: // iterate over the oops in this oop, marking and pushing duke@435: // the ones in CMS heap (i.e. in _span). duke@435: newOop->oop_iterate(&_par_pushAndMarkClosure); duke@435: } duke@435: } duke@435: } duke@435: coleenp@4037: // CMSOopClosure and CMSoopsInGenClosure are duplicated, coleenp@4037: // until we get rid of OopsInGenClosure. coleenp@4037: coleenp@4037: inline void CMSOopClosure::do_klass(Klass* k) { do_klass_nv(k); } coleenp@4037: inline void CMSOopsInGenClosure::do_klass(Klass* k) { do_klass_nv(k); } coleenp@4037: coleenp@4037: inline void CMSOopClosure::do_klass_nv(Klass* k) { coleenp@4037: ClassLoaderData* cld = k->class_loader_data(); coleenp@4037: do_class_loader_data(cld); jmasa@1370: } coleenp@4037: inline void CMSOopsInGenClosure::do_klass_nv(Klass* k) { coleenp@4037: ClassLoaderData* cld = k->class_loader_data(); coleenp@4037: do_class_loader_data(cld); duke@435: } duke@435: coleenp@4037: inline void CMSOopClosure::do_class_loader_data(ClassLoaderData* cld) { coleenp@4037: assert(_klass_closure._oop_closure == this, "Must be"); coleenp@4037: coleenp@4037: bool claim = true; // Must claim the class loader data before processing. coleenp@4037: cld->oops_do(_klass_closure._oop_closure, &_klass_closure, claim); coleenp@4037: } coleenp@4037: inline void CMSOopsInGenClosure::do_class_loader_data(ClassLoaderData* cld) { coleenp@4037: assert(_klass_closure._oop_closure == this, "Must be"); coleenp@4037: coleenp@4037: bool claim = true; // Must claim the class loader data before processing. coleenp@4037: cld->oops_do(_klass_closure._oop_closure, &_klass_closure, claim); ysr@1376: } ysr@1376: ysr@1376: stefank@2314: #endif // SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSOOPCLOSURES_INLINE_HPP