feat: JIT (unusable, segfault)

This commit is contained in:
2025-05-18 15:01:19 +08:00
parent 29e959894d
commit f98d623c13
8 changed files with 326 additions and 122 deletions

View File

@@ -101,16 +101,18 @@ impl Compile for ir::Attrs {
cap: self.stcs.len() + self.dyns.len(),
});
for stc in self.stcs {
let thunk = stc.1.is_thunk();
stc.1.compile(comp);
if !self.rec {
if thunk && !self.rec {
comp.push(OpCode::CaptureEnv);
}
comp.push(OpCode::PushStaticAttr { name: stc.0 });
}
for dynamic in self.dyns {
let thunk = dynamic.1.is_thunk();
dynamic.0.compile(comp);
dynamic.1.compile(comp);
if !self.rec {
if thunk && !self.rec {
comp.push(OpCode::CaptureEnv);
}
comp.push(OpCode::PushDynamicAttr)