提交 d4178c1f 编写于 作者: C coleenp

7195833: NPG: Rename instanceClassLoaderKlass, instanceRefKlass and instanceMirrorKlass

Summary: Simple renaming to be consistent with instanceKlass->InstanceKlass renaming
Reviewed-by: stefank, jmasa
上级 2f942e3e
......@@ -45,7 +45,7 @@ public class InstanceClassLoaderKlass extends InstanceKlass {
private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
// Just make sure it's there for now
Type type = db.lookupType("instanceClassLoaderKlass");
Type type = db.lookupType("InstanceClassLoaderKlass");
}
public InstanceClassLoaderKlass(Address addr) {
......
......@@ -45,7 +45,7 @@ public class InstanceMirrorKlass extends InstanceKlass {
private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
// Just make sure it's there for now
Type type = db.lookupType("instanceMirrorKlass");
Type type = db.lookupType("InstanceMirrorKlass");
}
public InstanceMirrorKlass(Address addr) {
......
......@@ -45,7 +45,7 @@ public class InstanceRefKlass extends InstanceKlass {
private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
// Just make sure it's there for now
Type type = db.lookupType("instanceRefKlass");
Type type = db.lookupType("InstanceRefKlass");
}
public InstanceRefKlass(Address addr) {
......
......@@ -52,9 +52,9 @@ abstract public class Metadata extends VMObject {
metadataConstructor.addMapping("Metadata", Metadata.class);
metadataConstructor.addMapping("Klass", Klass.class);
metadataConstructor.addMapping("InstanceKlass", InstanceKlass.class);
metadataConstructor.addMapping("instanceMirrorKlass", InstanceMirrorKlass.class);
metadataConstructor.addMapping("instanceRefKlass", InstanceRefKlass.class);
metadataConstructor.addMapping("instanceClassLoaderKlass", InstanceClassLoaderKlass.class);
metadataConstructor.addMapping("InstanceMirrorKlass", InstanceMirrorKlass.class);
metadataConstructor.addMapping("InstanceRefKlass", InstanceRefKlass.class);
metadataConstructor.addMapping("InstanceClassLoaderKlass", InstanceClassLoaderKlass.class);
metadataConstructor.addMapping("typeArrayKlass", TypeArrayKlass.class);
metadataConstructor.addMapping("objArrayKlass", ObjArrayKlass.class);
metadataConstructor.addMapping("Method", Method.class);
......
......@@ -3271,7 +3271,7 @@ instanceKlassHandle ClassFileParser::parseClassFile(Symbol* name,
int next_nonstatic_field_offset;
// Calculate the starting byte offsets
next_static_oop_offset = instanceMirrorKlass::offset_of_static_fields();
next_static_oop_offset = InstanceMirrorKlass::offset_of_static_fields();
next_static_double_offset = next_static_oop_offset +
(fac.count[STATIC_OOP] * heapOopSize);
if ( fac.count[STATIC_DOUBLE] &&
......
......@@ -500,7 +500,7 @@ static void initialize_static_field(fieldDescriptor* fd, TRAPS) {
void java_lang_Class::fixup_mirror(KlassHandle k, TRAPS) {
assert(instanceMirrorKlass::offset_of_static_fields() != 0, "must have been computed already");
assert(InstanceMirrorKlass::offset_of_static_fields() != 0, "must have been computed already");
// If the offset was read from the shared archive, it was fixed up already
if (!k->is_shared()) {
......@@ -510,7 +510,7 @@ void java_lang_Class::fixup_mirror(KlassHandle k, TRAPS) {
// update all the static field offsets to included the size.
for (JavaFieldStream fs(InstanceKlass::cast(k())); !fs.done(); fs.next()) {
if (fs.access_flags().is_static()) {
int real_offset = fs.offset() + instanceMirrorKlass::offset_of_static_fields();
int real_offset = fs.offset() + InstanceMirrorKlass::offset_of_static_fields();
fs.set_offset(real_offset);
}
}
......@@ -531,9 +531,9 @@ oop java_lang_Class::create_mirror(KlassHandle k, TRAPS) {
// the mirror.
if (SystemDictionary::Class_klass_loaded()) {
// Allocate mirror (java.lang.Class instance)
Handle mirror = instanceMirrorKlass::cast(SystemDictionary::Class_klass())->allocate_instance(k, CHECK_0);
Handle mirror = InstanceMirrorKlass::cast(SystemDictionary::Class_klass())->allocate_instance(k, CHECK_0);
instanceMirrorKlass* mk = instanceMirrorKlass::cast(mirror->klass());
InstanceMirrorKlass* mk = InstanceMirrorKlass::cast(mirror->klass());
java_lang_Class::set_static_oop_field_count(mirror(), mk->compute_static_oop_field_count(mirror()));
// It might also have a component mirror. This mirror must already exist.
......@@ -592,14 +592,14 @@ void java_lang_Class::set_static_oop_field_count(oop java_class, int size) {
oop java_lang_Class::create_basic_type_mirror(const char* basic_type_name, BasicType type, TRAPS) {
// This should be improved by adding a field at the Java level or by
// introducing a new VM klass (see comment in ClassFileParser)
oop java_class = instanceMirrorKlass::cast(SystemDictionary::Class_klass())->allocate_instance(NULL, CHECK_0);
oop java_class = InstanceMirrorKlass::cast(SystemDictionary::Class_klass())->allocate_instance(NULL, CHECK_0);
if (type != T_VOID) {
Klass* aklass = Universe::typeArrayKlassObj(type);
assert(aklass != NULL, "correct bootstrap");
set_array_klass(java_class, aklass);
}
#ifdef ASSERT
instanceMirrorKlass* mk = instanceMirrorKlass::cast(SystemDictionary::Class_klass());
InstanceMirrorKlass* mk = InstanceMirrorKlass::cast(SystemDictionary::Class_klass());
assert(java_lang_Class::static_oop_field_count(java_class) == 0, "should have been zeroed by allocation");
#endif
return java_class;
......@@ -2835,17 +2835,17 @@ oop java_lang_ClassLoader::non_reflection_class_loader(oop loader) {
// Support for java_lang_System
int java_lang_System::in_offset_in_bytes() {
return (instanceMirrorKlass::offset_of_static_fields() + static_in_offset);
return (InstanceMirrorKlass::offset_of_static_fields() + static_in_offset);
}
int java_lang_System::out_offset_in_bytes() {
return (instanceMirrorKlass::offset_of_static_fields() + static_out_offset);
return (InstanceMirrorKlass::offset_of_static_fields() + static_out_offset);
}
int java_lang_System::err_offset_in_bytes() {
return (instanceMirrorKlass::offset_of_static_fields() + static_err_offset);
return (InstanceMirrorKlass::offset_of_static_fields() + static_err_offset);
}
......@@ -3124,10 +3124,10 @@ bool JavaClasses::check_static_offset(const char *klass_name, int hardcoded_offs
tty->print_cr("Static field %s.%s appears to be nonstatic", klass_name, field_name);
return false;
}
if (fd.offset() == hardcoded_offset + instanceMirrorKlass::offset_of_static_fields()) {
if (fd.offset() == hardcoded_offset + InstanceMirrorKlass::offset_of_static_fields()) {
return true;
} else {
tty->print_cr("Offset of static field %s.%s is hardcoded as %d but should really be %d.", klass_name, field_name, hardcoded_offset, fd.offset() - instanceMirrorKlass::offset_of_static_fields());
tty->print_cr("Offset of static field %s.%s is hardcoded as %d but should really be %d.", klass_name, field_name, hardcoded_offset, fd.offset() - InstanceMirrorKlass::offset_of_static_fields());
return false;
}
}
......
......@@ -1976,7 +1976,7 @@ void SystemDictionary::initialize_preloaded_classes(TRAPS) {
// Preload ref klasses and set reference types
InstanceKlass::cast(WK_KLASS(Reference_klass))->set_reference_type(REF_OTHER);
instanceRefKlass::update_nonstatic_oop_maps(WK_KLASS(Reference_klass));
InstanceRefKlass::update_nonstatic_oop_maps(WK_KLASS(Reference_klass));
initialize_wk_klasses_through(WK_KLASS_ENUM_NAME(PhantomReference_klass), scan, CHECK);
InstanceKlass::cast(WK_KLASS(SoftReference_klass))->set_reference_type(REF_SOFT);
......
......@@ -1108,7 +1108,7 @@ void CompileBroker::compile_method_base(methodHandle method,
// the pending list lock or a 3-way deadlock may occur
// between the reference handler thread, a GC (instigated
// by a compiler thread), and compiled method registration.
if (instanceRefKlass::owns_pending_list_lock(JavaThread::current())) {
if (InstanceRefKlass::owns_pending_list_lock(JavaThread::current())) {
return;
}
......@@ -1440,7 +1440,7 @@ uint CompileBroker::assign_compile_id(methodHandle method, int osr_bci) {
// Should the current thread be blocked until this compilation request
// has been fulfilled?
bool CompileBroker::is_compile_blocking(methodHandle method, int osr_bci) {
assert(!instanceRefKlass::owns_pending_list_lock(JavaThread::current()), "possible deadlock");
assert(!InstanceRefKlass::owns_pending_list_lock(JavaThread::current()), "possible deadlock");
return !BackgroundCompilation;
}
......
......@@ -839,7 +839,7 @@ class PSParallelCompact : AllStatic {
friend class AdjustKlassClosure;
friend class FollowKlassClosure;
friend class FollowRootClosure;
friend class instanceClassLoaderKlass;
friend class InstanceClassLoaderKlass;
friend class RefProcTaskProxy;
private:
......
......@@ -255,13 +255,13 @@ void SurrogateLockerThread::loop() {
}
switch(msg) {
case acquirePLL: {
instanceRefKlass::acquire_pending_list_lock(&pll_basic_lock);
InstanceRefKlass::acquire_pending_list_lock(&pll_basic_lock);
debug_only(owned++;)
break;
}
case releaseAndNotifyPLL: {
assert(owned > 0, "Don't have PLL");
instanceRefKlass::release_and_notify_pending_list_lock(&pll_basic_lock);
InstanceRefKlass::release_and_notify_pending_list_lock(&pll_basic_lock);
debug_only(owned--;)
break;
}
......
......@@ -70,13 +70,13 @@ void VM_GC_Operation::notify_gc_end() {
void VM_GC_Operation::acquire_pending_list_lock() {
// we may enter this with pending exception set
instanceRefKlass::acquire_pending_list_lock(&_pending_list_basic_lock);
InstanceRefKlass::acquire_pending_list_lock(&_pending_list_basic_lock);
}
void VM_GC_Operation::release_and_notify_pending_list_lock() {
instanceRefKlass::release_and_notify_pending_list_lock(&_pending_list_basic_lock);
InstanceRefKlass::release_and_notify_pending_list_lock(&_pending_list_basic_lock);
}
// Allocations may fail in several threads at about the same time,
......
......@@ -516,7 +516,7 @@ oop CollectedHeap::Class_obj_allocate(KlassHandle klass, int size, KlassHandle r
real_klass->set_java_mirror(mirror);
}
instanceMirrorKlass* mk = instanceMirrorKlass::cast(mirror->klass());
InstanceMirrorKlass* mk = InstanceMirrorKlass::cast(mirror->klass());
assert(size == mk->instance_size(real_klass), "should have been set");
// notify jvmti and dtrace
......
......@@ -1036,7 +1036,7 @@ inline DiscoveredList* ReferenceProcessor::get_discovered_list(ReferenceType rt)
list = &_discoveredPhantomRefs[id];
break;
case REF_NONE:
// we should not reach here if we are an instanceRefKlass
// we should not reach here if we are an InstanceRefKlass
default:
ShouldNotReachHere();
}
......
......@@ -199,7 +199,7 @@ class SpecializationStats {
public:
enum Kind {
ik, // InstanceKlass
irk, // instanceRefKlass
irk, // InstanceRefKlass
oa, // objArrayKlass
NUM_Kinds
};
......
......@@ -435,9 +435,9 @@ static inline void add_vtable(void** list, int* n, void* o, int count) {
void Universe::init_self_patching_vtbl_list(void** list, int count) {
int n = 0;
{ InstanceKlass o; add_vtable(list, &n, &o, count); }
{ instanceClassLoaderKlass o; add_vtable(list, &n, &o, count); }
{ instanceMirrorKlass o; add_vtable(list, &n, &o, count); }
{ instanceRefKlass o; add_vtable(list, &n, &o, count); }
{ InstanceClassLoaderKlass o; add_vtable(list, &n, &o, count); }
{ InstanceMirrorKlass o; add_vtable(list, &n, &o, count); }
{ InstanceRefKlass o; add_vtable(list, &n, &o, count); }
{ typeArrayKlass o; add_vtable(list, &n, &o, count); }
{ objArrayKlass o; add_vtable(list, &n, &o, count); }
{ Method o; add_vtable(list, &n, &o, count); }
......@@ -486,7 +486,7 @@ void Universe::fixup_mirrors(TRAPS) {
assert(SystemDictionary::Class_klass_loaded(), "java.lang.Class should be loaded");
HandleMark hm(THREAD);
// Cache the start of the static fields
instanceMirrorKlass::init_offset_of_static_fields();
InstanceMirrorKlass::init_offset_of_static_fields();
GrowableArray <Klass*>* list = java_lang_Class::fixup_mirror_list();
int list_length = list->length();
......
......@@ -49,14 +49,14 @@
"Inconsistency in do_metadata"); \
if (closure->do_metadata##nv_suffix())
// Macro to define instanceClassLoaderKlass::oop_oop_iterate for virtual/nonvirtual for
// Macro to define InstanceClassLoaderKlass::oop_oop_iterate for virtual/nonvirtual for
// all closures. Macros calling macros above for each oop size.
// Since ClassLoader objects have only a pointer to the loader_data, they are not
// compressed nor does the pointer move.
#define InstanceClassLoaderKlass_OOP_OOP_ITERATE_DEFN(OopClosureType, nv_suffix)\
\
int instanceClassLoaderKlass:: \
int InstanceClassLoaderKlass:: \
oop_oop_iterate##nv_suffix(oop obj, OopClosureType* closure) { \
/* Get size before changing pointers */ \
SpecializationStats::record_iterate_call##nv_suffix(SpecializationStats::irk);\
......@@ -76,7 +76,7 @@ oop_oop_iterate##nv_suffix(oop obj, OopClosureType* closure) {
#ifndef SERIALGC
#define InstanceClassLoaderKlass_OOP_OOP_ITERATE_BACKWARDS_DEFN(OopClosureType, nv_suffix) \
\
int instanceClassLoaderKlass:: \
int InstanceClassLoaderKlass:: \
oop_oop_iterate_backwards##nv_suffix(oop obj, OopClosureType* closure) { \
/* Get size before changing pointers */ \
SpecializationStats::record_iterate_call##nv_suffix(SpecializationStats::irk);\
......@@ -88,7 +88,7 @@ oop_oop_iterate_backwards##nv_suffix(oop obj, OopClosureType* closure) {
#define InstanceClassLoaderKlass_OOP_OOP_ITERATE_DEFN_m(OopClosureType, nv_suffix) \
\
int instanceClassLoaderKlass:: \
int InstanceClassLoaderKlass:: \
oop_oop_iterate##nv_suffix##_m(oop obj, \
OopClosureType* closure, \
MemRegion mr) { \
......@@ -118,7 +118,7 @@ ALL_OOP_OOP_ITERATE_CLOSURES_2(InstanceClassLoaderKlass_OOP_OOP_ITERATE_BACKWARD
ALL_OOP_OOP_ITERATE_CLOSURES_1(InstanceClassLoaderKlass_OOP_OOP_ITERATE_DEFN_m)
ALL_OOP_OOP_ITERATE_CLOSURES_2(InstanceClassLoaderKlass_OOP_OOP_ITERATE_DEFN_m)
void instanceClassLoaderKlass::oop_follow_contents(oop obj) {
void InstanceClassLoaderKlass::oop_follow_contents(oop obj) {
InstanceKlass::oop_follow_contents(obj);
ClassLoaderData * const loader_data = java_lang_ClassLoader::loader_data(obj);
......@@ -130,7 +130,7 @@ void instanceClassLoaderKlass::oop_follow_contents(oop obj) {
}
#ifndef SERIALGC
void instanceClassLoaderKlass::oop_follow_contents(ParCompactionManager* cm,
void InstanceClassLoaderKlass::oop_follow_contents(ParCompactionManager* cm,
oop obj) {
InstanceKlass::oop_follow_contents(cm, obj);
ClassLoaderData * const loader_data = java_lang_ClassLoader::loader_data(obj);
......@@ -139,7 +139,7 @@ void instanceClassLoaderKlass::oop_follow_contents(ParCompactionManager* cm,
}
}
void instanceClassLoaderKlass::oop_push_contents(PSPromotionManager* pm, oop obj) {
void InstanceClassLoaderKlass::oop_push_contents(PSPromotionManager* pm, oop obj) {
InstanceKlass::oop_push_contents(pm, obj);
// This is called by the young collector. It will already have taken care of
......@@ -147,7 +147,7 @@ void instanceClassLoaderKlass::oop_push_contents(PSPromotionManager* pm, oop obj
// class loader data link.
}
int instanceClassLoaderKlass::oop_update_pointers(ParCompactionManager* cm, oop obj) {
int InstanceClassLoaderKlass::oop_update_pointers(ParCompactionManager* cm, oop obj) {
InstanceKlass::oop_update_pointers(cm, obj);
ClassLoaderData * const loader_data = java_lang_ClassLoader::loader_data(obj);
if (loader_data != NULL) {
......
......@@ -27,24 +27,24 @@
#include "oops/instanceKlass.hpp"
// An instanceClassLoaderKlass is a specialization of the InstanceKlass. It does
// An InstanceClassLoaderKlass is a specialization of the InstanceKlass. It does
// not add any field. It is added to walk the dependencies for the class loader
// key that this class loader points to. This is how the loader_data graph is
// walked and dependant class loaders are kept alive. I thought we walked
// the list later?
class instanceClassLoaderKlass: public InstanceKlass {
class InstanceClassLoaderKlass: public InstanceKlass {
friend class VMStructs;
friend class InstanceKlass;
// Constructor
instanceClassLoaderKlass(int vtable_len, int itable_len, int static_field_size, int nonstatic_oop_map_size, ReferenceType rt, AccessFlags access_flags, bool is_anonymous)
InstanceClassLoaderKlass(int vtable_len, int itable_len, int static_field_size, int nonstatic_oop_map_size, ReferenceType rt, AccessFlags access_flags, bool is_anonymous)
: InstanceKlass(vtable_len, itable_len, static_field_size, nonstatic_oop_map_size, rt, access_flags, is_anonymous) {}
public:
virtual bool oop_is_instanceClassLoader() const { return true; }
instanceClassLoaderKlass() { assert(DumpSharedSpaces || UseSharedSpaces, "only for CDS"); }
InstanceClassLoaderKlass() { assert(DumpSharedSpaces || UseSharedSpaces, "only for CDS"); }
// Iterators
int oop_oop_iterate(oop obj, ExtendedOopClosure* blk) {
......
......@@ -191,14 +191,14 @@ Klass* InstanceKlass::allocate_instance_klass(ClassLoaderData* loader_data,
InstanceKlass* ik;
if (rt == REF_NONE) {
if (name == vmSymbols::java_lang_Class()) {
ik = new (loader_data, size, THREAD) instanceMirrorKlass(
ik = new (loader_data, size, THREAD) InstanceMirrorKlass(
vtable_len, itable_len, static_field_size, nonstatic_oop_map_size, rt,
access_flags, !host_klass.is_null());
} else if (name == vmSymbols::java_lang_ClassLoader() ||
(SystemDictionary::ClassLoader_klass_loaded() &&
super_klass != NULL &&
super_klass->is_subtype_of(SystemDictionary::ClassLoader_klass()))) {
ik = new (loader_data, size, THREAD) instanceClassLoaderKlass(
ik = new (loader_data, size, THREAD) InstanceClassLoaderKlass(
vtable_len, itable_len, static_field_size, nonstatic_oop_map_size, rt,
access_flags, !host_klass.is_null());
} else {
......@@ -209,7 +209,7 @@ Klass* InstanceKlass::allocate_instance_klass(ClassLoaderData* loader_data,
}
} else {
// reference klass
ik = new (loader_data, size, THREAD) instanceRefKlass(
ik = new (loader_data, size, THREAD) InstanceRefKlass(
vtable_len, itable_len, static_field_size, nonstatic_oop_map_size, rt,
access_flags, !host_klass.is_null());
}
......@@ -2284,7 +2284,7 @@ void InstanceKlass::set_source_debug_extension(char* array, int length) {
}
address InstanceKlass::static_field_addr(int offset) {
return (address)(offset + instanceMirrorKlass::offset_of_static_fields() + (intptr_t)java_mirror());
return (address)(offset + InstanceMirrorKlass::offset_of_static_fields() + (intptr_t)java_mirror());
}
......@@ -3073,7 +3073,7 @@ void JNIid::deallocate(JNIid* current) {
void JNIid::verify(Klass* holder) {
int first_field_offset = instanceMirrorKlass::offset_of_static_fields();
int first_field_offset = InstanceMirrorKlass::offset_of_static_fields();
int end_field_offset;
end_field_offset = first_field_offset + (InstanceKlass::cast(holder)->static_field_size() * wordSize);
......
......@@ -47,7 +47,7 @@
#include "oops/oop.pcgc.inline.hpp"
#endif
int instanceMirrorKlass::_offset_of_static_fields = 0;
int InstanceMirrorKlass::_offset_of_static_fields = 0;
#ifdef ASSERT
template <class T> void assert_is_in(T *p) {
......@@ -148,7 +148,7 @@ template <class T> void assert_nothing(T *p) {}
}
void instanceMirrorKlass::oop_follow_contents(oop obj) {
void InstanceMirrorKlass::oop_follow_contents(oop obj) {
InstanceKlass::oop_follow_contents(obj);
// Follow the klass field in the mirror.
......@@ -169,7 +169,7 @@ void instanceMirrorKlass::oop_follow_contents(oop obj) {
}
#ifndef SERIALGC
void instanceMirrorKlass::oop_follow_contents(ParCompactionManager* cm,
void InstanceMirrorKlass::oop_follow_contents(ParCompactionManager* cm,
oop obj) {
InstanceKlass::oop_follow_contents(cm, obj);
......@@ -191,7 +191,7 @@ void instanceMirrorKlass::oop_follow_contents(ParCompactionManager* cm,
}
#endif // SERIALGC
int instanceMirrorKlass::oop_adjust_pointers(oop obj) {
int InstanceMirrorKlass::oop_adjust_pointers(oop obj) {
int size = oop_size(obj);
InstanceKlass::oop_adjust_pointers(obj);
......@@ -235,12 +235,12 @@ int instanceMirrorKlass::oop_adjust_pointers(oop obj) {
"Inconsistency in do_metadata"); \
if (closure->do_metadata##nv_suffix())
// Macro to define instanceMirrorKlass::oop_oop_iterate for virtual/nonvirtual for
// Macro to define InstanceMirrorKlass::oop_oop_iterate for virtual/nonvirtual for
// all closures. Macros calling macros above for each oop size.
#define InstanceMirrorKlass_OOP_OOP_ITERATE_DEFN(OopClosureType, nv_suffix) \
\
int instanceMirrorKlass:: \
int InstanceMirrorKlass:: \
oop_oop_iterate##nv_suffix(oop obj, OopClosureType* closure) { \
/* Get size before changing pointers */ \
SpecializationStats::record_iterate_call##nv_suffix(SpecializationStats::irk); \
......@@ -265,7 +265,7 @@ oop_oop_iterate##nv_suffix(oop obj, OopClosureType* closure) {
#ifndef SERIALGC
#define InstanceMirrorKlass_OOP_OOP_ITERATE_BACKWARDS_DEFN(OopClosureType, nv_suffix) \
\
int instanceMirrorKlass:: \
int InstanceMirrorKlass:: \
oop_oop_iterate_backwards##nv_suffix(oop obj, OopClosureType* closure) { \
/* Get size before changing pointers */ \
SpecializationStats::record_iterate_call##nv_suffix(SpecializationStats::irk); \
......@@ -283,7 +283,7 @@ oop_oop_iterate_backwards##nv_suffix(oop obj, OopClosureType* closure) {
#define InstanceMirrorKlass_OOP_OOP_ITERATE_DEFN_m(OopClosureType, nv_suffix) \
\
int instanceMirrorKlass:: \
int InstanceMirrorKlass:: \
oop_oop_iterate##nv_suffix##_m(oop obj, \
OopClosureType* closure, \
MemRegion mr) { \
......@@ -318,7 +318,7 @@ ALL_OOP_OOP_ITERATE_CLOSURES_1(InstanceMirrorKlass_OOP_OOP_ITERATE_DEFN_m)
ALL_OOP_OOP_ITERATE_CLOSURES_2(InstanceMirrorKlass_OOP_OOP_ITERATE_DEFN_m)
#ifndef SERIALGC
void instanceMirrorKlass::oop_push_contents(PSPromotionManager* pm, oop obj) {
void InstanceMirrorKlass::oop_push_contents(PSPromotionManager* pm, oop obj) {
// Note that we don't have to follow the mirror -> klass pointer, since all
// klasses that are dirty will be scavenged when we iterate over the
// ClassLoaderData objects.
......@@ -332,7 +332,7 @@ void instanceMirrorKlass::oop_push_contents(PSPromotionManager* pm, oop obj) {
assert_nothing )
}
int instanceMirrorKlass::oop_update_pointers(ParCompactionManager* cm, oop obj) {
int InstanceMirrorKlass::oop_update_pointers(ParCompactionManager* cm, oop obj) {
int size = oop_size(obj);
InstanceKlass::oop_update_pointers(cm, obj);
......@@ -355,14 +355,14 @@ int instanceMirrorKlass::oop_update_pointers(ParCompactionManager* cm, oop obj)
}
#endif // SERIALGC
int instanceMirrorKlass::instance_size(KlassHandle k) {
int InstanceMirrorKlass::instance_size(KlassHandle k) {
if (k() != NULL && k->oop_is_instance()) {
return align_object_size(size_helper() + InstanceKlass::cast(k())->static_field_size());
}
return size_helper();
}
instanceOop instanceMirrorKlass::allocate_instance(KlassHandle k, TRAPS) {
instanceOop InstanceMirrorKlass::allocate_instance(KlassHandle k, TRAPS) {
// Query before forming handle.
int size = instance_size(k);
KlassHandle h_k(THREAD, this);
......@@ -370,11 +370,11 @@ instanceOop instanceMirrorKlass::allocate_instance(KlassHandle k, TRAPS) {
return i;
}
int instanceMirrorKlass::oop_size(oop obj) const {
int InstanceMirrorKlass::oop_size(oop obj) const {
return java_lang_Class::oop_size(obj);
}
int instanceMirrorKlass::compute_static_oop_field_count(oop obj) {
int InstanceMirrorKlass::compute_static_oop_field_count(oop obj) {
Klass* k = java_lang_Class::as_Klass(obj);
if (k != NULL && k->oop_is_instance()) {
return InstanceKlass::cast(k)->static_oop_field_count();
......
......@@ -29,7 +29,7 @@
#include "oops/instanceKlass.hpp"
#include "runtime/handles.hpp"
// An instanceMirrorKlass is a specialized InstanceKlass for
// An InstanceMirrorKlass is a specialized InstanceKlass for
// java.lang.Class instances. These instances are special because
// they contain the static fields of the class in addition to the
// normal fields of Class. This means they are variable sized
......@@ -37,7 +37,7 @@
// iteration of their oops.
class instanceMirrorKlass: public InstanceKlass {
class InstanceMirrorKlass: public InstanceKlass {
friend class VMStructs;
friend class InstanceKlass;
......@@ -45,18 +45,18 @@ class instanceMirrorKlass: public InstanceKlass {
static int _offset_of_static_fields;
// Constructor
instanceMirrorKlass(int vtable_len, int itable_len, int static_field_size, int nonstatic_oop_map_size, ReferenceType rt, AccessFlags access_flags, bool is_anonymous)
InstanceMirrorKlass(int vtable_len, int itable_len, int static_field_size, int nonstatic_oop_map_size, ReferenceType rt, AccessFlags access_flags, bool is_anonymous)
: InstanceKlass(vtable_len, itable_len, static_field_size, nonstatic_oop_map_size, rt, access_flags, is_anonymous) {}
public:
instanceMirrorKlass() { assert(DumpSharedSpaces || UseSharedSpaces, "only for CDS"); }
InstanceMirrorKlass() { assert(DumpSharedSpaces || UseSharedSpaces, "only for CDS"); }
// Type testing
bool oop_is_instanceMirror() const { return true; }
// Casting from Klass*
static instanceMirrorKlass* cast(Klass* k) {
assert(k->oop_is_instanceMirror(), "cast to instanceMirrorKlass");
return (instanceMirrorKlass*) k;
static InstanceMirrorKlass* cast(Klass* k) {
assert(k->oop_is_instanceMirror(), "cast to InstanceMirrorKlass");
return (InstanceMirrorKlass*) k;
}
// Returns the size of the instance including the extra static fields.
......@@ -71,7 +71,7 @@ class instanceMirrorKlass: public InstanceKlass {
static void init_offset_of_static_fields() {
// Cache the offset of the static fields in the Class instance
assert(_offset_of_static_fields == 0, "once");
_offset_of_static_fields = instanceMirrorKlass::cast(SystemDictionary::Class_klass())->size_helper() << LogHeapWordSize;
_offset_of_static_fields = InstanceMirrorKlass::cast(SystemDictionary::Class_klass())->size_helper() << LogHeapWordSize;
}
static int offset_of_static_fields() {
......
......@@ -45,12 +45,12 @@
#endif
template <class T>
void specialized_oop_follow_contents(instanceRefKlass* ref, oop obj) {
void specialized_oop_follow_contents(InstanceRefKlass* ref, oop obj) {
T* referent_addr = (T*)java_lang_ref_Reference::referent_addr(obj);
T heap_oop = oopDesc::load_heap_oop(referent_addr);
debug_only(
if(TraceReferenceGC && PrintGCDetails) {
gclog_or_tty->print_cr("instanceRefKlass::oop_follow_contents " INTPTR_FORMAT, obj);
gclog_or_tty->print_cr("InstanceRefKlass::oop_follow_contents " INTPTR_FORMAT, obj);
}
)
if (!oopDesc::is_null(heap_oop)) {
......@@ -112,7 +112,7 @@ void specialized_oop_follow_contents(instanceRefKlass* ref, oop obj) {
ref->InstanceKlass::oop_follow_contents(obj);
}
void instanceRefKlass::oop_follow_contents(oop obj) {
void InstanceRefKlass::oop_follow_contents(oop obj) {
if (UseCompressedOops) {
specialized_oop_follow_contents<narrowOop>(this, obj);
} else {
......@@ -122,14 +122,14 @@ void instanceRefKlass::oop_follow_contents(oop obj) {
#ifndef SERIALGC
template <class T>
void specialized_oop_follow_contents(instanceRefKlass* ref,
void specialized_oop_follow_contents(InstanceRefKlass* ref,
ParCompactionManager* cm,
oop obj) {
T* referent_addr = (T*)java_lang_ref_Reference::referent_addr(obj);
T heap_oop = oopDesc::load_heap_oop(referent_addr);
debug_only(
if(TraceReferenceGC && PrintGCDetails) {
gclog_or_tty->print_cr("instanceRefKlass::oop_follow_contents " INTPTR_FORMAT, obj);
gclog_or_tty->print_cr("InstanceRefKlass::oop_follow_contents " INTPTR_FORMAT, obj);
}
)
if (!oopDesc::is_null(heap_oop)) {
......@@ -186,7 +186,7 @@ void specialized_oop_follow_contents(instanceRefKlass* ref,
ref->InstanceKlass::oop_follow_contents(cm, obj);
}
void instanceRefKlass::oop_follow_contents(ParCompactionManager* cm,
void InstanceRefKlass::oop_follow_contents(ParCompactionManager* cm,
oop obj) {
if (UseCompressedOops) {
specialized_oop_follow_contents<narrowOop>(this, cm, obj);
......@@ -218,18 +218,18 @@ template <class T> void trace_reference_gc(const char *s, oop obj,
}
#endif
template <class T> void specialized_oop_adjust_pointers(instanceRefKlass *ref, oop obj) {
template <class T> void specialized_oop_adjust_pointers(InstanceRefKlass *ref, oop obj) {
T* referent_addr = (T*)java_lang_ref_Reference::referent_addr(obj);
MarkSweep::adjust_pointer(referent_addr);
T* next_addr = (T*)java_lang_ref_Reference::next_addr(obj);
MarkSweep::adjust_pointer(next_addr);
T* discovered_addr = (T*)java_lang_ref_Reference::discovered_addr(obj);
MarkSweep::adjust_pointer(discovered_addr);
debug_only(trace_reference_gc("instanceRefKlass::oop_adjust_pointers", obj,
debug_only(trace_reference_gc("InstanceRefKlass::oop_adjust_pointers", obj,
referent_addr, next_addr, discovered_addr);)
}
int instanceRefKlass::oop_adjust_pointers(oop obj) {
int InstanceRefKlass::oop_adjust_pointers(oop obj) {
int size = size_helper();
InstanceKlass::oop_adjust_pointers(obj);
......@@ -298,12 +298,12 @@ int instanceRefKlass::oop_adjust_pointers(oop obj) {
template <class T> bool contains(T *t) { return true; }
// Macro to define instanceRefKlass::oop_oop_iterate for virtual/nonvirtual for
// Macro to define InstanceRefKlass::oop_oop_iterate for virtual/nonvirtual for
// all closures. Macros calling macros above for each oop size.
#define InstanceRefKlass_OOP_OOP_ITERATE_DEFN(OopClosureType, nv_suffix) \
\
int instanceRefKlass:: \
int InstanceRefKlass:: \
oop_oop_iterate##nv_suffix(oop obj, OopClosureType* closure) { \
/* Get size before changing pointers */ \
SpecializationStats::record_iterate_call##nv_suffix(SpecializationStats::irk);\
......@@ -320,7 +320,7 @@ oop_oop_iterate##nv_suffix(oop obj, OopClosureType* closure) {
#ifndef SERIALGC
#define InstanceRefKlass_OOP_OOP_ITERATE_BACKWARDS_DEFN(OopClosureType, nv_suffix) \
\
int instanceRefKlass:: \
int InstanceRefKlass:: \
oop_oop_iterate_backwards##nv_suffix(oop obj, OopClosureType* closure) { \
/* Get size before changing pointers */ \
SpecializationStats::record_iterate_call##nv_suffix(SpecializationStats::irk);\
......@@ -338,7 +338,7 @@ oop_oop_iterate_backwards##nv_suffix(oop obj, OopClosureType* closure) {
#define InstanceRefKlass_OOP_OOP_ITERATE_DEFN_m(OopClosureType, nv_suffix) \
\
int instanceRefKlass:: \
int InstanceRefKlass:: \
oop_oop_iterate##nv_suffix##_m(oop obj, \
OopClosureType* closure, \
MemRegion mr) { \
......@@ -363,7 +363,7 @@ ALL_OOP_OOP_ITERATE_CLOSURES_2(InstanceRefKlass_OOP_OOP_ITERATE_DEFN_m)
#ifndef SERIALGC
template <class T>
void specialized_oop_push_contents(instanceRefKlass *ref,
void specialized_oop_push_contents(InstanceRefKlass *ref,
PSPromotionManager* pm, oop obj) {
T* referent_addr = (T*)java_lang_ref_Reference::referent_addr(obj);
if (PSScavenge::should_scavenge(referent_addr)) {
......@@ -414,7 +414,7 @@ void specialized_oop_push_contents(instanceRefKlass *ref,
ref->InstanceKlass::oop_push_contents(pm, obj);
}
void instanceRefKlass::oop_push_contents(PSPromotionManager* pm, oop obj) {
void InstanceRefKlass::oop_push_contents(PSPromotionManager* pm, oop obj) {
if (UseCompressedOops) {
specialized_oop_push_contents<narrowOop>(this, pm, obj);
} else {
......@@ -423,7 +423,7 @@ void instanceRefKlass::oop_push_contents(PSPromotionManager* pm, oop obj) {
}
template <class T>
void specialized_oop_update_pointers(instanceRefKlass *ref,
void specialized_oop_update_pointers(InstanceRefKlass *ref,
ParCompactionManager* cm, oop obj) {
T* referent_addr = (T*)java_lang_ref_Reference::referent_addr(obj);
PSParallelCompact::adjust_pointer(referent_addr);
......@@ -431,11 +431,11 @@ void specialized_oop_update_pointers(instanceRefKlass *ref,
PSParallelCompact::adjust_pointer(next_addr);
T* discovered_addr = (T*)java_lang_ref_Reference::discovered_addr(obj);
PSParallelCompact::adjust_pointer(discovered_addr);
debug_only(trace_reference_gc("instanceRefKlass::oop_update_ptrs", obj,
debug_only(trace_reference_gc("InstanceRefKlass::oop_update_ptrs", obj,
referent_addr, next_addr, discovered_addr);)
}
int instanceRefKlass::oop_update_pointers(ParCompactionManager* cm, oop obj) {
int InstanceRefKlass::oop_update_pointers(ParCompactionManager* cm, oop obj) {
InstanceKlass::oop_update_pointers(cm, obj);
if (UseCompressedOops) {
specialized_oop_update_pointers<narrowOop>(this, cm, obj);
......@@ -446,7 +446,7 @@ int instanceRefKlass::oop_update_pointers(ParCompactionManager* cm, oop obj) {
}
#endif // SERIALGC
void instanceRefKlass::update_nonstatic_oop_maps(Klass* k) {
void InstanceRefKlass::update_nonstatic_oop_maps(Klass* k) {
// Clear the nonstatic oop-map entries corresponding to referent
// and nextPending field. They are treated specially by the
// garbage collector.
......@@ -485,7 +485,7 @@ void instanceRefKlass::update_nonstatic_oop_maps(Klass* k) {
// Verification
void instanceRefKlass::oop_verify_on(oop obj, outputStream* st) {
void InstanceRefKlass::oop_verify_on(oop obj, outputStream* st) {
InstanceKlass::oop_verify_on(obj, st);
// Verify referent field
oop referent = java_lang_ref_Reference::referent(obj);
......@@ -506,13 +506,13 @@ void instanceRefKlass::oop_verify_on(oop obj, outputStream* st) {
}
}
bool instanceRefKlass::owns_pending_list_lock(JavaThread* thread) {
bool InstanceRefKlass::owns_pending_list_lock(JavaThread* thread) {
if (java_lang_ref_Reference::pending_list_lock() == NULL) return false;
Handle h_lock(thread, java_lang_ref_Reference::pending_list_lock());
return ObjectSynchronizer::current_thread_holds_lock(thread, h_lock);
}
void instanceRefKlass::acquire_pending_list_lock(BasicLock *pending_list_basic_lock) {
void InstanceRefKlass::acquire_pending_list_lock(BasicLock *pending_list_basic_lock) {
// we may enter this with pending exception set
PRESERVE_EXCEPTION_MARK; // exceptions are never thrown, needed for TRAPS argument
......@@ -529,7 +529,7 @@ void instanceRefKlass::acquire_pending_list_lock(BasicLock *pending_list_basic_l
if (HAS_PENDING_EXCEPTION) CLEAR_PENDING_EXCEPTION;
}
void instanceRefKlass::release_and_notify_pending_list_lock(
void InstanceRefKlass::release_and_notify_pending_list_lock(
BasicLock *pending_list_basic_lock) {
// we may enter this with pending exception set
PRESERVE_EXCEPTION_MARK; // exceptions are never thrown, needed for TRAPS argument
......
......@@ -27,7 +27,7 @@
#include "oops/instanceKlass.hpp"
// An instanceRefKlass is a specialized InstanceKlass for Java
// An InstanceRefKlass is a specialized InstanceKlass for Java
// classes that are subclasses of java/lang/ref/Reference.
//
// These classes are used to implement soft/weak/final/phantom
......@@ -44,22 +44,22 @@
// and the pending list lock object in the same class is notified.
class instanceRefKlass: public InstanceKlass {
class InstanceRefKlass: public InstanceKlass {
friend class InstanceKlass;
// Constructor
instanceRefKlass(int vtable_len, int itable_len, int static_field_size, int nonstatic_oop_map_size, ReferenceType rt, AccessFlags access_flags, bool is_anonymous)
InstanceRefKlass(int vtable_len, int itable_len, int static_field_size, int nonstatic_oop_map_size, ReferenceType rt, AccessFlags access_flags, bool is_anonymous)
: InstanceKlass(vtable_len, itable_len, static_field_size, nonstatic_oop_map_size, rt, access_flags, is_anonymous) {}
public:
instanceRefKlass() { assert(DumpSharedSpaces || UseSharedSpaces, "only for CDS"); }
InstanceRefKlass() { assert(DumpSharedSpaces || UseSharedSpaces, "only for CDS"); }
// Type testing
bool oop_is_instanceRef() const { return true; }
// Casting from Klass*
static instanceRefKlass* cast(Klass* k) {
assert(k->oop_is_instanceRef(), "cast to instanceRefKlass");
return (instanceRefKlass*) k;
static InstanceRefKlass* cast(Klass* k) {
assert(k->oop_is_instanceRef(), "cast to InstanceRefKlass");
return (InstanceRefKlass*) k;
}
// Garbage collection
......
......@@ -376,7 +376,7 @@ void Method::print_invocation_count() {
void Method::build_interpreter_method_data(methodHandle method, TRAPS) {
// Do not profile method if current thread holds the pending list lock,
// which avoids deadlock for acquiring the MethodData_lock.
if (instanceRefKlass::owns_pending_list_lock((JavaThread*)THREAD)) {
if (InstanceRefKlass::owns_pending_list_lock((JavaThread*)THREAD)) {
return;
}
......
......@@ -169,9 +169,9 @@ class CompiledICHolder;
class Klass;
class InstanceKlass;
class instanceMirrorKlass;
class instanceClassLoaderKlass;
class instanceRefKlass;
class InstanceMirrorKlass;
class InstanceClassLoaderKlass;
class InstanceRefKlass;
class arrayKlass;
class objArrayKlass;
class typeArrayKlass;
......
......@@ -2380,7 +2380,7 @@ TypeOopPtr::TypeOopPtr( TYPES t, PTR ptr, ciKlass* k, bool xk, ciObject* o, int
assert(this->isa_instptr(), "must be an instance ptr.");
_is_ptr_to_narrowoop = false;
} else if (klass() == ciEnv::current()->Class_klass() &&
_offset >= instanceMirrorKlass::offset_of_static_fields()) {
_offset >= InstanceMirrorKlass::offset_of_static_fields()) {
// Static fields
assert(o != NULL, "must be constant");
ciInstanceKlass* k = o->as_instance()->java_lang_Class_klass()->as_instance_klass();
......
......@@ -2790,7 +2790,7 @@ inline bool VM_HeapWalkOperation::iterate_over_type_array(oop o) {
static inline bool verify_static_oop(InstanceKlass* ik,
oop mirror, int offset) {
address obj_p = (address)mirror + offset;
address start = (address)instanceMirrorKlass::start_of_static_fields(mirror);
address start = (address)InstanceMirrorKlass::start_of_static_fields(mirror);
address end = start + (java_lang_Class::static_oop_field_count(mirror) * heapOopSize);
assert(end >= start, "sanity check");
......
......@@ -1374,9 +1374,9 @@ typedef TwoOopHashtable<Symbol*, mtClass> SymbolTwoOopHashtable;
declare_type(objArrayKlass, arrayKlass) \
declare_type(typeArrayKlass, arrayKlass) \
declare_type(InstanceKlass, Klass) \
declare_type(instanceClassLoaderKlass, InstanceKlass) \
declare_type(instanceMirrorKlass, InstanceKlass) \
declare_type(instanceRefKlass, InstanceKlass) \
declare_type(InstanceClassLoaderKlass, InstanceKlass) \
declare_type(InstanceMirrorKlass, InstanceKlass) \
declare_type(InstanceRefKlass, InstanceKlass) \
declare_type(ConstantPool, Metadata) \
declare_type(ConstantPoolCache, MetaspaceObj) \
declare_type(MethodData, Metadata) \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册