feat: 搭建字节码函数调用基础设施

This commit is contained in:
2026-06-07 16:18:20 +08:00
parent 546d9db338
commit a232cb6969
5 changed files with 183 additions and 8 deletions
+5
View File
@@ -167,6 +167,10 @@ impl CompileCtx {
self.switch_stack.last()
}
pub(crate) fn is_builtin(&self, name: &str) -> bool {
self.builtin_reg_map.iter().any(|(n, _)| n == name)
}
pub(crate) fn pre_register_builtins(&mut self) {
let builtins = [
"NaN",
@@ -235,6 +239,7 @@ impl Compiler {
constants: ctx.constants,
n_registers: ctx.max_regs,
builtin_reg_map: ctx.builtin_reg_map,
sub_modules: Vec::new(),
})
}
}