[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: gij as JRE 5
From: |
Andrew Haley |
Subject: |
Re: gij as JRE 5 |
Date: |
Mon, 15 Nov 2004 15:39:33 +0000 |
Robert Schuster writes:
>
> 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.
My, he is busy. ;-)
> >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?
-fenable-assertions
> 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.
It could do, but supporting such a matrix is something of a potential
minefield. We've always used -f<feature>.
Andrew.
- RE: gij as JRE 5, (continued)
RE: gij as JRE 5, Jeroen Frijters, 2004/11/15