src/hotspot/share/oops/instanceKlass.cpp
changeset 53152 08db5aa02f7b
parent 52784 621efe32eb0b
child 53232 32c6cc430526
equal deleted inserted replaced
53151:22baf8054a40 53152:08db5aa02f7b
     1 /*
     1 /*
     2  * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
  1197     }
  1197     }
  1198     return secondaries;
  1198     return secondaries;
  1199   }
  1199   }
  1200 }
  1200 }
  1201 
  1201 
  1202 bool InstanceKlass::compute_is_subtype_of(Klass* k) {
       
  1203   if (k->is_interface()) {
       
  1204     return implements_interface(k);
       
  1205   } else {
       
  1206     return Klass::compute_is_subtype_of(k);
       
  1207   }
       
  1208 }
       
  1209 
       
  1210 bool InstanceKlass::implements_interface(Klass* k) const {
  1202 bool InstanceKlass::implements_interface(Klass* k) const {
  1211   if (this == k) return true;
  1203   if (this == k) return true;
  1212   assert(k->is_interface(), "should be an interface class");
  1204   assert(k->is_interface(), "should be an interface class");
  1213   for (int i = 0; i < transitive_interfaces()->length(); i++) {
  1205   for (int i = 0; i < transitive_interfaces()->length(); i++) {
  1214     if (transitive_interfaces()->at(i) == k) {
  1206     if (transitive_interfaces()->at(i) == k) {