PING: Reflection doesn't work across interfaces

Bryce McKinlay mckinlay@redhat.com
Thu Apr 15 01:29:00 GMT 2004


Tom Tromey wrote:

>Bryce> I think it would be better to just have the compiler put the interface
>Bryce> method's index in the meth->index field here, rather than have the
>Bryce> runtime do fixups on a hypothetical vtable offset. How does the patch
>Bryce> below look? Otherwise, your patch looks fine to me. Obviously the
>Bryce> invocation code has become a bit of a mess and could really use some
>Bryce> refactoring, for example to clearly separate the lookup and argument
>Bryce> prep/execution stages, but this looks ok for now.
>
>This sounds reasonable to me.  Andrew would have to approve the patch
>though.  Wouldn't we also need (or at least want) to fill in this
>field at runtime for those interfaces laid out then?
>  
>

Since the dispatch index for each individual interface starts at 1, the 
value is always known at compile time regardless of any inheritance etc.

But actually, the compiler doesn't need to generate the index field at 
all (interface or otherwise) for the BC-ABI - we should drop it when we 
change/optimize the class metadata format for BC. But for now, I figure 
the space is there in _Jv_Method anyway, so we might as well use it.

I have checked in the following patch.

Regards

Bryce

-------------- next part --------------
A non-text attachment was scrubbed...
Name: iface-invoke.patch
Type: text/x-patch
Size: 6584 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/java-patches/attachments/20040415/0044d45d/attachment.bin>


More information about the Java-patches mailing list