Lines Matching refs:cache

106 streamer_tree_cache_add_to_node_array (struct streamer_tree_cache_d *cache,  in streamer_tree_cache_add_to_node_array()  argument
110 if (cache->nodes.exists ()) in streamer_tree_cache_add_to_node_array()
112 if (cache->nodes.length () == ix) in streamer_tree_cache_add_to_node_array()
113 cache->nodes.safe_push (t); in streamer_tree_cache_add_to_node_array()
115 cache->nodes[ix] = t; in streamer_tree_cache_add_to_node_array()
117 if (cache->hashes.exists ()) in streamer_tree_cache_add_to_node_array()
119 if (cache->hashes.length () == ix) in streamer_tree_cache_add_to_node_array()
120 cache->hashes.safe_push (hash); in streamer_tree_cache_add_to_node_array()
122 cache->hashes[ix] = hash; in streamer_tree_cache_add_to_node_array()
138 streamer_tree_cache_insert_1 (struct streamer_tree_cache_d *cache, in streamer_tree_cache_insert_1() argument
146 unsigned int &ix = cache->node_map->get_or_insert (t, &existed_p); in streamer_tree_cache_insert_1()
151 ix = cache->next_idx++; in streamer_tree_cache_insert_1()
155 streamer_tree_cache_add_to_node_array (cache, ix, t, hash); in streamer_tree_cache_insert_1()
165 streamer_tree_cache_add_to_node_array (cache, ix, t, hash); in streamer_tree_cache_insert_1()
183 streamer_tree_cache_insert (struct streamer_tree_cache_d *cache, tree t, in streamer_tree_cache_insert() argument
186 return streamer_tree_cache_insert_1 (cache, t, hash, ix_p, true); in streamer_tree_cache_insert()
193 streamer_tree_cache_replace_tree (struct streamer_tree_cache_d *cache, in streamer_tree_cache_replace_tree() argument
197 if (cache->hashes.exists ()) in streamer_tree_cache_replace_tree()
198 hash = streamer_tree_cache_get_hash (cache, ix); in streamer_tree_cache_replace_tree()
199 if (!cache->node_map) in streamer_tree_cache_replace_tree()
200 streamer_tree_cache_add_to_node_array (cache, ix, t, hash); in streamer_tree_cache_replace_tree()
202 streamer_tree_cache_insert_1 (cache, t, hash, &ix, false); in streamer_tree_cache_replace_tree()
209 streamer_tree_cache_append (struct streamer_tree_cache_d *cache, in streamer_tree_cache_append() argument
212 unsigned ix = cache->next_idx++; in streamer_tree_cache_append()
213 if (!cache->node_map) in streamer_tree_cache_append()
214 streamer_tree_cache_add_to_node_array (cache, ix, t, hash); in streamer_tree_cache_append()
216 streamer_tree_cache_insert_1 (cache, t, hash, &ix, false); in streamer_tree_cache_append()
224 streamer_tree_cache_lookup (struct streamer_tree_cache_d *cache, tree t, in streamer_tree_cache_lookup() argument
233 slot = cache->node_map->get (t); in streamer_tree_cache_lookup()
255 verify_common_node_recorded (struct streamer_tree_cache_d *cache, tree node) in verify_common_node_recorded() argument
263 if (cache->node_map) in verify_common_node_recorded()
264 gcc_assert (streamer_tree_cache_lookup (cache, node, NULL)); in verify_common_node_recorded()
268 gcc_assert (cache->nodes.exists ()); in verify_common_node_recorded()
270 for (unsigned i = 0; !found && i < cache->nodes.length (); ++i) in verify_common_node_recorded()
271 if (cache->nodes[i] == node) in verify_common_node_recorded()
281 record_common_node (struct streamer_tree_cache_d *cache, tree node) in record_common_node() argument
306 streamer_tree_cache_append (cache, node, cache->next_idx + 0xc001); in record_common_node()
325 record_common_node (cache, TREE_TYPE (node)); in record_common_node()
330 verify_common_node_recorded (cache, TREE_TYPE (node)); in record_common_node()
340 record_common_node (cache, f); in record_common_node()
353 preload_common_nodes (struct streamer_tree_cache_d *cache) in preload_common_nodes() argument
360 record_common_node (cache, integer_types[i]); in preload_common_nodes()
363 record_common_node (cache, sizetype_tab[i]); in preload_common_nodes()
391 record_common_node (cache, global_trees[i]); in preload_common_nodes()
400 struct streamer_tree_cache_d *cache; in streamer_tree_cache_create() local
402 cache = XCNEW (struct streamer_tree_cache_d); in streamer_tree_cache_create()
405 cache->node_map = new hash_map<tree, unsigned> (251); in streamer_tree_cache_create()
406 cache->next_idx = 0; in streamer_tree_cache_create()
408 cache->nodes.create (165); in streamer_tree_cache_create()
410 cache->hashes.create (165); in streamer_tree_cache_create()
415 preload_common_nodes (cache); in streamer_tree_cache_create()
417 return cache; in streamer_tree_cache_create()