summaryrefslogtreecommitdiffstats
path: root/Python/generated_cases.c.h
diff options
context:
space:
mode:
authorIrit Katriel <1055913+iritkatriel@users.noreply.github.com>2025-03-28 10:35:20 (GMT)
committerGitHub <noreply@github.com>2025-03-28 10:35:20 (GMT)
commit2c8f329dc634290fb88636f85c05e473bc0104d5 (patch)
treea16e7016315970312b8c61200d8f09573fc5f53b /Python/generated_cases.c.h
parent674dbf3b3a72bd3d17298c2ead79f32edcff774a (diff)
downloadcpython-2c8f329dc634290fb88636f85c05e473bc0104d5.zip
cpython-2c8f329dc634290fb88636f85c05e473bc0104d5.tar.gz
cpython-2c8f329dc634290fb88636f85c05e473bc0104d5.tar.bz2
gh-131738: optimize builtin any/all/tuple calls with a generator expression arg (#131737)
Diffstat (limited to 'Python/generated_cases.c.h')
-rw-r--r--Python/generated_cases.c.h12
1 files changed, 2 insertions, 10 deletions
diff --git a/Python/generated_cases.c.h b/Python/generated_cases.c.h
index 0314f98..f1e22f6 100644
--- a/Python/generated_cases.c.h
+++ b/Python/generated_cases.c.h
@@ -8723,16 +8723,8 @@
INSTRUCTION_STATS(LOAD_COMMON_CONSTANT);
_PyStackRef value;
// Keep in sync with _common_constants in opcode.py
- // If we ever have more than two constants, use a lookup table
- PyObject *val;
- if (oparg == CONSTANT_ASSERTIONERROR) {
- val = PyExc_AssertionError;
- }
- else {
- assert(oparg == CONSTANT_NOTIMPLEMENTEDERROR);
- val = PyExc_NotImplementedError;
- }
- value = PyStackRef_FromPyObjectImmortal(val);
+ assert(oparg < NUM_COMMON_CONSTANTS);
+ value = PyStackRef_FromPyObjectNew(tstate->interp->common_consts[oparg]);
stack_pointer[0] = value;
stack_pointer += 1;
assert(WITHIN_STACK_BOUNDS());