make all --jobs 4
./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
+ jit-with-disabled-gil:
+ name: Free-Threaded (Debug)
+ needs: interpreter
+ runs-on: ubuntu-24.04
+ timeout-minutes: 90
+ strategy:
+ fail-fast: false
+ matrix:
+ llvm:
+ - 19
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ persist-credentials: false
+ - uses: actions/setup-python@v5
+ with:
+ python-version: '3.11'
+ - name: Build with JIT enabled and GIL disabled
+ run: |
+ sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }}
+ export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH"
+ ./configure --enable-experimental-jit --with-pydebug --disable-gil
+ make all --jobs 4
+ - name: Run tests
+ run: |
+ ./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
+ continue-on-error: true
+
no-opt-jit:
name: JIT without optimizations (Debug)
needs: interpreter
- name: Run tests without optimizations
run: |
PYTHON_UOPS_OPTIMIZE=0 ./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
-
- # XXX: GH-133171
- # jit-with-disabled-gil:
- # name: Free-Threaded (Debug)
- # needs: interpreter
- # runs-on: ubuntu-24.04
- # timeout-minutes: 90
- # strategy:
- # fail-fast: false
- # matrix:
- # llvm:
- # - 19
- # steps:
- # - uses: actions/checkout@v4
- # with:
- # persist-credentials: false
- # - uses: actions/setup-python@v5
- # with:
- # python-version: '3.11'
- # - name: Build with JIT enabled and GIL disabled
- # run: |
- # sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }}
- # export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH"
- # ./configure --enable-experimental-jit --with-pydebug --disable-gil
- # make all --jobs 4
- # - name: Run tests
- # run: |
- # ./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
PyStackRef_CLOSE(ref);
}
+static inline int
+PyStackRef_RefcountOnObject(_PyStackRef ref)
+{
+ return (ref.bits & Py_TAG_REFCNT) == 0;
+}
+
static inline _PyStackRef
PyStackRef_DUP(_PyStackRef stackref)
{
};
tier1 op(_SPECIALIZE_JUMP_BACKWARD, (--)) {
- #if ENABLE_SPECIALIZATION
+ #if ENABLE_SPECIALIZATION_FT
if (this_instr->op.code == JUMP_BACKWARD) {
- this_instr->op.code = tstate->interp->jit ? JUMP_BACKWARD_JIT : JUMP_BACKWARD_NO_JIT;
+ uint8_t desired = tstate->interp->jit ? JUMP_BACKWARD_JIT : JUMP_BACKWARD_NO_JIT;
+ FT_ATOMIC_STORE_UINT8_RELAXED(this_instr->op.code, desired);
// Need to re-dispatch so the warmup counter isn't off by one:
next_instr = this_instr;
DISPATCH_SAME_OPARG();
/* Skip 1 cache entry */
// _SPECIALIZE_JUMP_BACKWARD
{
- #if ENABLE_SPECIALIZATION
+ #if ENABLE_SPECIALIZATION_FT
if (this_instr->op.code == JUMP_BACKWARD) {
- this_instr->op.code = tstate->interp->jit ? JUMP_BACKWARD_JIT : JUMP_BACKWARD_NO_JIT;
+ uint8_t desired = tstate->interp->jit ? JUMP_BACKWARD_JIT : JUMP_BACKWARD_NO_JIT;
+ FT_ATOMIC_STORE_UINT8_RELAXED(this_instr->op.code, desired);
next_instr = this_instr;
DISPATCH_SAME_OPARG();
}
PyInterpreterState *interp = _PyInterpreterState_GET();
assert(interp->jit);
assert(!interp->compiling);
+#ifndef Py_GIL_DISABLED
interp->compiling = true;
// The first executor in a chain and the MAX_CHAIN_DEPTH'th executor *must*
// make progress in order to avoid infinite loops or excessively-long
assert((*executor_ptr)->vm_data.valid);
interp->compiling = false;
return 1;
+#else
+ return 0;
+#endif
}
static _PyExecutorObject *
if test "$disable_gil" = "yes" -a "$enable_experimental_jit" != "no"; then
# GH-133171: This configuration builds the JIT but never actually uses it,
# which is surprising (and strictly worse than not building it at all):
- as_fn_error $? "--enable-experimental-jit cannot be used with --disable-gil." "$LINENO" 5
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: --enable-experimental-jit does not work correctly with --disable-gil." >&5
+printf "%s\n" "$as_me: WARNING: --enable-experimental-jit does not work correctly with --disable-gil." >&2;}
fi
case "$ac_cv_cc_name" in
if test "$disable_gil" = "yes" -a "$enable_experimental_jit" != "no"; then
# GH-133171: This configuration builds the JIT but never actually uses it,
# which is surprising (and strictly worse than not building it at all):
- AC_MSG_ERROR([--enable-experimental-jit cannot be used with --disable-gil.])
+ AC_MSG_WARN([--enable-experimental-jit does not work correctly with --disable-gil.])
fi
case "$ac_cv_cc_name" in