classpath
[Top][All Lists]
Advanced

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

Re: gij as JRE 5


From: Robert Schuster
Subject: Re: gij as JRE 5
Date: Mon, 15 Nov 2004 15:25:53 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; de-AT; rv:1.7.3) Gecko/20040930


Andrew Haley wrote:

Robert Schuster writes:
> > >There is actually a good reason. If the 1.5 classes are missing, the
> >chances that a 1.5 compiled class will run are slim. This is what Andrew
> >John Hughes was trying to address with his proposal to implement the 1.5
> >classes as much as possible (using 1.4 sources). I haven't thought about
> >it deeply, but on the surface that seems like it could be a good idea.
> >
> > > > > Actually I have doubts at this point. Javac 1.5/5 compiles all its > "-target 1.5" stuff with the help of java.lang.StringBuilder > instead of java.lang.StringBuffer. This little difference makes all code > that would normally run in a 1.4 environment unusable. > The funny thing is that StringBuilder (and attached interfaces > Appendable, CharSequence) make no use of 1.5 features. > > So this is my vote for adding support for 1.5 bytecode addition as well > as 'source 1.5'-independent (helper) classes.

Sounds good: it looks to me like we can do StringBuilder trivially by
removing all the instances of "synchronized" from StringBuffer.  We
already have methods like ensureCapacity_unsynchronized in the
implementation.
Tom Tromey has submitted a StringBuilder implementation in classpath's generics branch.

The question does arise, however, about when we should start to
generate calls to StringBuilder in gcj.  Do we have to wait for the
rest of 1.5?  This is a hard one: no problem if we're generating
bytecode for the locally installed gij, but otherwise...

Unfortunately I am not used to gcj but from a short glimpse to its man-page I can see that it does not support something comparable to javac's -source and -target switch. How does gcj treat the assert() statement? Its an 1.4-introduced feature that has IMHO a similar nature like the (subset of) 1.5-additions we are currently discussing. A '-source/target'-like switch could help gcj to determine what kind of source and binary level features are allowed.

cu
Robert




reply via email to

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