refactor: 扁平化对象属性存储并优化常量池与 IC 热路径

This commit is contained in:
爱特每羊队
2026-06-13 23:59:47 +08:00
parent dcc7db2575
commit bf74adf7f5
26 changed files with 307 additions and 87 deletions
+9 -1
View File
@@ -9,13 +9,21 @@ use crate::{kernel_debug, kernel_info};
pub use oxide_compiler::compiler::structural_hash;
/// Shared compiled-module cache.
///
/// Concurrency model:
/// - Read-heavy after warmup: cache hits dominate steady-state execution.
/// - Backed by a fixed-shard `DashMap` so lookup contention stays predictable across
/// developer machines and CI hosts.
pub struct CodeForge {
map: DashMap<u64, Arc<CompiledModule>>,
}
impl CodeForge {
pub fn new() -> Self {
Self { map: DashMap::new() }
Self {
map: DashMap::with_shard_amount(16),
}
}
pub fn get_or_compile(