Lines Matching refs:depth
50 * A function instance keyed by (callsite, depth).
52 * Marks are tracked for each frame up to @depth.
56 u32 callsite; /* call insn that invoked this subprog (subprog_start for depth 0) */
57 u32 depth; /* call depth (0 = entry subprog) */
74 DECLARE_HASHTABLE(func_instances, 8); /* maps (depth, callsite) to func_instance */
80 * Hash/compare key for func_instance: (depth, callsite).
81 * For depth == 0 (entry subprog), @callsite is the subprog start insn.
82 * For depth > 0, @callsite is the call instruction index that invoked the subprog.
84 static u32 instance_hash(u32 callsite, u32 depth)
86 u32 key[2] = { depth, callsite };
92 u32 callsite, u32 depth)
96 u32 key = instance_hash(callsite, depth);
99 if (f->depth == depth && f->callsite == callsite)
108 u32 depth = caller ? caller->depth + 1 : 0;
110 u32 lookup_key = depth > 0 ? callsite : subprog_start;
114 f = find_instance(env, lookup_key, depth);
122 f->depth = depth;
126 hash = instance_hash(lookup_key, depth);
137 u32 key, depth;
142 for (depth = frameno; ; depth--) {
143 key = depth > 0 ? callsite : subprog_start;
144 f = find_instance(env, key, depth);
145 if (f || depth == 0)
168 for (i = 0; i <= instance->depth; i++)
469 for (frame = 0; frame <= instance->depth; frame++) {
544 cur_delta = (int)curframe_instance->depth - (int)q->curframe;
546 if (rel <= curframe_instance->depth)
557 delta = (int)instance->depth - (int)i;
559 if (rel > instance->depth)
587 "(d%d,cs%d)", instance->depth, instance->callsite);
659 for (frame = instance->depth; frame >= 0; --frame) {
712 int ddepth = (int)a->depth - b->depth;
746 fm = instance->frames[instance->depth];
764 /* print use/def slots for all instances ordered by callsite first, then by depth */
1178 int depth)
1181 .mask = (1u << (depth + 1)) - 1,
1357 static bool can_be_local_fp(int depth, int regno, struct arg_track *at)
1359 return regno == BPF_REG_FP || at->frame == depth ||
1360 (at->frame == ARG_IMPRECISE && (at->mask & BIT(depth)));
1370 int depth, u32 *callsites)
1374 if (can_be_local_fp(depth, reg, ptr))
1375 return fill_from_stack(insn, at_out, reg, at_stack_out, nslots, depth);
1376 if (ptr->frame >= 0 && ptr->frame < depth) {
1381 if (ptr->frame == ARG_IMPRECISE && !(ptr->mask & BIT(depth)) && ptr->mask)
1387 * True if the call at @insn_idx can pass a pointer to the frame at @depth to a static subprog
1393 struct arg_track *at, int depth)
1406 if ((r <= BPF_REG_5 || r >= MAX_BPF_REG) && can_be_local_fp(depth, r, &at[r]))
1423 int depth = instance->depth;
1487 if (subprog_gets_local_fp(env, insn, insn_idx, at_out, depth))
1496 at_stack_out, nslots, depth, callsites);
1503 bool dst_is_local_fp = can_be_local_fp(depth, insn->dst_reg, dst);
1513 at_stack_out, nslots, depth, callsites);
1523 at_stack_out, nslots, depth, callsites);
1532 bool dst_is_local_fp = can_be_local_fp(depth, insn->dst_reg, dst);
1623 int depth = instance->depth;
1629 if (f <= depth) {
1652 int depth = instance->depth;
1721 if (ptr->frame >= 0 && ptr->frame <= depth)
1736 int depth = instance->depth;
1750 for (int f = 0; f <= depth; f++) {
1763 if (frame >= 0 && frame <= depth)
1982 int depth = instance->depth;
2022 at_in[0][BPF_REG_FP] = arg_single(depth, 0);
2039 verbose(env, "subprog#%d: analyzing (depth %d)...\n", subprog, depth);
2160 for (f = 0; f <= dst->depth; f++) {
2212 for (f = 0; f < callee->depth; f++) {
2237 f->depth = src->depth;
2248 for (i = 0; i <= instance->depth; i++)
2258 * depends on the entry args and frame depth. Consider: A->C->D and B->C->D
2269 int depth = instance->depth;
2345 for (int f = 0; f <= depth; f++) {
2370 if (depth == MAX_CALL_FRAMES - 1) {
2380 callsites[depth] = idx;
2390 for (int f = 0; f < callee_instance->depth; f++) {