This is the mail archive of the java@gcc.gnu.org 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: method invocation and parameter access


>>>>> "Dachuan" == Dachuan Yu <dachuan.yu@yale.edu> writes:

Dachuan> Would someone please tell me where the code is in
Dachuan> GCJ that builds tree nodes of method invocations?
Dachuan> I'm looking at the "......build(CALL_EXPR....." in
Dachuan> the "patch_invoke" function in file
Dachuan> ".../gcc/java/parse.c". Is this it?

My reading is that that particular piece of code is constructing the
call to _Jv_AllocObject.

I think the code you want is in build_method_invocation().  At least,
for the .java front end.  For the .class front end I'm not so sure.

Note that you really want to look at parse.y and not parse.c.  parse.c
is automatically generated from parse.y.

Dachuan> Also, when compiling a method body, how does one
Dachuan> refer to the formal parameters? It seems that the
Dachuan> "...build(PARM_DECL..." in ".../gcc/java/parse.c" is
Dachuan> used to construct the parameters. But I don't
Dachuan> understand what to do when compiling the part of
Dachuan> method body where that parameter is used/accessed.

Offhand I don't know the answer.  For the small amount of front-end
hacking I've done, I've found that using `debug_tree' from the
debugger has been the most help in terms of understanding how things
are laid out.  That plus lots of reading of tree.[ch], tree.def, etc.
These days there is also some texinfo that can help.

Tom


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