coleenp@4037: /* coleenp@4037: * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. coleenp@4037: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. coleenp@4037: * coleenp@4037: * This code is free software; you can redistribute it and/or modify it coleenp@4037: * under the terms of the GNU General Public License version 2 only, as coleenp@4037: * published by the Free Software Foundation. coleenp@4037: * coleenp@4037: * This code is distributed in the hope that it will be useful, but WITHOUT coleenp@4037: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or coleenp@4037: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License coleenp@4037: * version 2 for more details (a copy is included in the LICENSE file that coleenp@4037: * accompanied this code). coleenp@4037: * coleenp@4037: * You should have received a copy of the GNU General Public License version coleenp@4037: * 2 along with this work; if not, write to the Free Software Foundation, coleenp@4037: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. coleenp@4037: * coleenp@4037: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA coleenp@4037: * or visit www.oracle.com if you need additional information or have any coleenp@4037: * questions. coleenp@4037: * coleenp@4037: */ coleenp@4037: coleenp@4037: #ifndef SHARE_VM_OOPS_INSTANCECLASSLOADERKLASS_HPP coleenp@4037: #define SHARE_VM_OOPS_INSTANCECLASSLOADERKLASS_HPP coleenp@4037: coleenp@4037: #include "oops/instanceKlass.hpp" coleenp@4037: coleenp@4047: // An InstanceClassLoaderKlass is a specialization of the InstanceKlass. It does coleenp@4037: // not add any field. It is added to walk the dependencies for the class loader coleenp@4037: // key that this class loader points to. This is how the loader_data graph is coleenp@4037: // walked and dependant class loaders are kept alive. I thought we walked coleenp@4037: // the list later? coleenp@4037: coleenp@4047: class InstanceClassLoaderKlass: public InstanceKlass { coleenp@4037: friend class VMStructs; coleenp@4037: friend class InstanceKlass; coleenp@4037: coleenp@4037: // Constructor coleenp@4047: InstanceClassLoaderKlass(int vtable_len, int itable_len, int static_field_size, int nonstatic_oop_map_size, ReferenceType rt, AccessFlags access_flags, bool is_anonymous) coleenp@4037: : InstanceKlass(vtable_len, itable_len, static_field_size, nonstatic_oop_map_size, rt, access_flags, is_anonymous) {} coleenp@4037: coleenp@4037: public: coleenp@4037: virtual bool oop_is_instanceClassLoader() const { return true; } coleenp@4037: coleenp@4047: InstanceClassLoaderKlass() { assert(DumpSharedSpaces || UseSharedSpaces, "only for CDS"); } coleenp@4037: coleenp@4037: // Iterators coleenp@4037: int oop_oop_iterate(oop obj, ExtendedOopClosure* blk) { coleenp@4037: return oop_oop_iterate_v(obj, blk); coleenp@4037: } coleenp@4037: int oop_oop_iterate_m(oop obj, ExtendedOopClosure* blk, MemRegion mr) { coleenp@4037: return oop_oop_iterate_v_m(obj, blk, mr); coleenp@4037: } coleenp@4037: coleenp@4037: #define InstanceClassLoaderKlass_OOP_OOP_ITERATE_DECL(OopClosureType, nv_suffix) \ coleenp@4037: int oop_oop_iterate##nv_suffix(oop obj, OopClosureType* blk); \ coleenp@4037: int oop_oop_iterate##nv_suffix##_m(oop obj, OopClosureType* blk, MemRegion mr); coleenp@4037: coleenp@4037: ALL_OOP_OOP_ITERATE_CLOSURES_1(InstanceClassLoaderKlass_OOP_OOP_ITERATE_DECL) coleenp@4037: ALL_OOP_OOP_ITERATE_CLOSURES_2(InstanceClassLoaderKlass_OOP_OOP_ITERATE_DECL) coleenp@4037: coleenp@4037: #ifndef SERIALGC coleenp@4037: #define InstanceClassLoaderKlass_OOP_OOP_ITERATE_BACKWARDS_DECL(OopClosureType, nv_suffix) \ coleenp@4037: int oop_oop_iterate_backwards##nv_suffix(oop obj, OopClosureType* blk); coleenp@4037: coleenp@4037: ALL_OOP_OOP_ITERATE_CLOSURES_1(InstanceClassLoaderKlass_OOP_OOP_ITERATE_BACKWARDS_DECL) coleenp@4037: ALL_OOP_OOP_ITERATE_CLOSURES_2(InstanceClassLoaderKlass_OOP_OOP_ITERATE_BACKWARDS_DECL) coleenp@4037: #endif // !SERIALGC coleenp@4037: coleenp@4037: // Garbage collection coleenp@4037: void oop_follow_contents(oop obj); coleenp@4037: coleenp@4037: // Parallel Scavenge and Parallel Old coleenp@4037: PARALLEL_GC_DECLS coleenp@4037: }; coleenp@4037: coleenp@4037: #endif // SHARE_VM_OOPS_INSTANCECLASSLOADERKLASS_HPP