Skip to content

Commit bc8a294

Browse files
committed
Merge branch 'main' into gh-148380/remove-LookupByVersion
2 parents 565507e + 52a7f1b commit bc8a294

File tree

164 files changed

+5161
-2360
lines changed

Some content is hidden

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

164 files changed

+5161
-2360
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ jobs:
354354
with:
355355
persist-credentials: false
356356
- name: Build and test
357-
run: ./Android/android.py ci --fast-ci ${{ matrix.arch }}-linux-android
357+
run: python3 Platforms/Android ci --fast-ci ${{ matrix.arch }}-linux-android
358358

359359
build-ios:
360360
name: iOS

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*.cover
66
*.iml
77
*.o
8+
*.o.tmp
89
*.lto
910
*.a
1011
*.so

Doc/c-api/interp-lifecycle.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,11 @@ Initializing and finalizing the interpreter
410410
(zero) if not. After :c:func:`Py_FinalizeEx` is called, this returns false until
411411
:c:func:`Py_Initialize` is called again.
412412
413+
.. versionchanged:: next
414+
This function no longer returns true until initialization has fully
415+
completed, including import of the :mod:`site` module. Previously it
416+
could return true while :c:func:`Py_Initialize` was still running.
417+
413418
414419
.. c:function:: int Py_IsFinalizing()
415420

Doc/library/argparse.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1970,7 +1970,7 @@ FileType objects
19701970
run and then use the :keyword:`with`-statement to manage the files.
19711971

19721972
.. versionchanged:: 3.4
1973-
Added the *encodings* and *errors* parameters.
1973+
Added the *encoding* and *errors* parameters.
19741974

19751975
.. deprecated:: 3.14
19761976

Doc/library/functions.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,7 @@ are always available. They are listed here in alphabetical order.
644644
If the given source is a string, then leading and trailing spaces and tabs
645645
are stripped.
646646

647-
See :func:`ast.literal_eval` for a function that can safely evaluate strings
647+
See :func:`ast.literal_eval` for a function to evaluate strings
648648
with expressions containing only literals.
649649

650650
.. audit-event:: exec code_object eval

Doc/library/multiprocessing.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -932,7 +932,8 @@ For an example of the usage of queues for interprocess communication see
932932
standard library's :mod:`queue` module are raised to signal timeouts.
933933

934934
:class:`Queue` implements all the methods of :class:`queue.Queue` except for
935-
:meth:`~queue.Queue.task_done` and :meth:`~queue.Queue.join`.
935+
:meth:`~queue.Queue.task_done`, :meth:`~queue.Queue.join`, and
936+
:meth:`~queue.Queue.shutdown`.
936937

937938
.. method:: qsize()
938939

Doc/whatsnew/3.15.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1551,7 +1551,11 @@ pprint
15511551
:func:`pprint.pformat`, :func:`pprint.pp`. If true, the output will be
15521552
formatted similar to pretty-printed :func:`json.dumps` when
15531553
*indent* is supplied.
1554-
(Contributed by Stefan Todoran and Semyon Moroz in :gh:`112632`.)
1554+
(Contributed by Stefan Todoran, Semyon Moroz and Hugo van Kemenade in
1555+
:gh:`112632`.)
1556+
1557+
* Add t-string support to :mod:`pprint`.
1558+
(Contributed by Loïc Simon and Hugo van Kemenade in :gh:`134551`.)
15551559

15561560

15571561
sre_*

