Lines Matching refs:CLG_
43 void CLG_(init_bbcc_hash)(bbcc_hash* bbccs)
57 void CLG_(copy_current_bbcc_hash)(bbcc_hash* dst)
66 bbcc_hash* CLG_(get_current_bbcc_hash)()
71 void CLG_(set_current_bbcc_hash)(bbcc_hash* h)
83 void CLG_(zero_bbcc)(BBCC* bbcc)
104 CLG_(init_cost)( CLG_(sets).full, jcc->cost );
112 void CLG_(forall_bbccs)(void (*func)(BBCC*))
164 if (!CLG_(clo).separate_threads) {
168 if (bbcc->tid == CLG_(current_tid)) return bbcc;
171 CLG_(stat).bbcc_lru_misses++;
186 if (bbcc) CLG_(print_bbcc)(-2,bbcc);
239 CLG_(stat).bbcc_hash_resizes++;
278 bbcc->tid = CLG_(current_tid);
282 bbcc->cost = CLG_(get_costarray)(bb->cost_count);
296 CLG_(stat).distinct_bbccs++;
299 bb_addr(bb), bbcc, CLG_(stat).distinct_bbccs);
387 CLG_ASSERT((orig->tid != CLG_(current_tid)) ||
398 if (CLG_(clo).separate_threads)
399 CLG_ASSERT(orig->tid == CLG_(current_tid));
419 CLG_(print_bbcc)(-2, bbcc);
432 CLG_(stat).bbcc_clones++;
444 BBCC* CLG_(get_bbcc)(BB* bb)
465 CLG_(print_bbcc)(-2, bbcc);
502 source_bb = CLG_(get_bb)(bb_addr(bb)-1, 0, &seen_before);
503 source_bbcc = CLG_(get_bbcc)(source_bb);
507 source_bbcc->ecounter_sum = CLG_(current_state).collect ? 1 : 0;
509 else if (CLG_(current_state).collect)
513 CLG_(current_fn_stack).top--;
514 CLG_(current_state).cxt = 0;
515 caller = CLG_(get_fn_node)(bb);
516 CLG_(push_cxt)( caller );
524 source_bbcc->cxt = CLG_(current_state).cxt;
527 CLG_ASSERT(CLG_(current_state).bbcc);
530 fn_number = CLG_(current_state).bbcc->cxt->fn[0]->number;
531 pactive = CLG_(get_fn_entry)(fn_number);
538 CLG_(current_state).nonskipped = 0; /* we didn't skip this function */
540 CLG_(push_cxt)( CLG_(current_state).bbcc->cxt->fn[0] );
541 CLG_(push_call_stack)(source_bbcc, 0, CLG_(current_state).bbcc,
544 &(CLG_(current_call_stack).entry[CLG_(current_call_stack).sp -1]);
547 if (CLG_(current_state).sig == 0)
548 CLG_(copy_cost)( CLG_(sets).full, call_entry_up->enter_cost,
549 CLG_(get_current_thread)()->lastdump_cost );
551 CLG_(zero_cost)( CLG_(sets).full, call_entry_up->enter_cost );
561 void CLG_(setup_bbcc)(BB* bb)
577 * with callback CLG_(run_thread) only: we have otherwise no way to get
584 /* CLG_(switch_thread) is a no-op when tid is equal to CLG_(current_tid).
585 * As this is on the hot path, we only call CLG_(switch_thread)(tid)
586 * if tid differs from the CLG_(current_tid).
588 if (UNLIKELY(tid != CLG_(current_tid)))
589 CLG_(switch_thread)(tid);
591 CLG_ASSERT(VG_(get_running_tid)() == CLG_(current_tid));
595 last_bbcc = CLG_(current_state).bbcc;
599 passed = CLG_(current_state).jmps_passed;
604 if (CLG_(current_state).collect) {
605 if (!CLG_(current_state).nonskipped) {
608 if (!CLG_(clo).simulate_cache) {
611 CLG_(current_state).cost[ fullOffset(EG_IR) ] += instr_count;
617 if (!CLG_(clo).simulate_cache) {
620 CLG_(current_state).cost[ fullOffset(EG_IR) ] += instr_count;
621 CLG_(current_state).nonskipped->skipped[ fullOffset(EG_IR) ]
628 CLG_(print_execstate)(-2, &CLG_(current_state) );
629 CLG_(print_bbcc_cost)(-2, last_bbcc);
639 csp = CLG_(current_call_stack).sp;
644 call_entry* top_ce = &(CLG_(current_call_stack).entry[csp_up]);
661 top_ce = &(CLG_(current_call_stack).entry[csp_up]);
704 if (CLG_(get_fn_node)(last_bb)->pop_on_jump && (csp>0)) {
706 call_entry* top_ce = &(CLG_(current_call_stack).entry[csp-1]);
713 CLG_(current_state).bbcc = top_ce->jcc->from;
716 CLG_(pop_call_stack)();
719 CLG_ASSERT(CLG_(current_state).nonskipped != 0);
729 skip = CLG_(get_fn_node)(bb)->skip;
751 ((CLG_(current_fn_stack).top > CLG_(current_fn_stack).bottom) &&
752 ( *(CLG_(current_fn_stack).top-1)==0)) ) {
758 CLG_(pop_call_stack)();
762 CLG_(unwind_call_stack)(sp, popcount_on_return);
766 Int unwind_count = CLG_(unwind_call_stack)(sp, 0);
775 csp = CLG_(current_call_stack).sp;
777 sp = CLG_(current_call_stack).entry[csp-1].sp;
783 if ((delayed_push && !skip) || (CLG_(current_state).cxt == 0)) {
784 CLG_(push_cxt)(CLG_(get_fn_node)(bb));
786 CLG_ASSERT(CLG_(current_fn_stack).top > CLG_(current_fn_stack).bottom);
789 bbcc = CLG_(get_bbcc)(bb);
793 bbcc->cxt = CLG_(current_state).cxt;
795 new_recursion((*CLG_(current_fn_stack).top)->separate_recursions);
809 (bbcc->cxt != CLG_(current_state).cxt)))
816 bbcc = lookup_bbcc(bb, CLG_(current_state).cxt);
818 bbcc = clone_bbcc(bb->bbcc_list, CLG_(current_state).cxt, 0);
827 if ((*CLG_(current_fn_stack).top)->separate_recursions >1) {
829 fn_node* top = *(CLG_(current_fn_stack).top);
831 level = *CLG_(get_fn_entry)(top->number);
834 if (CLG_(clo).skip_direct_recursion) {
836 CLG_ASSERT(CLG_(current_state).bbcc != 0);
838 if (CLG_(current_state).bbcc->cxt->fn[0] != bbcc->cxt->fn[0])
849 *CLG_(get_fn_entry)(top->number) = 1;
856 bbcc = clone_bbcc(bbcc, CLG_(current_state).cxt, idx);
862 if (!skip && CLG_(current_state).nonskipped) {
864 CLG_(current_state).bbcc = CLG_(current_state).nonskipped;
866 passed = CLG_(current_state).bbcc->bb->cjmp_count;
868 CLG_(push_call_stack)(CLG_(current_state).bbcc, passed,
872 if (CLG_(clo).collect_jumps && (jmpkind == jk_Jump)) {
877 jCC* jcc = CLG_(get_jcc)(last_bbcc, passed, bbcc);
889 CLG_(stat).jcnd_counter++;
891 CLG_(stat).jump_counter++;
894 CLG_(current_state).bbcc = bbcc;
898 CLG_(current_state).jmps_passed = 0;
900 CLG_(bb_base) = bb->obj->offset + bb->offset;
901 CLG_(cost_base) = bbcc->cost;
905 CLG_(print_bbcc_fn)(bbcc);
913 CLG_(print_cxt)(-8, CLG_(current_state).cxt, bbcc->rec_index);
916 CLG_(stat).bb_executions++;