public inbox for java-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* RE: FYI: Linker & Verifier fixes (really GC mark procedures)
@ 2006-02-01 18:22 Boehm, Hans
  2006-02-01 18:43 ` Andrew Haley
  2006-02-01 19:42 ` Tom Tromey
  0 siblings, 2 replies; 17+ messages in thread
From: Boehm, Hans @ 2006-02-01 18:22 UTC (permalink / raw)
  To: Bryce McKinlay, Robert Schuster; +Cc: java-patches

I haven't been following the details here, but some of the suggested
directions scare me a bit.

The present issue aside, I think we're in general far better off
allocating collectable memory for anything that interacts with the
collector, and making the mark descriptors conservative, and eventually
correct.  (If we know that fields will contain either small integers or
pointers, just allocating it as potentially pointer-containing would
also currently work fine.)  Certainly I think we should be moving in
that direction.

The code in _Jv_MarkObj that directly traces objects referenced from
class objects (instead of pushing them on the mark stack) is on very
thin ice.  That's not how mark procedures are supposed to work.  In my
opinion, if we could make it go away, that would be great.

In particular, in thinking about this again, I'm not sure this is
correct with incremental GC, and it may be causing some of the problems
there.  With incremental GC we may end up tracing only the subobjects,
since the containing object may not have been dirtied.  I think the
subobjects currently look pointer-free, which would cause this to fail.

Aside from this issue, _Jv_MarkObj seems to already have been a major
source of very subtle bugs.  I am more and more convinced that this is
just not the right design.

Hans

^ permalink raw reply	[flat|nested] 17+ messages in thread
* RE: FYI: Linker & Verifier fixes (really GC mark procedures)
@ 2006-02-04  1:18 Boehm, Hans
  0 siblings, 0 replies; 17+ messages in thread
From: Boehm, Hans @ 2006-02-04  1:18 UTC (permalink / raw)
  To: David Daney, tromey
  Cc: Andrew Haley, Bryce McKinlay, Robert Schuster, java-patches

> This is slightly off topic, but could you put the bitmap 
> descriptor as 
> the last field in the Class object?  Then make a variable length bit 
> string with the high (or perhaps low) order bit indicating if 
> there was 
> another segment of bit string following?
> 
> One word of bit string would mark the first 31 (or 63) 
> fields, then if 
> the high bit were set there would be another word for the next 31 (or 
> 63) fields...
> 
Theoretically it could.  But it doesn't match well with the way the GC
does things.  And I also don't think it would be a measurable win.

The GC understands descriptor words associated with an entire page of
objects.  That word may be a descriptor that tells the GC to look in the
object itself for the real descriptor, or to indirect twice through a
"vtable pointer" to find it.  This is all reasonably clean so long as
all descriptors fit in a word.  (Actually it's unclean in one very
subtle respect, which might get even more complicated with
variable-length descriptors.  The issue has to do with false pointers to
objects with garbage descriptors.)

The reason for doing all of this, instead of just calling mark
procedures from the collector, is largely to avoid a procedure call (and
associated startup costs dealing with got-tables, etc.) for every marked
object.  The only place it fails is for objects that are longer than 30
or 62 words long and don't qualify for a length descriptor.  But those
generally require enough work to trace that the procedure call is likely
to be in the noise anyway.

So long as we get the mark procedure(s) to behave correctly, I think
we're fine.  Class objects aren't likely to make up a large fraction of
the heap anyway, I hope.

Hans

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2006-02-04  1:18 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-01 18:22 FYI: Linker & Verifier fixes (really GC mark procedures) Boehm, Hans
2006-02-01 18:43 ` Andrew Haley
2006-02-01 19:39   ` Bryce McKinlay
2006-02-01 19:44   ` Tom Tromey
2006-02-01 19:56     ` Andrew Haley
2006-02-01 20:09       ` Bryce McKinlay
2006-02-02 12:22         ` Andrew Haley
2006-02-03  1:22     ` Tom Tromey
2006-02-03  5:30       ` Hans Boehm
2006-02-03 16:56         ` Tom Tromey
2006-02-03 17:07           ` David Daney
2006-02-03 17:53       ` Bryce McKinlay
2006-02-03 18:09         ` David Daney
2006-02-03 18:12           ` Andrew Haley
2006-02-03 19:38           ` Bryce McKinlay
2006-02-01 19:42 ` Tom Tromey
2006-02-04  1:18 Boehm, Hans

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).