instanceKlassKlass.hpp revision 1472
98N/A/*
98N/A * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
98N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
98N/A *
98N/A * This code is free software; you can redistribute it and/or modify it
98N/A * under the terms of the GNU General Public License version 2 only, as
98N/A * published by the Free Software Foundation.
98N/A *
98N/A * This code is distributed in the hope that it will be useful, but WITHOUT
98N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
98N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
98N/A * version 2 for more details (a copy is included in the LICENSE file that
98N/A * accompanied this code).
98N/A *
98N/A * You should have received a copy of the GNU General Public License version
98N/A * 2 along with this work; if not, write to the Free Software Foundation,
98N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
98N/A *
98N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
98N/A * or visit www.oracle.com if you need additional information or have any
98N/A * questions.
98N/A *
98N/A */
98N/A
98N/A// An instanceKlassKlass is the klass of an instanceKlass
98N/A
98N/Aclass instanceKlassKlass : public klassKlass {
98N/A public:
98N/A // Dispatched operation
98N/A bool oop_is_klass() const { return true; }
98N/A bool oop_is_instanceKlass() const { return true; }
98N/A
98N/A int oop_size(oop obj) const;
98N/A int klass_oop_size() const { return object_size(); }
98N/A
98N/A // Allocation
98N/A DEFINE_ALLOCATE_PERMANENT(instanceKlassKlass);
98N/A static klassOop create_klass(TRAPS);
98N/A klassOop allocate_instance_klass(int vtable_len,
98N/A int itable_len,
98N/A int static_field_size,
98N/A unsigned int nonstatic_oop_map_count,
98N/A ReferenceType rt,
98N/A TRAPS);
98N/A
98N/A // Casting from klassOop
98N/A static instanceKlassKlass* cast(klassOop k) {
98N/A assert(k->klass_part()->oop_is_klass(), "cast to instanceKlassKlass");
98N/A return (instanceKlassKlass*) k->klass_part();
98N/A }
98N/A
98N/A // Sizing
98N/A static int header_size() { return oopDesc::header_size() + sizeof(instanceKlassKlass)/HeapWordSize; }
98N/A int object_size() const { return align_object_size(header_size()); }
98N/A
98N/A // Garbage collection
98N/A void oop_follow_contents(oop obj);
98N/A int oop_adjust_pointers(oop obj);
98N/A bool oop_is_parsable(oop obj) const;
98N/A
98N/A // Parallel Scavenge and Parallel Old
98N/A PARALLEL_GC_DECLS
98N/A
98N/A // Iterators
98N/A int oop_oop_iterate(oop obj, OopClosure* blk);
98N/A int oop_oop_iterate_m(oop obj, OopClosure* blk, MemRegion mr);
98N/A
98N/Aprivate:
98N/A // Apply closure to the InstanceKlass oops that are outside the java heap.
98N/A inline void iterate_c_heap_oops(instanceKlass* ik, OopClosure* closure);
98N/A
98N/A public:
98N/A // Printing
98N/A void oop_print_value_on(oop obj, outputStream* st);
98N/A#ifndef PRODUCT
98N/A void oop_print_on(oop obj, outputStream* st);
98N/A#endif
98N/A
98N/A // Verification
98N/A const char* internal_name() const;
98N/A void oop_verify_on(oop obj, outputStream* st);
98N/A // tells whether obj is partially constructed (gc during class loading)
98N/A bool oop_partially_loaded(oop obj) const;
98N/A void oop_set_partially_loaded(oop obj);
98N/A};
98N/A