Path: blob/master/src/hotspot/share/oops/instanceClassLoaderKlass.inline.hpp
40951 views
/*1* Copyright (c) 2015, 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_INLINE_HPP25#define SHARE_OOPS_INSTANCECLASSLOADERKLASS_INLINE_HPP2627#include "oops/instanceClassLoaderKlass.hpp"2829#include "classfile/javaClasses.hpp"30#include "memory/iterator.hpp"31#include "oops/instanceKlass.inline.hpp"32#include "oops/oop.inline.hpp"33#include "utilities/debug.hpp"34#include "utilities/globalDefinitions.hpp"35#include "utilities/macros.hpp"3637template <typename T, class OopClosureType>38inline void InstanceClassLoaderKlass::oop_oop_iterate(oop obj, OopClosureType* closure) {39InstanceKlass::oop_oop_iterate<T>(obj, closure);4041if (Devirtualizer::do_metadata(closure)) {42ClassLoaderData* cld = java_lang_ClassLoader::loader_data_raw(obj);43// cld can be null if we have a non-registered class loader.44if (cld != NULL) {45Devirtualizer::do_cld(closure, cld);46}47}48}4950template <typename T, class OopClosureType>51inline void InstanceClassLoaderKlass::oop_oop_iterate_reverse(oop obj, OopClosureType* closure) {52InstanceKlass::oop_oop_iterate_reverse<T>(obj, closure);5354assert(!Devirtualizer::do_metadata(closure),55"Code to handle metadata is not implemented");56}5758template <typename T, class OopClosureType>59inline void InstanceClassLoaderKlass::oop_oop_iterate_bounded(oop obj, OopClosureType* closure, MemRegion mr) {60InstanceKlass::oop_oop_iterate_bounded<T>(obj, closure, mr);6162if (Devirtualizer::do_metadata(closure)) {63if (mr.contains(obj)) {64ClassLoaderData* cld = java_lang_ClassLoader::loader_data_raw(obj);65// cld can be null if we have a non-registered class loader.66if (cld != NULL) {67Devirtualizer::do_cld(closure, cld);68}69}70}71}7273#endif // SHARE_OOPS_INSTANCECLASSLOADERKLASS_INLINE_HPP747576