+2004-04-21 Bryce McKinlay <mckinlay@redhat.com>
+
+ * java/lang/natClass.cc (_Jv_LayoutInterfaceMethods): New method.
+ Set method->index values for interface methods to their itable index.
+ (initializeClass): Call _Jv_LayoutInterfaceMethods.
+
2004-04-21 Michael Koch <konqueror@gmx.de>
* java/nio/DirectByteBufferImpl.java
friend jshort _Jv_AppendPartialITable (jclass, jclass, void **, jshort);
friend jshort _Jv_FindIIndex (jclass *, jshort *, jshort);
friend void _Jv_LinkSymbolTable (jclass);
+ friend void _Jv_LayoutInterfaceMethods (jclass);
friend void _Jv_LayoutVTableMethods (jclass klass);
friend void _Jv_SetVTableEntries (jclass, _Jv_VTable *, jboolean *);
friend void _Jv_MakeVTable (jclass);
}
}
+ if (isInterface ())
+ _Jv_LayoutInterfaceMethods (this);
+
_Jv_PrepareConstantTimeTables (this);
if (vtable == NULL)
throw new java::lang::AbstractMethodError();
}
+// Set itable method indexes for members of interface IFACE.
+void
+_Jv_LayoutInterfaceMethods (jclass iface)
+{
+ if (! iface->isInterface())
+ return;
+
+ // itable indexes start at 1.
+ // FIXME: Static initalizers currently get a NULL placeholder entry in the
+ // itable so they are also assigned an index here.
+ for (int i = 0; i < iface->method_count; i++)
+ iface->methods[i].index = i + 1;
+}
+
// Prepare virtual method declarations in KLASS, and any superclasses as
// required, by determining their vtable index, setting method->index, and
// finally setting the class's vtable_method_count. Must be called with the