Lines Matching refs:cache

72   const struct tailcall_cache *cache = (const struct tailcall_cache *) arg;  in cache_hash()  local
74 return htab_hash_pointer (cache->next_bottom_frame); in cache_hash()
95 struct tailcall_cache *cache = XCNEW (struct tailcall_cache); in cache_new_ref1() local
98 cache->next_bottom_frame = next_bottom_frame; in cache_new_ref1()
99 cache->refc = 1; in cache_new_ref1()
101 slot = htab_find_slot (cache_htab, cache, INSERT); in cache_new_ref1()
103 *slot = cache; in cache_new_ref1()
105 return cache; in cache_new_ref1()
111 cache_ref (struct tailcall_cache *cache) in cache_ref() argument
113 gdb_assert (cache->refc > 0); in cache_ref()
115 cache->refc++; in cache_ref()
122 cache_unref (struct tailcall_cache *cache) in cache_unref() argument
124 gdb_assert (cache->refc > 0); in cache_unref()
126 if (!--cache->refc) in cache_unref()
128 gdb_assert (htab_find_slot (cache_htab, cache, NO_INSERT) != NULL); in cache_unref()
129 htab_remove_elt (cache_htab, cache); in cache_unref()
131 xfree (cache->chain); in cache_unref()
132 xfree (cache); in cache_unref()
151 struct tailcall_cache *cache; in cache_find() local
164 cache = (struct tailcall_cache *) *slot; in cache_find()
165 gdb_assert (cache != NULL); in cache_find()
166 return cache; in cache_find()
174 struct tailcall_cache *cache) in existing_next_levels() argument
177 - frame_relative_level (cache->next_bottom_frame) - 1); in existing_next_levels()
213 struct tailcall_cache *cache = (struct tailcall_cache *) *this_cache; in tailcall_frame_this_id() local
223 (*this_id).artificial_depth = (cache->chain_levels in tailcall_frame_this_id()
224 - existing_next_levels (this_frame, cache)); in tailcall_frame_this_id()
232 pretend_pc (struct frame_info *this_frame, struct tailcall_cache *cache) in pretend_pc() argument
234 int next_levels = existing_next_levels (this_frame, cache); in pretend_pc()
235 struct call_site_chain *chain = cache->chain; in pretend_pc()
255 return cache->prev_pc; in pretend_pc()
268 struct tailcall_cache *cache = (struct tailcall_cache *) *tailcall_cachep; in dwarf2_tailcall_prev_register_first() local
272 addr = pretend_pc (this_frame, cache); in dwarf2_tailcall_prev_register_first()
273 else if (cache->prev_sp_p && regnum == gdbarch_sp_regnum (this_gdbarch)) in dwarf2_tailcall_prev_register_first()
275 int next_levels = existing_next_levels (this_frame, cache); in dwarf2_tailcall_prev_register_first()
277 if (next_levels == cache->chain_levels - 1) in dwarf2_tailcall_prev_register_first()
278 addr = cache->prev_sp; in dwarf2_tailcall_prev_register_first()
280 addr = dwarf2_frame_cfa (this_frame) - cache->entry_cfa_sp_offset; in dwarf2_tailcall_prev_register_first()
297 struct tailcall_cache *cache = (struct tailcall_cache *) *this_cache; in tailcall_frame_prev_register() local
300 gdb_assert (this_frame != cache->next_bottom_frame); in tailcall_frame_prev_register()
320 struct tailcall_cache *cache; in tailcall_frame_sniffer() local
330 cache = cache_find (next_frame); in tailcall_frame_sniffer()
331 if (cache == NULL) in tailcall_frame_sniffer()
334 cache_ref (cache); in tailcall_frame_sniffer()
336 next_levels = existing_next_levels (this_frame, cache); in tailcall_frame_sniffer()
340 gdb_assert (next_levels <= cache->chain_levels); in tailcall_frame_sniffer()
342 if (next_levels == cache->chain_levels) in tailcall_frame_sniffer()
344 cache_unref (cache); in tailcall_frame_sniffer()
348 *this_cache = cache; in tailcall_frame_sniffer()
372 struct tailcall_cache *cache; in dwarf2_tailcall_sniffer_first() local
428 cache = cache_new_ref1 (this_frame); in dwarf2_tailcall_sniffer_first()
429 *tailcall_cachep = cache; in dwarf2_tailcall_sniffer_first()
430 cache->chain = chain.release (); in dwarf2_tailcall_sniffer_first()
431 cache->prev_pc = prev_pc; in dwarf2_tailcall_sniffer_first()
432 cache->chain_levels = pretended_chain_levels (cache->chain); in dwarf2_tailcall_sniffer_first()
433 cache->prev_sp_p = prev_sp_p; in dwarf2_tailcall_sniffer_first()
434 if (cache->prev_sp_p) in dwarf2_tailcall_sniffer_first()
436 cache->prev_sp = prev_sp; in dwarf2_tailcall_sniffer_first()
437 cache->entry_cfa_sp_offset = *entry_cfa_sp_offsetp; in dwarf2_tailcall_sniffer_first()
439 gdb_assert (cache->chain_levels > 0); in dwarf2_tailcall_sniffer_first()
449 struct tailcall_cache *cache = (struct tailcall_cache *) this_cache; in tailcall_frame_dealloc_cache() local
451 cache_unref (cache); in tailcall_frame_dealloc_cache()
461 struct tailcall_cache *cache = (struct tailcall_cache *) *this_prologue_cache; in tailcall_frame_prev_arch() local
463 return get_frame_arch (cache->next_bottom_frame); in tailcall_frame_prev_arch()