summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2023-08-16 23:26:43 (GMT)
committerGitHub <noreply@github.com>2023-08-16 23:26:43 (GMT)
commitdc8fdf5fd5f572e87152883f15f35c354fa4b4bf (patch)
tree8b4c01a4f29113416bda04ebecc1da7126400bb5 /Lib/test
parent665a4391e10167dad1c854fb604c86f336fcd331 (diff)
downloadcpython-dc8fdf5fd5f572e87152883f15f35c354fa4b4bf.zip
cpython-dc8fdf5fd5f572e87152883f15f35c354fa4b4bf.tar.gz
cpython-dc8fdf5fd5f572e87152883f15f35c354fa4b4bf.tar.bz2
gh-106581: Split `CALL_PY_EXACT_ARGS` into uops (#107760)
* Split `CALL_PY_EXACT_ARGS` into uops This is only the first step for doing `CALL` in Tier 2. The next step involves tracing into the called code object and back. After that we'll have to do the remaining `CALL` specialization. Finally we'll have to deal with `KW_NAMES`. Note: this moves setting `frame->return_offset` directly in front of `DISPATCH_INLINED()`, to make it easier to move it into `_PUSH_FRAME`.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_capi/test_misc.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/Lib/test/test_capi/test_misc.py b/Lib/test/test_capi/test_misc.py
index c812122..3dfbfdc 100644
--- a/Lib/test/test_capi/test_misc.py
+++ b/Lib/test/test_capi/test_misc.py
@@ -2618,6 +2618,23 @@ class TestUops(unittest.TestCase):
with self.assertRaises(StopIteration):
next(it)
+ def test_call_py_exact_args(self):
+ def testfunc(n):
+ def dummy(x):
+ return x+1
+ for i in range(n):
+ dummy(i)
+
+ opt = _testinternalcapi.get_uop_optimizer()
+ with temporary_optimizer(opt):
+ testfunc(10)
+
+ ex = get_first_executor(testfunc)
+ self.assertIsNotNone(ex)
+ uops = {opname for opname, _, _ in ex}
+ self.assertIn("_PUSH_FRAME", uops)
+
+
if __name__ == "__main__":
unittest.main()