Debian Codegraph @

rpython/jit/backend/test/test_model.py

raw symbols SCIP
1 from rpython.jit.backend.model import CompiledLoopToken
2
3 class FakeCPU(object):
4 class tracker:
5 total_compiled_loops = 0
6 total_freed_loops = 0
7 total_freed_bridges = 0
8
9 def free_loop_and_bridges(self, *args):
10 pass
11
12 class FrameInfo(object):
13 def __init__(self, depth):
14 self.jfi_frame_depth = depth
15
16 def update_frame_depth(self, baseofs, newdepth):
17 self.jfi_frame_depth = newdepth
18
19 def test_redirect_loop_token():
20 cpu = FakeCPU()
21 c = CompiledLoopToken(cpu, 0)
22 c2 = CompiledLoopToken(cpu, 0)
23 c.frame_info = FrameInfo(1)
24 c2.frame_info = FrameInfo(2)
25 c2.update_frame_info(c, 0)
26 assert c.frame_info.jfi_frame_depth == 2
27 c3 = CompiledLoopToken(cpu, 0)
28 c3.frame_info = FrameInfo(3)
29 c3.update_frame_info(c2, 0)
30 assert c.frame_info.jfi_frame_depth == 3
31 assert c2.frame_info.jfi_frame_depth == 3
32