This is the mail archive of the
java-discuss@sourceware.cygnus.com
mailing list for the Java project.
Re: Patches for faster interface dispatch, type checking
- To: Bryce McKinlay <bryce at albatross dot co dot nz>
- Subject: Re: Patches for faster interface dispatch, type checking
- From: Tom Tromey <tromey at cygnus dot com>
- Date: Fri, 10 Dec 1999 17:08:03 -0800 (PST)
- Cc: Godmar Back <gback at cs dot utah dot edu>, java-discuss at sourceware dot cygnus dot com
- References: <199912102125.OAA13952@peerless.cs.utah.edu><3851A003.B13037D8@albatross.co.nz>
>>>>> "Bryce" == Bryce McKinlay <bryce@albatross.co.nz> writes:
Bryce> inline void *
Bryce> _Jv_LookupInterfaceMethod0 (jclass klass, jclass iface, int method_idx)
Bryce> {
Bryce> _Jv_IDispatchTable *cldt = klass->idt;
Bryce> int idx = iface->idt->iface.ioffsets[cldt->cls.iindex] + method_idx;
Bryce> void *ncode = cldt->cls.itable[idx];
Bryce> if (!ncode)
Bryce> JvThrow (new java::lang::NoSuchMethodError
Bryce> (_Jv_GetMethodString (klass, iface->methods[method_idx].name)));
Bryce> return ncode;
Bryce> }
Bryce> So, we'd take a hit of about 25% doing it by-the-book. The
Bryce> method also maybe becomes too long to realistically inline in
Bryce> most cases.
You don't have to do an extra check. Instead, when constructing the
table, point missing entries to a function which just throws
the exception.
T