Skip to content

Commit 6aa007c

Browse files
authored
Merge branch 'main' into zb/bolt
2 parents 5f9c410 + 76856ae commit 6aa007c

File tree

96 files changed

+2860
-1692
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+2860
-1692
lines changed

Doc/library/importlib.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,13 +380,15 @@ ABC hierarchy::
380380

381381
.. class:: ResourceLoader
382382

383+
*Superseded by TraversableResources*
384+
383385
An abstract base class for a :term:`loader` which implements the optional
384386
:pep:`302` protocol for loading arbitrary resources from the storage
385387
back-end.
386388

387389
.. deprecated:: 3.7
388390
This ABC is deprecated in favour of supporting resource loading
389-
through :class:`importlib.resources.abc.ResourceReader`.
391+
through :class:`importlib.resources.abc.TraversableResources`.
390392

391393
.. abstractmethod:: get_data(path)
392394

Doc/library/sys.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
This module provides access to some variables used or maintained by the
1010
interpreter and to functions that interact strongly with the interpreter. It is
11-
always available.
11+
always available. Unless explicitly noted otherwise, all variables are read-only.
1212

1313

1414
.. data:: abiflags

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/cpython/pystats.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
#define PYSTATS_MAX_UOP_ID 512
3333

34-
#define SPECIALIZATION_FAILURE_KINDS 36
34+
#define SPECIALIZATION_FAILURE_KINDS 37
3535

3636
/* Stats for determining who is calling PyEval_EvalFrame */
3737
#define EVAL_CALL_TOTAL 0

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_dict.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,16 @@ extern Py_ssize_t _Py_dict_lookup_threadsafe_stackref(PyDictObject *mp, PyObject
114114

115115
extern Py_ssize_t _PyDict_LookupIndex(PyDictObject *, PyObject *);
116116
extern Py_ssize_t _PyDictKeys_StringLookup(PyDictKeysObject* dictkeys, PyObject *key);
117+
118+
/* Look up a string key in an all unicode dict keys, assign the keys object a version, and
119+
* store it in version.
120+
*
121+
* Returns DKIX_ERROR if key is not a string or if the keys object is not all
122+
* strings.
123+
*
124+
* Returns DKIX_EMPTY if the key is not present.
125+
*/
126+
extern Py_ssize_t _PyDictKeys_StringLookupAndVersion(PyDictKeysObject* dictkeys, PyObject *key, uint32_t *version);
117127
extern Py_ssize_t _PyDictKeys_StringLookupSplit(PyDictKeysObject* dictkeys, PyObject *key);
118128
PyAPI_FUNC(PyObject *)_PyDict_LoadGlobal(PyDictObject *, PyDictObject *, PyObject *);
119129
PyAPI_FUNC(void) _PyDict_LoadGlobalStackRef(PyDictObject *, PyDictObject *, PyObject *, _PyStackRef *);

Include/internal/pycore_gc.h

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,13 @@ static inline PyObject* _Py_FROM_GC(PyGC_Head *gc) {
4545
* the per-object lock.
4646
*/
4747
#ifdef Py_GIL_DISABLED
48-
# define _PyGC_BITS_TRACKED (1) // Tracked by the GC
49-
# define _PyGC_BITS_FINALIZED (2) // tp_finalize was called
50-
# define _PyGC_BITS_UNREACHABLE (4)
51-
# define _PyGC_BITS_FROZEN (8)
52-
# define _PyGC_BITS_SHARED (16)
53-
# define _PyGC_BITS_DEFERRED (64) // Use deferred reference counting
48+
# define _PyGC_BITS_TRACKED (1<<0) // Tracked by the GC
49+
# define _PyGC_BITS_FINALIZED (1<<1) // tp_finalize was called
50+
# define _PyGC_BITS_UNREACHABLE (1<<2)
51+
# define _PyGC_BITS_FROZEN (1<<3)
52+
# define _PyGC_BITS_SHARED (1<<4)
53+
# define _PyGC_BITS_ALIVE (1<<5) // Reachable from a known root.
54+
# define _PyGC_BITS_DEFERRED (1<<6) // Use deferred reference counting
5455
#endif
5556

5657
#ifdef Py_GIL_DISABLED
@@ -330,6 +331,9 @@ struct _gc_runtime_state {
330331
collections, and are awaiting to undergo a full collection for
331332
the first time. */
332333
Py_ssize_t long_lived_pending;
334+
335+
/* True if gc.freeze() has been used. */
336+
int freeze_active;
333337
#endif
334338
};
335339

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_object.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -299,12 +299,6 @@ Py_ssize_t _Py_ExplicitMergeRefcount(PyObject *op, Py_ssize_t extra);
299299
extern int _PyType_CheckConsistency(PyTypeObject *type);
300300
extern int _PyDict_CheckConsistency(PyObject *mp, int check_content);
301301

302-
/* Update the Python traceback of an object. This function must be called
303-
when a memory block is reused from a free list.
304-
305-
Internal function called by _Py_NewReference(). */
306-
extern int _PyTraceMalloc_TraceRef(PyObject *op, PyRefTracerEvent event, void*);
307-
308302
// Fast inlined version of PyType_HasFeature()
309303
static inline int
310304
_PyType_HasFeature(PyTypeObject *type, unsigned long feature) {

Include/internal/pycore_opcode_metadata.h

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

0 commit comments

Comments
 (0)