Home | History | Annotate | Download | only in callgrind

Lines Matching refs:jCC

32 /*--- Jump Cost Center (JCC) operations, including Calls   ---*/
47 jccs->table = (jCC**) CLG_MALLOC("cl.jumps.ijh.1",
48 jccs->size * sizeof(jCC*));
82 /* double size of jcc table */
86 jCC** new_table;
88 jCC *curr_jcc, *next_jcc;
91 new_table = (jCC**) CLG_MALLOC("cl.jumps.rjt.1",
92 new_size * sizeof(jCC*));
122 CLG_DEBUG(0, "Resize JCC Hash: %d => %d (entries %d, conflicts %d/%d)\n",
133 /* new jCC structure: a call was done to a BB of a BBCC
136 static jCC* new_jcc(BBCC* from, UInt jmp, BBCC* to)
138 jCC* jcc;
141 /* check fill degree of jcc hash table and resize if needed (>80%) */
146 jcc = (jCC*) CLG_MALLOC("cl.jumps.nj.1", sizeof(jCC));
148 jcc->from = from;
149 jcc->jmp = jmp;
150 jcc->to = to;
151 jcc->jmpkind = jk_Call;
152 jcc->call_counter = 0;
153 jcc->cost = 0;
155 /* insert into JCC chain of calling BBCC.
161 jcc->next_from = from->jmp[jmp].jcc_list;
162 from->jmp[jmp].jcc_list = jcc;
165 jcc->next_from = current_jccs.spontaneous;
166 current_jccs.spontaneous = jcc;
169 /* insert into JCC hash table */
171 jcc->next_hash = current_jccs.table[new_idx];
172 current_jccs.table[new_idx] = jcc;
178 CLG_(stat).distinct_jccs, jcc);
181 return jcc;
185 /* get the jCC for a call arc (BBCC->BBCC) */
186 jCC* CLG_(get_jcc)(BBCC* from, UInt jmp, BBCC* to)
188 jCC* jcc;
194 /* first check last recently used JCC */
195 jcc = to->lru_to_jcc;
196 if (jcc && (jcc->from == from) && (jcc->jmp == jmp)) {
197 CLG_ASSERT(to == jcc->to);
198 CLG_DEBUG(5,"- get_jcc: [LRU to] jcc %p\n", jcc);
199 return jcc;
202 jcc = from->lru_from_jcc;
203 if (jcc && (jcc->to == to) && (jcc->jmp == jmp)) {
204 CLG_ASSERT(from == jcc->from);
205 CLG_DEBUG(5, "- get_jcc: [LRU from] jcc %p\n", jcc);
206 return jcc;
212 jcc = current_jccs.table[idx];
214 while(jcc) {
215 if ((jcc->from == from) &&
216 (jcc->jmp == jmp) &&
217 (jcc->to == to)) break;
218 jcc = jcc->next_hash;
221 if (!jcc)
222 jcc = new_jcc(from, jmp, to);
225 from->lru_from_jcc = jcc;
226 to->lru_to_jcc = jcc;
231 return jcc;