public inbox for java@gcc.gnu.org
 help / color / mirror / Atom feed
* About compiling process in GCJ and garbage collection
@ 2011-09-11 19:23 Li junsong
  2011-09-12 10:08 ` Bryce McKinlay
  0 siblings, 1 reply; 2+ messages in thread
From: Li junsong @ 2011-09-11 19:23 UTC (permalink / raw)
  To: java

Hi there,

I have asked some questions about the plugin loading problem ( refer
to Andrew's answer: http://gcc.gnu.org/ml/java/2011-09/msg00001.html
and Bryce's answer: http://gcc.gnu.org/ml/java/2011-09/msg00003.html )
And now I know ecj is the workhorse when compiling source code to
bytecode.

I still have a question about the compiling process:

if I use GCJ to compile the java source code to machine code directly,
 it will first use ecj to compile java source to bytecode, and then
compile the bytecode(or other information) to machine code.( right? )
BUT, I write a plugin, which removes a certain statement in gimple
tree, and the gcj dump the gimple tree into file. The plugin works.
That means that  GCJ does do something in the process  of compiling
the source code, otherwise the ecj MUST use the same tree
structure(GENERIC, GIMPLE) as gcc does to compile source code in order
to provide information to the compiler of GCJ to do the rest process(
in my case, to provide information for GCJ to remove a certain
statement), which is kind of impossible since ecj is not part of gcc
but GIMPLE is.
Can you help correct me, and explain this?

I have tried the usage of "gcj -v" to print the compiling information,
and I see there are a few files being produced in /tmp, I think that
it is the bytecode of java code, or the STRING type stuff( because I
didn't find any string in the dumped file. )


Thanks,
J. Li

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: About compiling process in GCJ and garbage collection
  2011-09-11 19:23 About compiling process in GCJ and garbage collection Li junsong
@ 2011-09-12 10:08 ` Bryce McKinlay
  0 siblings, 0 replies; 2+ messages in thread
From: Bryce McKinlay @ 2011-09-12 10:08 UTC (permalink / raw)
  To: Li junsong; +Cc: java

On Sun, Sep 11, 2011 at 8:22 PM, Li junsong <ljs.darkfish@gmail.com> wrote:

> if I use GCJ to compile the java source code to machine code directly,
>  it will first use ecj to compile java source to bytecode, and then
> compile the bytecode(or other information) to machine code.( right? )

Correct.

> BUT, I write a plugin, which removes a certain statement in gimple
> tree, and the gcj dump the gimple tree into file. The plugin works.
> That means that  GCJ does do something in the process  of compiling
> the source code, otherwise the ecj MUST use the same tree
> structure(GENERIC, GIMPLE) as gcc does

No, ecj does not share any tree data with GCC, other than the bytecode
itself. ecj produces .class files, which gcj parses to produce the
GENERIC tree which is dispatched to GCC's optimizers and back end.
Your plugin runs at this stage of the compile process.

> I have tried the usage of "gcj -v" to print the compiling information,
> and I see there are a few files being produced in /tmp, I think that
> it is the bytecode of java code, or the STRING type stuff( because I
> didn't find any string in the dumped file. )

Try using -save-temps as well to get more human-readable names for the
intermediate files.

Bryce

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-09-12 10:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-11 19:23 About compiling process in GCJ and garbage collection Li junsong
2011-09-12 10:08 ` Bryce McKinlay

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).