Path: blob/master/src/hotspot/share/oops/instanceClassLoaderKlass.hpp
40951 views
/*1* Copyright (c) 2011, 2019, 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#ifndef SHARE_OOPS_INSTANCECLASSLOADERKLASS_HPP25#define SHARE_OOPS_INSTANCECLASSLOADERKLASS_HPP2627#include "oops/instanceKlass.hpp"28#include "utilities/macros.hpp"2930class ClassFileParser;3132// An InstanceClassLoaderKlass is a specialization of the InstanceKlass. It does33// not add any field. It is added to walk the dependencies for the class loader34// key that this class loader points to. This is how the loader_data graph is35// walked and dependent class loaders are kept alive. I thought we walked36// the list later?3738class InstanceClassLoaderKlass: public InstanceKlass {39friend class VMStructs;40friend class InstanceKlass;41public:42static const KlassID ID = InstanceClassLoaderKlassID;4344private:45InstanceClassLoaderKlass(const ClassFileParser& parser) : InstanceKlass(parser, InstanceKlass::_kind_class_loader, ID) {}4647public:48InstanceClassLoaderKlass() { assert(DumpSharedSpaces || UseSharedSpaces, "only for CDS"); }4950// Oop fields (and metadata) iterators51//52// The InstanceClassLoaderKlass iterators also visit the CLD pointer (or mirror of hidden klasses.)5354// Forward iteration55// Iterate over the oop fields and metadata.56template <typename T, class OopClosureType>57inline void oop_oop_iterate(oop obj, OopClosureType* closure);5859// Reverse iteration60// Iterate over the oop fields and metadata.61template <typename T, class OopClosureType>62inline void oop_oop_iterate_reverse(oop obj, OopClosureType* closure);6364// Bounded range iteration65// Iterate over the oop fields and metadata.66template <typename T, class OopClosureType>67inline void oop_oop_iterate_bounded(oop obj, OopClosureType* closure, MemRegion mr);68};6970#endif // SHARE_OOPS_INSTANCECLASSLOADERKLASS_HPP717273