hotspot/src/share/vm/oops/instanceKlass.cpp
changeset 21917 325b980b3208
parent 21916 4977554a0c5e
parent 21768 b7dba4cde1c6
child 21919 70200a883e9d
--- a/hotspot/src/share/vm/oops/instanceKlass.cpp	Tue Nov 26 14:35:38 2013 +0100
+++ b/hotspot/src/share/vm/oops/instanceKlass.cpp	Mon Dec 02 15:43:04 2013 +0100
@@ -1051,6 +1051,18 @@
   return false;
 }
 
+bool InstanceKlass::is_same_or_direct_interface(Klass *k) const {
+  // Verify direct super interface
+  if (this == k) return true;
+  assert(k->is_interface(), "should be an interface class");
+  for (int i = 0; i < local_interfaces()->length(); i++) {
+    if (local_interfaces()->at(i) == k) {
+      return true;
+    }
+  }
+  return false;
+}
+
 objArrayOop InstanceKlass::allocate_objArray(int n, int length, TRAPS) {
   if (length < 0) THROW_0(vmSymbols::java_lang_NegativeArraySizeException());
   if (length > arrayOopDesc::max_array_length(T_OBJECT)) {