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

Method get_cached_values

Lib/test/test_dis.py:1418–1432  ·  view source on GitHub ↗
(self, quickened, adaptive)

Source from the content-addressed store, hash-verified

1416 self.do_disassembly_compare(got, dis_extended_arg_quick_code)
1417
1418 def get_cached_values(self, quickened, adaptive):
1419 def f():
1420 l = []
1421 for i in range(42):
1422 l.append(i)
1423 if quickened:
1424 self.code_quicken(f)
1425 else:
1426 # "copy" the code to un-quicken it:
1427 reset_code(f)
1428 for instruction in _unroll_caches_as_Instructions(dis.get_instructions(
1429 f, show_caches=True, adaptive=adaptive
1430 ), show_caches=True):
1431 if instruction.opname == "CACHE":
1432 yield instruction.argrepr
1433
1434 @cpython_only
1435 def test_show_caches(self):

Callers 1

test_show_cachesMethod · 0.95

Calls 4

code_quickenMethod · 0.95
reset_codeFunction · 0.90
get_instructionsMethod · 0.80

Tested by

no test coverage detected