equal
deleted
inserted
replaced
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) { |