Why does wasmtime/lightbeam need cranelift_codegen?

wasmtime/lightbeam: wasmtime/crates/lightbeam at main · bytecodealliance/wasmtime · GitHub

In wasmtime/Cargo.toml at main · bytecodealliance/wasmtime · GitHub , we have:

cranelift-codegen = { path = "../../cranelift/codegen", version = "0.75.0" }
derive_more = "0.99"
dynasm = "1.0.0"
dynasmrt = "1.0.0"

I am trying to understand why this also needs cranelift_codegen when it is already using dynasm

usage of cranelift_codegen:

./src/backend.rs:use cranelift_codegen::{
./src/backend.rs:        name: &cranelift_codegen::ir::ExternalName,
./src/module.rs:use cranelift_codegen::{
./src/translate_sections.rs:use cranelift_codegen::{binemit, ir};
./src/function_body.rs:use cranelift_codegen::{binemit, ir};
./wasmtime/src/lib.rs:use cranelift_codegen::binemit;
./wasmtime/src/lib.rs:use cranelift_codegen::ir::{self, ExternalName};
./wasmtime/src/lib.rs:use cranelift_codegen::isa;

Can anyone versed in wasm/JIT/cranelift explain, in plain English, why wasmtime/lightbeam needs cranelift_codegen when it already has access to dynasm/dynasmrt for generating x86_64 ?

From a pedantic view, I understand that "because it uses structs / mods from the cranelift_codegen module, as shown above", but I am looking for a more high level architectural view on what cranelift_codegen is providing that dynasm/dynasmrt does not already provide.

Thanks!

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.