gij as JRE 5

Tom Tromey
Sat Nov 13 19:51:00 GMT 2004

>>>>> "Bojan" == Bojan Antonovic <> writes:

Bojan> Java 5.0 has some new language extensions. Many (?) of them, like
Bojan> generics, are compiled in the way that the byte code binary is
Bojan> compatible to older versions. While extending GCJ to support the new
Bojan> language extensions can take a while, it should be easier that GIJ can
Bojan> run them. Does anybody know when those new binaries will be supported?
Bojan> Can it be done for GCC 4.0 ?

Here are the minimal changes required to support 1.5 bytecode.

* Make sure we recognize the new class file version number.

* Change the bytecode verifiers to accept "ldc <class>" when the
  bytecode in question came from a 1.5 file.  (For the libgcj
  verifier I already have a patch for this, it is in gcjx.  It could
  easily be merged.)

* Change the interpreter and the bytecode front end to the compiler
  to recognize this opcode.

This set of changes is pretty easy.

Note that 1.5 adds many new classes.  Code using these classes still
won't work on libgcj, at least until they are written.  There is some
work in this area in the `generics' branch of the Classpath CVS

In particular, attributes won't work properly at runtime, enums won't
work at all, the new enhanced "for" loop will only iterate over arrays
(since libgcj doesn't have Iterable), and auto-boxing will not work
(this requires new methods in the primitive wrapper classes).

Static import is purely source-side, and varargs is also implemented
that way, so these will work fine.  Generics ought to work fine as


More information about the Java mailing list