MCPcopy Index your code
hub / github.com/python/cpython / test_call_specialize

Method test_call_specialize

Lib/test/test_dis.py:1353–1368  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1351 @cpython_only
1352 @requires_specialization
1353 def test_call_specialize(self):
1354 call_quicken = """\
1355 0 RESUME_CHECK{: <6} 0
1356
1357 1 LOAD_NAME 0 (str)
1358 PUSH_NULL
1359 LOAD_SMALL_INT 1
1360 CALL_STR_1 1
1361 RETURN_VALUE
1362"""
1363 co = compile("str(1)", "", "eval")
1364 self.code_quicken(lambda: exec(co, {}, {}))
1365 got = self.get_disassembly(co, adaptive=True)
1366 jit = sys._jit.is_enabled()
1367 expected = call_quicken.format("_JIT" if jit else "")
1368 self.do_disassembly_compare(got, expected)
1369
1370 @cpython_only
1371 @requires_specialization

Callers

nothing calls this directly

Calls 5

code_quickenMethod · 0.95
get_disassemblyMethod · 0.95
compileFunction · 0.50
formatMethod · 0.45

Tested by

no test coverage detected