This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 1/5] add an alternative to if_marked using hash_table
- From: Jeff Law <law at redhat dot com>
- To: tsaunders at mozilla dot com, gcc-patches at gcc dot gnu dot org
- Date: Thu, 13 Nov 2014 17:27:13 -0700
- Subject: Re: [PATCH 1/5] add an alternative to if_marked using hash_table
- Authentication-results: sourceware.org; auth=none
- References: <1415858143-32692-1-git-send-email-tsaunders at mozilla dot com>
On 11/12/14 22:55, tsaunders@mozilla.com wrote:
From: Trevor Saunders <tsaunders@mozilla.com>
Hi,
This adds a gty cache attribute that calls user code after marking and before
sweeping allowing user code to mark more objects or clear caches as
appropriate. User code for hash_table is set up to work similarly to if_marked
for htab.
bootstrapped + regtested x86_64-unknown-linux-gnu, ok?
Trev
gcc/ChangeLog:
2014-11-13 Trevor Saunders <tsaunders@mozilla.com>
* doc/gty.texi: Document the new cache gty attribute.
* gengtype.c (finish_cache_funcs): New function.
(write_roots): Call gt_clear_cache on global variables with the cache
gty attribute.
* ggc-common.c (ggc_mark_roots): Call gt_clear_caches.
* ggc.h (gt_clear_caches): New declaration.
* hash-table.h (struct ggc_cache_hasher): New hasher for caches in gc
memory.
(gt_cleare_cache): New function.
* emit-rtl.c, rtl.h, tree.c: Use hash_table instead of htab.
Presumably the goal here is continuing to move to the new style hash
tables. So you need to support something like if_marked in the new sytle
hash tables. There really isn't any significant functional changes
here, right?
diff --git a/gcc/gengtype.c b/gcc/gengtype.c
index fac83ee..38c173f 100644
--- a/gcc/gengtype.c
+++ b/gcc/gengtype.c
@@ -4482,6 +4482,58 @@ finish_root_table (struct flist *flp, const char *pfx, const char *lastname,
}
}
+static void
+finish_cache_funcs (flist *flp)
Function comment missing.
+
+ /* clear out entries if there about to be gc'd. */
s/there/they are/ ?
s/clear/Clear/
OK with the above nits fixed.
jeff