This is the mail archive of the java-discuss@sourceware.cygnus.com mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: interface dispatch


Godmar Back <gback@cs.utah.edu> writes:

> > #define CLASS_INSTANCEOF_INTERFACE(CL, IFACE) \
> >   (CLASS_IINDEX(CL) <= CLASS_IOFFSETS_LENGTH(IFACE) \
> >    && ({unsigned short __offset = CLASS_IOFFSETS(IFACE)[CLASS_IINDEX(CL)]; \
> >         __offset < CLASS_ITABLE_LENGTH(CL) \
> >         && CLASS_ITABLE(CL)[__offset]] == IFACE}))
> 
> What I don't understand here is the "CLASS_ITABLE(CL)[__offset]] == IFACE"

I belive that should have been:

        && CLASS_ITABLE(CL)[__offset][0] == IFACE}))

Note this part:

// Each superinterface of a class (i.e. each interface that the class
// directly or indirectly implements) has a corresponding "Partial
// Interface Dispatch Table" whose size is (number of methods + 1) words.
// The first word is a pointer to the interface (i.e. the java.lang.Class
// instance for that interface).  The remaining words are pointers to the
// actual methods that implement the methods declared in the interface,
// in the order specified by the Interface Method Index of the previous
// paragraph.
-- 
	--Per Bothner
per@bothner.com   http://www.bothner.com/~per/

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]