On 11/12/14 22:55, tsaund...@mozilla.com wrote:
From: Trevor Saunders <tsaund...@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 <tsaund...@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