Include/internal/pycore_dict.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ _PyDict_NotifyEvent(PyDict_WatchEvent event,
292292
PyObject *value)
293293
{
294294
assert(Py_REFCNT((PyObject*)mp) > 0);
295-
int watcher_bits = mp->_ma_watcher_tag & DICT_WATCHER_MASK;
295+
int watcher_bits = FT_ATOMIC_LOAD_UINT64_ACQUIRE(mp->_ma_watcher_tag) & DICT_WATCHER_MASK;
296296
if (watcher_bits) {
297297
RARE_EVENT_STAT_INC(watched_dict_modification);
298298
_PyDict_SendEvent(watcher_bits, event, mp, key, value);
@@ -368,7 +368,7 @@ PyDictObject *_PyObject_MaterializeManagedDict_LockHeld(PyObject *);
368368
static inline Py_ssize_t
369369
_PyDict_UniqueId(PyDictObject *mp)
370370
{
371-
return (Py_ssize_t)(mp->_ma_watcher_tag >> DICT_UNIQUE_ID_SHIFT);
371+
return (Py_ssize_t)(FT_ATOMIC_LOAD_UINT64_RELAXED(mp->_ma_watcher_tag) >> DICT_UNIQUE_ID_SHIFT);
372372
}
373373

374374
static inline void

Include/internal/pycore_opcode_metadata.h

Lines changed: 6 additions & 6 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: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,15 @@ typedef struct _PyJitTracerInitialState {
9191
_Py_CODEUNIT *jump_backward_instr;
9292
} _PyJitTracerInitialState;
9393

94+
#define MAX_RECORDED_VALUES 3
9495
typedef struct _PyJitTracerPreviousState {
9596
int instr_oparg;
9697
int instr_stacklevel;
9798
_Py_CODEUNIT *instr;
9899
PyCodeObject *instr_code; // Strong
99100
struct _PyInterpreterFrame *instr_frame;
100-
PyObject *recorded_value; // Strong, may be NULL
101+
PyObject *recorded_values[MAX_RECORDED_VALUES]; // Strong, may be NULL
102+
int recorded_count;
101103
} _PyJitTracerPreviousState;
102104

103105
typedef struct _PyJitTracerTranslatorState {
@@ -400,6 +402,7 @@ extern JitOptRef _Py_uop_sym_new_null(JitOptContext *ctx);
400402
extern bool _Py_uop_sym_has_type(JitOptRef sym);
401403
extern bool _Py_uop_sym_matches_type(JitOptRef sym, PyTypeObject *typ);
402404
extern bool _Py_uop_sym_matches_type_version(JitOptRef sym, unsigned int version);
405+
extern unsigned int _Py_uop_sym_get_type_version(JitOptRef sym);
403406
extern void _Py_uop_sym_set_null(JitOptContext *ctx, JitOptRef sym);
404407
extern void _Py_uop_sym_set_non_null(JitOptContext *ctx, JitOptRef sym);
405408
extern void _Py_uop_sym_set_type(JitOptContext *ctx, JitOptRef sym, PyTypeObject *typ);
@@ -424,8 +427,6 @@ extern PyCodeObject *_Py_uop_sym_get_probable_func_code(JitOptRef sym);
424427
extern PyObject *_Py_uop_sym_get_probable_value(JitOptRef sym);
425428
extern PyTypeObject *_Py_uop_sym_get_probable_type(JitOptRef sym);
426429
extern JitOptRef *_Py_uop_sym_set_stack_depth(JitOptContext *ctx, int stack_depth, JitOptRef *current_sp);
427-
extern uint32_t _Py_uop_sym_get_func_version(JitOptRef ref);
428-
bool _Py_uop_sym_set_func_version(JitOptContext *ctx, JitOptRef ref, uint32_t version);
429430

430431
extern void _Py_uop_abstractcontext_init(JitOptContext *ctx, _PyBloomFilter *dependencies);
431432
extern void _Py_uop_abstractcontext_fini(JitOptContext *ctx);
@@ -483,7 +484,12 @@ void _PyJit_TracerFree(_PyThreadStateImpl *_tstate);
483484
#ifdef _Py_TIER2
484485
typedef void (*_Py_RecordFuncPtr)(_PyInterpreterFrame *frame, _PyStackRef *stackpointer, int oparg, PyObject **recorded_value);
485486
PyAPI_DATA(const _Py_RecordFuncPtr) _PyOpcode_RecordFunctions[];
486-
PyAPI_DATA(const uint8_t) _PyOpcode_RecordFunctionIndices[256];
487+
488+
typedef struct {
489+
uint8_t count;
490+
uint8_t indices[MAX_RECORDED_VALUES];
491+
} _PyOpcodeRecordEntry;
492+
PyAPI_DATA(const _PyOpcodeRecordEntry) _PyOpcode_RecordEntries[256];
487493
#endif
488494

489495
#ifdef __cplusplus

0 commit comments

Comments
 (0)