This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 1/2] Convert symtab, cgraph and varpool nodes into a real class hierarchy
- From: Steven Bosscher <stevenb dot gcc at gmail dot com>
- To: Jan Hubicka <hubicka at ucw dot cz>
- Cc: David Malcolm <dmalcolm at redhat dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 20 Aug 2013 23:26:26 +0200
- Subject: Re: [PATCH 1/2] Convert symtab, cgraph and varpool nodes into a real class hierarchy
- References: <1376614672-8927-1-git-send-email-dmalcolm at redhat dot com> <1376614672-8927-2-git-send-email-dmalcolm at redhat dot com> <20130820210623 dot GD16244 at atrey dot karlin dot mff dot cuni dot cz>
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
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...
Ciao!
Steven