[kaffe] updated ARM Patch, and portability woes

Dalibor Topic robilad at yahoo.com
Thu Aug 22 03:58:02 PDT 2002


Hi,

here's an updated version of the ARM patch. It allows
the interpreter to run (ie. to make rt.jar using kjc)
again on the skiff cluster (ipaqs). Jit is still
broken though.

This patch fixes compile problems, and the interpreter
on ipaqs. Compiling the interpreter with -O0
(convenient for gdb) now also gives you a working
interpreter.

The interesting changes are in common.h, where the
first change is necessary to get interpreter working
when compiled with -O0. It checks if the last default
parameter has size 2, and copies its first part into
correct position.

The second change special cases returning references:
interpreter would fail because references were somehow
 broken upon return.

I'd really like to see someone who understands the ARM
platform to take a look at it. I haven't got an ARM,
and have no idea about its calling conventions,
signedness issues etc.

If someone wants to fix the remaining bugs with the
interpreter: you want to take a look at what's
happening when doubles are passed as parameters:
something is very wrong there according to
DoubleComp.java regression test. The long bits that
represent a NaN are returned as 0, and that seems
quite weird. 

I believe that's due to doubleToLong in
kaffe/kaffevm/fp.c using jvalue to convert the bit
pattern of a double into a long. As jvalue is a union,
the C standard says that you can only safely read back
from a union the type that you've written to it, and
long and double are not the same type, so we get
undefined behaviour. I assume that's also the reason
why common.h return value failed for the interpreter.

The interpreter still has various bugs: it will
apparently happily hang itself on a couple of tests.
:)

During the compilation of the interpreter I got a lot
of interesting warnings from gcc 3.0 ( I compiled with
*all* warnings enabled, not just -Wall). I've attached
them for reference and inspiration. If someone would
like to attempt to fix them, I'd be more than happy to
merge the changes in. The warnings are a condensed
form of the original warnings, created with grep
warning | sort | uniq .

best regards,

dalibor topic

__________________________________________________
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: arm.diff
Type: application/octet-stream
Size: 1010 bytes
Desc: arm.diff
Url : http://kaffe.org/pipermail/kaffe/attachments/20020822/ce32ad4c/attachment-0006.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gcc-warnings-uniq-arm.bz2
Type: application/octet-stream
Size: 15753 bytes
Desc: gcc-warnings-uniq-arm.bz2
Url : http://kaffe.org/pipermail/kaffe/attachments/20020822/ce32ad4c/attachment-0007.obj 


More information about the kaffe mailing list