return imf.newInterfaceMethodTable( me, imtName, ivec );
}
public static InterfaceMethodTable
generateInterfaceTable( ClassClass cc, InterfaceMethodFactory imf ){
ClassInfo c = cc.ci;
if ( c.allInterfaces == null )
c.findAllInterfaces();
String imtName = c.getGenericNativeName() + "_intfMethodtable";
ClassInfo sup = c.superClassInfo;
int ntotal = c.allInterfaces.size();
int nsuper = 0;
if ( (c.access&Const.ACC_INTERFACE) != 0 ){
return generateTablesForInterface( c, imtName, imf );
}
if ( sup != null ){
nsuper = sup.allInterfaces.size();
if ( nsuper == ntotal ){
// use other class's tables entirely.
// we have nothing further to add.
return sup.vmClass.inf;
}
}
//
// generate the offset tables, or symbolic references
// to them.
InterfaceVector vec[] = new InterfaceVector[ ntotal ];
if ( nsuper != 0 ){
// borrow some from superclass. They are the same.
System.arraycopy( sup.vmClass.inf.iv, 0, vec, 0, nsuper );
}
// compute the rest of the thing ourselves.
for( int i = nsuper; i < ntotal; i++ ){
ClassInfo intf = (ClassInfo)c.allInterfaces.elementAt( i );
MethodConstant mtab[] = intf.refMethodtable;
int nmethods = mtab.length;
short ivec[] = new short[ nmethods ];
for( int j = 0; j < nmethods; j++ ){
MethodInfo target = mtab[j].find();