feat: JIT (WIP)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
extern crate test;
|
||||
|
||||
use inkwell::context::Context;
|
||||
use test::{Bencher, black_box};
|
||||
|
||||
use ecow::EcoString;
|
||||
@@ -9,6 +10,7 @@ use crate::compile::compile;
|
||||
use crate::ir::downgrade;
|
||||
use crate::ty::common::Symbol;
|
||||
use crate::ty::public::*;
|
||||
use crate::vm::JITContext;
|
||||
|
||||
use super::run;
|
||||
|
||||
@@ -17,7 +19,9 @@ fn test_expr(expr: &str, expected: Value) {
|
||||
let downgraded = downgrade(rnix::Root::parse(expr).tree().expr().unwrap()).unwrap();
|
||||
let prog = compile(downgraded);
|
||||
dbg!(&prog);
|
||||
assert_eq!(run(prog).unwrap(), expected);
|
||||
let ctx = Context::create();
|
||||
let jit = JITContext::new(&ctx);
|
||||
assert_eq!(run(prog, jit).unwrap(), expected);
|
||||
}
|
||||
|
||||
macro_rules! thunk {
|
||||
|
||||
Reference in New Issue
Block a user