22
33This is a simple demo that JIT-compiles a toy language, using Cranelift.
44
5- It uses the new SimpleJIT interface in development
6- [ here] ( https://github.com/bytecodealliance/wasmtime/tree/main/cranelift/jit ) . SimpleJIT takes care
5+ It uses the new JIT interface in development
6+ [ here] ( https://github.com/bytecodealliance/wasmtime/tree/main/cranelift/jit ) . JIT takes care
77of managing a symbol table, allocating memory, and performing relocations, offering
88a relatively simple API.
99
@@ -17,17 +17,17 @@ and it makes efficient use of memory.
1717
1818And Cranelift is being architected to allow flexibility in how one uses it.
1919Sometimes that flexibility can be a burden, which we've recently started to
20- address in a new set of crates, ` cranelift-module ` , ` cranelift-simplejit ` , and
20+ address in a new set of crates, ` cranelift-module ` , ` cranelift-jit ` , and
2121` cranelift-faerie ` , which put the pieces together in some easy-to-use
2222configurations for working with multiple functions at once. ` cranelift-module `
2323is a common interface for working with multiple functions and data interfaces
24- at once. This interface can sit on top of ` cranelift-simplejit ` , which writes
24+ at once. This interface can sit on top of ` cranelift-jit ` , which writes
2525code and data to memory where they can be executed and accessed. And, it can
2626sit on top of ` cranelift-faerie ` , which writes code and data to native .o files
2727which can be linked into native executables.
2828
29- This post introduces Cranelift by walking through a simple JIT demo, using
30- the [ ` cranelift-simplejit ` ] ( https://crates.io/crates/cranelift-simplejit ) crate.
29+ This post introduces Cranelift by walking through a JIT demo, using
30+ the [ ` cranelift-jit ` ] ( https://crates.io/crates/cranelift-jit ) crate.
3131Currently this demo works on Linux x86-64 platforms. It may also work on Mac
3232x86-64 platforms, though I haven't specifically tested that yet. And Cranelift
3333is being designed to support many other kinds of platforms in the future.
@@ -376,7 +376,7 @@ make any references so there isn't anything to do) and to obtain the final
376376runtime address of the data, which we then convert back into a Rust slice for
377377convenience.
378378
379- And to show off a handy feature of the simplejit backend, it can look up symbols
379+ And to show off a handy feature of the jit backend, it can look up symbols
380380with ` libc::dlsym ` , so you can call libc functions such as ` puts ` (being careful
381381to NUL-terminate your strings!). Unfortunately, ` printf ` requires varargs, which
382382Cranelift does not yet support.
0 commit comments