This is the mail archive of the java-discuss@sourceware.cygnus.com mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: _Jv_LookupInterfaceMethod


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 ]

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]