refactor: 退役 Vm epoch 字段面与 doc epoch 表述

This commit is contained in:
2026-10-03 10:10:20 +00:00
parent 214494d3d5
commit b5a0582843
8 changed files with 19 additions and 32 deletions
+1 -7
View File
@@ -21,7 +21,7 @@ use crate::vm_debug;
use crate::vm_state::{GcState, IterState, ProfilingState, SymbolState};
use oxide_kernel::kernel::{KernelCore, KernelSession};
use oxide_types::error::JsErrorKind;
use oxide_types::mem::{Epoch, P};
use oxide_types::mem::P;
use oxide_types::object::{Cell, JsObject, NativeFnPtr};
use oxide_types::private_key::INT_KEY_COUNT;
use oxide_types::value::JsValue;
@@ -179,7 +179,6 @@ pub struct Vm {
/// KernelCore 不重建),属性 get/set 热路径免每次 intern(hash64 + DashMap +
/// RwLock 读锁)。
pub(crate) length_si: u32,
pub epoch: Epoch,
pub object_prototype: P<JsObject>,
/// `%GeneratorPrototype%`:生成器实例的原型(next/return/throw 方法挂此)。
pub generator_proto: P<JsObject>,
@@ -456,11 +455,6 @@ impl Vm {
self.pc_watch = path;
}
/// 只读访问 VM 的 epoch arena。
pub fn epoch(&self) -> &Epoch {
&self.epoch
}
/// 若 `val` 是字符串,返回其内容的 `String` 副本;否则返回 `None`。
pub fn lookup_str(&self, val: JsValue) -> Option<String> {
if !val.is_string() {
-4
View File
@@ -3,7 +3,6 @@
use std::sync::Arc;
use oxide_kernel::kernel::{KernelCore, KernelSession};
use oxide_types::mem::Epoch;
use oxide_types::object::{Cell, JsObject, PropAttributes};
use oxide_types::value::JsValue;
@@ -46,9 +45,6 @@ impl oxide_runtime_api::VmHost for Vm {
fn session(&self) -> &KernelSession {
self.session()
}
fn epoch(&self) -> &Epoch {
self.epoch()
}
fn pc(&self) -> usize {
self.pc
}
+1 -3
View File
@@ -11,7 +11,7 @@ use crate::vm_info;
use crate::vm_state::{GcState, IterState, ProfilingState, SymbolState};
use oxide_kernel::kernel::{KernelConfig, KernelCore, KernelSession};
use oxide_kernel::shape_forge::EMPTY_SHAPE_ID;
use oxide_types::mem::{Epoch, P};
use oxide_types::mem::P;
use oxide_types::object::{JsObject, JsString, PropAttributes};
use oxide_types::value::JsValue;
@@ -55,7 +55,6 @@ impl Vm {
kernel_core: core,
session,
length_si,
epoch: Epoch::new(),
object_prototype: obj_proto,
generator_proto: P::new(JsObject::new_empty(EMPTY_SHAPE_ID, JsValue::null())),
generator_function_proto: P::new(JsObject::new_empty(EMPTY_SHAPE_ID, JsValue::null())),
@@ -189,7 +188,6 @@ impl Vm {
kernel_core: core,
session,
length_si,
epoch: Epoch::new(),
object_prototype: obj_proto,
generator_proto: P::new(JsObject::new_empty(EMPTY_SHAPE_ID, JsValue::null())),
generator_function_proto: P::new(JsObject::new_empty(EMPTY_SHAPE_ID, JsValue::null())),