Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Add jit_compile/1, very basic JIT2 #2424

Open
wants to merge 29 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
6491961
First WAM instructions
aarroyoc Mar 1, 2024
1775efb
JIT Rust file
aarroyoc Mar 1, 2024
f8345f8
WIP jit_compile/1
aarroyoc Mar 18, 2024
8b27852
First predicate able to execute!
aarroyoc Mar 20, 2024
9306296
Adding trampoline
aarroyoc Mar 23, 2024
4cb2314
Fix ExecuteNamed
aarroyoc Mar 24, 2024
cb80744
More instructions
aarroyoc Mar 26, 2024
a5754d4
Add instruction
aarroyoc Apr 8, 2024
b668c26
Add tests nd jit_store_deref_reg helper
aarroyoc Apr 15, 2024
9dcbd23
Improve add and execute to handle registers
aarroyoc Apr 15, 2024
0f2376b
Move JIT code to feature "jit"
aarroyoc May 31, 2024
eed3371
Add SetConstant
aarroyoc May 31, 2024
056877c
Print code
aarroyoc Jun 6, 2024
0569ef8
Add jit2 skeleton
aarroyoc Jun 17, 2024
e8cbd2e
Fix errors for CI
aarroyoc Jun 17, 2024
3dc92f2
Add more instructions to JIT2
aarroyoc Jul 2, 2024
094d8eb
Implement basic GetConstant to test integration
aarroyoc Jul 6, 2024
eb2fe46
Cleanup JIT1
aarroyoc Jul 9, 2024
b9e408b
Fix store and deref JIT2
aarroyoc Jul 9, 2024
1fb9278
Merge branch 'master' into cranelift-jit
aarroyoc Jul 9, 2024
d32a574
BIND operation and comments
aarroyoc Jul 21, 2024
4a5f5bd
Unify (TBD), fix stuff, more tests
aarroyoc Jul 23, 2024
1ea633d
Return failure, more tests
aarroyoc Jul 28, 2024
c5033ce
I think unification finally works :)
aarroyoc Aug 12, 2024
cebab22
Add Call and Execute
aarroyoc Aug 13, 2024
520ede4
Stack allocation
aarroyoc Aug 16, 2024
b3b3de3
Exit early
aarroyoc Aug 20, 2024
2b906ae
Backtracking and heap reset
aarroyoc Aug 24, 2024
904fba4
Stack backtracking I guess
aarroyoc Aug 30, 2024
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
18 changes: 18 additions & 0 deletions .github/workflows/jit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Test JIT

on:
pull_request:
workflow_dispatch:

jobs:
test-jit:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Setup Rust
uses: ./.github/actions/setup-rust
with:
rust-version: nightly
targets: x86_64-unknown-linux-gnu
- name: Test with JIT
run: cargo +nightly test --features jit
235 changes: 233 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ build = "build/main.rs"
rust-version = "1.77"

[lib]
crate-type = ["cdylib", "rlib"]
crate-type = ["cdylib", "rlib", "staticlib"]

[features]
default = ["ffi", "repl", "hostname", "tls", "http", "crypto-full"]
Expand All @@ -24,6 +24,7 @@ tls = ["dep:native-tls"]
http = ["dep:warp", "dep:reqwest"]
rust_beta_channel = []
crypto-full = []
jit = ["dep:cranelift", "dep:cranelift-jit", "dep:cranelift-module", "dep:cranelift-codegen"]

[build-dependencies]
indexmap = "1.0.2"
Expand Down Expand Up @@ -85,6 +86,10 @@ native-tls = { version = "0.2.4", optional = true }
reqwest = { version = "0.11.18", optional = true }
rustyline = { version = "12.0.0", optional = true }
tokio = { version = "1.28.2", features = ["full"] }
cranelift = { version = "0.108.1", optional = true }
cranelift-jit = { version = "0.108.1", optional = true }
cranelift-module = { version = "0.108.1", optional = true }
cranelift-codegen = { version = "0.108.1", optional = true }
warp = { version = "=0.3.5", features = ["tls"], optional = true }

[target.'cfg(target_arch = "wasm32")'.dependencies]
Expand Down
Loading