This is the mail archive of the java-discuss@sources.redhat.com mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

patches allow Kawa to be compiled by Gcj


I'm about to submit a number of patches to gcc/java.  These allow
Gcj to compile 1.4MB zip file consisting of a mix of Java and 
Scheme code compiled to .class files and thence to an executable.
(I had to revert RTH's i386 PIC patch, as discussed earlier.)
This is the first time I have been able to compile all of Kawa
in a long time, *and* its the first time the run-time code
generation works.  What I did was:

        gcj --main=kawa.repl kawa-1.6.71-compiled.zip  -o kawa.exe -g -v

I was then able to do:

        ./kawa.exe
        #|kawa:1|# (list 'Hello "world!")
        (Hello world!)
        #|kawa:2|# (define xx 20)
        #|kawa:3|# (define (plus20 x) (+ x xx))
        #|kawa:4|# (plus20 12)
        32

The interesting thing to note is that defining the function plus20
causes Kawa to generate bytecode for the function, load the new
bytecode with a ClassLoader, and then execute it using the interpreter.

I have not run my patches through the gcc or gcj testsuites, beyond
running 'make check' (which didn't look too bad).  Also, a few of the
patches are clearly non-critical, so should technically wait until
after the gcc 3.0 branch.  And some changes may be controversial.
However, I'm going to check these in anyway because I'm pressed
for time: I'm leaving Monday morning for Southern California for a
week.  While I will be able to check email, it will be difficult to do
serious work.  I think most of these patches are critical and needed
for gcc 3, and I want to get them in now rather than later.  My
apologies if something should break. (At least all the changes are
limited to gcc/java.)  Feel free to fix or revert any change if it
seems needed.
-- 
	--Per Bothner
per@bothner.com   http://www.bothner.com/~per/

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]