MCPcopy Index your code
hub / github.com/RustPython/RustPython / get_cached_values

Method get_cached_values

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

Source from the content-addressed store, hash-verified

1395 self.do_disassembly_compare(got, dis_extended_arg_quick_code)
1396
1397 def get_cached_values(self, quickened, adaptive):
1398 def f():
1399 l = []
1400 for i in range(42):
1401 l.append(i)
1402 if quickened:
1403 self.code_quicken(f)
1404 else:
1405 # "copy" the code to un-quicken it:
1406 reset_code(f)
1407 for instruction in _unroll_caches_as_Instructions(dis.get_instructions(
1408 f, show_caches=True, adaptive=adaptive
1409 ), show_caches=True):
1410 if instruction.opname == "CACHE":
1411 yield instruction.argrepr
1412
1413 @cpython_only
1414 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