Both the x86 and SPARC JIT compilers mistakenly believe that interfaces
and interface methods are always "carefully resolvable" and can be resolved without loading classes. This was true in 1.0, but not in 1.1.
There are several bugs, some on the x86, some on SPARC, some on both.
1) resolveCarefullyCommon (both architectures) would return true when asked about a CONST_InterfaceMethodref. It would not bother to check and see if the
interface class had been loaded. Resolving an interface method ref causes the
interface to be loaded. So roughly the same code that is used for
CONSTANT_Methodref needs to be applied to CONSTANT_InterfaceMethodref
2) Neither compiler provides any support for "patching" the code should
the "careful" resolution of the interface method return false. This turns out
to be a rather trivial patch to implement.
3) On the x86, the JITCompile_md() loop completely forgot to include
opc_invoke_interface_quick. This seems to be either an overside, or based on
1.0, when more re-writing was done between opc_invokeinterface and opc_invokeinterface_quick. Simply having the two byte codes do the same thing
seems to work fine.
I have already fixed these bugs in the JavaOS world. Feel free to copy my changes.
and interface methods are always "carefully resolvable" and can be resolved without loading classes. This was true in 1.0, but not in 1.1.
There are several bugs, some on the x86, some on SPARC, some on both.
1) resolveCarefullyCommon (both architectures) would return true when asked about a CONST_InterfaceMethodref. It would not bother to check and see if the
interface class had been loaded. Resolving an interface method ref causes the
interface to be loaded. So roughly the same code that is used for
CONSTANT_Methodref needs to be applied to CONSTANT_InterfaceMethodref
2) Neither compiler provides any support for "patching" the code should
the "careful" resolution of the interface method return false. This turns out
to be a rather trivial patch to implement.
3) On the x86, the JITCompile_md() loop completely forgot to include
opc_invoke_interface_quick. This seems to be either an overside, or based on
1.0, when more re-writing was done between opc_invokeinterface and opc_invokeinterface_quick. Simply having the two byte codes do the same thing
seems to work fine.
I have already fixed these bugs in the JavaOS world. Feel free to copy my changes.