Skip to content

Truly independent web browser

LibJS: Move the compile thread pool and JIT options out of the compiler

Andreas Kling29e19e779c85
diff --git a/Libraries/LibJS/JIT/Rust/src/lib.rs b/Libraries/LibJS/JIT/Rust/src/lib.rs
index 47216536eb5..ffcb4f9cc98 100644
--- a/Libraries/LibJS/JIT/Rust/src/lib.rs
+++ b/Libraries/LibJS/JIT/Rust/src/lib.rs
@@ -25,13 +25,9 @@ pub mod builder;
pub mod bytecode;
pub mod code;
pub mod codegen;
-#[allow(clippy::disallowed_types, clippy::disallowed_macros, clippy::disallowed_methods)]
-pub mod compile_pool;
pub mod coverage;
pub mod debug_text;
pub mod ir;
-#[allow(clippy::disallowed_types, clippy::disallowed_macros, clippy::disallowed_methods)]
-pub mod options;
pub mod passes;
pub mod regalloc;
pub mod scratch;
diff --git a/Libraries/LibJS/Rust/src/jit/compile_queue.rs b/Libraries/LibJS/Rust/src/jit/compile_queue.rs
index 21843ce9445..ae626739041 100644
--- a/Libraries/LibJS/Rust/src/jit/compile_queue.rs
+++ b/Libraries/LibJS/Rust/src/jit/compile_queue.rs
@@ -15,9 +15,9 @@ use std::sync::mpsc::{Receiver, Sender, channel};
use std::sync::{Arc, Mutex, MutexGuard, OnceLock, PoisonError};
use std::time::Duration;
+use crate::jit_compile_pool::{CompilePool, CompilePoolClient};
use libjs_jit::CompileFailure;
use libjs_jit::code::CompiledCode;
-use libjs_jit::compile_pool::{CompilePool, CompilePoolClient};
use libjs_jit::scratch::Scratch;
use libjs_jit::snapshot::{OpenLists, Snapshot};
diff --git a/Libraries/LibJS/Rust/src/jit/mod.rs b/Libraries/LibJS/Rust/src/jit/mod.rs
index f53e466b2d4..d2a2004cd85 100644
--- a/Libraries/LibJS/Rust/src/jit/mod.rs
+++ b/Libraries/LibJS/Rust/src/jit/mod.rs
@@ -27,7 +27,7 @@ pub mod testing;
pub mod tier_up;
pub mod translate;
-pub use libjs_jit::options;
+pub use crate::jit_options as options;
use core::cell::{Cell, OnceCell, RefCell};
use core::ptr::NonNull;
diff --git a/Libraries/LibJS/JIT/Rust/src/compile_pool.rs b/Libraries/LibJS/Rust/src/jit_compile_pool.rs
similarity index 100%
rename from Libraries/LibJS/JIT/Rust/src/compile_pool.rs
rename to Libraries/LibJS/Rust/src/jit_compile_pool.rs
diff --git a/Libraries/LibJS/JIT/Rust/src/options.rs b/Libraries/LibJS/Rust/src/jit_options.rs
similarity index 100%
rename from Libraries/LibJS/JIT/Rust/src/options.rs
rename to Libraries/LibJS/Rust/src/jit_options.rs
diff --git a/Libraries/LibJS/Rust/src/lib.rs b/Libraries/LibJS/Rust/src/lib.rs
index 85c09448783..e2ce34c6c7a 100644
--- a/Libraries/LibJS/Rust/src/lib.rs
+++ b/Libraries/LibJS/Rust/src/lib.rs
@@ -120,6 +120,12 @@ compile_error!("the JIT supports Windows on x86-64 only: build without the jit f
#[cfg(all(not(test), not(feature = "jit")))]
#[path = "jit/disabled.rs"]
pub mod jit;
+// NB: The thread pool of the compiles and the options of the JIT use nothing of the runtime, so they are part of a
+// test build, which `jit` is not.
+#[cfg(feature = "jit")]
+pub mod jit_compile_pool;
+#[cfg(feature = "jit")]
+pub mod jit_options;
#[cfg(not(test))]
pub mod layout;
#[cfg(not(test))]