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: Godmar Back <gback at cs dot utah dot edu>
- Subject: Re: Patches for faster interface dispatch, type checking
- From: Bryce McKinlay <bryce at albatross dot co dot nz>
- Date: Sat, 11 Dec 1999 09:53:40 +1300
- CC: java-discuss at sourceware dot cygnus dot com
- References: <199912101730.KAA25341@faith.cs.utah.edu>
Godmar Back wrote:
> Cool!
>
> >From a quick look at it though, I don't think it's 100% correct.
> I don't see any checks for NoSuchMethodError and I also don't see
> how you handle the java.lang.Object case.
>
> I may be mistaken though: Does it work?
I don't think there is any need to check for NoSuchMethodError in
_Jv_LookupInterfaceMethod (). The compiler won't call
_Jv_LookupInterfaceMethod unless the object is known to implement the
interface - the interface reference must have passed through a
_Jv_CheckCast() test first if it is not directly assignable from the
class in question.
If a class claims to implement a given interface but doesn't (which
could happen if it was compiled against a different version of the
interface), this is detected when the idispatch tables are generated
(prior to class initialization) in _Jv_AppendPartialITable():
if (! _Jv_equalUtf8Consts (iface->methods[j].name,
clinit_name))
JvThrow (new java::lang::NoSuchMethodError
(_Jv_GetMethodString (klass,
iface->methods[j].name)));
There are also checks for method access and abstract/static methods.
What is the java.lang.Object case?
regards
[ bryce ]