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

Method test_load_attr_specialize

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

Source from the content-addressed store, hash-verified

1334 @cpython_only
1335 @requires_specialization
1336 def test_load_attr_specialize(self):
1337 load_attr_quicken = """\
1338 0 RESUME_CHECK{: <6} 0
1339
1340 1 LOAD_CONST 0 ('a')
1341 LOAD_ATTR_SLOT 0 (__class__)
1342 RETURN_VALUE
1343"""
1344 co = compile("'a'.__class__", "", "eval")
1345 self.code_quicken(lambda: exec(co, {}, {}))
1346 got = self.get_disassembly(co, adaptive=True)
1347 jit = sys._jit.is_enabled()
1348 expected = load_attr_quicken.format("_JIT" if jit else "")
1349 self.do_disassembly_compare(got, expected)
1350
1351 @cpython_only
1352 @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