Skip to content

Commit 8f9c2ab

Browse files
Split CALL_BUILTIN_FAST decrefs into POP_NOS
1 parent 36f15ba commit 8f9c2ab

File tree

16 files changed

+2109
-1250
lines changed

16 files changed

+2109
-1250
lines changed

Include/internal/pycore_ceval.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ _Py_VectorCallInstrumentation_StackRefSteal(
433433
PyThreadState* tstate);
434434

435435
PyAPI_FUNC(PyObject *)
436-
_Py_BuiltinCallFast_StackRefSteal(
436+
_Py_BuiltinCallFast_StackRef(
437437
_PyStackRef callable,
438438
_PyStackRef *arguments,
439439
int total_args);

Include/internal/pycore_magic_number.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,7 @@ Known values:
294294
Python 3.15a4 3661 (Lazy imports IMPORT_NAME opcode changes)
295295
Python 3.15a8 3662 (Add counter to RESUME)
296296
Python 3.15a8 3663 (Merge GET_ITER and GET_YIELD_FROM_ITER. Modify SEND to make it a bit more like FOR_ITER)
297+
Python 3.15b1 3664 (All code objects now have 1 extra stack slot space)
297298
298299
299300
Python 3.16 will start with 3700
@@ -307,7 +308,7 @@ PC/launcher.c must also be updated.
307308
308309
*/
309310

310-
#define PYC_MAGIC_NUMBER 3663
311+
#define PYC_MAGIC_NUMBER 3664
311312
/* This is equivalent to converting PYC_MAGIC_NUMBER to 2 bytes
312313
(little-endian) and then appending b'\r\n'. */
313314
#define PYC_MAGIC_NUMBER_TOKEN \

Include/internal/pycore_opcode_metadata.h

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Include/internal/pycore_stackref.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -845,6 +845,18 @@ _Py_TryXGetStackRef(PyObject **src, _PyStackRef *out)
845845
} \
846846
} while (0)
847847

848+
static inline void
849+
_PyStackRef_CloseStack(_PyStackRef *arguments, int total_args)
850+
{
851+
// arguments is a pointer into the GC visible stack,
852+
// so we must NULL out values as we clear them.
853+
for (int i = total_args-1; i >= 0; i--) {
854+
_PyStackRef tmp = arguments[i];
855+
arguments[i] = PyStackRef_NULL;
856+
PyStackRef_CLOSE(tmp);
857+
}
858+
}
859+
848860
#ifdef __cplusplus
849861
}
850862
#endif

0 commit comments

Comments
 (0)