Skip to content

Commit 691068b

Browse files
Merge branch 'main' into gc-visit
2 parents d511f2a + 2984ff9 commit 691068b

File tree

168 files changed

+2265
-880
lines changed

Some content is hidden

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

168 files changed

+2265
-880
lines changed

.github/workflows/tail-call.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ jobs:
8787
set PlatformToolset=clangcl
8888
set LLVMToolsVersion=${{ matrix.llvm }}.1.5
8989
set LLVMInstallDir=C:\Program Files\LLVM
90-
./PCbuild/build.bat --tail-call-interp -d -p ${{ matrix.architecture }}
91-
./PCbuild/rt.bat -d -p ${{ matrix.architecture }} -q --multiprocess 0 --timeout 4500 --verbose2 --verbose3
90+
call ./PCbuild/build.bat --tail-call-interp -d -p ${{ matrix.architecture }}
91+
call ./PCbuild/rt.bat -d -p ${{ matrix.architecture }} -q --multiprocess 0 --timeout 4500 --verbose2 --verbose3
9292
9393
# No tests (yet):
9494
- name: Emulated Windows (release)

Include/cpython/tupleobject.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
typedef struct {
66
PyObject_VAR_HEAD
7+
/* Cached hash. Initially set to -1. */
8+
Py_hash_t ob_hash;
79
/* ob_item contains space for 'ob_size' elements.
810
Items must normally not be NULL, except during construction when
911
the tuple is not yet visible outside the function that builds it. */

Include/internal/pycore_dict.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,10 @@ extern int _PyDict_Pop_KnownHash(
150150
Py_hash_t hash,
151151
PyObject **result);
152152

153+
#ifdef Py_GIL_DISABLED
154+
PyAPI_FUNC(void) _PyDict_EnsureSharedOnRead(PyDictObject *mp);
155+
#endif
156+
153157
#define DKIX_EMPTY (-1)
154158
#define DKIX_DUMMY (-2) /* Used internally */
155159
#define DKIX_ERROR (-3)

Include/internal/pycore_global_objects_fini_generated.h

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

Include/internal/pycore_global_strings.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,9 @@ struct _Py_global_strings {
283283
STRUCT_FOR_ID(aggregate_class)
284284
STRUCT_FOR_ID(alias)
285285
STRUCT_FOR_ID(align)
286+
STRUCT_FOR_ID(all)
286287
STRUCT_FOR_ID(allow_code)
288+
STRUCT_FOR_ID(any)
287289
STRUCT_FOR_ID(append)
288290
STRUCT_FOR_ID(arg)
289291
STRUCT_FOR_ID(argdefs)

Include/internal/pycore_interp_structs.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ extern "C" {
99

1010
#include "pycore_ast_state.h" // struct ast_state
1111
#include "pycore_llist.h" // struct llist_node
12+
#include "pycore_opcode_utils.h" // NUM_COMMON_CONSTANTS
1213
#include "pycore_pymath.h" // _PY_SHORT_FLOAT_REPR
1314
#include "pycore_structs.h" // PyHamtObject
1415
#include "pycore_tstate.h" // _PyThreadStateImpl
@@ -912,6 +913,7 @@ struct _is {
912913
struct ast_state ast;
913914
struct types_state types;
914915
struct callable_cache callable_cache;
916+
PyObject *common_consts[NUM_COMMON_CONSTANTS];
915917
bool jit;
916918
struct _PyExecutorObject *executor_list_head;
917919
size_t trace_run_counter;

Include/internal/pycore_magic_number.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,7 @@ Known values:
272272
Python 3.14a6 3617 (Branch monitoring for async for loops)
273273
Python 3.14a6 3618 (Add oparg to END_ASYNC_FOR)
274274
Python 3.14a6 3619 (Renumber RESUME opcode from 149 to 128)
275+
Python 3.14a6 3620 (Optimize bytecode for all/any/tuple called on a genexp)
275276
276277
Python 3.15 will start with 3650
277278
@@ -284,7 +285,7 @@ PC/launcher.c must also be updated.
284285
285286
*/
286287

287-
#define PYC_MAGIC_NUMBER 3619
288+
#define PYC_MAGIC_NUMBER 3620
288289
/* This is equivalent to converting PYC_MAGIC_NUMBER to 2 bytes
289290
(little-endian) and then appending b'\r\n'. */
290291
#define PYC_MAGIC_NUMBER_TOKEN \

Include/internal/pycore_opcode_utils.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ extern "C" {
88
# error "this header requires Py_BUILD_CORE define"
99
#endif
1010

11-
#include "opcode_ids.h"
12-
1311
#define MAX_REAL_OPCODE 254
1412

1513
#define IS_WITHIN_OPCODE_RANGE(opcode) \
@@ -67,7 +65,10 @@ extern "C" {
6765
/* Values used as the oparg for LOAD_COMMON_CONSTANT */
6866
#define CONSTANT_ASSERTIONERROR 0
6967
#define CONSTANT_NOTIMPLEMENTEDERROR 1
70-
#define NUM_COMMON_CONSTANTS 2
68+
#define CONSTANT_BUILTIN_TUPLE 2
69+
#define CONSTANT_BUILTIN_ALL 3
70+
#define CONSTANT_BUILTIN_ANY 4
71+
#define NUM_COMMON_CONSTANTS 5
7172

7273
/* Values used in the oparg for RESUME */
7374
#define RESUME_AT_FUNC_START 0

Include/internal/pycore_runtime_init.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ extern "C" {
2727
#include "pycore_runtime_init_generated.h" // _Py_bytes_characters_INIT
2828
#include "pycore_signal.h" // _signals_RUNTIME_INIT
2929
#include "pycore_tracemalloc.h" // _tracemalloc_runtime_state_INIT
30+
#include "pycore_tuple.h" // _PyTuple_HASH_EMPTY
3031

3132

3233
extern PyTypeObject _PyExc_MemoryError;
@@ -106,6 +107,7 @@ extern PyTypeObject _PyExc_MemoryError;
106107
}, \
107108
.tuple_empty = { \
108109
.ob_base = _PyVarObject_HEAD_INIT(&PyTuple_Type, 0), \
110+
.ob_hash = _PyTuple_HASH_EMPTY, \
109111
}, \
110112
.hamt_bitmap_node_empty = { \
111113
.ob_base = _PyVarObject_HEAD_INIT(&_PyHamt_BitmapNode_Type, 0), \

Include/internal/pycore_runtime_init_generated.h

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

0 commit comments

Comments
 (0)