docs: 形状模块使用范围说明与 crate 头中文化

This commit is contained in:
2026-09-16 19:47:21 +00:00
parent 511d30492d
commit 9c8e6a85e1
2 changed files with 6 additions and 3 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
#![doc = "OxideJS - Shared core types (JsValue, JsObject, Shape, P, Epoch)"] #![doc = "OxideJS 共享核心类型:ECMAScript 值、对象模型、形状存储、内存抽象与运行时错误类型。"]
/// 运行时错误类型([`JsError`] / [`JsErrorKind`])。 /// 运行时错误类型([`JsError`] / [`JsErrorKind`])。
pub mod error; pub mod error;
+5 -2
View File
@@ -2,8 +2,11 @@
//! //!
//! 形状表是对象属性布局的可共享描述:每次往对象添加一个命名属性就沿链增长一个 //! 形状表是对象属性布局的可共享描述:每次往对象添加一个命名属性就沿链增长一个
//! shape。形状按 `(parent_id, prop_name)` 哈希一致化(hash-cons),使结构相同的 //! shape。形状按 `(parent_id, prop_name)` 哈希一致化(hash-cons),使结构相同的
//! 对象共享同一 shape,从而支持属性位置缓存(inline cache)。全局单例 //! 对象共享同一 shape,从而支持属性位置缓存(inline cache)。
//! `SHAPE_STORE` 以互斥锁保护,见 `get_shape` 等自由函数。 //!
//! 使用范围:本模块仅 `EMPTY_SHAPE_ID` 常量被外部引用(如 `oxide_runtime_api`);
//! `SHAPE_STORE` 全局单例与 `get_shape` 等自由函数目前仅本模块测试使用,运行时
//! 跨 VM 共享的形状存储是 `oxide_kernel::shape_forge::ShapeForge`。
use std::sync::{Arc, Mutex, OnceLock}; use std::sync::{Arc, Mutex, OnceLock};