[PATCH 1/2] Convert symtab, cgraph and varpool nodes into a real class hierarchy

Jan Hubicka hubicka@ucw.cz
Tue Aug 20 21:34:00 GMT 2013


> On Tue, Aug 20, 2013 at 11:06 PM, Jan Hubicka <hubicka@ucw.cz> wrote:
> >> +/* GTY((user)) hooks for symtab_node_base (and its subclasses).
> >> +   We could use virtual functions for this, but given the presence of the
> >> +   "type" field and the trivial size of the class hierarchy, switches are
> >> +   perhaps simpler and faster.  */
> >
> > Generally I am not really happy about the hand marking - why can't GTY just handle
> > it by itself?  Do we have some eisting exmaple of this?
> >
> > GTY was in a way of getting proper class hiearchy for quite a while and this is
> > probably less ugly than C-syntax-classes we have now.  But it would be nice to
> > have some longer term plan what to do here.  Obviously this is going to make
> > any changes to GGC implementation close to imposible since all the
> > implementation details are exposed now.
> 
> As far as I understand, the intent is to move to user markers, see:
> http://gcc.gnu.org/ml/gcc-patches/2012-08/msg00630.html

OK, I have nothing against explicit user markers. It however seem to need a bit
of abstraction - just writting by hand whatever gengtype produces seems ugly.
> 
> On the up-side: This would allow explicitly-tracked objects to be
> moved back out of GGC-space. Can't wait to put the CFG object back in
> pools! :-) And I guess symtab objects are also explicitly tracked and
> therefore candidates for a more cache-friendly allocation strategy...

Indeed, nothing in symbol table needs to be garbage collected and everything is
freed explicitely.  We only have it in GGC because of PCH and the fact that we
hook trees out of that and we do not want them to be garbage collected out.

Honza
> 
> Ciao!
> Steven



More information about the Gcc-patches mailing list