@@ -575,7 +575,7 @@ void InstanceKlass::deallocate_methods(ClassLoaderData* loader_data,
575575}
576576
577577void InstanceKlass::deallocate_interfaces (ClassLoaderData* loader_data,
578- const Klass * super_klass,
578+ const InstanceKlass * super_klass,
579579 Array<InstanceKlass*>* local_interfaces,
580580 Array<InstanceKlass*>* transitive_interfaces) {
581581 // Only deallocate transitive interfaces if not empty, same as super class
@@ -584,7 +584,7 @@ void InstanceKlass::deallocate_interfaces(ClassLoaderData* loader_data,
584584 if (ti != Universe::the_empty_instance_klass_array () && ti != local_interfaces) {
585585 // check that the interfaces don't come from super class
586586 Array<InstanceKlass*>* sti = (super_klass == nullptr ) ? nullptr :
587- InstanceKlass::cast ( super_klass) ->transitive_interfaces ();
587+ super_klass->transitive_interfaces ();
588588 if (ti != sti && ti != nullptr && !ti->is_shared ()) {
589589 MetadataFactory::free_array<InstanceKlass*>(loader_data, ti);
590590 }
@@ -677,7 +677,7 @@ void InstanceKlass::deallocate_contents(ClassLoaderData* loader_data) {
677677 }
678678 set_secondary_supers (nullptr , SECONDARY_SUPERS_BITMAP_EMPTY);
679679
680- deallocate_interfaces (loader_data, super (), local_interfaces (), transitive_interfaces ());
680+ deallocate_interfaces (loader_data, java_super (), local_interfaces (), transitive_interfaces ());
681681 set_transitive_interfaces (nullptr );
682682 set_local_interfaces (nullptr );
683683
@@ -942,7 +942,7 @@ bool InstanceKlass::link_class_impl(TRAPS) {
942942 JavaThread* jt = THREAD;
943943
944944 // link super class before linking this class
945- Klass * super_klass = super ();
945+ InstanceKlass * super_klass = java_super ();
946946 if (super_klass != nullptr ) {
947947 if (super_klass->is_interface ()) { // check if super class is an interface
948948 ResourceMark rm (THREAD);
@@ -957,8 +957,7 @@ bool InstanceKlass::link_class_impl(TRAPS) {
957957 return false ;
958958 }
959959
960- InstanceKlass* ik_super = InstanceKlass::cast (super_klass);
961- ik_super->link_class_impl (CHECK_false);
960+ super_klass->link_class_impl (CHECK_false);
962961 }
963962
964963 // link all interfaces implemented by this class before linking this class
@@ -1805,15 +1804,15 @@ bool InstanceKlass::find_local_field(Symbol* name, Symbol* sig, fieldDescriptor*
18051804Klass* InstanceKlass::find_interface_field (Symbol* name, Symbol* sig, fieldDescriptor* fd) const {
18061805 const int n = local_interfaces ()->length ();
18071806 for (int i = 0 ; i < n; i++) {
1808- Klass * intf1 = local_interfaces ()->at (i);
1807+ InstanceKlass * intf1 = local_interfaces ()->at (i);
18091808 assert (intf1->is_interface (), " just checking type" );
18101809 // search for field in current interface
1811- if (InstanceKlass::cast ( intf1) ->find_local_field (name, sig, fd)) {
1810+ if (intf1->find_local_field (name, sig, fd)) {
18121811 assert (fd->is_static (), " interface field must be static" );
18131812 return intf1;
18141813 }
18151814 // search for field in direct superinterfaces
1816- Klass* intf2 = InstanceKlass::cast ( intf1) ->find_interface_field (name, sig, fd);
1815+ Klass* intf2 = intf1->find_interface_field (name, sig, fd);
18171816 if (intf2 != nullptr ) return intf2;
18181817 }
18191818 // otherwise field lookup fails
@@ -1832,8 +1831,8 @@ Klass* InstanceKlass::find_field(Symbol* name, Symbol* sig, fieldDescriptor* fd)
18321831 if (intf != nullptr ) return intf;
18331832 }
18341833 // 3) apply field lookup recursively if superclass exists
1835- { Klass * supr = super ();
1836- if (supr != nullptr ) return InstanceKlass::cast ( supr) ->find_field (name, sig, fd);
1834+ { InstanceKlass * supr = java_super ();
1835+ if (supr != nullptr ) return supr->find_field (name, sig, fd);
18371836 }
18381837 // 4) otherwise field lookup fails
18391838 return nullptr ;
@@ -1852,8 +1851,8 @@ Klass* InstanceKlass::find_field(Symbol* name, Symbol* sig, bool is_static, fiel
18521851 if (intf != nullptr ) return intf;
18531852 }
18541853 // 3) apply field lookup recursively if superclass exists
1855- { Klass * supr = super ();
1856- if (supr != nullptr ) return InstanceKlass::cast ( supr) ->find_field (name, sig, is_static, fd);
1854+ { InstanceKlass * supr = java_super ();
1855+ if (supr != nullptr ) return supr->find_field (name, sig, is_static, fd);
18571856 }
18581857 // 4) otherwise field lookup fails
18591858 return nullptr ;
@@ -1872,12 +1871,12 @@ bool InstanceKlass::find_local_field_from_offset(int offset, bool is_static, fie
18721871
18731872
18741873bool InstanceKlass::find_field_from_offset (int offset, bool is_static, fieldDescriptor* fd) const {
1875- Klass * klass = const_cast <InstanceKlass*>( this ) ;
1874+ const InstanceKlass * klass = this ;
18761875 while (klass != nullptr ) {
1877- if (InstanceKlass::cast ( klass) ->find_local_field_from_offset (offset, is_static, fd)) {
1876+ if (klass->find_local_field_from_offset (offset, is_static, fd)) {
18781877 return true ;
18791878 }
1880- klass = klass->super ();
1879+ klass = klass->java_super ();
18811880 }
18821881 return false ;
18831882}
@@ -1920,7 +1919,7 @@ void InstanceKlass::do_local_static_fields(void f(fieldDescriptor*, Handle, TRAP
19201919}
19211920
19221921void InstanceKlass::do_nonstatic_fields (FieldClosure* cl) {
1923- InstanceKlass* super = superklass ();
1922+ InstanceKlass* super = java_super ();
19241923 if (super != nullptr ) {
19251924 super->do_nonstatic_fields (cl);
19261925 }
@@ -1937,7 +1936,7 @@ static int compare_fields_by_offset(FieldInfo* a, FieldInfo* b) {
19371936}
19381937
19391938void InstanceKlass::print_nonstatic_fields (FieldClosure* cl) {
1940- InstanceKlass* super = superklass ();
1939+ InstanceKlass* super = java_super ();
19411940 if (super != nullptr ) {
19421941 super->print_nonstatic_fields (cl);
19431942 }
@@ -2232,17 +2231,17 @@ Method* InstanceKlass::uncached_lookup_method(const Symbol* name,
22322231 OverpassLookupMode overpass_mode,
22332232 PrivateLookupMode private_mode) const {
22342233 OverpassLookupMode overpass_local_mode = overpass_mode;
2235- const Klass * klass = this ;
2234+ const InstanceKlass * klass = this ;
22362235 while (klass != nullptr ) {
2237- Method* const method = InstanceKlass::cast ( klass) ->find_method_impl (name,
2238- signature,
2239- overpass_local_mode,
2240- StaticLookupMode::find,
2241- private_mode);
2236+ Method* const method = klass->find_method_impl (name,
2237+ signature,
2238+ overpass_local_mode,
2239+ StaticLookupMode::find,
2240+ private_mode);
22422241 if (method != nullptr ) {
22432242 return method;
22442243 }
2245- klass = klass->super ();
2244+ klass = klass->java_super ();
22462245 overpass_local_mode = OverpassLookupMode::skip; // Always ignore overpass methods in superclasses
22472246 }
22482247 return nullptr ;
@@ -2252,12 +2251,12 @@ Method* InstanceKlass::uncached_lookup_method(const Symbol* name,
22522251// search through class hierarchy and return true if this class or
22532252// one of the superclasses was redefined
22542253bool InstanceKlass::has_redefined_this_or_super () const {
2255- const Klass * klass = this ;
2254+ const InstanceKlass * klass = this ;
22562255 while (klass != nullptr ) {
2257- if (InstanceKlass::cast ( klass) ->has_been_redefined ()) {
2256+ if (klass->has_been_redefined ()) {
22582257 return true ;
22592258 }
2260- klass = klass->super ();
2259+ klass = klass->java_super ();
22612260 }
22622261 return false ;
22632262}
@@ -3986,15 +3985,15 @@ void InstanceKlass::print_class_load_helper(ClassLoaderData* loader_data,
39863985
39873986 // Class hierarchy info
39883987 debug_stream.print (" klass: " PTR_FORMAT " super: " PTR_FORMAT,
3989- p2i (this ), p2i (superklass ()));
3988+ p2i (this ), p2i (java_super ()));
39903989
39913990 // Interfaces
39923991 if (local_interfaces () != nullptr && local_interfaces ()->length () > 0 ) {
39933992 debug_stream.print (" interfaces:" );
39943993 int length = local_interfaces ()->length ();
39953994 for (int i = 0 ; i < length; i++) {
39963995 debug_stream.print (" " PTR_FORMAT,
3997- p2i (InstanceKlass::cast ( local_interfaces ()->at (i) )));
3996+ p2i (local_interfaces ()->at (i)));
39983997 }
39993998 }
40003999
@@ -4207,19 +4206,17 @@ void InstanceKlass::oop_verify_on(oop obj, outputStream* st) {
42074206 obj->oop_iterate (&blk);
42084207}
42094208
4210-
42114209// JNIid class for jfieldIDs only
42124210// Note to reviewers:
42134211// These JNI functions are just moved over to column 1 and not changed
42144212// in the compressed oops workspace.
4215- JNIid::JNIid (Klass * holder, int offset, JNIid* next) {
4213+ JNIid::JNIid (InstanceKlass * holder, int offset, JNIid* next) {
42164214 _holder = holder;
42174215 _offset = offset;
42184216 _next = next;
42194217 DEBUG_ONLY (_is_static_field_id = false ;)
42204218}
42214219
4222-
42234220JNIid* JNIid::find (int offset) {
42244221 JNIid* current = this ;
42254222 while (current != nullptr ) {
@@ -4237,11 +4234,10 @@ void JNIid::deallocate(JNIid* current) {
42374234 }
42384235}
42394236
4240-
4241- void JNIid::verify (Klass* holder) {
4237+ void JNIid::verify (InstanceKlass* holder) {
42424238 int first_field_offset = InstanceMirrorKlass::offset_of_static_fields ();
42434239 int end_field_offset;
4244- end_field_offset = first_field_offset + (InstanceKlass::cast ( holder) ->static_field_size () * wordSize);
4240+ end_field_offset = first_field_offset + (holder->static_field_size () * wordSize);
42454241
42464242 JNIid* current = this ;
42474243 while (current != nullptr ) {
@@ -4554,7 +4550,7 @@ void ClassHierarchyIterator::next() {
45544550 }
45554551 _visit_subclasses = true ; // reset
45564552 while (_current->next_sibling () == nullptr && _current != _root) {
4557- _current = _current->superklass (); // backtrack; no more sibling subclasses left
4553+ _current = _current->java_super (); // backtrack; no more sibling subclasses left
45584554 }
45594555 if (_current == _root) {
45604556 // Iteration is over (back at root after backtracking). Invalidate the iterator.
0 commit comments