This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: method invocation and parameter access
- To: Dachuan Yu <dachuan dot yu at yale dot edu>
- Subject: Re: method invocation and parameter access
- From: Tom Tromey <tromey at redhat dot com>
- Date: 28 Sep 2001 11:37:20 -0600
- Cc: java at gcc dot gnu dot org
- References: <3BB4AFCF.BD42561A@yale.edu>
- Reply-To: tromey at redhat dot com
>>>>> "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