walking Methods & dispatchtable

Date view Thread view Subject view Author view

From: Godmar Back (gback@cs.utah.edu)
Date: Fri Dec 18 1998 - 17:21:24 EST


>
> On Dec 18, 1998, Godmar Back <gback@cs.utah.edu> wrote:
>
> >> problems in an array of methods; size was apparently miscomputed, so I
> >> fixed it to get the size of the class object of the first method. But
>
> > What size was miscomputed? The size passed in to walkMethods?
> > That's the size of the block allocated, not the number of methods.
>
> No, I really meant the number of methods, it was called `nm', I think.
> The class said 32, but nm was computed as 42. I believe the actual
> size may contain some excess, and that's why we should try to compute
> the size from the class info. Unless there's something else after the
> table of methods that I'm missing.
>

That is essentially what I meant.

> > I see, so you fixed that: is that fix correct?
> > Just because the first method does not have a class pointer means
> > we don't have to walk the rest of them???
>
> I think so, since methods are read and initialized from first to
> last. We can't lose in this case. Or so I thought :-)

What could break this is if methods at higher indices
had their class pointers set first.

Another possible approach we could take would be to add internal
class finalizers (in gcFunctions) and explicitly allocate and free all data
structures that were

    a) allocated on behalf of a class
    b) are not shared with other classes.

This would for instance include gc_layout.

I understand that the Method* are shared between for instance a class
and its subclasses, since the subclasses hold a pointer to a Method*
of a superclass in its dispatchtable.

(BTW: thinking about that it: doesn't that already break the current class
gc scheme right there?
What if a class gets freed, but other classes that are still alive hold
pointers to its methods in their dispatchtable ---
Walking the dispatchtable of the class that's still alive conservatively
will not help us with this problem.)

>
i >> then, I'd get the same problem with field, but field doesn't have a
> >> pointer to a class, so I gave up for a while (I've got a report due to
> >> 4 PM; I had only 12 hours left then, and all I had was the .bib I had
> >> prepared with 108 citations :-)
>
> > I see.
>
> Finished! YES! The semester is over! Back to hacking!
>
> (not that much, actually; I've got to submit a scholarship request
> still in 1998 or first week of 1999 worst case. :-(
>

Well, I still need to do some writing for my proposal.
I wish I wouldn't let myself get distracted by kaffe hacking so much...

        - Godmar


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Sat Sep 23 2000 - 19:57:23 EDT