Skip to content

Commit 60d0d9b

Browse files
Merge remote-tracking branch 'upstream/main' into tail-call
2 parents e13aab9 + b44ff6d commit 60d0d9b

37 files changed

+1101
-786
lines changed

Include/cpython/object.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -475,9 +475,6 @@ partially-deallocated object. To check this, the tp_dealloc function must be
475475
passed as second argument to Py_TRASHCAN_BEGIN().
476476
*/
477477

478-
/* Python 3.9 private API, invoked by the macros below. */
479-
PyAPI_FUNC(int) _PyTrash_begin(PyThreadState *tstate, PyObject *op);
480-
PyAPI_FUNC(void) _PyTrash_end(PyThreadState *tstate);
481478

482479
PyAPI_FUNC(void) _PyTrash_thread_deposit_object(PyThreadState *tstate, PyObject *op);
483480
PyAPI_FUNC(void) _PyTrash_thread_destroy_chain(PyThreadState *tstate);

Include/internal/pycore_code.h

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ typedef struct {
100100

101101
typedef struct {
102102
_Py_BackoffCounter counter;
103+
uint16_t external_cache[4];
103104
} _PyBinaryOpCache;
104105

105106
#define INLINE_CACHE_ENTRIES_BINARY_OP CACHE_ENTRIES(_PyBinaryOpCache)
@@ -438,7 +439,7 @@ write_u64(uint16_t *p, uint64_t val)
438439
}
439440

440441
static inline void
441-
write_obj(uint16_t *p, PyObject *val)
442+
write_ptr(uint16_t *p, void *val)
442443
{
443444
memcpy(p, &val, sizeof(val));
444445
}
@@ -576,6 +577,16 @@ adaptive_counter_backoff(_Py_BackoffCounter counter) {
576577
return restart_backoff_counter(counter);
577578
}
578579

580+
/* Specialization Extensions */
581+
582+
/* callbacks for an external specialization */
583+
typedef int (*binaryopguardfunc)(PyObject *lhs, PyObject *rhs);
584+
typedef PyObject *(*binaryopactionfunc)(PyObject *lhs, PyObject *rhs);
585+
586+
typedef struct {
587+
binaryopguardfunc guard;
588+
binaryopactionfunc action;
589+
} _PyBinaryOpSpecializationDescr;
579590

580591
/* Comparison bit masks. */
581592

Include/internal/pycore_magic_number.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ Known values:
266266
Python 3.14a4 3611 (Add NOT_TAKEN instruction)
267267
Python 3.14a4 3612 (Add POP_ITER and INSTRUMENTED_POP_ITER)
268268
Python 3.14a4 3613 (Add LOAD_CONST_MORTAL instruction)
269+
Python 3.14a5 3614 (Add BINARY_OP_EXTEND)
269270
270271
Python 3.15 will start with 3650
271272
@@ -278,7 +279,7 @@ PC/launcher.c must also be updated.
278279
279280
*/
280281

281-
#define PYC_MAGIC_NUMBER 3613
282+
#define PYC_MAGIC_NUMBER 3614
282283
/* This is equivalent to converting PYC_MAGIC_NUMBER to 2 bytes
283284
(little-endian) and then appending b'\r\n'. */
284285
#define PYC_MAGIC_NUMBER_TOKEN \

Include/internal/pycore_opcode_metadata.h

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

Include/internal/pycore_optimizer.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,6 @@ struct _PyOptimizerObject {
9898
};
9999

100100
/** Test support **/
101-
typedef struct {
102-
_PyOptimizerObject base;
103-
int64_t count;
104-
} _PyCounterOptimizerObject;
105-
106101
_PyOptimizerObject *_Py_SetOptimizer(PyInterpreterState *interp, _PyOptimizerObject* optimizer);
107102

108103

@@ -119,7 +114,6 @@ PyAPI_FUNC(void) _Py_Executor_DependsOn(_PyExecutorObject *executor, void *obj);
119114
// Export for '_testinternalcapi' shared extension.
120115
PyAPI_FUNC(_PyOptimizerObject *) _Py_GetOptimizer(void);
121116
PyAPI_FUNC(int) _Py_SetTier2Optimizer(_PyOptimizerObject* optimizer);
122-
PyAPI_FUNC(PyObject *) _PyOptimizer_NewCounter(void);
123117
PyAPI_FUNC(PyObject *) _PyOptimizer_NewUOpOptimizer(void);
124118

125119
#define _Py_MAX_ALLOWED_BUILTINS_MODIFICATIONS 3
@@ -150,8 +144,6 @@ int _Py_uop_analyze_and_optimize(struct _PyInterpreterFrame *frame,
150144
_PyUOpInstruction *trace, int trace_len, int curr_stackentries,
151145
_PyBloomFilter *dependencies);
152146

153-
extern PyTypeObject _PyCounterExecutor_Type;
154-
extern PyTypeObject _PyCounterOptimizer_Type;
155147
extern PyTypeObject _PyDefaultOptimizer_Type;
156148
extern PyTypeObject _PyUOpExecutor_Type;
157149
extern PyTypeObject _PyUOpOptimizer_Type;

0 commit comments

Comments
 (0)