@@ -1166,7 +1166,7 @@ Klass* AbstractClassHierarchyWalker::find_witness(InstanceKlass* context_type, K
1166
1166
return nullptr ; // no implementors
1167
1167
} else if (nof_impls == 1 ) { // unique implementor
1168
1168
assert (context_type != context_type->implementor (), " not unique" );
1169
- context_type = InstanceKlass::cast ( context_type->implementor () );
1169
+ context_type = context_type->implementor ();
1170
1170
} else { // nof_impls >= 2
1171
1171
// Avoid this case: *I.m > { A.m, C }; B.m > C
1172
1172
// Here, I.m has 2 concrete implementations, but m appears unique
@@ -1597,10 +1597,9 @@ bool Dependencies::verify_method_context(InstanceKlass* ctxk, Method* m) {
1597
1597
return true ; // Must punt the assertion to true.
1598
1598
}
1599
1599
Method* lm = ctxk->lookup_method (m->name (), m->signature ());
1600
- if (lm == nullptr && ctxk-> is_instance_klass () ) {
1600
+ if (lm == nullptr ) {
1601
1601
// It might be an interface method
1602
- lm = InstanceKlass::cast (ctxk)->lookup_method_in_ordered_interfaces (m->name (),
1603
- m->signature ());
1602
+ lm = ctxk->lookup_method_in_ordered_interfaces (m->name (), m->signature ());
1604
1603
}
1605
1604
if (lm == m) {
1606
1605
// Method m is inherited into ctxk.
@@ -2174,7 +2173,7 @@ Klass* Dependencies::DepStream::spot_check_dependency_at(DepChange& changes) {
2174
2173
void DepChange::print () {
2175
2174
int nsup = 0 , nint = 0 ;
2176
2175
for (ContextStream str (*this ); str.next (); ) {
2177
- Klass * k = str.klass ();
2176
+ InstanceKlass * k = str.klass ();
2178
2177
switch (str.change_type ()) {
2179
2178
case Change_new_type:
2180
2179
tty->print_cr (" dependee = %s" , k->external_name ());
@@ -2203,7 +2202,7 @@ void DepChange::print() {
2203
2202
}
2204
2203
2205
2204
void DepChange::ContextStream::start () {
2206
- Klass * type = (_changes.is_klass_change () ? _changes.as_klass_change ()->type () : (Klass *) nullptr );
2205
+ InstanceKlass * type = (_changes.is_klass_change () ? _changes.as_klass_change ()->type () : (InstanceKlass *) nullptr );
2207
2206
_change_type = (type == nullptr ? NO_CHANGE : Start_Klass);
2208
2207
_klass = type;
2209
2208
_ti_base = nullptr ;
@@ -2214,7 +2213,7 @@ void DepChange::ContextStream::start() {
2214
2213
bool DepChange::ContextStream::next () {
2215
2214
switch (_change_type) {
2216
2215
case Start_Klass: // initial state; _klass is the new type
2217
- _ti_base = InstanceKlass::cast ( _klass) ->transitive_interfaces ();
2216
+ _ti_base = _klass->transitive_interfaces ();
2218
2217
_ti_index = 0 ;
2219
2218
_change_type = Change_new_type;
2220
2219
return true ;
@@ -2224,7 +2223,7 @@ bool DepChange::ContextStream::next() {
2224
2223
case Change_new_sub:
2225
2224
// 6598190: brackets workaround Sun Studio C++ compiler bug 6629277
2226
2225
{
2227
- _klass = _klass->super ();
2226
+ _klass = _klass->java_super ();
2228
2227
if (_klass != nullptr ) {
2229
2228
return true ;
2230
2229
}
@@ -2254,18 +2253,18 @@ void KlassDepChange::initialize() {
2254
2253
// Mark all dependee and all its superclasses
2255
2254
// Mark transitive interfaces
2256
2255
for (ContextStream str (*this ); str.next (); ) {
2257
- Klass * d = str.klass ();
2258
- assert (!InstanceKlass::cast (d) ->is_marked_dependent (), " checking" );
2259
- InstanceKlass::cast (d) ->set_is_marked_dependent (true );
2256
+ InstanceKlass * d = str.klass ();
2257
+ assert (!d ->is_marked_dependent (), " checking" );
2258
+ d ->set_is_marked_dependent (true );
2260
2259
}
2261
2260
}
2262
2261
2263
2262
KlassDepChange::~KlassDepChange () {
2264
2263
// Unmark all dependee and all its superclasses
2265
2264
// Unmark transitive interfaces
2266
2265
for (ContextStream str (*this ); str.next (); ) {
2267
- Klass * d = str.klass ();
2268
- InstanceKlass::cast (d) ->set_is_marked_dependent (false );
2266
+ InstanceKlass * d = str.klass ();
2267
+ d ->set_is_marked_dependent (false );
2269
2268
}
2270
2269
}
2271
2270
0 commit comments