Some patches for Kaffe (for callMethodA and CLASSPATH)

Alexandre Oliva oliva at dcc.unicamp.br
Sun Jun 14 16:47:42 PDT 1998


Now that Kaffe supports JNI, callMethodA should not assume the `args'
argument is MAXMARGS long.  If you are unlucky enough, like I was, to
call a non-static method with an array of arguments allocated
dynamically, with a size just large enough for the arguments, and it
happens to occupy the end of the last mapped page, callMethodA will
crash.  The problem is that, for non-static methods, callMethodA
memcpy()s the argument list, assuming it is MAXMARGS-1 long, so it can
add a reference to the target object in the copy's 0th element.  The
first attached patch fixes this problem, that can be easily verified
by running Guarana's performance test program; it would *sometimes*
crash on finalMethodRun, more often on x86 than on sparc, and not on
every run.  A patch that applies cleanly on Guarana's sources (without
line offsets or such) can be downloaded from the home page of Guarana
<URL:http://www.dcc.unicamp.br/~oliva/guarana>

The second attached patch is already present in Guarana 1.3, but I
seem to have forgotten to send it back to Tim.  Some users of Guarana
seem to appreciate particularly large CLASSPATHs, with more entries
than Kaffe could cope with.  Kaffe would just ignore the entries after
the 16th :-(.  With the attached patch, the internal representation of
the CLASSPATH grows dynamically.

Enjoy!

-- 
Alexandre Oliva
mailto:oliva at dcc.unicamp.br mailto:aoliva at acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil
-------------- next part --------------
A non-text attachment was scrubbed...
Name: arglist.diff
Type: application/octet-stream
Size: 1650 bytes
Desc: not available
Url : http://kaffe.org/pipermail/kaffe/attachments/19980614/0e3faf02/attachment-0014.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: classpath.diff
Type: application/octet-stream
Size: 1814 bytes
Desc: not available
Url : http://kaffe.org/pipermail/kaffe/attachments/19980614/0e3faf02/attachment-0015.obj 


More information about the kaffe mailing list