From: Parmelan, Edouard (EP510777@exchange.FRANCE.NCR.com)
Date: Tue Dec 22 1998 - 08:06:02 EST
Godmar,
> Was the old scheme indeed broken or was it simply a waste of
> one slot per static method in the dispatch table?
The old scheme is broken as idx != -1 for static
and soft_fixup_trampoline() if idx >= 0 replaces
the trampoline by the translated method in dtable[].
But, for an interface, dtable is NULL :(.
The new scheme set idx to -1 for static and don't
waste one slot per static method (per interface
implemented by the class).
> Btw, do you have a test case that we could add to the regression
> suite?
The Test case should use an interface that have
a <clinit>. Initialize an array in the interface
generates a <clinit> as in:
// Extract from JavaDeps-1.0.4, generated by JavaCC
interface JavaConstants {
...
String[] tokenImage = {
"<EOF>",
"<NUMBER>",
"<STRING>",
"<CHARACTER>",
"<COMMENT>",
"<IDENTIFIER>"
}
...
}
For the previous patch about walkMethod(), I don't think
a test case could be write for regression suite as the gc
should be run after trampolines are build (CSTATE_PREPARED)
and before <clinit>() is called (CSTATE_COMPLETE).
In any case, the fix in walkMethod() is the best one as if
ncode is a trampoline for a normal class, it's an entry in
the dtable[] and gc_head_isobject() called by markObject()
should return false.
The comment in buildDispatchTable() about the GC reasons is
now wrong. You can change it to:
/* Allocate the dispatch table and this class' trampolines all in
* one block of memory. This works out for space reasons. */
The space reasons should be studied, as trampolines are now
freeable by the GC (holds in meth->ncode if !METHOD_TRANSLATED()).
> Happy holidays,
Same to you.
Edouard.
This archive was generated by hypermail 2b29 : Sat Sep 23 2000 - 19:57:27 EDT