[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Patch: FYI:

From: Tom Tromey
Subject: Re: Patch: FYI:
Date: 24 Jan 2004 12:59:37 -0700
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

>>>>> "Michael" == Michael Koch <address@hidden> writes:

>> Actually, jikes does not do CSE when emitting bytecode; it assumes that any 
>> common subexpression elimination will be done by a JIT.  Therefore, 
>> Jeroen's style produces a smaller .class file than Michael's.  Besides, 
>> path.length() is a function call, and it becomes very hard for the compiler 
>> to guarantee that it will return the same value twice; manually caching the 
>> result generally results in fewer method invocations.

Michael> Perhaps I think to gcj oriented. gcj inlines this at -O2 and this no
Michael> real method call is generated at all.

We want to be careful here, since the new binary compatibility ABI
will mean we can't inline things like this by default.  We might still
omit the redundant calls to length() when generating native code, but
even that isn't assured (it depends on whether gcc can tell that the
callee is "pure").  IMO in most cases it is preferable to write code
not assuming gcj's various tricks -- this works better with all the
other classpath users, and it will work better once we turn on binary
compatibility by default.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]