This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
VMSpec 1.2 5.4.3.3
- From: Martin Vechev <martin at fadata dot bg>
- To: java at gcc dot gnu dot org
- Date: Fri, 22 Mar 2002 20:37:43 +0200
- Subject: VMSpec 1.2 5.4.3.3
About method resoluton, as a 3rd step, it says the following:
"......Otherwise, method lookup attempts to locate the referenced method in
any of the superinterfaces of the specified class C.
- If any superinterface of C declares a method with the name and
descriptor specified by the method reference, method lookup succeeds.
- Otherwise, method lookup fails. "
I cannot think of a situation where one would need this for the
invokevirtual instruction. The method declaration should already be
found (if one exists) while searching up through the class hierarchy.
There is no need to lookup the superinterfaces. That would mean there is a
case where the method declaration is in one of the superinterfaces but not
in one of the superclasses. Clearly, if declaration is not found on the way
up (in the superclasses), there is no need for invokevirtual to start
searching for the definition in the superclasses.