Lines Matching refs:bbcc
83 void CLG_(zero_bbcc)(BBCC* bbcc) in CLG_()
88 CLG_ASSERT(bbcc->cxt != 0); in CLG_()
91 bb_addr(bbcc->bb), in CLG_()
92 bbcc->cxt->base_number + bbcc->rec_index, in CLG_()
93 bbcc->cxt->fn[0]->name, in CLG_()
94 bbcc->rec_index); in CLG_()
96 if ((bbcc->ecounter_sum ==0) && in CLG_()
97 (bbcc->ret_counter ==0)) return; in CLG_()
99 for(i=0;i<bbcc->bb->cost_count;i++) in CLG_()
100 bbcc->cost[i] = 0; in CLG_()
101 for(i=0;i <= bbcc->bb->cjmp_count;i++) { in CLG_()
102 bbcc->jmp[i].ecounter = 0; in CLG_()
103 for(jcc=bbcc->jmp[i].jcc_list; jcc; jcc=jcc->next_from) in CLG_()
106 bbcc->ecounter_sum = 0; in CLG_()
107 bbcc->ret_counter = 0; in CLG_()
114 BBCC *bbcc, *bbcc2; in CLG_() local
118 if ((bbcc=current_bbccs.table[i]) == NULL) continue; in CLG_()
119 while (bbcc) { in CLG_()
121 CLG_ASSERT(bbcc->rec_array != 0); in CLG_()
123 for(j=0;j<bbcc->cxt->fn[0]->separate_recursions;j++) { in CLG_()
124 if ((bbcc2 = bbcc->rec_array[j]) == 0) continue; in CLG_()
128 bbcc = bbcc->next; in CLG_()
159 BBCC* bbcc = bb->last_bbcc; in lookup_bbcc() local
163 if (bbcc->cxt == cxt) { in lookup_bbcc()
166 return bbcc; in lookup_bbcc()
168 if (bbcc->tid == CLG_(current_tid)) return bbcc; in lookup_bbcc()
174 bbcc = current_bbccs.table[idx]; in lookup_bbcc()
175 while (bbcc && in lookup_bbcc()
176 (bb != bbcc->bb || in lookup_bbcc()
177 cxt != bbcc->cxt)) { in lookup_bbcc()
178 bbcc = bbcc->next; in lookup_bbcc()
183 bbcc, bbcc ? bbcc->tid : 0); in lookup_bbcc()
186 if (bbcc) CLG_(print_bbcc)(-2,bbcc); in lookup_bbcc()
188 return bbcc; in lookup_bbcc()
268 BBCC* bbcc; in new_bbcc() local
274 bbcc = (BBCC*)CLG_MALLOC("cl.bbcc.nb.1", in new_bbcc()
277 bbcc->bb = bb; in new_bbcc()
278 bbcc->tid = CLG_(current_tid); in new_bbcc()
280 bbcc->ret_counter = 0; in new_bbcc()
281 bbcc->skipped = 0; in new_bbcc()
282 bbcc->cost = CLG_(get_costarray)(bb->cost_count); in new_bbcc()
284 bbcc->cost[i] = 0; in new_bbcc()
286 bbcc->jmp[i].ecounter = 0; in new_bbcc()
287 bbcc->jmp[i].jcc_list = 0; in new_bbcc()
289 bbcc->ecounter_sum = 0; in new_bbcc()
292 bbcc->lru_next_bbcc = 0; in new_bbcc()
293 bbcc->lru_from_jcc = 0; in new_bbcc()
294 bbcc->lru_to_jcc = 0; in new_bbcc()
299 bb_addr(bb), bbcc, CLG_(stat).distinct_bbccs); in new_bbcc()
301 return bbcc; in new_bbcc()
317 void insert_bbcc_into_hash(BBCC* bbcc) in insert_bbcc_into_hash() argument
321 CLG_ASSERT(bbcc->cxt != 0); in insert_bbcc_into_hash()
324 bb_addr(bbcc->bb), bbcc->cxt->fn[0]->name); in insert_bbcc_into_hash()
331 idx = bbcc_hash_idx(bbcc->bb, bbcc->cxt, current_bbccs.size); in insert_bbcc_into_hash()
332 bbcc->next = current_bbccs.table[idx]; in insert_bbcc_into_hash()
333 current_bbccs.table[idx] = bbcc; in insert_bbcc_into_hash()
377 BBCC* bbcc; in clone_bbcc() local
382 bbcc = new_bbcc(orig->bb); in clone_bbcc()
390 bbcc->rec_index = 0; in clone_bbcc()
391 bbcc->cxt = cxt; in clone_bbcc()
392 bbcc->rec_array = new_recursion(cxt->fn[0]->separate_recursions); in clone_bbcc()
393 bbcc->rec_array[0] = bbcc; in clone_bbcc()
395 insert_bbcc_into_hash(bbcc); in clone_bbcc()
407 bbcc->rec_index = rec_index; in clone_bbcc()
408 bbcc->cxt = cxt; in clone_bbcc()
409 bbcc->rec_array = orig->rec_array; in clone_bbcc()
410 bbcc->rec_array[rec_index] = bbcc; in clone_bbcc()
414 bbcc->next_bbcc = orig->bb->bbcc_list; in clone_bbcc()
415 orig->bb->bbcc_list = bbcc; in clone_bbcc()
419 CLG_(print_bbcc)(-2, bbcc); in clone_bbcc()
422 HChar *mangled_bbcc = mangled_cxt(bbcc->cxt, bbcc->rec_index); in clone_bbcc()
434 return bbcc; in clone_bbcc()
446 BBCC* bbcc; in CLG_() local
450 bbcc = bb->bbcc_list; in CLG_()
452 if (!bbcc) { in CLG_()
453 bbcc = new_bbcc(bb); in CLG_()
456 bbcc->cxt = 0; in CLG_()
457 bbcc->rec_array = 0; in CLG_()
458 bbcc->rec_index = 0; in CLG_()
460 bbcc->next_bbcc = bb->bbcc_list; in CLG_()
461 bb->bbcc_list = bbcc; in CLG_()
462 bb->last_bbcc = bbcc; in CLG_()
465 CLG_(print_bbcc)(-2, bbcc); in CLG_()
469 bb_addr(bb), bbcc); in CLG_()
471 return bbcc; in CLG_()
527 CLG_ASSERT(CLG_(current_state).bbcc); in handleUnderflow()
530 fn_number = CLG_(current_state).bbcc->cxt->fn[0]->number; in handleUnderflow()
540 CLG_(push_cxt)( CLG_(current_state).bbcc->cxt->fn[0] ); in handleUnderflow()
541 CLG_(push_call_stack)(source_bbcc, 0, CLG_(current_state).bbcc, in handleUnderflow()
563 BBCC *bbcc, *last_bbcc; in CLG_() local
595 last_bbcc = CLG_(current_state).bbcc; in CLG_()
713 CLG_(current_state).bbcc = top_ce->jcc->from; in CLG_()
789 bbcc = CLG_(get_bbcc)(bb); in CLG_()
790 if (bbcc->cxt == 0) { in CLG_()
791 CLG_ASSERT(bbcc->rec_array == 0); in CLG_()
793 bbcc->cxt = CLG_(current_state).cxt; in CLG_()
794 bbcc->rec_array = in CLG_()
796 bbcc->rec_array[0] = bbcc; in CLG_()
798 insert_bbcc_into_hash(bbcc); in CLG_()
806 bbcc = last_bbcc->lru_next_bbcc; in CLG_()
807 if (bbcc && in CLG_()
808 ((bbcc->bb != bb) || in CLG_()
809 (bbcc->cxt != CLG_(current_state).cxt))) in CLG_()
810 bbcc = 0; in CLG_()
813 bbcc = 0; in CLG_()
815 if (!bbcc) in CLG_()
816 bbcc = lookup_bbcc(bb, CLG_(current_state).cxt); in CLG_()
817 if (!bbcc) in CLG_()
818 bbcc = clone_bbcc(bb->bbcc_list, CLG_(current_state).cxt, 0); in CLG_()
820 bb->last_bbcc = bbcc; in CLG_()
825 last_bbcc->lru_next_bbcc = bbcc; in CLG_()
836 CLG_ASSERT(CLG_(current_state).bbcc != 0); in CLG_()
838 if (CLG_(current_state).bbcc->cxt->fn[0] != bbcc->cxt->fn[0]) in CLG_()
853 if (bbcc->rec_array[idx]) in CLG_()
854 bbcc = bbcc->rec_array[idx]; in CLG_()
856 bbcc = clone_bbcc(bbcc, CLG_(current_state).cxt, idx); in CLG_()
858 CLG_ASSERT(bbcc->rec_array[bbcc->rec_index] == bbcc); in CLG_()
864 CLG_(current_state).bbcc = CLG_(current_state).nonskipped; in CLG_()
866 passed = CLG_(current_state).bbcc->bb->cjmp_count; in CLG_()
868 CLG_(push_call_stack)(CLG_(current_state).bbcc, passed, in CLG_()
869 bbcc, sp, skip); in CLG_()
877 jCC* jcc = CLG_(get_jcc)(last_bbcc, passed, bbcc); in CLG_()
894 CLG_(current_state).bbcc = bbcc; in CLG_()
901 CLG_(cost_base) = bbcc->cost; in CLG_()
905 CLG_(print_bbcc_fn)(bbcc); in CLG_()
910 bb_addr(bb), bbcc->cost, bb->cost_count, in CLG_()
913 CLG_(print_cxt)(-8, CLG_(current_state).cxt, bbcc->rec_index); in CLG_()