Reconsidering gcjx

Per Bothner per@bothner.com
Sun Jan 29 19:05:00 GMT 2006


Tom Tromey wrote:
> While investigating I realized that we would also lose a small
> optimization related to String "+" operations.  When translating from
> .java we currently use a non-synchronizing variant of StringBuffer to
> do this.

In Java-5-mode I would expect ecj to use the unsynchronized
java.lang.StringBuilder.  If not, I'd consider it a bug.

A desirable optimization would be to convert local (non-escaping)
uses of StringBuffer/StringBuilder to be stack allocated.  You
could even stack-allocate the actual buffer up to a limited size,
only heap-allocating when it gets over that size.
-- 
	--Per Bothner
per@bothner.com   http://per.bothner.com/



More information about the Gcc mailing list