11use crate :: frontend:: * ;
22use cranelift:: prelude:: * ;
33use cranelift_module:: { DataContext , Linkage , Module } ;
4- use cranelift_simplejit :: { SimpleJITBuilder , SimpleJITModule } ;
4+ use cranelift_jit :: { JITBuilder , JITModule } ;
55use std:: collections:: HashMap ;
66use std:: slice;
77
@@ -19,15 +19,15 @@ pub struct JIT {
1919 /// The data context, which is to data objects what `ctx` is to functions.
2020 data_ctx : DataContext ,
2121
22- /// The module, with the simplejit backend, which manages the JIT'd
22+ /// The module, with the jit backend, which manages the JIT'd
2323 /// functions.
24- module : SimpleJITModule ,
24+ module : JITModule ,
2525}
2626
2727impl Default for JIT {
2828 fn default ( ) -> Self {
29- let builder = SimpleJITBuilder :: new ( cranelift_module:: default_libcall_names ( ) ) ;
30- let module = SimpleJITModule :: new ( builder) ;
29+ let builder = JITBuilder :: new ( cranelift_module:: default_libcall_names ( ) ) ;
30+ let module = JITModule :: new ( builder) ;
3131 Self {
3232 builder_context : FunctionBuilderContext :: new ( ) ,
3333 ctx : module. make_context ( ) ,
@@ -47,7 +47,7 @@ impl JIT {
4747 // Then, translate the AST nodes into Cranelift IR.
4848 self . translate ( params, the_return, stmts) ?;
4949
50- // Next, declare the function to simplejit . Functions must be declared
50+ // Next, declare the function to jit . Functions must be declared
5151 // before they can be called, or defined.
5252 //
5353 // TODO: This may be an area where the API should be streamlined; should
@@ -58,11 +58,11 @@ impl JIT {
5858 . declare_function ( & name, Linkage :: Export , & self . ctx . func . signature )
5959 . map_err ( |e| e. to_string ( ) ) ?;
6060
61- // Define the function to simplejit . This finishes compilation, although
62- // there may be outstanding relocations to perform. Currently, simplejit
61+ // Define the function to jit . This finishes compilation, although
62+ // there may be outstanding relocations to perform. Currently, jit
6363 // cannot finish relocations until all functions to be called are
64- // defined. For this toy demo for now, we'll just finalize the function
65- // below.
64+ // defined. For this toy demo for now, we'll just finalize the
65+ // function below.
6666 self . module
6767 . define_function ( id, & mut self . ctx , & mut codegen:: binemit:: NullTrapSink { } )
6868 . map_err ( |e| e. to_string ( ) ) ?;
@@ -177,7 +177,7 @@ struct FunctionTranslator<'a> {
177177 int : types:: Type ,
178178 builder : FunctionBuilder < ' a > ,
179179 variables : HashMap < String , Variable > ,
180- module : & ' a mut SimpleJITModule ,
180+ module : & ' a mut JITModule ,
181181}
182182
183183impl < ' a > FunctionTranslator < ' a > {
0 commit comments