Rewriting byte codes

Erik Corry erik at
Mon Apr 1 00:20:18 PST 2002

On Sun, Mar 31, 2002 at 08:41:34PM -0700, Patrick Tullmann wrote:
> Erik wrote:
> > I'd like to make some changes to Kaffe to make it simpler to do more
> > precise GC.
> Just for reference, so everyone's on the same page, Kaffe already does
> precise walking of Java objects (see gcFuncs.c:walkObject()).  It does
> not precisely walk stacks.  I believe it walks many native objects
> (like jthreads, etc) conservatively.
> The big problem with walking the stack isn't the Java stack as much as
> the native stack.  You could walk the Java parts precisely, and the
> native bits conservatively, but I don't know what you'd win anything
> by doing this.

OK, I'm not so familiar with the way Java interacts with
native code, but why do we need to walk the native bits at
all?  Surely C code doesn't need GC?

> As I understand GC trade-offs, the big win for precise GC is the
> ability to update pointers and thus implement a compacting collector.
> Is there something else you're hoping to get out of precise stack
> walking?

Predictability and speed of GC.

> Another approach to consider is to implement GC-safe points (e.g., on
> method calls and backwards branches in Java code).  Then you only have
> to track and update the stack maps at each safe point,

There's a lot to be said for this, but since you can allocate
unlimited memory in an exception handler, every point that can
throw an exception has to be a safe point, which reduces the

Erik Corry erik at
Citér kun det nødvendige.  Slet denne signature.  Svar under det citerede.

More information about the kaffe mailing list