1.1 --- a/src/share/vm/oops/instanceKlass.cpp Tue May 21 19:52:01 2013 -0700 1.2 +++ b/src/share/vm/oops/instanceKlass.cpp Wed May 22 14:37:49 2013 -0400 1.3 @@ -268,8 +268,6 @@ 1.4 set_fields(NULL, 0); 1.5 set_constants(NULL); 1.6 set_class_loader_data(NULL); 1.7 - set_protection_domain(NULL); 1.8 - set_signers(NULL); 1.9 set_source_file_name(NULL); 1.10 set_source_debug_extension(NULL, 0); 1.11 set_array_name(NULL); 1.12 @@ -279,7 +277,6 @@ 1.13 set_is_marked_dependent(false); 1.14 set_init_state(InstanceKlass::allocated); 1.15 set_init_thread(NULL); 1.16 - set_init_lock(NULL); 1.17 set_reference_type(rt); 1.18 set_oop_map_cache(NULL); 1.19 set_jni_ids(NULL); 1.20 @@ -408,12 +405,6 @@ 1.21 } 1.22 set_inner_classes(NULL); 1.23 1.24 - // Null out Java heap objects, although these won't be walked to keep 1.25 - // alive once this InstanceKlass is deallocated. 1.26 - set_protection_domain(NULL); 1.27 - set_signers(NULL); 1.28 - set_init_lock(NULL); 1.29 - 1.30 // We should deallocate the Annotations instance 1.31 MetadataFactory::free_metadata(loader_data, annotations()); 1.32 set_annotations(NULL); 1.33 @@ -451,6 +442,24 @@ 1.34 } 1.35 } 1.36 1.37 +// JVMTI spec thinks there are signers and protection domain in the 1.38 +// instanceKlass. These accessors pretend these fields are there. 1.39 +// The hprof specification also thinks these fields are in InstanceKlass. 1.40 +oop InstanceKlass::protection_domain() const { 1.41 + // return the protection_domain from the mirror 1.42 + return java_lang_Class::protection_domain(java_mirror()); 1.43 +} 1.44 + 1.45 +// To remove these from requires an incompatible change and CCC request. 1.46 +objArrayOop InstanceKlass::signers() const { 1.47 + // return the signers from the mirror 1.48 + return java_lang_Class::signers(java_mirror()); 1.49 +} 1.50 + 1.51 +volatile oop InstanceKlass::init_lock() const { 1.52 + // return the init lock from the mirror 1.53 + return java_lang_Class::init_lock(java_mirror()); 1.54 +} 1.55 1.56 void InstanceKlass::eager_initialize_impl(instanceKlassHandle this_oop) { 1.57 EXCEPTION_MARK; 1.58 @@ -1883,16 +1892,6 @@ 1.59 1.60 // Garbage collection 1.61 1.62 -void InstanceKlass::oops_do(OopClosure* cl) { 1.63 - Klass::oops_do(cl); 1.64 - 1.65 - cl->do_oop(adr_protection_domain()); 1.66 - cl->do_oop(adr_signers()); 1.67 - cl->do_oop(adr_init_lock()); 1.68 - 1.69 - // Don't walk the arrays since they are walked from the ClassLoaderData objects. 1.70 -} 1.71 - 1.72 #ifdef ASSERT 1.73 template <class T> void assert_is_in(T *p) { 1.74 T heap_oop = oopDesc::load_heap_oop(p); 1.75 @@ -2241,9 +2240,6 @@ 1.76 m->remove_unshareable_info(); 1.77 } 1.78 1.79 - // Need to reinstate when reading back the class. 1.80 - set_init_lock(NULL); 1.81 - 1.82 // do array classes also. 1.83 array_klasses_do(remove_unshareable_in_class); 1.84 } 1.85 @@ -2275,13 +2271,6 @@ 1.86 ik->itable()->initialize_itable(false, CHECK); 1.87 } 1.88 1.89 - // Allocate a simple java object for a lock. 1.90 - // This needs to be a java object because during class initialization 1.91 - // it can be held across a java call. 1.92 - typeArrayOop r = oopFactory::new_typeArray(T_INT, 0, CHECK); 1.93 - Handle h(THREAD, (oop)r); 1.94 - ik->set_init_lock(h()); 1.95 - 1.96 // restore constant pool resolved references 1.97 ik->constants()->restore_unshareable_info(CHECK); 1.98 1.99 @@ -2836,10 +2825,7 @@ 1.100 class_loader_data()->print_value_on(st); 1.101 st->cr(); 1.102 } 1.103 - st->print(BULLET"protection domain: "); ((InstanceKlass*)this)->protection_domain()->print_value_on(st); st->cr(); 1.104 st->print(BULLET"host class: "); host_klass()->print_value_on_maybe_null(st); st->cr(); 1.105 - st->print(BULLET"signers: "); signers()->print_value_on(st); st->cr(); 1.106 - st->print(BULLET"init_lock: "); ((oop)_init_lock)->print_value_on(st); st->cr(); 1.107 if (source_file_name() != NULL) { 1.108 st->print(BULLET"source file: "); 1.109 source_file_name()->print_value_on(st); 1.110 @@ -3040,7 +3026,6 @@ 1.111 n += (sz->_method_ordering_bytes = sz->count_array(method_ordering())); 1.112 n += (sz->_local_interfaces_bytes = sz->count_array(local_interfaces())); 1.113 n += (sz->_transitive_interfaces_bytes = sz->count_array(transitive_interfaces())); 1.114 - n += (sz->_signers_bytes = sz->count_array(signers())); 1.115 n += (sz->_fields_bytes = sz->count_array(fields())); 1.116 n += (sz->_inner_classes_bytes = sz->count_array(inner_classes())); 1.117 sz->_ro_bytes += n; 1.118 @@ -3206,17 +3191,11 @@ 1.119 guarantee(constants()->is_metadata(), "should be in metaspace"); 1.120 guarantee(constants()->is_constantPool(), "should be constant pool"); 1.121 } 1.122 - if (protection_domain() != NULL) { 1.123 - guarantee(protection_domain()->is_oop(), "should be oop"); 1.124 - } 1.125 const Klass* host = host_klass(); 1.126 if (host != NULL) { 1.127 guarantee(host->is_metadata(), "should be in metaspace"); 1.128 guarantee(host->is_klass(), "should be klass"); 1.129 } 1.130 - if (signers() != NULL) { 1.131 - guarantee(signers()->is_objArray(), "should be obj array"); 1.132 - } 1.133 } 1.134 1.135 void InstanceKlass::oop_verify_on(oop obj, outputStream* st) {