@@ -908,7 +908,7 @@ oop Dependencies::DepStream::argument_oop(int i) {
908908 return result;
909909}
910910
911- Klass * Dependencies::DepStream::context_type () {
911+ InstanceKlass * Dependencies::DepStream::context_type () {
912912 assert (must_be_in_vm (), " raw oops here" );
913913
914914 // Most dependencies have an explicit context type argument.
@@ -917,7 +917,7 @@ Klass* Dependencies::DepStream::context_type() {
917917 if (ctxkj >= 0 ) {
918918 Metadata* k = argument (ctxkj);
919919 assert (k != NULL && k->is_klass (), " type check" );
920- return ( Klass*)k;
920+ return InstanceKlass::cast (( Klass*)k) ;
921921 }
922922 }
923923
@@ -927,8 +927,8 @@ Klass* Dependencies::DepStream::context_type() {
927927 int ctxkj = dep_implicit_context_arg (type ());
928928 if (ctxkj >= 0 ) {
929929 Klass* k = argument_oop (ctxkj)->klass ();
930- assert (k != NULL && k-> is_klass () , " type check" );
931- return (Klass*) k ;
930+ assert (k != NULL , " type check" );
931+ return InstanceKlass::cast (k) ;
932932 }
933933 }
934934
@@ -1051,7 +1051,7 @@ class ClassHierarchyWalker {
10511051#ifdef ASSERT
10521052 // Assert that m is inherited into ctxk, without intervening overrides.
10531053 // (May return true even if this is not true, in corner cases where we punt.)
1054- bool check_method_context (Klass * ctxk, Method* m) {
1054+ bool check_method_context (InstanceKlass * ctxk, Method* m) {
10551055 if (m->method_holder () == ctxk)
10561056 return true ; // Quick win.
10571057 if (m->is_private ())
@@ -1169,6 +1169,7 @@ class ClassHierarchyWalker {
11691169 return in_list (k, &_participants[1 ]);
11701170 }
11711171 }
1172+
11721173 bool ignore_witness (Klass* witness) {
11731174 if (_record_witnesses == 0 ) {
11741175 return false ;
@@ -1196,10 +1197,8 @@ class ClassHierarchyWalker {
11961197 InstanceKlass* context_type,
11971198 bool participants_hide_witnesses);
11981199 public:
1199- Klass* find_witness_subtype (Klass* k , KlassDepChange* changes = NULL ) {
1200+ Klass* find_witness_subtype (InstanceKlass* context_type , KlassDepChange* changes = NULL ) {
12001201 assert (doing_subtype_search (), " must set up a subtype search" );
1201- assert (k->is_instance_klass (), " required" );
1202- InstanceKlass* context_type = InstanceKlass::cast (k);
12031202 // When looking for unexpected concrete types,
12041203 // do not look beneath expected ones.
12051204 const bool participants_hide_witnesses = true ;
@@ -1211,10 +1210,8 @@ class ClassHierarchyWalker {
12111210 return find_witness_anywhere (context_type, participants_hide_witnesses);
12121211 }
12131212 }
1214- Klass* find_witness_definer (Klass* k , KlassDepChange* changes = NULL ) {
1213+ Klass* find_witness_definer (InstanceKlass* context_type , KlassDepChange* changes = NULL ) {
12151214 assert (!doing_subtype_search (), " must set up a method definer search" );
1216- assert (k->is_instance_klass (), " required" );
1217- InstanceKlass* context_type = InstanceKlass::cast (k);
12181215 // When looking for unexpected concrete methods,
12191216 // look beneath expected ones, to see if there are overrides.
12201217 const bool participants_hide_witnesses = true ;
@@ -1448,17 +1445,16 @@ Klass* Dependencies::check_evol_method(Method* m) {
14481445// can be optimized more strongly than this, because we
14491446// know that the checked type comes from a concrete type,
14501447// and therefore we can disregard abstract types.)
1451- Klass* Dependencies::check_leaf_type (Klass * ctxk) {
1448+ Klass* Dependencies::check_leaf_type (InstanceKlass * ctxk) {
14521449 assert (must_be_in_vm (), " raw oops here" );
14531450 assert_locked_or_safepoint (Compile_lock);
1454- InstanceKlass* ctx = InstanceKlass::cast (ctxk);
1455- Klass* sub = ctx->subklass ();
1451+ Klass* sub = ctxk->subklass ();
14561452 if (sub != NULL ) {
14571453 return sub;
1458- } else if (ctx ->nof_implementors () != 0 ) {
1454+ } else if (ctxk ->nof_implementors () != 0 ) {
14591455 // if it is an interface, it must be unimplemented
14601456 // (if it is not an interface, nof_implementors is always zero)
1461- Klass * impl = ctx ->implementor ();
1457+ InstanceKlass * impl = ctxk ->implementor ();
14621458 assert (impl != NULL , " must be set" );
14631459 return impl;
14641460 } else {
@@ -1470,7 +1466,7 @@ Klass* Dependencies::check_leaf_type(Klass* ctxk) {
14701466// The type conck itself is allowed to have have further concrete subtypes.
14711467// This allows the compiler to narrow occurrences of ctxk by conck,
14721468// when dealing with the types of actual instances.
1473- Klass* Dependencies::check_abstract_with_unique_concrete_subtype (Klass * ctxk,
1469+ Klass* Dependencies::check_abstract_with_unique_concrete_subtype (InstanceKlass * ctxk,
14741470 Klass* conck,
14751471 KlassDepChange* changes) {
14761472 ClassHierarchyWalker wf (conck);
@@ -1483,7 +1479,7 @@ Klass* Dependencies::check_abstract_with_unique_concrete_subtype(Klass* ctxk,
14831479// proper subtypes, return ctxk itself, whether it is concrete or not.
14841480// The returned subtype is allowed to have have further concrete subtypes.
14851481// That is, return CC1 for CX > CC1 > CC2, but NULL for CX > { CC1, CC2 }.
1486- Klass* Dependencies::find_unique_concrete_subtype (Klass * ctxk) {
1482+ Klass* Dependencies::find_unique_concrete_subtype (InstanceKlass * ctxk) {
14871483 ClassHierarchyWalker wf (ctxk); // Ignore ctxk when walking.
14881484 wf.record_witnesses (1 ); // Record one other witness when walking.
14891485 Klass* wit = wf.find_witness_subtype (ctxk);
@@ -1511,7 +1507,7 @@ Klass* Dependencies::find_unique_concrete_subtype(Klass* ctxk) {
15111507
15121508// If a class (or interface) has a unique concrete method uniqm, return NULL.
15131509// Otherwise, return a class that contains an interfering method.
1514- Klass* Dependencies::check_unique_concrete_method (Klass* ctxk,
1510+ Klass* Dependencies::check_unique_concrete_method (InstanceKlass* ctxk,
15151511 Method* uniqm,
15161512 KlassDepChange* changes) {
15171513 // Here is a missing optimization: If uniqm->is_final(),
@@ -1526,7 +1522,7 @@ Klass* Dependencies::check_unique_concrete_method(Klass* ctxk,
15261522// (The method m must be defined or inherited in ctxk.)
15271523// Include m itself in the set, unless it is abstract.
15281524// If this set has exactly one element, return that element.
1529- Method* Dependencies::find_unique_concrete_method (Klass * ctxk, Method* m) {
1525+ Method* Dependencies::find_unique_concrete_method (InstanceKlass * ctxk, Method* m) {
15301526 // Return NULL if m is marked old; must have been a redefined method.
15311527 if (m->is_old ()) {
15321528 return NULL ;
@@ -1557,7 +1553,7 @@ Method* Dependencies::find_unique_concrete_method(Klass* ctxk, Method* m) {
15571553 return fm;
15581554}
15591555
1560- Klass* Dependencies::check_has_no_finalizable_subclasses (Klass * ctxk, KlassDepChange* changes) {
1556+ Klass* Dependencies::check_has_no_finalizable_subclasses (InstanceKlass * ctxk, KlassDepChange* changes) {
15611557 Klass* search_at = ctxk;
15621558 if (changes != NULL )
15631559 search_at = changes->new_type (); // just look at the new bit
0 commit comments