feat: JIT (WIP)
This commit is contained in:
@@ -52,6 +52,11 @@ impl<'vm> Func<'vm> {
|
||||
pub fn call(&self, vm: &'vm VM<'_>, arg: Value<'vm>) -> Result<Value<'vm>> {
|
||||
use Param::*;
|
||||
|
||||
let count = self.count.get();
|
||||
if count >= 1 {
|
||||
let compiled = self.compiled.get_or_init(|| vm.compile_func(self));
|
||||
}
|
||||
self.count.replace(count + 1);
|
||||
let mut env = self.env.clone();
|
||||
|
||||
match self.func.param.clone() {
|
||||
|
||||
Reference in New Issue
Block a user