Skip to content

Commit fc2a93b

Browse files
committed
Merge remote-tracking branch 'upstream/main' into gh-133171-JUMP_BACKWARD
2 parents 2aa295a + 70ad1b3 commit fc2a93b

23 files changed

+616
-573
lines changed

.github/workflows/jit.yml

Lines changed: 54 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -134,30 +134,57 @@ jobs:
134134
make all --jobs 4
135135
./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
136136
137-
jit-with-disabled-gil:
138-
name: Free-Threaded (Debug)
139-
needs: interpreter
140-
runs-on: ubuntu-24.04
141-
timeout-minutes: 90
142-
strategy:
143-
fail-fast: false
144-
matrix:
145-
llvm:
146-
- 19
147-
steps:
148-
- uses: actions/checkout@v4
149-
with:
150-
persist-credentials: false
151-
- uses: actions/setup-python@v5
152-
with:
153-
python-version: '3.11'
154-
- name: Build with JIT enabled and GIL disabled
155-
run: |
156-
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }}
157-
export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH"
158-
./configure --enable-experimental-jit --with-pydebug --disable-gil
159-
make all --jobs 4
160-
- name: Run tests
161-
run: |
162-
./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
163-
continue-on-error: true
137+
jit-with-disabled-gil:
138+
name: Free-Threaded (Debug)
139+
needs: interpreter
140+
runs-on: ubuntu-24.04
141+
timeout-minutes: 90
142+
strategy:
143+
fail-fast: false
144+
matrix:
145+
llvm:
146+
- 19
147+
steps:
148+
- uses: actions/checkout@v4
149+
with:
150+
persist-credentials: false
151+
- uses: actions/setup-python@v5
152+
with:
153+
python-version: '3.11'
154+
- name: Build with JIT enabled and GIL disabled
155+
run: |
156+
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }}
157+
export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH"
158+
./configure --enable-experimental-jit --with-pydebug --disable-gil
159+
make all --jobs 4
160+
- name: Run tests
161+
run: |
162+
./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
163+
continue-on-error: true
164+
165+
no-opt-jit:
166+
name: JIT without optimizations (Debug)
167+
needs: interpreter
168+
runs-on: ubuntu-24.04
169+
timeout-minutes: 90
170+
strategy:
171+
fail-fast: false
172+
matrix:
173+
llvm:
174+
- 19
175+
steps:
176+
- uses: actions/checkout@v4
177+
with:
178+
persist-credentials: false
179+
- uses: actions/setup-python@v5
180+
with:
181+
python-version: '3.11'
182+
- name: Build with JIT
183+
run: |
184+
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }}
185+
export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH"
186+
./configure --enable-experimental-jit --with-pydebug
187+
make all --jobs 4
188+
- name: Run tests without optimizations
189+
run: |
190+
PYTHON_UOPS_OPTIMIZE=0 ./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3

Doc/c-api/unicode.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -747,7 +747,7 @@ APIs:
747747
Return ``0`` on success, ``-1`` on error with an exception set.
748748
749749
This function checks that *unicode* is a Unicode object, that the index is
750-
not out of bounds, and that the object's reference count is one).
750+
not out of bounds, and that the object's reference count is one.
751751
See :c:func:`PyUnicode_WRITE` for a version that skips these checks,
752752
making them your responsibility.
753753

Include/internal/pycore_optimizer.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,9 +250,13 @@ PyJitRef_IsBorrowed(JitOptRef ref)
250250
}
251251

252252
struct _Py_UOpsAbstractFrame {
253+
bool globals_watched;
254+
// The version number of the globals dicts, once checked. 0 if unchecked.
255+
uint32_t globals_checked_version;
253256
// Max stacklen
254257
int stack_len;
255258
int locals_len;
259+
PyFunctionObject *func;
256260

257261
JitOptRef *stack_pointer;
258262
JitOptRef *stack;
@@ -271,6 +275,8 @@ typedef struct _JitOptContext {
271275
char done;
272276
char out_of_space;
273277
bool contradiction;
278+
// Has the builtins dict been watched?
279+
bool builtins_watched;
274280
// The current "executing" frame.
275281
_Py_UOpsAbstractFrame *frame;
276282
_Py_UOpsAbstractFrame frames[MAX_ABSTRACT_FRAME_DEPTH];

0 commit comments

Comments
 (0)