A crazy idea

Pavel Roskin pavel_roskin at geocities.com
Wed Nov 18 02:03:25 PST 1998


Hello!

> Since gcc is available for almost any processor you can think of (that
> means for almost any processor you want to port Kaffe to) and since
> gcc backend seems to use a pseudo-instruction set very close to the
> one used by Kaffe JIT, couldn't, in some way, for somebody that knows
> how this works, it be used to automatically generate the 
> config/<arch>/jit-<arch>.def file ? or at least the op_xxx_rrr() functions
> that generates the opcodes.

Unfortunately, it is not easy. There are at least two projects, which aim
to provide "foreign function interface"
One of them is ffcall
http://clisp.cons.org/~haible/packages-ffcall.html
Unfortunately, this package doesn't seem to be maintained anymore. I can
also say that its implementation for hppa proceccor is not quite correct.
Due to peculiar calling convention on HP-UX calling function must allocate
space for arguments on stack, and this must be done dynamically, since the
number of the arguments is not known. avcall-hppa.c always allocates 1060
bytes on stack. I'm affraid, implementations for other architectures are
not flawless either.
Another project is libffi, which is a part of japhar, another open-source
java machine (http://www.hungry.com/)
libffi doesn't support hppa, but it does support arm. You could try make
Kaffe use libffi if it is available. It would be very useful, since it
would join efforts of the Open-source community in creation of GPL
implementations of Java and other languages. On another side, it would
give Kaffe developers more time to concentrate on platform-independent
issues.

Pavel Roskin.



More information about the kaffe mailing list