This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Allocate all target globals using GC for SWITCHABLE_TARGETs


On Fri, Jan 10, 2014 at 6:37 PM, Richard Henderson <rth@redhat.com> wrote:
> On 01/09/2014 03:34 PM, Jakub Jelinek wrote:
>> 2014-01-09  Jakub Jelinek  <jakub@redhat.com>
>>
>>       * target-globals.c (save_target_globals): Allocate < 4KB structs using
>>       GC in payload of target_globals struct instead of allocating them on
>>       the heap and the larger structs separately using GC.
>>       * target-globals.h (struct target_globals): Make regs, hard_regs,
>>       reload, expmed, ira, ira_int and lra_fields GTY((atomic)) instead
>>       of GTY((skip)) and change type to void *.
>>       (reset_target_globals): Cast loads from those fields to corresponding
>>       types.
>>
>> --- gcc/target-globals.h.jj   2014-01-09 19:24:20.000000000 +0100
>> +++ gcc/target-globals.h      2014-01-09 19:39:43.879348712 +0100
>> @@ -41,17 +41,17 @@ extern struct target_lower_subreg *this_
>>
>>  struct GTY(()) target_globals {
>>    struct target_flag_state *GTY((skip)) flag_state;
>> -  struct target_regs *GTY((skip)) regs;
>> +  void *GTY((atomic)) regs;
>
> I'm not entirely fond of this either, for the obvious reason.  Clearly a
> deficiency in gengtype, but after 2 hours of poking around I can see that
> it isn't a quick fix.
>
> I guess I'm ok with the patch, since the use of the target_globals structure
> is so restricted.

Yeah.  At some time we need a way to specify a finalization hook called
if an object is collected and eventually a hook that walks extra roots
indirectly
reachable via an object (so you can have GC -> heap -> GC memory layouts
more easily).

Richard.

>
> r~
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]