Lines Matching refs:cache
71 const struct tailcall_cache *cache = (const struct tailcall_cache *) arg;
73 return htab_hash_pointer (cache->next_bottom_frame);
94 struct tailcall_cache *cache = XCNEW (struct tailcall_cache);
97 cache->next_bottom_frame = next_bottom_frame.get ();
98 cache->refc = 1;
100 slot = htab_find_slot (cache_htab, cache, INSERT);
102 *slot = cache;
104 return cache;
107 /* Create new reference to CACHE. */
110 cache_ref (struct tailcall_cache *cache)
112 gdb_assert (cache->refc > 0);
114 cache->refc++;
117 /* Drop reference to CACHE, possibly fully freeing it and unregistering it from
121 cache_unref (struct tailcall_cache *cache)
123 gdb_assert (cache->refc > 0);
125 if (!--cache->refc)
127 gdb_assert (htab_find_slot (cache_htab, cache, NO_INSERT) != NULL);
128 htab_remove_elt (cache_htab, cache);
130 xfree (cache->chain);
131 xfree (cache);
150 struct tailcall_cache *cache;
167 cache = (struct tailcall_cache *) *slot;
168 gdb_assert (cache != NULL);
169 return cache;
172 /* Number of virtual frames between THIS_FRAME and CACHE->NEXT_BOTTOM_FRAME.
173 If THIS_FRAME is CACHE-> NEXT_BOTTOM_FRAME return -1. */
177 struct tailcall_cache *cache)
180 - frame_relative_level (frame_info_ptr (cache->next_bottom_frame)) - 1);
216 struct tailcall_cache *cache = (struct tailcall_cache *) *this_cache;
226 (*this_id).artificial_depth = (cache->chain_levels
227 - existing_next_levels (this_frame, cache));
232 CACHE. */
235 pretend_pc (const frame_info_ptr &this_frame, struct tailcall_cache *cache)
237 int next_levels = existing_next_levels (this_frame, cache);
238 struct call_site_chain *chain = cache->chain;
258 return cache->prev_pc;
271 struct tailcall_cache *cache = (struct tailcall_cache *) *tailcall_cachep;
275 addr = pretend_pc (this_frame, cache);
276 else if (cache->prev_sp_p && regnum == gdbarch_sp_regnum (this_gdbarch))
278 int next_levels = existing_next_levels (this_frame, cache);
280 if (next_levels == cache->chain_levels - 1)
281 addr = cache->prev_sp;
283 addr = dwarf2_frame_cfa (this_frame) - cache->entry_cfa_sp_offset;
300 struct tailcall_cache *cache = (struct tailcall_cache *) *this_cache;
303 gdb_assert (this_frame != cache->next_bottom_frame);
323 struct tailcall_cache *cache;
333 cache = cache_find (next_frame);
334 if (cache == NULL)
337 cache_ref (cache);
339 next_levels = existing_next_levels (this_frame, cache);
343 gdb_assert (next_levels <= cache->chain_levels);
345 if (next_levels == cache->chain_levels)
347 cache_unref (cache);
351 *this_cache = cache;
375 struct tailcall_cache *cache;
431 cache = cache_new_ref1 (this_frame);
432 *tailcall_cachep = cache;
433 cache->chain = chain.release ();
434 cache->prev_pc = prev_pc;
435 cache->chain_levels = pretended_chain_levels (cache->chain);
436 cache->prev_sp_p = prev_sp_p;
437 if (cache->prev_sp_p)
439 cache->prev_sp = prev_sp;
440 cache->entry_cfa_sp_offset = *entry_cfa_sp_offsetp;
442 gdb_assert (cache->chain_levels > 0);
452 struct tailcall_cache *cache = (struct tailcall_cache *) this_cache;
454 cache_unref (cache);
464 struct tailcall_cache *cache = (struct tailcall_cache *) *this_prologue_cache;
466 return get_frame_arch (frame_info_ptr (cache->next_bottom_frame));