From 2dffb91e878d9d27a88292a81d8adfb382063406 Mon Sep 17 00:00:00 2001 From: Richard Gibson Date: Tue, 24 Dec 2024 23:23:57 -0500 Subject: [PATCH] Editorial: Permit immutable Data Blocks with memory locations that subset other immutable Data Blocks --- spec.emu | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/spec.emu b/spec.emu index 87e3f53..08993a6 100644 --- a/spec.emu +++ b/spec.emu @@ -12,6 +12,15 @@ shortname: proposal-immutable-arraybuffer contributors: Mark S. Miller, Richard Gibson + +

ECMAScript Data Types and Values

+ + +

Data Blocks

+

A data block that resides in memory that can be referenced from multiple agents concurrently is designated a Shared Data Block. A Shared Data Block has an identity (for the purposes of equality testing Shared Data Block values) that is address-free: it is tied not to the virtual addresses the block is mapped to in any process, but to the set of locations in memory that the block represents. Two data blocks are equal only if the sets of the locations they contain are equal; otherwise, they are not equal. and the intersection of the sets of locations they contain is empty The intersection of the sets of locations contained by two non-equal data blocks may be non-empty only when both data blocks are immutable and either one is a strict subset of the other or both are strict subsets of an immutable common parent. Finally, Shared Data Blocks can be distinguished from Data Blocks.

+
+
+

Operations on Objects

@@ -484,6 +493,9 @@ contributors: Mark S. Miller, Richard Gibson 1. Perform CopyDataBlockBytes(_toBlock_, 0, _fromBlock_, 0, _count_). 1. Return _newBuffer_. + +

Because neither the identity of a Data Block nor the set of locations in memory represented by it are observable, implementations may implement this operation without allocating new memory locations when _fromBlock_ is the value of the [[ArrayBufferData]] slot for some other immutable ArrayBuffer (and therefore already immutable) and _count_ = _byteLength_.

+