Path: blob/master/src/hotspot/share/memory/iterator.cpp
40949 views
/*1* Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*22*/2324#include "precompiled.hpp"25#include "classfile/classLoaderDataGraph.hpp"26#include "code/nmethod.hpp"27#include "memory/iterator.inline.hpp"28#include "oops/oop.inline.hpp"29#include "utilities/debug.hpp"30#include "utilities/globalDefinitions.hpp"3132DoNothingClosure do_nothing_cl;3334void CLDToOopClosure::do_cld(ClassLoaderData* cld) {35cld->oops_do(_oop_closure, _cld_claim);36}3738void ObjectToOopClosure::do_object(oop obj) {39obj->oop_iterate(_cl);40}4142void VoidClosure::do_void() {43ShouldNotCallThis();44}4546void CodeBlobToOopClosure::do_nmethod(nmethod* nm) {47nm->oops_do(_cl);48if (_fix_relocations) {49nm->fix_oop_relocations();50}51}5253void CodeBlobToOopClosure::do_code_blob(CodeBlob* cb) {54nmethod* nm = cb->as_nmethod_or_null();55if (nm != NULL) {56do_nmethod(nm);57}58}5960void MarkingCodeBlobClosure::do_code_blob(CodeBlob* cb) {61nmethod* nm = cb->as_nmethod_or_null();62if (nm != NULL && nm->oops_do_try_claim()) {63do_nmethod(nm);64}65}6667void CodeBlobToNMethodClosure::do_code_blob(CodeBlob* cb) {68nmethod* nm = cb->as_nmethod_or_null();69if (nm != NULL) {70_nm_cl->do_nmethod(nm);71}72}737475