mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-24 02:31:13 +08:00
perf: run 签名改 &Arc<CompiledModule>,顶层模块跨 run 共享——collect_flat_modules 顶层改 Arc::clone 消除逐 run 常量池深拷贝,全调用点 Arc 包装迁移
This commit is contained in:
@@ -287,7 +287,7 @@ pub fn run_mem_dirty_rebuild_leak(kernel: &Arc<KernelCore>) -> ExitCode {
|
||||
return ExitCode::FAILURE;
|
||||
}
|
||||
};
|
||||
if let Err(e) = vm.run(&module) {
|
||||
if let Err(e) = vm.run(&Arc::new(module)) {
|
||||
eprintln!("[dirty_rebuild] round {round} run failed: {e}");
|
||||
return ExitCode::FAILURE;
|
||||
}
|
||||
@@ -581,7 +581,7 @@ pub fn run_mem_kernel_lifetime() -> ExitCode {
|
||||
Err(_) => return ExitCode::FAILURE,
|
||||
};
|
||||
let js_module = match Compiler::new().compile(&program) {
|
||||
Ok(m) => m,
|
||||
Ok(m) => Arc::new(m),
|
||||
Err(e) => {
|
||||
eprintln!("[kernel_lifetime] js phase compile failed: {e}");
|
||||
return ExitCode::FAILURE;
|
||||
|
||||
Reference in New Issue
Block a user