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

jit/x86: Windows support #359

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
17 changes: 14 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,19 @@ jobs:
cargo clippy --all --tests -- --deny=warnings --deny=clippy::integer_arithmetic
if: matrix.rust != 'nightly'
shell: bash
- name: Build and test
- name: Build and test (windows)
run: |
export RUSTFLAGS="-D warnings"
cargo build --verbose --features jit-windows-not-safe-for-production
cargo test --verbose --features jit-windows-not-safe-for-production
if: matrix.rust != 'nightly' && matrix.os == 'windows-latest'
shell: bash
- name: Build and test (unix)
run: |
export RUSTFLAGS="-D warnings"
cargo build --verbose
cargo test --verbose
if: matrix.rust != 'nightly'
if: matrix.rust != 'nightly' && matrix.os != 'windows-latest'
shell: bash
- name: Check CLI
run: |
Expand All @@ -56,7 +63,11 @@ jobs:
cargo fuzz build
if: matrix.rust == 'nightly' && matrix.os != 'windows-latest'
shell: bash
- name: Benchmark
- name: Benchmark (windows)
run: RUSTFLAGS="-D warnings" cargo bench --features jit-windows-not-safe-for-production -- --nocapture
if: matrix.rust == 'nightly' && matrix.os == 'windows-latest'
shell: bash
- name: Benchmark (unix)
run: RUSTFLAGS="-D warnings" cargo bench -- --nocapture
if: matrix.rust == 'nightly' && matrix.os != 'windows-latest'
shell: bash
Expand Down
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,12 @@ rand = { version = "0.8.5", features = ["small_rng"]}
scroll = "0.11"
thiserror = "1.0.26"
rustc-demangle = "0.1"
winapi = { version = "0.3", features = ["memoryapi", "sysinfoapi", "winnt", "errhandlingapi"] }

[features]
fuzzer-not-safe-for-production = ["arbitrary"]
jit-aarch64-not-safe-for-production = []
jit-windows-not-safe-for-production = []

[dev-dependencies]
elf = "0.0.10"
Expand Down
8 changes: 0 additions & 8 deletions benches/vm_execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ fn bench_init_interpreter_execution(bencher: &mut Bencher) {
});
}

#[cfg(not(windows))]
#[bench]
fn bench_init_jit_execution(bencher: &mut Bencher) {
let mut file = File::open("tests/elfs/pass_stack_reference.so").unwrap();
Expand All @@ -68,7 +67,6 @@ fn bench_init_jit_execution(bencher: &mut Bencher) {
});
}

#[cfg(not(windows))]
fn bench_jit_vs_interpreter(
bencher: &mut Bencher,
assembly: &str,
Expand Down Expand Up @@ -118,7 +116,6 @@ fn bench_jit_vs_interpreter(
);
}

#[cfg(not(windows))]
#[bench]
fn bench_jit_vs_interpreter_address_translation(bencher: &mut Bencher) {
bench_jit_vs_interpreter(
Expand Down Expand Up @@ -147,7 +144,6 @@ static ADDRESS_TRANSLATION_STACK_CODE: &str = "
jlt r2, 0x10000, -8
exit";

#[cfg(not(windows))]
#[bench]
fn bench_jit_vs_interpreter_address_translation_stack_fixed(bencher: &mut Bencher) {
bench_jit_vs_interpreter(
Expand All @@ -162,7 +158,6 @@ fn bench_jit_vs_interpreter_address_translation_stack_fixed(bencher: &mut Benche
);
}

#[cfg(not(windows))]
#[bench]
fn bench_jit_vs_interpreter_address_translation_stack_dynamic(bencher: &mut Bencher) {
bench_jit_vs_interpreter(
Expand All @@ -177,7 +172,6 @@ fn bench_jit_vs_interpreter_address_translation_stack_dynamic(bencher: &mut Benc
);
}

#[cfg(not(windows))]
#[bench]
fn bench_jit_vs_interpreter_empty_for_loop(bencher: &mut Bencher) {
bench_jit_vs_interpreter(
Expand All @@ -194,7 +188,6 @@ fn bench_jit_vs_interpreter_empty_for_loop(bencher: &mut Bencher) {
);
}

#[cfg(not(windows))]
#[bench]
fn bench_jit_vs_interpreter_call_depth_fixed(bencher: &mut Bencher) {
bench_jit_vs_interpreter(
Expand Down Expand Up @@ -224,7 +217,6 @@ fn bench_jit_vs_interpreter_call_depth_fixed(bencher: &mut Bencher) {
);
}

#[cfg(not(windows))]
#[bench]
fn bench_jit_vs_interpreter_call_depth_dynamic(bencher: &mut Bencher) {
bench_jit_vs_interpreter(
Expand Down
Loading