Skip to content

Commit 41fa9e3

Browse files
Implement CALL_FUNCTION_EX_PY specialization
1 parent b538c28 commit 41fa9e3

15 files changed

+1445
-1117
lines changed

Include/internal/pycore_code.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,12 @@ typedef struct {
160160

161161
#define INLINE_CACHE_ENTRIES_CONTAINS_OP CACHE_ENTRIES(_PyContainsOpCache)
162162

163+
typedef struct {
164+
_Py_BackoffCounter counter;
165+
} _PyCallFunctionExCache;
166+
167+
#define INLINE_CACHE_ENTRIES_CALL_FUNCTION_EX CACHE_ENTRIES(_PyCallFunctionExCache)
168+
163169
/* "Locals plus" for a code object is the set of locals + cell vars +
164170
* free vars. This relates to variable names as well as offsets into
165171
* the "fast locals" storage array of execution frames. The compiler
@@ -326,6 +332,7 @@ PyAPI_FUNC(void) _Py_Specialize_Send(_PyStackRef receiver, _Py_CODEUNIT *instr);
326332
PyAPI_FUNC(void) _Py_Specialize_ToBool(_PyStackRef value, _Py_CODEUNIT *instr);
327333
PyAPI_FUNC(void) _Py_Specialize_ContainsOp(_PyStackRef value, _Py_CODEUNIT *instr);
328334
PyAPI_FUNC(void) _Py_GatherStats_GetIter(_PyStackRef iterable);
335+
PyAPI_FUNC(void) _Py_Specialize_CallFunctionEx(_PyStackRef func_st, _Py_CODEUNIT *instr);
329336

330337
// Utility functions for reading/writing 32/64-bit values in the inline caches.
331338
// Great care should be taken to ensure that these functions remain correct and

Include/internal/pycore_magic_number.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,7 @@ Known values:
287287
Python 3.15a1 3654 (Fix missing exception handlers in logical expression)
288288
Python 3.15a1 3655 (Fix miscompilation of some module-level annotations)
289289
Python 3.15a1 3656 (Add TRACE_RECORD instruction, for platforms with switch based interpreter)
290+
Python 3.15a1 3657 (Add CALL_FUNCTION_EX specialization)
290291
291292
292293
Python 3.16 will start with 3700
@@ -300,7 +301,7 @@ PC/launcher.c must also be updated.
300301
301302
*/
302303

303-
#define PYC_MAGIC_NUMBER 3656
304+
#define PYC_MAGIC_NUMBER 3657
304305
/* This is equivalent to converting PYC_MAGIC_NUMBER to 2 bytes
305306
(little-endian) and then appending b'\r\n'. */
306307
#define PYC_MAGIC_NUMBER_TOKEN \

Include/internal/pycore_opcode_metadata.h

Lines changed: 11 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)