Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
02ca84d
specialize concatenation of lists and tuples
eendebakpt Jan 17, 2025
27f4c56
📜🤖 Added by blurb_it.
blurb-it[bot] Jan 17, 2025
51d1b11
refactor for type information
eendebakpt Apr 5, 2026
e8263f9
add unique type propagation
eendebakpt Apr 5, 2026
77c1558
Merge branch 'main' into binary_op_list_list
eendebakpt Apr 6, 2026
fe63c59
special case for concatenation
eendebakpt Apr 6, 2026
f099585
fix
eendebakpt Apr 6, 2026
7f2c4a0
Merge branch 'main' into binary_op_list_list
eendebakpt Apr 7, 2026
d2dcb87
add asserts
eendebakpt Apr 7, 2026
6b0e5ed
review comments: reduce number of guards
eendebakpt Apr 9, 2026
d3f2d9d
review comments: reduce number of guards
eendebakpt Apr 9, 2026
49459c4
review comments: only guard on rhs or lhs if needed
eendebakpt Apr 9, 2026
72e8ab8
update tests
eendebakpt Apr 9, 2026
652286a
mark tier2 ops
eendebakpt Apr 10, 2026
6dc2e3c
Merge branch 'main' into binary_op_list_list
eendebakpt Apr 10, 2026
0b8dfee
Merge branch 'main' into binary_op_list_list
eendebakpt Apr 11, 2026
430248c
fix: pass descriptor to _GUARD_BINARY_OP_EXTEND_{LHS,RHS} in tier2 op…
eendebakpt Apr 11, 2026
a018c03
Regenerate optimizer_cases.c.h with descriptor operand fix
eendebakpt Apr 11, 2026
d6740d7
Merge branch 'main' into binary_op_list_list
eendebakpt Apr 11, 2026
538d072
fix ADD_OP
eendebakpt Apr 12, 2026
c390a03
Merge branch 'main' into binary_op_list_list
eendebakpt Apr 12, 2026
b2cb6b1
remove indirection
eendebakpt Apr 12, 2026
8d5e201
Merge remote-tracking branch 'origin/main' into binary_op_list_list
eendebakpt Apr 12, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Include/internal/pycore_bytesobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ extern PyObject* _PyBytes_FormatEx(
PyObject *args,
int use_bytearray);

/* Concatenate two bytes objects. Used as the sq_concat slot and by the
* specializing interpreter. Unlike PyBytes_Concat(), this returns a new
* reference rather than modifying its first argument in place. */
extern PyObject* _PyBytes_Concat(PyObject *a, PyObject *b);

extern PyObject* _PyBytes_FromHex(
PyObject *string,
int use_bytearray);
Expand Down
5 changes: 5 additions & 0 deletions Include/internal/pycore_code.h
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,11 @@ typedef struct {
aliased to either operand). Used by the tier 2 optimizer to enable
inplace follow-up ops. */
int result_unique;
/* Expected types of the left and right operands. Used by the tier 2
optimizer to eliminate _GUARD_BINARY_OP_EXTEND when the operand
types are already known. NULL means unknown/don't eliminate. */
PyTypeObject *lhs_type;
PyTypeObject *rhs_type;
} _PyBinaryOpSpecializationDescr;

/* Comparison bit masks. */
Expand Down
5 changes: 5 additions & 0 deletions Include/internal/pycore_dict.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ typedef struct {
extern PyDictKeysObject *_PyDict_NewKeysForClass(PyHeapTypeObject *);
extern PyObject *_PyDict_FromKeys(PyObject *, PyObject *, PyObject *);

/* Implementations of the `|` and `|=` operators for dict, used by the
* specializing interpreter. */
extern PyObject *_PyDict_Or(PyObject *self, PyObject *other);
extern PyObject *_PyDict_IOr(PyObject *self, PyObject *other);

/* Gets a version number unique to the current state of the keys of dict, if possible.
* Returns the version number, or zero if it was not possible to get a version number. */
extern uint32_t _PyDictKeys_GetVersionForCurrentState(
Expand Down
1 change: 1 addition & 0 deletions Include/internal/pycore_list.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ extern "C" {
PyAPI_FUNC(PyObject*) _PyList_Extend(PyListObject *, PyObject *);
PyAPI_FUNC(PyObject) *_PyList_SliceSubscript(PyObject*, PyObject*);
PyAPI_FUNC(PyObject *) _PyList_BinarySlice(PyObject *, PyObject *, PyObject *);
PyAPI_FUNC(PyObject *) _PyList_Concat(PyObject *, PyObject *);
extern void _PyList_DebugMallocStats(FILE *out);
// _PyList_GetItemRef should be used only when the object is known as a list
// because it doesn't raise TypeError when the object is not a list, whereas PyList_GetItemRef does.
Expand Down
1 change: 1 addition & 0 deletions Include/internal/pycore_tuple.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ PyAPI_FUNC(void) _PyStolenTuple_Free(PyObject *self);
PyAPI_FUNC(PyObject *)_PyTuple_FromStackRefStealOnSuccess(const union _PyStackRef *, Py_ssize_t);
PyAPI_FUNC(PyObject *)_PyTuple_FromArraySteal(PyObject *const *, Py_ssize_t);
PyAPI_FUNC(PyObject *) _PyTuple_BinarySlice(PyObject *, PyObject *, PyObject *);
PyAPI_FUNC(PyObject *) _PyTuple_Concat(PyObject *, PyObject *);

PyAPI_FUNC(PyObject *) _PyTuple_FromPair(PyObject *, PyObject *);
PyAPI_FUNC(PyObject *) _PyTuple_FromPairSteal(PyObject *, PyObject *);
Expand Down
Loading
Loading