Ejemplo n.º 1
0
 def main(s):
     loop(30, s)
     assert jit_hooks.get_jitcell_at_key("jit", s)
     assert not jit_hooks.get_jitcell_at_key("jit", s + 1)
     jit_hooks.trace_next_iteration("jit", s + 1)
     loop(s + 3, s + 1)
     assert jit_hooks.get_jitcell_at_key("jit", s + 1)
Ejemplo n.º 2
0
 def main(s):
     loop(30, s)
     assert jit_hooks.get_jitcell_at_key("jit", s)
     assert not jit_hooks.get_jitcell_at_key("jit", s + 1)
     jit_hooks.trace_next_iteration("jit", s + 1)
     loop(s + 3, s + 1)
     assert jit_hooks.get_jitcell_at_key("jit", s + 1)
Ejemplo n.º 3
0
 def main(s):
     g1 = Green()
     g2 = Green()
     g1_ptr = cast_instance_to_gcref(g1)
     g2_ptr = cast_instance_to_gcref(g2)
     loop(10, g1)
     assert jit_hooks.get_jitcell_at_key("jit", g1_ptr)
     assert not jit_hooks.get_jitcell_at_key("jit", g2_ptr)
     jit_hooks.trace_next_iteration("jit", g2_ptr)
     loop(2, g2)
     assert jit_hooks.get_jitcell_at_key("jit", g2_ptr)
Ejemplo n.º 4
0
 def main(s):
     g1 = Green()
     g2 = Green()
     g1_ptr = cast_instance_to_gcref(g1)
     g2_ptr = cast_instance_to_gcref(g2)
     loop(10, g1)
     assert jit_hooks.get_jitcell_at_key("jit", g1_ptr)
     assert not jit_hooks.get_jitcell_at_key("jit", g2_ptr)
     jit_hooks.trace_next_iteration("jit", g2_ptr)
     loop(2, g2)
     assert jit_hooks.get_jitcell_at_key("jit", g2_ptr)
Ejemplo n.º 5
0
def get_jitcell_at_key(space, next_instr, is_being_profiled, w_pycode):
    ll_pycode = cast_instance_to_gcref(w_pycode)
    return space.wrap(bool(jit_hooks.get_jitcell_at_key(
        'pypyjit', r_uint(next_instr), int(is_being_profiled), ll_pycode)))