Track subcall read regions within read-only calls

This commit is contained in:
2026-10-21 16:31:04 +08:00
parent 4a2f81cb48
commit b7daabdaad
7 changed files with 76 additions and 2 deletions
+10
View File
@@ -21,6 +21,16 @@ impl ObjectStore {
pub fn end_read_only(&mut self, scope: usize) -> Result<Vec<ObjectRef>, VmError> {
self.heap.end_read_only(scope)
}
/// Track one subcall inside the active read-only scope. Regions nest in
/// LIFO order and do not clear the enclosing call's read dependencies.
/// Handles returned by end_read_tracking are borrowed, never owning roots.
pub fn begin_read_tracking(&self) -> Result<usize, VmError> {
self.heap.begin_read_tracking()
}
pub fn end_read_tracking(&self, token: usize) -> Result<Vec<ObjectRef>, VmError> {
self.heap.end_read_tracking(token)
}
pub fn is_read_only(&self) -> bool {
self.heap.is_read_only()
}