forked from python/cpython
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: Merge Brandt's Copy and Patch compiler (python#52)
Co-authored-by: Ken Jin <[email protected]> Co-authored-by: Brandt Bucher <[email protected]>
- Loading branch information
1 parent
7210772
commit a6533c1
Showing
32 changed files
with
1,503 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
name: JIT | ||
on: push | ||
jobs: | ||
jit: | ||
name: ${{ matrix.target }} (${{ matrix.debug && 'Debug' || 'Release' }}, LLVM ${{ matrix.llvm }}) | ||
runs-on: ${{ matrix.runner }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
target: | ||
# - i686-pc-windows-msvc/msvc | ||
- x86_64-pc-windows-msvc/msvc | ||
# - x86_64-apple-darwin/clang | ||
# - x86_64-unknown-linux-gnu/gcc | ||
# - aarch64-apple-darwin/clang | ||
# - aarch64-unknown-linux-gnu/gcc | ||
# - aarch64-unknown-linux-gnu/clang | ||
# - powerpc64le-unknown-linux-gnu/gcc | ||
# - x86_64-unknown-linux-gnu/clang | ||
debug: | ||
- true | ||
# - false | ||
llvm: | ||
#- 14 | ||
#- 15 | ||
- 16 | ||
include: | ||
# - target: i686-pc-windows-msvc/msvc | ||
# architecture: i686 | ||
# runner: windows-latest | ||
# compiler: msvc | ||
# tier: 1 | ||
# windows_platform: Win32 | ||
- target: x86_64-pc-windows-msvc/msvc | ||
architecture: x86_64 | ||
runner: windows-latest | ||
compiler: msvc | ||
tier: 1 | ||
windows_platform: x64 | ||
# - target: x86_64-apple-darwin/clang | ||
# architecture: x86_64 | ||
# runner: macos-latest | ||
# compiler: clang | ||
# tier: 1 | ||
# - target: x86_64-unknown-linux-gnu/gcc | ||
# architecture: x86_64 | ||
# runner: ubuntu-latest | ||
# compiler: gcc | ||
# tier: 1 | ||
# - target: aarch64-apple-darwin/clang | ||
# architecture: aarch64 | ||
# runner: macos-latest | ||
# compiler: clang | ||
# tier: 2 | ||
# - target: aarch64-unknown-linux-gnu/gcc | ||
# architecture: aarch64 | ||
# runner: ubuntu-latest | ||
# compiler: gcc | ||
# tier: 2 | ||
# - target: aarch64-unknown-linux-gnu/clang | ||
# architecture: aarch64 | ||
# runner: ubuntu-latest | ||
# compiler: clang | ||
# tier: 2 | ||
# - target: powerpc64le-unknown-linux-gnu/gcc | ||
# architecture: ppc64le | ||
# runner: ubuntu-latest | ||
# compiler: gcc | ||
# tier: 2 | ||
# - target: x86_64-unknown-linux-gnu/clang | ||
# architecture: x86_64 | ||
# runner: ubuntu-latest | ||
# compiler: clang | ||
# tier: 2 | ||
env: | ||
CC: ${{ matrix.compiler }} | ||
PYTHON_LLVM_VERSION: ${{ matrix.llvm }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.10' | ||
# Only support Window x64 ~ Jules | ||
# - name: macOS | ||
# if: runner.os == 'macOS' | ||
# run: | | ||
# brew install llvm@${{ matrix.llvm }} | ||
# export SDKROOT="$(xcrun --show-sdk-path)" | ||
# ./configure ${{ matrix.debug && '--with-pydebug' || '--enable-optimizations --with-lto' }} | ||
# make | ||
# ./python.exe -m test -j0 -wW | ||
# - name: Native Linux | ||
# if: runner.os == 'Linux' && matrix.architecture == 'x86_64' | ||
# run: | | ||
# sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }} | ||
# ${{ matrix.llvm == 14 && 'sudo apt install libclang-rt-14-dev' || '' }} | ||
# export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH" | ||
# ./configure ${{ matrix.debug && '--with-pydebug' || '--enable-optimizations --with-lto' }} | ||
# make | ||
# ./python -m test -j0 -wW | ||
# - name: Emulated Linux | ||
# if: runner.os == 'Linux' && matrix.architecture != 'x86_64' | ||
# uses: uraimo/run-on-arch-action@v2 | ||
# with: | ||
# arch: ${{ matrix.architecture }} | ||
# distro: ubuntu_latest | ||
# run: | | ||
# sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }} | ||
# ${{ matrix.llvm == 14 && 'sudo apt install libclang-rt-14-dev' || '' }} | ||
# export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH" | ||
# ./configure ${{ matrix.debug && '--with-pydebug' || '--enable-optimizations --with-lto' }} | ||
# make | ||
# ./python -m test -j0 -wW | ||
- name: Windows | ||
if: runner.os == 'Windows' | ||
run: | | ||
choco install llvm --allow-downgrade --version ${{ matrix.llvm }} | ||
./PCbuild/build ${{ matrix.debug && '-d' || '--pgo' }} -p ${{ matrix.windows_platform }} | ||
# ./PCbuild/rt${{ matrix.debug && ' -d' || '' }} -p ${{ matrix.windows_platform }} -q -j0 -wW | ||
- name: Tests | ||
run: .\python.bat tier2_test.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
typedef enum { | ||
_JUSTIN_RETURN_DEOPT = -1, | ||
_JUSTIN_RETURN_OK = 0, | ||
_JUSTIN_RETURN_GOTO_ERROR = 1, | ||
} _PyJITReturnCode; | ||
|
||
typedef _PyJITReturnCode (*_PyJITFunction)(PyThreadState *tstate, _PyInterpreterFrame *frame, PyObject **stack_pointer, _Py_CODEUNIT *next_instr); | ||
|
||
PyAPI_FUNC(_PyJITFunction)_PyJIT_CompileTrace(int size, _Py_CODEUNIT **trace); | ||
PyAPI_FUNC(void)_PyJIT_Free(_PyJITFunction trace); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.