feat: lots of optimization
* allocate vm stack on the stack * use Rc instead of Arc * optimize recursive attribute set
This commit is contained in:
@@ -95,11 +95,7 @@ impl Compile for ir::Thunk {
|
||||
|
||||
impl Compile for ir::Attrs {
|
||||
fn compile(self, comp: &mut Compiler) {
|
||||
comp.push(if self.rec {
|
||||
OpCode::RecAttrSet
|
||||
} else {
|
||||
OpCode::AttrSet
|
||||
});
|
||||
comp.push(OpCode::AttrSet);
|
||||
for stc in self.stcs {
|
||||
stc.1.compile(comp);
|
||||
comp.push(OpCode::PushStaticAttr { name: stc.0 });
|
||||
@@ -110,7 +106,7 @@ impl Compile for ir::Attrs {
|
||||
comp.push(OpCode::PushDynamicAttr)
|
||||
}
|
||||
if self.rec {
|
||||
comp.push(OpCode::LeaveEnv);
|
||||
comp.push(OpCode::FinalizeRec);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user