_Jv_LookupInterfaceMethod

Bryce McKinlay bryce@albatross.co.nz
Thu Dec 2 15:22:00 GMT 1999


Per Bothner wrote:

> > Per Bothner wrote:
> >
> > > Alex is right.  (I am a bit rusty ...)
> > > I meant `TREE_TYPE (method)' should give you the `IFACE'.
> >
> > Cheers, that seems to work. Now, with the code:
> 
> Oops, no it doesn't.  TREE_TYPE(method) give you the type of the
> method itself (i.e. a method_type, which is not very interesting).  We
> want the type that *contains* the method.  For that, use DECL_CONTEXT.
> I.e. I believe `DECL_CONTEXT(method)' should give you the `IFACE'.
> If I'm currect, debug_tree(iface) should show that it is a RECORD_TYPE node.

Yep, thats right. I actually managed to figure that part out after looking more
closely at what debug_tree was telling me. 

Now it finds the method index fine, but later gets "internal error in
check-init: tree code not implemented: record_type", which I guess means that I
cant stick the `iface' directly into lookup_arg.

Do I have to do something similar to what is done for "dtable"?:

  dtable = build1 (INDIRECT_REF, dtable_type, dtable);
  dtable = build (COMPONENT_REF, class_ptr_type, dtable,
		  lookup_field (&dtable_type, class_ident));

regards

  [ bryce ]


More information about the Java mailing list