class gc
Jon Olson
olson@mmsi.com
Fri Feb 26 18:09:00 GMT 1999
On Fri, 26 Feb 1999, Godmar Back wrote:
>I don't see how any of these suggestions would work.
>The problem is not walking the class objects, the problem is marking
>class objects when following references. These references may or may not
>refer to objects that were allocated on the heap. In most cases, they're not,
>and if you can help it, you don't want to check every time, or at least
>make the check as cheap as possible (cheaper than what Boehm's or Kaffe's
>gc does to find out whether an address points to an object in the heap.)
>
If you know that a reference indeed points to a class object, and all class
objects have the same format (ie. that layed out by the gcj compiler). Just
add a bit to the `accflags' to indicate that a particular class is dynamically
allocated. This bit would be zero for statically allocated classes generated
by the compiler, but non-zero for dynamically generated classes, like
[Ljava/lang/Object; allocated by the run-time environment.
In the case of a word which may or may not be a pointer (ie. one which is
being conservatively scanned), you'll need to do the typical conservative
heap checks anyway.
--
Jon Olson, Modular Mining Systems
3289 E. Hemisphere Loop
Tucson, AZ 85706
INTERNET: olson@mmsi.com
PHONE: (520)746-9127
FAX: (520)889-5790
More information about the Java
mailing list