@oseo/runtime-c 0.0.0-stage → 0.1.0-canary.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +674 -0
- package/MIT-LICENSE.txt +21 -0
- package/README.md +1677 -2
- package/UNICODE-LICENSE.txt +39 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +269 -0
- package/dist/index.js.map +1 -0
- package/native/oseo_runtime.h +2594 -0
- package/native/runtime_agent.c +1693 -0
- package/native/runtime_arguments.c +355 -0
- package/native/runtime_array.c +5742 -0
- package/native/runtime_array_buffer.c +1724 -0
- package/native/runtime_async_generator.c +948 -0
- package/native/runtime_atomics.c +1259 -0
- package/native/runtime_bigint.c +1363 -0
- package/native/runtime_bigint_object.c +602 -0
- package/native/runtime_binding.c +1005 -0
- package/native/runtime_boolean.c +296 -0
- package/native/runtime_clock.c +157 -0
- package/native/runtime_clock_posix.c +575 -0
- package/native/runtime_core.c +464 -0
- package/native/runtime_data_view.c +1111 -0
- package/native/runtime_date.c +1973 -0
- package/native/runtime_descriptor.c +1080 -0
- package/native/runtime_disposal.c +1643 -0
- package/native/runtime_enumeration.c +612 -0
- package/native/runtime_error.c +973 -0
- package/native/runtime_event_loop.c +629 -0
- package/native/runtime_function.c +3643 -0
- package/native/runtime_generator.c +1096 -0
- package/native/runtime_internal.h +5554 -0
- package/native/runtime_iterator.c +5355 -0
- package/native/runtime_json.c +1968 -0
- package/native/runtime_map.c +1539 -0
- package/native/runtime_math.c +894 -0
- package/native/runtime_memory.c +1341 -0
- package/native/runtime_module.c +860 -0
- package/native/runtime_number.c +2053 -0
- package/native/runtime_object.c +399 -0
- package/native/runtime_object_builtin.c +3877 -0
- package/native/runtime_primitive.c +2244 -0
- package/native/runtime_process.c +720 -0
- package/native/runtime_promise.c +3354 -0
- package/native/runtime_property.c +791 -0
- package/native/runtime_proxy.c +1533 -0
- package/native/runtime_realm.c +411 -0
- package/native/runtime_reflect.c +624 -0
- package/native/runtime_regexp.c +3495 -0
- package/native/runtime_regexp_matcher.c +3535 -0
- package/native/runtime_regexp_symbol.c +1471 -0
- package/native/runtime_set.c +1751 -0
- package/native/runtime_string.c +2862 -0
- package/native/runtime_string_match.c +1161 -0
- package/native/runtime_symbol.c +986 -0
- package/native/runtime_typed_array.c +5113 -0
- package/native/runtime_unicode_tables.h +14647 -0
- package/native/runtime_uri.c +676 -0
- package/native/runtime_weak_collection.c +1275 -0
- package/package.json +38 -3
package/README.md
CHANGED
|
@@ -1,3 +1,1678 @@
|
|
|
1
|
-
|
|
1
|
+
@oseo/runtime-c
|
|
2
|
+
===============
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
Historical Zig 0.16.0 runs did not provide ASan coverage. The separate Linux
|
|
5
|
+
host C sanitizer lane now verifies instrumentation; its measured scope is
|
|
6
|
+
recorded in the [activity audit]. That evidence does not retroactively
|
|
7
|
+
validate earlier gates or establish macOS ASan coverage. Zig address
|
|
8
|
+
self-checks remain TODOs.
|
|
9
|
+
This package provides versioned, reviewed C11 runtime source inputs. The
|
|
10
|
+
runtime owns opaque NaN-boxed values, UTF-16 strings, primitive semantics,
|
|
11
|
+
two-word call results, explicit root frames, mark-and-sweep collection,
|
|
12
|
+
ordinary objects, arrays, environments, binding cells, function objects, and
|
|
13
|
+
the deterministic `console.log` intrinsic. Native assets remain separate files
|
|
14
|
+
and are included in npm and JSR packages.
|
|
15
|
+
|
|
16
|
+
Oseo-authored native support is under MIT; see *MIT-LICENSE.txt*. The
|
|
17
|
+
Unicode-derived tables retain their terms in *UNICODE-LICENSE.txt*. The
|
|
18
|
+
TypeScript asset provider is under GPL-3.0-or-later. Include the MIT and
|
|
19
|
+
Unicode notices when redistributing the linked runtime in a program.
|
|
20
|
+
|
|
21
|
+
The reviewed asset list is ordered. *oseo\_runtime.h* stays the only header
|
|
22
|
+
included by generated C and direct native fixtures. *runtime\_internal.h* is
|
|
23
|
+
package-private and owns the shared heap layouts, tag masks, and inline value
|
|
24
|
+
helpers used across the runtime translation units. Every listed C source
|
|
25
|
+
compiles as its own translation unit and is archived in asset order.
|
|
26
|
+
|
|
27
|
+
The shared NaN-boxed layout admits allocator-provided data pointers only after
|
|
28
|
+
an explicit low-48-bit payload check. Linux AMD64 and macOS AArch64 execution
|
|
29
|
+
exercise that boundary under the target's address and undefined-behavior
|
|
30
|
+
sanitizer policy.
|
|
31
|
+
|
|
32
|
+
The collector queues newly marked objects through an intrusive worklist, so it
|
|
33
|
+
traces each reachable object once regardless of allocation-list order.
|
|
34
|
+
|
|
35
|
+
M3 property operations implement descriptors, prototypes, array holes and
|
|
36
|
+
length, ordered own-key enumeration, and private cache primitives for explicit
|
|
37
|
+
MIR property-read guards.
|
|
38
|
+
|
|
39
|
+
Function creation installs the standard configurable, non-enumerable `name` and
|
|
40
|
+
`length` properties through the ordinary descriptor representation. Its ABI
|
|
41
|
+
also retains callable kind and the traced lexical receiver of arrows. Arrow and
|
|
42
|
+
asynchronous functions omit the implicit `prototype` property and reject
|
|
43
|
+
construction.
|
|
44
|
+
|
|
45
|
+
The `m4-2` ABI adds traced promises, reactions, jobs, and timer tasks. Promise
|
|
46
|
+
executors run synchronously through a generated-function dispatcher. Reactions
|
|
47
|
+
and thenable assimilation enter a runtime-owned FIFO microtask queue. The
|
|
48
|
+
context retains queued work as collector roots and records unhandled rejections
|
|
49
|
+
only at an explicit microtask checkpoint.
|
|
50
|
+
|
|
51
|
+
The `m4-3` ABI adds a top-level await scheduler checkpoint. It normalizes an
|
|
52
|
+
awaited value through the promise job queue and advances timer turns only until
|
|
53
|
+
that value settles. A pending value with no owned work reports `OSEO3001`
|
|
54
|
+
instead of leaving the native executable blocked.
|
|
55
|
+
|
|
56
|
+
The `m5-1` ABI adds the `oseo_typeof` and `oseo_remainder` helpers.
|
|
57
|
+
`oseo_typeof` allocates its result string and can trigger collection, so
|
|
58
|
+
lowering declares it a safepoint. `oseo_remainder` applies the shared primitive
|
|
59
|
+
numeric coercion and IEEE 754 remainder semantics.
|
|
60
|
+
|
|
61
|
+
The `m5-2` ABI adds `oseo_to_number`, `oseo_bitwise_not`, `oseo_exponentiate`,
|
|
62
|
+
and the six bitwise and shift helpers. All apply the shared primitive numeric
|
|
63
|
+
coercion. The 32-bit operations wrap through explicit modular unsigned
|
|
64
|
+
arithmetic instead of implementation-defined casts. Shifts mask their count to
|
|
65
|
+
five bits. Exponentiation follows `Number::exponentiate`, including the `NaN`
|
|
66
|
+
exponent and unit-base infinite-exponent cases where C `pow` differs.
|
|
67
|
+
|
|
68
|
+
The `m5-3` ABI adds `oseo_loose_equal` and `oseo_not_loose_equal`, implementing
|
|
69
|
+
`IsLooselyEqual` for the admitted values. Nullish pairs are equal. A nullish
|
|
70
|
+
operand compared with anything else is unequal without coercion. Booleans and
|
|
71
|
+
numeric strings coerce through the shared numeric conversion. Objects compare
|
|
72
|
+
by identity. Comparing an object with a number or string keeps the shared
|
|
73
|
+
unsupported object-to-primitive boundary.
|
|
74
|
+
|
|
75
|
+
The `m5-4` ABI adds `oseo_has_property` and `oseo_instanceof`.
|
|
76
|
+
`oseo_has_property` converts its key through the shared property-key conversion
|
|
77
|
+
and walks the prototype chain with the same own-descriptor and promise-method
|
|
78
|
+
visibility as generic property reads. It throws a catchable error for
|
|
79
|
+
non-object right operands. `oseo_instanceof` implements `OrdinaryHasInstance`:
|
|
80
|
+
a non-callable right operand and a non-object `prototype` property throw
|
|
81
|
+
catchable errors, a primitive left operand is false, and the walk compares
|
|
82
|
+
prototype identity.
|
|
83
|
+
|
|
84
|
+
The `m5-5` ABI adds `oseo_error_intrinsic` and `oseo_context_print_thrown`, and
|
|
85
|
+
the *runtime\_error.c* component that owns the named error intrinsics.
|
|
86
|
+
`oseo_error_intrinsic` returns the lazily created constructor for one
|
|
87
|
+
`OseoErrorKind`. Each constructor is callable and constructible, builds an
|
|
88
|
+
instance with an own hidden `message` property, honors the ES2022 `cause`
|
|
89
|
+
option, and shares one `Error.prototype.toString`. `oseo_context_print_thrown`
|
|
90
|
+
renders an unhandled thrown error instance as `Name: message` in the owned
|
|
91
|
+
diagnostic format.
|
|
92
|
+
|
|
93
|
+
The `m5-6` ABI adds `oseo_to_string` and the generic `ToPrimitive` behind the
|
|
94
|
+
numeric, string, addition, relational, loose-equality, property-key, console,
|
|
95
|
+
error-message, and timer-delay conversions. `OrdinaryToPrimitive` runs
|
|
96
|
+
user-reachable `valueOf` and `toString` in hint order. Objects on the realm
|
|
97
|
+
intrinsic chain use deferred `Object.prototype` and `Array.prototype`
|
|
98
|
+
conversions with cycle-safe, call-depth-bounded array joins. An object with no
|
|
99
|
+
convertible method throws a catchable `TypeError`. Functions preserve their
|
|
100
|
+
AOT-known source or use the native-function form; promise text conversion
|
|
101
|
+
remains an owned unsupported diagnostic.
|
|
102
|
+
|
|
103
|
+
The `m5-7` ABI adds `oseo_symbol_intrinsic` and the *runtime\_symbol.c*
|
|
104
|
+
component: unique GC-traced symbol primitives with descriptions, the lazily
|
|
105
|
+
created non-constructible `Symbol` intrinsic carrying the well-known
|
|
106
|
+
`iterator`, `toPrimitive`, and `toStringTag` symbols, and `Symbol(description)`
|
|
107
|
+
creation. Symbols are identity-compared property keys. `typeof` reports
|
|
108
|
+
`symbol`. Numeric and string conversion throw catchable `TypeError` instances.
|
|
109
|
+
Console output renders `Symbol(description)`, and a reachable
|
|
110
|
+
`Symbol.toPrimitive` method is dispatched by the generic `ToPrimitive`.
|
|
111
|
+
|
|
112
|
+
The `m5-8` ABI adds the *runtime\_iterator.c* component and the synchronous
|
|
113
|
+
iterator protocol: `oseo_internal_iterator_get`, `_next`, `_close`, over
|
|
114
|
+
`Symbol.iterator`, `next`, and `return`, plus a first-class array iterator
|
|
115
|
+
exposed through the realm's `%Array.prototype%`.
|
|
116
|
+
|
|
117
|
+
The array iterator is an ordinary object that steps by re-reading the array
|
|
118
|
+
length, and its `next` and `Symbol.iterator` methods live on realm-owned
|
|
119
|
+
prototypes. The next method is captured once by `GetIterator` and reused each
|
|
120
|
+
step. `IteratorClose` invokes a present `return` method when a combinator
|
|
121
|
+
rejects after a step. `Promise.all` and `Promise.race` consume any object
|
|
122
|
+
iterable through this protocol.
|
|
123
|
+
|
|
124
|
+
String and other primitive iteration and the generic array-like
|
|
125
|
+
`%Array.prototype.values%` remain boundaries for later consumers.
|
|
126
|
+
|
|
127
|
+
The `m5-9` ABI promotes that iterator record surface to the generated-code
|
|
128
|
+
entry points `oseo_iterator_get`, `oseo_iterator_next`, and
|
|
129
|
+
`oseo_iterator_close`. Generated C keeps the iterator, captured next method,
|
|
130
|
+
and yielded value in separate root slots instead of allocating a hidden
|
|
131
|
+
iterator-record object. Promise combinators use the same entry points. Array
|
|
132
|
+
binding declarations reuse these entry points without changing the runtime ABI.
|
|
133
|
+
Generated code owns their iterator done state and conditional close control
|
|
134
|
+
flow, while rest accumulation reuses `oseo_array_append`.
|
|
135
|
+
|
|
136
|
+
The `m5-10` ABI adds `oseo_array_append` and `oseo_array_append_hole` for
|
|
137
|
+
generated array accumulation. Value append creates a new own data property
|
|
138
|
+
without consulting the prototype. Hole append advances only the array length.
|
|
139
|
+
The array and appended value remain caller-rooted across property-key and
|
|
140
|
+
storage allocation. Generated accumulation is monotonic, so the array must not
|
|
141
|
+
already own the property named by its current length. Accumulation beyond the
|
|
142
|
+
runtime's 32-bit array-index limit fails with `OSEO2001` for value append and a
|
|
143
|
+
catchable `RangeError` for a trailing hole.
|
|
144
|
+
|
|
145
|
+
The `m5-11` ABI adds GC-traced dynamic argument lists. Generated code creates
|
|
146
|
+
and appends to a private list while evaluating spread arguments, then borrows
|
|
147
|
+
its stable count and value pointer for the call or construction. The list
|
|
148
|
+
remains rooted across invocation and is never exposed as a JavaScript object.
|
|
149
|
+
|
|
150
|
+
The `m5-12` ABI adds `oseo_require_object_coercible` for object binding
|
|
151
|
+
initialization. It rejects `null` and `undefined` with a catchable `TypeError`
|
|
152
|
+
before a computed property name can run, while every other admitted value
|
|
153
|
+
continues through the existing primitive-aware property-read operations.
|
|
154
|
+
|
|
155
|
+
The `m5-13` ABI adds `oseo_object_rest` for `CopyDataProperties`. It snapshots
|
|
156
|
+
own keys in ECMAScript order, skips excluded and non-enumerable keys, reads
|
|
157
|
+
each remaining value through the generic property path, and creates ordinary
|
|
158
|
+
data properties on a fresh result object.
|
|
159
|
+
|
|
160
|
+
The `m5-14` ABI adds synchronous generator objects and moves a generated
|
|
161
|
+
function's saved abrupt completions into an `OseoCompletionRecord` array.
|
|
162
|
+
`oseo_generator_create` allocates one record that owns the suspended body's
|
|
163
|
+
root slots and completion records. The collector traces a suspended frame
|
|
164
|
+
through the generator object, so no native C frame of a suspended body stays
|
|
165
|
+
alive. Generated code reacquires `oseo_generator_slots` and
|
|
166
|
+
`oseo_generator_completions` on every entry, leaves through
|
|
167
|
+
`oseo_generator_suspend`, and is reentered by the generator dispatcher that
|
|
168
|
+
`oseo_context_set_generator_dispatcher` installs. `oseo_generator_next` is the
|
|
169
|
+
materialized `%GeneratorPrototype%.next`, reached from a generator function's
|
|
170
|
+
`prototype` object alongside `Symbol.iterator`.
|
|
171
|
+
|
|
172
|
+
The `m5-15` ABI adds `oseo_generator_return` and `oseo_generator_resume_kind`.
|
|
173
|
+
`oseo_generator_return` is the materialized `%GeneratorPrototype%.return`,
|
|
174
|
+
served from the same `prototype` object, so `IteratorClose` reaches it whenever
|
|
175
|
+
a consumer abandons a generator. It resumes the body with a return completion,
|
|
176
|
+
which `oseo_generator_resume_kind` reports at the resume point as
|
|
177
|
+
`OSEO_GENERATOR_RESUME_RETURN`. Generated code then leaves through the
|
|
178
|
+
enclosing `finally` and iterator-close chain instead of continuing at the
|
|
179
|
+
suspension. The kind describes one resumption only and returns to
|
|
180
|
+
`OSEO_GENERATOR_RESUME_NEXT` once the body leaves.
|
|
181
|
+
|
|
182
|
+
A generator body's iterator done state also moves into its generator record's
|
|
183
|
+
root slots, because an automatic C local would not survive a suspension taken
|
|
184
|
+
while a `for-of` or array binding is still stepping.
|
|
185
|
+
|
|
186
|
+
The `m5-28` ABI adds `oseo_class_static_private_method_define`. It installs
|
|
187
|
+
static private methods directly on a class constructor and merges getter and
|
|
188
|
+
setter halves into one accessor element under their shared private name.
|
|
189
|
+
|
|
190
|
+
The `m5-29` ABI adds `oseo_private_in`. It performs the private-name brand
|
|
191
|
+
check used by `#name in object`, returning a boolean for object operands and
|
|
192
|
+
throwing a `TypeError` for non-objects.
|
|
193
|
+
|
|
194
|
+
The `m5-30` ABI adds `oseo_bind_arrow_context`. It captures the enclosing
|
|
195
|
+
function's home object and super-constructor context plus the current
|
|
196
|
+
`new.target`; arrow calls restore that context alongside their existing lexical
|
|
197
|
+
receiver.
|
|
198
|
+
|
|
199
|
+
The `m5-31` ABI adds `oseo_async_function_start` and
|
|
200
|
+
`oseo_async_function_reject`. Ordinary asynchronous functions now keep their
|
|
201
|
+
locals, roots, and completion records in a traced suspension frame. A call
|
|
202
|
+
drives that hidden frame until it completes or awaits, settles one capability
|
|
203
|
+
promise, and resumes awaited operands through the existing centralized promise
|
|
204
|
+
reaction paths.
|
|
205
|
+
|
|
206
|
+
The same ABI virtualizes the narrow `%Array.prototype.push%` dependency used by
|
|
207
|
+
the reviewed thenable-await case. Its cached function is context-rooted, reads
|
|
208
|
+
and converts an object receiver's `length`, performs ordered strict writes
|
|
209
|
+
through the generic property path, and leaves array length and abrupt
|
|
210
|
+
completion behavior to the existing object semantics.
|
|
211
|
+
|
|
212
|
+
The `m5-32` ABI adds start and result entry points for asynchronous iterator
|
|
213
|
+
steps and asynchronous generator delegation. Generated traced-frame code starts
|
|
214
|
+
one step, retains its promise and direct-value mode in owned root slots,
|
|
215
|
+
returns to the caller, and inspects the settled result only after a promise
|
|
216
|
+
reaction resumes the frame. Async-from-Sync continuation promises use a
|
|
217
|
+
runtime-owned fulfillment reaction to await the stepped value without draining
|
|
218
|
+
the scheduler. Module top-level asynchronous iterator closing retains the
|
|
219
|
+
existing drain-based entry point.
|
|
220
|
+
|
|
221
|
+
The `m5-33` ABI adds framed asynchronous iterator close start and result entry
|
|
222
|
+
points. Generated code retains the pending completion in the owning traced
|
|
223
|
+
frame while a present `return` method settles, and the runtime's
|
|
224
|
+
Async-from-Sync rejection reaction closes the wrapped synchronous iterator
|
|
225
|
+
before preserving the original rejection.
|
|
226
|
+
|
|
227
|
+
The `m5-34` ABI removes `oseo_await_value` and changes `oseo_event_loop_run`
|
|
228
|
+
from a context-only entry point to one that also accepts the entry promise.
|
|
229
|
+
Generated code using the two-argument entry point must pair with `m5-34`
|
|
230
|
+
runtime assets.
|
|
231
|
+
|
|
232
|
+
The `m5-35` ABI adds the *runtime\_bigint.c* component, exact BigInt literal
|
|
233
|
+
construction, `ToNumeric`, and numeric-one dispatch for update expressions.
|
|
234
|
+
Every BigInt is an `OSEO_HEAP_BIGINT` primitive with an inline, normalized sign
|
|
235
|
+
and magnitude using 30-bit limbs in `uint32_t` storage.
|
|
236
|
+
|
|
237
|
+
Generic arithmetic, comparison, decimal conversion, and signed shifts remain
|
|
238
|
+
behind the `OseoValue` runtime boundary. The collector traces the BigInt object
|
|
239
|
+
but no limb edges, and tag 7 remains unassigned. The baseline rejects
|
|
240
|
+
magnitudes above 65,536 bits with a catchable `RangeError` before allocating
|
|
241
|
+
the oversized result.
|
|
242
|
+
|
|
243
|
+
The `m5-36` ABI adds `oseo_require_delete_object_coercible`. Generated delete
|
|
244
|
+
lowering uses it after evaluating a computed key expression but before
|
|
245
|
+
`ToPropertyKey`, preserving the delete-specific nullish `TypeError` while
|
|
246
|
+
leaving the object-binding helper and message unchanged.
|
|
247
|
+
|
|
248
|
+
The `m5-37` ABI adds `oseo_object_literal_set_prototype`. It ignores primitive
|
|
249
|
+
prototype values and delegates object and null values to the existing
|
|
250
|
+
`oseo_object_set_prototype` authority.
|
|
251
|
+
|
|
252
|
+
The `m5-38` ABI adds `oseo_this_value`, `oseo_global_object_create`, and
|
|
253
|
+
`oseo_global_binding_set`. `oseo_this_value` resolves a nullish receiver to the
|
|
254
|
+
realm's global this value, which it creates on first use as an ordinary
|
|
255
|
+
extensible object with a null `[[Prototype]]`. The context permanently roots
|
|
256
|
+
that one object, so Script top-level `this` and every non-strict nullish
|
|
257
|
+
receiver observe one identity across collection.
|
|
258
|
+
|
|
259
|
+
The M5c `primitive-wrapper-objects` unit completes the non-nullish branch with
|
|
260
|
+
`ToObject`. Objects retain their identity; Boolean, Number, String, Symbol, and
|
|
261
|
+
BigInt primitives produce fresh branded wrappers over the callee realm's
|
|
262
|
+
intrinsic prototypes. The C backend binds and roots this receiver once at a
|
|
263
|
+
non-strict function's entry, before parameter effects or suspension-frame
|
|
264
|
+
creation. Repeated `this` reads and lexical arrows retain that identity, and
|
|
265
|
+
the suspension record traces it across resumes. Strict functions receive their
|
|
266
|
+
original values.
|
|
267
|
+
|
|
268
|
+
Existing wrapper layouts, tracing, constructor behavior, and branded prototype
|
|
269
|
+
methods remain authoritative; this unit adds no runtime entry point or heap
|
|
270
|
+
field.
|
|
271
|
+
|
|
272
|
+
`Array.from` keeps the original receiver for its `GetMethod` iterator lookup,
|
|
273
|
+
then materializes one `ToObject` result for the array-like branch's length and
|
|
274
|
+
indexed reads. `Object.prototype.toString` likewise reads `Symbol.toStringTag`
|
|
275
|
+
from its `ToObject` result. Ordinary primitive property References and
|
|
276
|
+
`Object.prototype.toLocaleString`'s `Invoke` keep their primitive receivers.
|
|
277
|
+
This admission does not complete primitive inherited `[[Set]]`, which has its
|
|
278
|
+
own M5c node.
|
|
279
|
+
|
|
280
|
+
`oseo_global_object_create` performs GlobalDeclarationInstantiation's binding
|
|
281
|
+
creation for one Script. Each named entry becomes a writable, enumerable,
|
|
282
|
+
non-configurable own property of that object whose stored value is the binding
|
|
283
|
+
cell in the passed environment, so the property and the binding are one storage
|
|
284
|
+
location and no value is ever copied between them. A backend calls it once,
|
|
285
|
+
after every binding cell exists and before the script body runs; module code
|
|
286
|
+
never calls it.
|
|
287
|
+
|
|
288
|
+
`oseo_global_binding_set` is SetMutableBinding for a binding the global object
|
|
289
|
+
also exposes. It writes the cell unless `[[DefineOwnProperty]]` made that
|
|
290
|
+
property non-writable, in which case it fails the way the equivalent property
|
|
291
|
+
assignment fails: with a `TypeError` in strict code and silently outside it.
|
|
292
|
+
|
|
293
|
+
Object reads, writes, descriptor queries, and definitions resolve such a
|
|
294
|
+
property through its cell, and the fixed-slot property cache excludes
|
|
295
|
+
cell-backed slots so that a cached load never yields the cell itself.
|
|
296
|
+
|
|
297
|
+
The `m5-39` ABI gives the virtualized `%GeneratorPrototype%.throw` its own
|
|
298
|
+
permanently rooted context cache. Without that cache, its lookup falls through
|
|
299
|
+
to the `[Symbol.iterator]` self function's slot, and whichever method a program
|
|
300
|
+
resolved first is returned for both keys afterward.
|
|
301
|
+
|
|
302
|
+
The `m5-40` ABI adds `oseo_mapped_arguments_create` and a `mapped_arguments`
|
|
303
|
+
object flag. The generated prologue calls it instead of `oseo_arguments_create`
|
|
304
|
+
whenever a non-strict function's parameter list is simple. Every supplied index
|
|
305
|
+
first snapshots its call argument exactly as the unmapped constructor does,
|
|
306
|
+
then a rightmost formal parameter's own index is redefined to hold that
|
|
307
|
+
parameter's environment binding cell as its stored value.
|
|
308
|
+
|
|
309
|
+
`cell_backed_property`, already shared by the global object and a module
|
|
310
|
+
namespace, recognizes the flag, so `[[Get]]`, `[[Set]]`, and
|
|
311
|
+
`[[GetOwnProperty]]` alias the index and the parameter with no exotic method
|
|
312
|
+
table of their own. `[[DefineOwnProperty]]`'s redefinition path severs that
|
|
313
|
+
alias, replacing the cell with a plain snapshot of the value just written. This
|
|
314
|
+
happens exactly when the accepted descriptor is an explicit non-writable data
|
|
315
|
+
descriptor or an accessor; the parameter itself keeps its own binding cell and
|
|
316
|
+
stays mutable regardless.
|
|
317
|
+
|
|
318
|
+
A duplicate formal name maps only its rightmost occurrence, and an index at or
|
|
319
|
+
beyond the parameter count keeps the unmapped snapshot.
|
|
320
|
+
|
|
321
|
+
The `m5-41` ABI drops `oseo_arguments_create`'s `callee` parameter and adds the
|
|
322
|
+
realm's `%ThrowTypeError%` intrinsic behind a new context cache. Every function
|
|
323
|
+
form except an arrow now owns an implicit `arguments` binding, so the unmapped
|
|
324
|
+
constructor also serves strict functions, methods, class constructors,
|
|
325
|
+
asynchronous functions, and asynchronous generators.
|
|
326
|
+
|
|
327
|
+
CreateUnmappedArgumentsObject defines `callee` as a non-configurable,
|
|
328
|
+
non-enumerable accessor whose `[[Get]]` and `[[Set]]` are both the single
|
|
329
|
+
cached `%ThrowTypeError%` function. Reading or writing it throws a `TypeError`,
|
|
330
|
+
and the running function is never reachable through the object. The intrinsic
|
|
331
|
+
is created on first use, permanently rooted, and shared by every unmapped
|
|
332
|
+
arguments object in the realm. Both accessor slots and every object's pair
|
|
333
|
+
compare equal. The 10.2.4.1 hardening applies: its `length` and `name` are
|
|
334
|
+
non-writable and non-configurable, and the function itself is non-extensible.
|
|
335
|
+
Only `oseo_mapped_arguments_create` still defines `callee` as a writable,
|
|
336
|
+
configurable data property naming the running function.
|
|
337
|
+
|
|
338
|
+
The same ABI gives both arguments object shapes an `@@iterator` data property
|
|
339
|
+
holding the cached `%Array.prototype.values%` function, which makes that
|
|
340
|
+
function and the array iterator's `next` generic over object array-likes.
|
|
341
|
+
`next` now takes its bound as `ToLength(ToNumber(Get(O, "length")))`, keeping
|
|
342
|
+
an ordinary array's own element count as an equivalent fast path.
|
|
343
|
+
|
|
344
|
+
The iterator snapshots the iterated target and cursor before that read and
|
|
345
|
+
advances the cursor before the element `Get`. The ordering matters because a
|
|
346
|
+
non-array target's `length` and elements can be accessors: a reentrant step
|
|
347
|
+
must not steal the index this step yields, and an abrupt element accessor must
|
|
348
|
+
leave the iterator on the following index rather than retrying the one it
|
|
349
|
+
failed to read.
|
|
350
|
+
|
|
351
|
+
The `m5-44` ABI adds `AggregateError` as the eighth public error kind and
|
|
352
|
+
expands the context's error constructor and prototype caches accordingly. Its
|
|
353
|
+
constructor consumes the first argument through the shared iterator protocol
|
|
354
|
+
into a fresh `errors` array. It also shares the optional `cause` installation
|
|
355
|
+
path with `Error` and every NativeError constructor. These public enum and
|
|
356
|
+
context layout changes shift the generated error code identifiers and require
|
|
357
|
+
the ABI bump.
|
|
358
|
+
|
|
359
|
+
The `m5-46` ABI replaces component-local intrinsic caches with one realm-owned
|
|
360
|
+
intrinsic table and materializes `%Object.prototype%`, `%Function.prototype%`,
|
|
361
|
+
and the admitted standard constructors as reachable values. The preceding
|
|
362
|
+
`m5-45` ABI expanded the well-known symbol table from four entries to the
|
|
363
|
+
complete thirteen-entry edition set. The public context layout changes with the
|
|
364
|
+
table, so embedding code must use runtime inputs with the matching ABI.
|
|
365
|
+
|
|
366
|
+
The `m5-47` ABI populates the realm-owned `%Object.prototype%` with its six
|
|
367
|
+
standard methods and `constructor` link. The intrinsic table gains stable slots
|
|
368
|
+
for those functions and the `Object` constructor identity. Callable constructor
|
|
369
|
+
behavior and primitive wrappers remain owned by their later M5b node.
|
|
370
|
+
|
|
371
|
+
The `m5-48` ABI completes `%Function.prototype%` with its standard call, apply,
|
|
372
|
+
bind, source-text, and has-instance behavior. The intrinsic table gains stable
|
|
373
|
+
slots for the `Function` identity and those methods, and function heap objects
|
|
374
|
+
gain traced initial-name, source, and bound-call state.
|
|
375
|
+
|
|
376
|
+
The `m5-49` ABI materializes `%Iterator%`, `%IteratorPrototype%`, and
|
|
377
|
+
`Iterator.from`. The intrinsic table gains stable slots for the constructor,
|
|
378
|
+
method, accessors, and wrap-for-valid-iterator prototype and methods. Ordinary
|
|
379
|
+
objects also gain traced state for the wrapped iterator and its captured `next`
|
|
380
|
+
method.
|
|
381
|
+
|
|
382
|
+
The `m5-50` ABI adds the *runtime\_number.c* component and materializes the
|
|
383
|
+
`Number` constructor, its branded wrapper objects, numeric constants, and
|
|
384
|
+
static predicate and parser methods. Ordinary objects gain Number data, the
|
|
385
|
+
intrinsic table gains stable Number slots, and the global object installs the
|
|
386
|
+
writable, non-enumerable, configurable constructor property. The Number
|
|
387
|
+
prototype formatting methods remain owned by their later M5b node.
|
|
388
|
+
|
|
389
|
+
The `m5-51` ABI makes the realm-owned `Object` constructor callable and
|
|
390
|
+
constructible and installs it on the global object. `Object` returns existing
|
|
391
|
+
objects unchanged, creates ordinary objects for nullish inputs, and wraps
|
|
392
|
+
primitives in collector-traced objects with stable intrinsic prototypes.
|
|
393
|
+
`Object.is`, `Object.getPrototypeOf`, and `Object.setPrototypeOf` are ordinary
|
|
394
|
+
static properties.
|
|
395
|
+
|
|
396
|
+
Ordinary objects gain traced primitive wrapper state, and the intrinsic table
|
|
397
|
+
gains the three static functions plus Boolean, String, and BigInt wrapper
|
|
398
|
+
prototype slots. The previously admitted `create`, `defineProperty`,
|
|
399
|
+
`getOwnPropertyDescriptor`, and `keys` helpers are also real function
|
|
400
|
+
properties of `Object`. Transient primitive property lookup boxes without
|
|
401
|
+
materializing String index properties that the lookup has already handled
|
|
402
|
+
directly.
|
|
403
|
+
|
|
404
|
+
The `m5-52` ABI admits `Object.defineProperty` as a complete descriptor
|
|
405
|
+
operation. Property-key coercion precedes descriptor conversion, descriptor
|
|
406
|
+
fields retain their specified observation order and defaults, and abrupt
|
|
407
|
+
completion stops before later observations or mutation. The shared descriptor
|
|
408
|
+
component applies ordinary, array, function, arguments, String-wrapper, and
|
|
409
|
+
module-namespace compatibility rules without changing public runtime layout.
|
|
410
|
+
|
|
411
|
+
The `m5-53` ABI materializes `%Promise%`. The constructor, its prototype link,
|
|
412
|
+
`Symbol.toStringTag`, the `Symbol.species` accessor, and the `resolve`,
|
|
413
|
+
`reject`, `withResolvers`, `try`, `all`, and `race` statics are ordinary
|
|
414
|
+
properties of one realm-owned constructor that the global object binds. A
|
|
415
|
+
promise takes its `[[Prototype]]` from the new target, so a subclass keeps its
|
|
416
|
+
own prototype. `Promise.prototype.then` and `finally` run SpeciesConstructor.
|
|
417
|
+
|
|
418
|
+
A capability over any constructor other than `%Promise%` is a three-slot record
|
|
419
|
+
holding the constructed promise and the resolving functions its executor
|
|
420
|
+
captured. `Promise.all` and `Promise.race` build that record from their `this`
|
|
421
|
+
value rather than from `%Promise%`. The retired `oseo_promise_construct`,
|
|
422
|
+
`oseo_promise_race`, and `oseo_promise_reject` entry points leave the
|
|
423
|
+
generated-code ABI, because generated code now reads the properties instead.
|
|
424
|
+
|
|
425
|
+
The `m5-54` ABI completes the descriptor checkpoint with the two query statics.
|
|
426
|
+
`Object.getOwnPropertyDescriptor` and the new
|
|
427
|
+
`Object.getOwnPropertyDescriptors` convert their target before their property
|
|
428
|
+
key. They report an absent property as `undefined` and an absent target
|
|
429
|
+
property set as an empty object, and build every reported descriptor through
|
|
430
|
+
one FromPropertyDescriptor body whose fields keep their specified order.
|
|
431
|
+
|
|
432
|
+
The plural query walks ordinary own keys, so integer indices lead in ascending
|
|
433
|
+
order. The array `length` and function `prototype` this runtime keeps outside
|
|
434
|
+
the property vector hold their creation positions, and symbol keys trail every
|
|
435
|
+
string key. Public runtime layout is unchanged.
|
|
436
|
+
|
|
437
|
+
The `m5-55` ABI materializes `%ArrayBuffer%`. The constructor takes its length
|
|
438
|
+
through ToIndex and its optional `maxByteLength` from an object options bag,
|
|
439
|
+
and it allocates one zero-initialized Data Block that exactly one buffer owns.
|
|
440
|
+
A resizable buffer reserves its whole maximum at allocation, so `resize` moves
|
|
441
|
+
the byte length inside a block that never moves and clears the bytes outside
|
|
442
|
+
it. `transfer` and `transferToFixedLength` copy into a second block before
|
|
443
|
+
detaching the source, `slice` allocates through SpeciesConstructor, and the
|
|
444
|
+
`byteLength`, `detached`, `maxByteLength`, and `resizable` accessors report the
|
|
445
|
+
detached state rather than throwing. Public runtime layout is unchanged; the
|
|
446
|
+
runtime adds one internal heap kind for the buffer record.
|
|
447
|
+
|
|
448
|
+
The `m5-56` ABI gives every object an observable extensibility state and admits
|
|
449
|
+
the six Object integrity statics. `preventExtensions` clears that state, `seal`
|
|
450
|
+
also makes every own property non-configurable, and `freeze` also makes every
|
|
451
|
+
own data property non-writable. `isExtensible`, `isSealed`, and `isFrozen`
|
|
452
|
+
report the corresponding state without boxing primitives.
|
|
453
|
+
|
|
454
|
+
Stored properties still transition through the shared descriptor component,
|
|
455
|
+
including arguments aliases and module namespace restrictions, while array
|
|
456
|
+
`length` and function `prototype` retain their specialized storage. Public
|
|
457
|
+
runtime layout is unchanged because the extensibility flag was reserved by the
|
|
458
|
+
intrinsic graph root.
|
|
459
|
+
|
|
460
|
+
The `m5-58` ABI completes the static Global Environment Record boundary. The
|
|
461
|
+
realm global object owns the standard `Infinity`, `NaN`, and `undefined` value
|
|
462
|
+
properties with their specified read-only, non-enumerable, and non-configurable
|
|
463
|
+
descriptors and every constructor global the profile admits. Global declaration
|
|
464
|
+
instantiation checks lexical declarations against restricted properties and
|
|
465
|
+
validates function and `var` declarations against existing descriptors and
|
|
466
|
+
extensibility before mutation. A new property stores its binding cell.
|
|
467
|
+
|
|
468
|
+
A declaration over an existing configurable property retains that property as
|
|
469
|
+
Object Environment Record storage, so deletion, accessors, and later descriptor
|
|
470
|
+
changes remain visible through the identifier, including inherited-property
|
|
471
|
+
lookup and `with` fallback. A failed standard-global installation remains
|
|
472
|
+
unpublished so it can be retried. Module declarations do not enter that record.
|
|
473
|
+
The global object remains unavailable as a `globalThis` binding, which is owned
|
|
474
|
+
by its later architecture decision.
|
|
475
|
+
|
|
476
|
+
The `m5-59` ABI makes every admitted configurable constructor global use the
|
|
477
|
+
same property-owned identifier path as the other mutable standard globals.
|
|
478
|
+
Property writes and deletes therefore change later bare reads, writes, and
|
|
479
|
+
`typeof` results. Global lexical and object declaration tables also carry each
|
|
480
|
+
declaration's line and column, which the runtime installs before
|
|
481
|
+
HasRestrictedGlobalProperty, CanDeclareGlobalFunction, or CanDeclareGlobalVar
|
|
482
|
+
can fail.
|
|
483
|
+
|
|
484
|
+
Module declarations remain outside the global object record. Each call
|
|
485
|
+
validates one independently compiled Script; the ABI does not retain
|
|
486
|
+
`[[VarNames]]` or declarative names across successive Script instantiations in
|
|
487
|
+
one realm, so multi-Script declaration collisions remain outside this unit.
|
|
488
|
+
|
|
489
|
+
The `m5-61` ABI makes `Array` a realm-owned intrinsic value and adds stable
|
|
490
|
+
slots for `from`, `of`, `isArray`, and the `Symbol.species` getter. The array
|
|
491
|
+
component owns length-argument construction and the generic constructor paths
|
|
492
|
+
used by the collection statics. Descriptor-complete boundary functions keep
|
|
493
|
+
unadmitted pre-ES2015 Array prototype methods explicitly unsupported.
|
|
494
|
+
|
|
495
|
+
The `m5-60` ABI admits `Object.defineProperties` as a complete collection
|
|
496
|
+
operation. The target check precedes every read of the properties argument,
|
|
497
|
+
ToObject precedes the own-key walk, and the walk keeps the own enumerable keys
|
|
498
|
+
in ordinary own-key order. Every kept descriptor is read with Get and converted
|
|
499
|
+
through the ToPropertyDescriptor body `Object.defineProperty` shares before the
|
|
500
|
+
first definition runs, so an abrupt collection leaves the target untouched
|
|
501
|
+
while an abrupt definition keeps every earlier definition. The shared
|
|
502
|
+
descriptor component applies ordinary, array, function, arguments,
|
|
503
|
+
String-wrapper, and module-namespace compatibility rules without changing
|
|
504
|
+
public runtime layout.
|
|
505
|
+
|
|
506
|
+
The `m5-63` ABI extends the realm-owned `%String%` cluster materialized at
|
|
507
|
+
`m5-62`. The constructor, its prototype link, and the `fromCharCode`,
|
|
508
|
+
`fromCodePoint`, and `raw` statics remain ordinary properties, and
|
|
509
|
+
`%String.prototype%.constructor` links back to the realm-owned constructor. The
|
|
510
|
+
prototype now supplies ordinary `at`, `charAt`, `charCodeAt`, `codePointAt`,
|
|
511
|
+
`toString`, and `valueOf` functions.
|
|
512
|
+
|
|
513
|
+
The four access methods are generic: they reject only a nullish receiver before
|
|
514
|
+
applying `ToString` and `ToIntegerOrInfinity`. `toString` and `valueOf` instead
|
|
515
|
+
require a String primitive or an object branded with `[[StringData]]`.
|
|
516
|
+
|
|
517
|
+
The `concat`, `lastIndexOf`, `localeCompare`, `match`, `replace`, `search`,
|
|
518
|
+
`slice`, `split`, `substring`, `toLocaleLowerCase`, `toLocaleUpperCase`,
|
|
519
|
+
`toLowerCase`, `toUpperCase`, and `trim` methods retain their source-located
|
|
520
|
+
M5b boundary. The generated-code ABI gains no entry point; the expanded
|
|
521
|
+
intrinsic code range remains runtime-internal.
|
|
522
|
+
|
|
523
|
+
The `m5-64` ABI adds ordinary `every`, `forEach`, and `some` functions to the
|
|
524
|
+
realm-owned `%Array.prototype%`. Each method converts its receiver, snapshots
|
|
525
|
+
LengthOfArrayLike once, and validates the callback before visiting any index.
|
|
526
|
+
It then performs a fresh HasProperty and Get for each index.
|
|
527
|
+
|
|
528
|
+
The callback receives the value, index, and converted receiver with the
|
|
529
|
+
supplied `thisArg`. `every` and `some` preserve their specified early
|
|
530
|
+
completion, while `forEach` returns `undefined`. Deleting, creating, or
|
|
531
|
+
inheriting an indexed property during the loop therefore affects a later visit,
|
|
532
|
+
while appending beyond the initial length does not. The generated-code ABI
|
|
533
|
+
gains no entry point.
|
|
534
|
+
|
|
535
|
+
The `m5-65` ABI implements `concat`, `indexOf`, `lastIndexOf`, `includes`,
|
|
536
|
+
`startsWith`, `endsWith`, `slice`, and `substring` on the same realm-owned
|
|
537
|
+
prototype. Each method converts its receiver before later operands. Search
|
|
538
|
+
methods preserve search-value-before-position conversion, the predicate methods
|
|
539
|
+
reject a true `@@match` result before search-value conversion, and matching
|
|
540
|
+
uses UTF-16 code units. Converted indices use their method-specific defaults,
|
|
541
|
+
clamping, negative-relative behavior, and endpoint swapping.
|
|
542
|
+
|
|
543
|
+
The `localeCompare`, `match`, `replace`, `search`, `split`,
|
|
544
|
+
`toLocaleLowerCase`, `toLocaleUpperCase`, `toLowerCase`, `toUpperCase`, and
|
|
545
|
+
`trim` methods retain their source-located M5b boundary. The generated-code ABI
|
|
546
|
+
again gains no entry point; the added intrinsic code IDs remain
|
|
547
|
+
runtime-internal.
|
|
548
|
+
|
|
549
|
+
The `m5-66` ABI adds ordinary `filter` and `map` functions to the same
|
|
550
|
+
prototype. Both retain the snapshot-length HasProperty and Get loop, then
|
|
551
|
+
create their result through ArraySpeciesCreate. An actual Array reads its
|
|
552
|
+
`constructor` and then `Symbol.species`; a nullish species selects the realm
|
|
553
|
+
Array, and any other species must be a constructor.
|
|
554
|
+
|
|
555
|
+
`map` defines each visited index and preserves holes in its requested-length
|
|
556
|
+
result, while `filter` defines selected values consecutively in its zero-length
|
|
557
|
+
result. A non-Array receiver skips both species reads and uses the realm Array.
|
|
558
|
+
The generated-code ABI gains no entry point.
|
|
559
|
+
|
|
560
|
+
The `m5-67` ABI completes `Promise.all` and `Promise.race` over the
|
|
561
|
+
materialized intrinsic. Both statics build a capability from their receiver,
|
|
562
|
+
read its `resolve` property once before acquiring the iterator, and call that
|
|
563
|
+
method with the receiver for every iterated value. `Promise.all` retains one
|
|
564
|
+
guarded fulfillment closure per index and one shared rejection closure;
|
|
565
|
+
`Promise.race` shares both settlement closures. An abrupt resolve call, `then`
|
|
566
|
+
getter, or `then` call closes an unfinished iterator before rejecting, while an
|
|
567
|
+
abrupt iterator step or final capability resolution preserves the completed
|
|
568
|
+
iterator state. The generated-code ABI gains no entry point.
|
|
569
|
+
|
|
570
|
+
The `m5-69` ABI adds ordinary `concat`, `flat`, `flatMap`, `join`, `slice`,
|
|
571
|
+
`toLocaleString`, and `toString` functions. Copying methods preserve holes,
|
|
572
|
+
observable indexed access, and abrupt completion. `concat` applies
|
|
573
|
+
`Symbol.isConcatSpreadable`; it, `flat`, `flatMap`, and `slice` allocate Array
|
|
574
|
+
results through ArraySpeciesCreate. Flattening skips holes, observes nested
|
|
575
|
+
Array elements recursively, and enforces the runtime's deterministic call depth
|
|
576
|
+
limit for cyclic or unbounded input.
|
|
577
|
+
|
|
578
|
+
`join` and `toLocaleString` retain their distinct element conversion rules,
|
|
579
|
+
including recursion-safe Array stringification. During element conversion,
|
|
580
|
+
re-entry through `join`, `toString`, or `toLocaleString` on the same active
|
|
581
|
+
receiver renders an empty string. These methods and ordinary string conversion
|
|
582
|
+
that reaches intrinsic Array `toString` reject a length above `2**32 - 1` with
|
|
583
|
+
a catchable `TypeError`.
|
|
584
|
+
|
|
585
|
+
Runtime string construction follows the Node.js and Deno ceiling of 536,870,888
|
|
586
|
+
UTF-16 code units and throws a catchable `RangeError` before publishing a
|
|
587
|
+
larger string. `toString` calls a callable `join` or falls back to
|
|
588
|
+
`Object.prototype.toString`. The generated-code ABI gains no entry point.
|
|
589
|
+
|
|
590
|
+
The `m5-70` ABI materializes `Map`, its keyed collection storage, and
|
|
591
|
+
`%MapIteratorPrototype%`. `[[MapData]]` is a plain growable array searched by
|
|
592
|
+
SameValueZero. A delete or clear marks a record dead in place instead of
|
|
593
|
+
removing it, so a live `%MapIteratorPrototype%.next` walking the same array by
|
|
594
|
+
index never skips or misaligns past a concurrent mutation. A key deleted and
|
|
595
|
+
re-added reappears at the end of insertion order rather than its original
|
|
596
|
+
position. `set` normalizes a `-0` key to `+0` only when it creates a new record.
|
|
597
|
+
|
|
598
|
+
The constructor reads `set` once and calls it for every iterated two-element
|
|
599
|
+
entry, closing an unfinished iterable on a non-object entry, a failed element
|
|
600
|
+
read, or an abrupt `set` call. `forEach` re-reads the entry array on every
|
|
601
|
+
step, so a `set` call from inside the callback that grows the backing storage
|
|
602
|
+
is still observed. `groupBy` builds its result directly into a fresh map's
|
|
603
|
+
records instead of through an observable `set` lookup. The generated-code ABI
|
|
604
|
+
gains no entry point.
|
|
605
|
+
|
|
606
|
+
The `m5-72` ABI adds the *runtime\_bigint\_object.c* component and materializes
|
|
607
|
+
the callable `BigInt` intrinsic, `%BigInt.prototype%`, and their own properties
|
|
608
|
+
over the already admitted primitive. `BigInt` has a `[[Construct]]` slot, so
|
|
609
|
+
class heritage and generic constructor selection see it as a constructor, but
|
|
610
|
+
every direct or derived construction throws `TypeError` before any conversion.
|
|
611
|
+
Its `prototype` is a non-writable, non-enumerable, non-configurable own
|
|
612
|
+
property whose value is an ordinary object with no `[[BigIntData]]` slot.
|
|
613
|
+
|
|
614
|
+
The callable path applies `ToPrimitive` with the number hint exactly once,
|
|
615
|
+
converts an integral Number exactly and rejects `NaN`, an infinity, and a
|
|
616
|
+
fractional value with `RangeError`, and otherwise applies the shared
|
|
617
|
+
`ToBigInt`, which rejects a Number, a Symbol, `undefined`, and `null` with
|
|
618
|
+
`TypeError` and an unparseable string with `SyntaxError`.
|
|
619
|
+
|
|
620
|
+
`BigInt.asIntN` and `BigInt.asUintN` convert the width through `ToIndex` before
|
|
621
|
+
the operand through `ToBigInt`, then truncate to the exact value modulo
|
|
622
|
+
`2**bits` inside a width-bounded two's complement, so a width above the
|
|
623
|
+
operand's bit length never materializes `2**bits`. `BigInt.asUintN` of a
|
|
624
|
+
negative operand is the one request whose result grows to the full width and
|
|
625
|
+
rejects a width past the reviewed 65,536-bit ceiling with a catchable
|
|
626
|
+
`RangeError`.
|
|
627
|
+
|
|
628
|
+
`%BigInt.prototype%.toString` checks its receiver brand before converting an
|
|
629
|
+
optional radix, admits radix 2 through 36 using lowercase `a` through `z` for
|
|
630
|
+
digit values 10 through 35, and shares one exact repeated-division conversion
|
|
631
|
+
with ordinary BigInt string conversion. `toLocaleString` returns the base
|
|
632
|
+
specification's own fallback, `thisBigIntValue` followed by `ToString`.
|
|
633
|
+
`valueOf` returns the receiver's primitive. All three admit a BigInt primitive
|
|
634
|
+
or a BigInt wrapper object and reject every other receiver, including
|
|
635
|
+
`%BigInt.prototype%` itself. `%BigInt.prototype%` carries `Symbol.toStringTag`
|
|
636
|
+
`"BigInt"`. The generated-code ABI gains no entry point.
|
|
637
|
+
|
|
638
|
+
The `m5-73` ABI adds the *runtime\_data\_view.c* component and materializes
|
|
639
|
+
`%DataView%` and `%DataView.prototype%` over the already admitted `ArrayBuffer`
|
|
640
|
+
Data Block. `DataView` is a constructor the global object binds as a writable,
|
|
641
|
+
non-enumerable, configurable property, so calling it without `new` throws
|
|
642
|
+
`TypeError`. It requires an `ArrayBuffer` argument, runs `ToIndex` over
|
|
643
|
+
`byteOffset` and then over `byteLength`, and validates the detached state and
|
|
644
|
+
both bounds once before and once after `OrdinaryCreateFromConstructor` reads
|
|
645
|
+
the new target's `prototype`, so arbitrary code in that read observes the
|
|
646
|
+
specified second rejection. An absent `byteLength` fixes the view's length over
|
|
647
|
+
a fixed-length buffer and makes it length-tracking over a resizable one.
|
|
648
|
+
|
|
649
|
+
A view owns no Data Block. It holds only its buffer's value, so the collector
|
|
650
|
+
keeps the block alive by tracing the buffer, and nothing in the component
|
|
651
|
+
allocates, resizes, or releases a block. Every accessor and every element
|
|
652
|
+
access recomputes the buffer's detached state and byte length, so a detached or
|
|
653
|
+
shrunk buffer produces the specified `TypeError` from `byteLength`,
|
|
654
|
+
`byteOffset`, and every `get` and `set`, while `buffer` still reports the
|
|
655
|
+
detached buffer. A zero-length view exactly at the end of its buffer stays in
|
|
656
|
+
bounds.
|
|
657
|
+
|
|
658
|
+
The eleven `get` and eleven `set` accessors cover `Int8`, `Uint8`, `Int16`,
|
|
659
|
+
`Uint16`, `Int32`, `Uint32`, `Float16`, `Float32`, `Float64`, `BigInt64`, and
|
|
660
|
+
`BigUint64`. Each `get` accessor runs `ToIndex` over the byte offset, then
|
|
661
|
+
`ToBoolean` over the byte-order flag; each `set` accessor runs `ToIndex`, then
|
|
662
|
+
`ToNumber` or `ToBigInt` over the stored value, then `ToBoolean`. Both then run
|
|
663
|
+
the out-of-bounds `TypeError` and the range `RangeError`, so a conversion that
|
|
664
|
+
detaches or shrinks the buffer still reaches the specified rejection. A
|
|
665
|
+
one-byte accessor takes no byte-order parameter: it passes little-endian
|
|
666
|
+
directly and runs no `ToBoolean`.
|
|
667
|
+
|
|
668
|
+
The integer element types truncate and wrap modulo the element width in two's
|
|
669
|
+
complement. The float element types round to nearest with ties to even using
|
|
670
|
+
exact integer arithmetic over the operand's own binary64 encoding, so no
|
|
671
|
+
narrowing floating conversion happens and no operand can reach an out-of-range
|
|
672
|
+
one. `Float64` is bit-preserving, a signed zero keeps its sign, and a NaN keeps
|
|
673
|
+
its class. Each element moves through a local byte buffer rather than a cast,
|
|
674
|
+
so an unaligned access is ordinary, and every index and size comparison is
|
|
675
|
+
written so that no host addition can wrap. `ArrayBuffer.isView` now reports the
|
|
676
|
+
one admitted view kind. The generated-code ABI gains no entry point.
|
|
677
|
+
|
|
678
|
+
The `m5-74` ABI records the admitted regular expression Unicode property and
|
|
679
|
+
character class escape checkpoint. The frontend resolves exact ECMA-262 names
|
|
680
|
+
through the pinned Unicode 17.0.0 tables, while the existing generic matcher
|
|
681
|
+
remains the semantic authority for those sets. This checkpoint changes no C
|
|
682
|
+
layout, runtime component, generated-code entry point, allocation path, or
|
|
683
|
+
built-in code range.
|
|
684
|
+
|
|
685
|
+
The `m5-75` ABI adds the *runtime\_regexp.c* component and materializes the
|
|
686
|
+
callable and constructible `%RegExp%` intrinsic, `%RegExp.prototype%`, the
|
|
687
|
+
constructor link, and the `Symbol.species` accessor. `IsRegExp` observes
|
|
688
|
+
`Symbol.match` before the native brand. Calling the intrinsic uses it as
|
|
689
|
+
`newTarget` and preserves the same-constructor identity case.
|
|
690
|
+
|
|
691
|
+
Construction retains the actual `newTarget`, reads its `prototype`, and
|
|
692
|
+
allocates an object with one writable, non-enumerable, non-configurable
|
|
693
|
+
`lastIndex` data property initialized to zero. Pattern conversion precedes
|
|
694
|
+
flags conversion only after allocation. A separately allocated immutable
|
|
695
|
+
matcher artifact owns the converted source, decoded flags, capture count, and
|
|
696
|
+
instruction budget, and the collector traces the RegExp-to-artifact-to-strings
|
|
697
|
+
ownership chain. Invalid dynamic patterns and flags throw a catchable
|
|
698
|
+
`SyntaxError`; unadmitted pattern extensions and resource limits retain
|
|
699
|
+
`OSEO2001`. Prototype execution, result construction, accessors, symbol
|
|
700
|
+
methods, and String integration remain later RegExp nodes. The generated-code
|
|
701
|
+
ABI gains no entry point.
|
|
702
|
+
|
|
703
|
+
The `m5-76` ABI adds ordinary `sort` and `toSorted` functions to
|
|
704
|
+
`%Array.prototype%` and removes `sort` from the unadmitted boundary table. Both
|
|
705
|
+
reject a non-callable comparator before converting the receiver, then read
|
|
706
|
+
every index into one collected list before the first comparison. `sort` skips
|
|
707
|
+
holes so that they collapse behind the sorted elements, and `toSorted` reads
|
|
708
|
+
through them so that a hole becomes an undefined element of the copy.
|
|
709
|
+
|
|
710
|
+
An undefined element orders after every defined one without reaching the
|
|
711
|
+
comparator. A supplied comparator decides every other pair through `ToNumber`
|
|
712
|
+
with `NaN` read as `+0`, and the default comparator compares the `ToString`
|
|
713
|
+
results in code-unit order. The collected list and its merge scratch buffer are
|
|
714
|
+
rooted for the whole sort, so the required stability and the first abrupt
|
|
715
|
+
comparison both survive collection.
|
|
716
|
+
|
|
717
|
+
`sort` writes the sorted elements back and deletes the trailing indices, while
|
|
718
|
+
`toSorted` fills a plain Array allocated before any element is read and
|
|
719
|
+
therefore never observes `constructor` or `Symbol.species`. Both code IDs come
|
|
720
|
+
from the existing Array range, and the generated-code ABI gains no entry point.
|
|
721
|
+
|
|
722
|
+
The `m5-77` ABI adds the *runtime\_regexp\_matcher.c* component and admits
|
|
723
|
+
built-in regular expression execution. The new component compiles one validated
|
|
724
|
+
pattern into an owned instruction program over a register file and executes it
|
|
725
|
+
with an explicit backtrack stack and undo trail, so backtracking depth is data
|
|
726
|
+
rather than native recursion and every owned boundary is deterministic.
|
|
727
|
+
|
|
728
|
+
`RegExp.prototype.exec` performs the specified `lastIndex` conversion, position
|
|
729
|
+
loop, and update and builds the match result with `index`, `input`, `groups`,
|
|
730
|
+
and optional `indices`. `test` dispatches through an overridden `exec`.
|
|
731
|
+
`toString` reads `source` and `flags` generically, and the `source`, `flags`,
|
|
732
|
+
and eight individual flag accessors answer from the artifact. The matcher
|
|
733
|
+
artifact gains an owned program pointer the collector releases with the
|
|
734
|
+
artifact, and the RegExp built-in code range replaces its one shared
|
|
735
|
+
deferred-method ID with thirteen dedicated IDs, so nineteen of its two hundred
|
|
736
|
+
fifty-six IDs are occupied. The generated-code ABI gains no entry point.
|
|
737
|
+
|
|
738
|
+
The `m5-83` ABI adds ordinary `reduce` and `reduceRight` functions to
|
|
739
|
+
`%Array.prototype%` and removes both from the unadmitted boundary table. One
|
|
740
|
+
accumulator loop serves both methods. The receiver is converted and its length
|
|
741
|
+
read before the callable check. `reduce` visits ascending indices and
|
|
742
|
+
`reduceRight` descending ones over the shared HasProperty/Get path, and holes
|
|
743
|
+
are skipped. Initial-value presence follows the argument count, a missing
|
|
744
|
+
initial value is replaced by the first present element in traversal order, and
|
|
745
|
+
a traversal that ends without an accumulator throws a catchable TypeError.
|
|
746
|
+
|
|
747
|
+
The callback receives the accumulator, element, index, and converted receiver
|
|
748
|
+
with an undefined this value, and the accumulator stays rooted across user
|
|
749
|
+
code. Neither method allocates a result array, so no `constructor` or
|
|
750
|
+
`Symbol.species` read is reachable. Both code IDs come from the existing Array
|
|
751
|
+
range, and the generated-code ABI gains no entry point.
|
|
752
|
+
|
|
753
|
+
The `m5-84` ABI adds ordinary `toLowerCase`, `toUpperCase`,
|
|
754
|
+
`toLocaleLowerCase`, `toLocaleUpperCase`, `trim`, `trimStart`, `trimEnd`,
|
|
755
|
+
`normalize`, and `localeCompare` functions to `%String.prototype%`. Every
|
|
756
|
+
function rejects a nullish receiver before shared string conversion. Case
|
|
757
|
+
conversion decodes UTF-16, preserves unpaired surrogates, and applies the full
|
|
758
|
+
locale-insensitive Unicode 17.0.0 mappings, including contextual final sigma.
|
|
759
|
+
The locale forms deliberately use the same pinned default mapping instead of
|
|
760
|
+
consulting process locale state.
|
|
761
|
+
|
|
762
|
+
Trimming owns the exact ECMAScript WhiteSpace and LineTerminator set.
|
|
763
|
+
Normalization owns canonical and compatibility decomposition, combining-class
|
|
764
|
+
ordering, composition exclusions, and algorithmic Hangul for `NFC`, `NFD`,
|
|
765
|
+
`NFKC`, and `NFKD`. Locale comparison normalizes both converted operands to
|
|
766
|
+
`NFD` before deterministic UTF-16 code-unit ordering, so canonically equivalent
|
|
767
|
+
strings compare equal on every target.
|
|
768
|
+
|
|
769
|
+
The Unicode generator emits the package-private *runtime\_unicode\_tables.h*
|
|
770
|
+
asset beside the TypeScript tables from the same reviewed inputs, and the
|
|
771
|
+
package includes the Unicode permission notice. Seven code IDs in the existing
|
|
772
|
+
String range dispatch the nine function objects. The generated-code ABI gains
|
|
773
|
+
no entry point.
|
|
774
|
+
|
|
775
|
+
The `m5-85` ABI adds ordinary `at`, `includes`, `indexOf`, and `lastIndexOf`
|
|
776
|
+
functions to `%Array.prototype%` and retires the two deferred search entries.
|
|
777
|
+
All four convert the receiver, snapshot its array-like length, and apply a
|
|
778
|
+
relative index. `indexOf` and `lastIndexOf` traverse present properties in
|
|
779
|
+
opposite directions and compare with strict equality. `includes` reads through
|
|
780
|
+
holes and uses SameValueZero, while `at` performs one direct Get or returns
|
|
781
|
+
undefined out of range. The receiver and searched value stay rooted across
|
|
782
|
+
conversion and property access. All four code IDs come from the existing Array
|
|
783
|
+
range, and the generated-code ABI gains no entry point.
|
|
784
|
+
|
|
785
|
+
The `m5-88` ABI adds ordinary `pop`, `shift`, `unshift`, `splice`, `fill`,
|
|
786
|
+
`copyWithin`, and `reverse` functions and completes the existing `push`
|
|
787
|
+
function on `%Array.prototype%`. Every method converts its receiver, snapshots
|
|
788
|
+
its array-like length, and performs its specified final length update. Indexed
|
|
789
|
+
moves distinguish present sources from holes, preserving holes and inherited
|
|
790
|
+
values through the required Set and DeletePropertyOrThrow operations.
|
|
791
|
+
|
|
792
|
+
`copyWithin` selects a safe overlap direction, `reverse` observes both ends
|
|
793
|
+
before writing, and `splice` creates its result through ArraySpeciesCreate.
|
|
794
|
+
Receiver, argument, result, and moved values stay rooted across every
|
|
795
|
+
observable operation. Seven new code IDs come from the existing Array range,
|
|
796
|
+
and the generated-code ABI gains no entry point.
|
|
797
|
+
|
|
798
|
+
The `m5-93` ABI adds ordinary `find`, `findIndex`, `findLast`, and
|
|
799
|
+
`findLastIndex` functions to `%Array.prototype%`. One predicate loop serves all
|
|
800
|
+
four. The receiver is converted and its length read before the callable check.
|
|
801
|
+
`find` and `findIndex` visit ascending indices and `findLast` and
|
|
802
|
+
`findLastIndex` descending ones, and every index below the snapshot length is
|
|
803
|
+
read with Get, so a hole reaches the predicate as `undefined`.
|
|
804
|
+
|
|
805
|
+
The predicate receives the element, index, and converted receiver with the
|
|
806
|
+
caller's `this` argument. Its first truthy result returns the element or its
|
|
807
|
+
index, and an exhausted search returns `undefined` or `-1`. No method allocates
|
|
808
|
+
a result array, so no `constructor` or `Symbol.species` read is reachable, and
|
|
809
|
+
the current element stays rooted across the predicate call. All four code IDs
|
|
810
|
+
come from the existing Array range, and the generated-code ABI gains no entry
|
|
811
|
+
point.
|
|
812
|
+
|
|
813
|
+
The `m5-94` ABI completes the realm-owned `Object` constructor's ordinary
|
|
814
|
+
`keys`, `values`, `entries`, `getOwnPropertyNames`, `getOwnPropertySymbols`,
|
|
815
|
+
`assign`, `fromEntries`, `hasOwn`, and `groupBy` functions. They share the
|
|
816
|
+
existing ordinary own-key ordering and preserve descriptor rechecks, Get and
|
|
817
|
+
Set order, iterator closing, symbol identity, and null-prototype grouping. The
|
|
818
|
+
temporary default primitive String path in `groupBy` iterates Unicode code
|
|
819
|
+
points without exposing the separate String iterator node.
|
|
820
|
+
|
|
821
|
+
`oseo_internal_own_property_descriptor` becomes the one own-property query
|
|
822
|
+
every reflective path uses, so the virtual
|
|
823
|
+
%String.prototype%[`Symbol.iterator`] reports the same existence and attributes
|
|
824
|
+
to HasOwnProperty, `propertyIsEnumerable`, the `in` operator, descriptor reads,
|
|
825
|
+
redefinition rechecks, own-key spread, and assignment. An ordinary read of the
|
|
826
|
+
untouched default stops at %String.prototype%.
|
|
827
|
+
|
|
828
|
+
An assignment to that virtual property replaces it in place. A read-only one
|
|
829
|
+
refuses the assignment. A non-configurable non-writable one accepts only a
|
|
830
|
+
redefinition whose value is SameValue to the `undefined` it models and stays
|
|
831
|
+
virtual through it. The generated-code ABI gains no entry point; the added
|
|
832
|
+
intrinsic code IDs remain runtime-internal.
|
|
833
|
+
|
|
834
|
+
The `m5-97` ABI completes the realm-owned Array iterator cluster. Ordinary
|
|
835
|
+
`entries`, `keys`, and `values` functions live on `%Array.prototype%`, whose
|
|
836
|
+
`Symbol.iterator` property references the exact `values` function object. Their
|
|
837
|
+
results share the materialized `%ArrayIteratorPrototype%`, which owns `next`
|
|
838
|
+
and the `"Array Iterator"` `Symbol.toStringTag` while inheriting the iterator
|
|
839
|
+
protocol from `%IteratorPrototype%`.
|
|
840
|
+
|
|
841
|
+
One internal enum distinguishes key, value, and key-value records. Every step
|
|
842
|
+
reads the converted receiver's live array-like length, advances the cursor
|
|
843
|
+
before an element Get, and clears the target permanently at exhaustion. Keys
|
|
844
|
+
avoid indexed reads, values preserve sparse and inherited lookup, and entries
|
|
845
|
+
allocate a fresh two-element Array. The iterator target and pending result stay
|
|
846
|
+
collector-rooted throughout. Two code IDs and two intrinsic slots are added;
|
|
847
|
+
the generated-code ABI gains no entry point.
|
|
848
|
+
|
|
849
|
+
The `m5-111` ABI adds `SharedArrayBuffer` and the single-agent `Atomics`
|
|
850
|
+
namespace. A shared buffer is the ArrayBuffer record with a shared brand, so
|
|
851
|
+
views accept it unchanged. Seven SharedArrayBuffer code IDs join the
|
|
852
|
+
ArrayBuffer range, code range index 25 holds the thirteen Atomics functions,
|
|
853
|
+
the public intrinsic table gains four slots, the heap gains the Atomics waiter
|
|
854
|
+
kind, and the public context gains the rooted WaiterList head and tail; the
|
|
855
|
+
value representation and the generated-code entry points are unchanged.
|
|
856
|
+
|
|
857
|
+
The `m5-109` ABI completes the TypedArray integer-indexed exotic object and
|
|
858
|
+
adds the core `%TypedArray.prototype%` accessors, `at`, `set`, `subarray`, the
|
|
859
|
+
three iterator methods, and the `%TypedArray%[Symbol.species]` getter. Twelve
|
|
860
|
+
TypedArray code IDs and one public intrinsic slot, which holds the original
|
|
861
|
+
`Array.prototype.toString` that `%TypedArray.prototype%.toString` shares, are
|
|
862
|
+
added; the value representation and the generated-code entry points are
|
|
863
|
+
unchanged.
|
|
864
|
+
|
|
865
|
+
The `m5-106` ABI materializes `%TypedArray%` and all eleven concrete
|
|
866
|
+
element-type constructors. Views retain a collector-traced `ArrayBuffer`
|
|
867
|
+
reference plus their element kind, byte offset, and fixed or length-tracking
|
|
868
|
+
element length. Construction accepts an element length, a buffer, an iterable,
|
|
869
|
+
an array-like object, or another typed array; Number and BigInt content types
|
|
870
|
+
remain distinct. Indexed element conversion and access are internal runtime
|
|
871
|
+
operations, and every byte access reacquires the backing buffer after a
|
|
872
|
+
possible safepoint.
|
|
873
|
+
|
|
874
|
+
The public intrinsic table grows by 24 slots and the runtime adds one internal
|
|
875
|
+
heap kind for the view record; the value representation and the generated-code
|
|
876
|
+
entry points are unchanged. Deferred prototype and static API lookups report
|
|
877
|
+
their later M5b owner instead of returning `undefined`, while own and
|
|
878
|
+
intermediate prototype properties continue to shadow those defaults.
|
|
879
|
+
|
|
880
|
+
The `m5-99` ABI extends `oseo_context_print_thrown` to a thrown value with no
|
|
881
|
+
intrinsic error identity. The identity is the `name` of the value's
|
|
882
|
+
`constructor` read with ordinary property access, and the message is its
|
|
883
|
+
`message` property converted through the generic string coercion. A user error
|
|
884
|
+
class such as a test262 harness `Test262Error` therefore renders as
|
|
885
|
+
`Name: message` and reports the same identity in its `OSEO_THROWN` marker.
|
|
886
|
+
|
|
887
|
+
The marker is one whitespace-free token. An identity outside the ASCII
|
|
888
|
+
identifier shape, an abrupt or non-object `constructor` or non-string `name`,
|
|
889
|
+
and a thrown primitive all keep the untyped-throw diagnostic and print no
|
|
890
|
+
marker. The identity read and message conversion run user JavaScript, so the
|
|
891
|
+
throw site is restored around them and the thrown value stays rooted. An abrupt
|
|
892
|
+
or unusable identity read leaves the value unidentified and keeps the
|
|
893
|
+
untyped-throw diagnostic. An abrupt message read or conversion keeps the
|
|
894
|
+
established identity and renders it alone.
|
|
895
|
+
|
|
896
|
+
The rendering applies to the unhandled-throw diagnostic only. An unhandled
|
|
897
|
+
rejection is a separate reviewed host-policy boundary reported by its own text,
|
|
898
|
+
so a rejected value with no intrinsic error identity leaves that path
|
|
899
|
+
unchanged: the boundary text alone, with no identity read and no marker. An
|
|
900
|
+
intrinsic error instance keeps the rendering and marker it already had on both
|
|
901
|
+
paths. No component, code ID, or generated-code entry point is added.
|
|
902
|
+
|
|
903
|
+
The `m5-101` ABI adds the *runtime\_date.c* component and materializes `%Date%`
|
|
904
|
+
and `%Date.prototype%`. `Date` is a constructor the global object binds as a
|
|
905
|
+
writable, non-enumerable, configurable property. Calling it without `new`
|
|
906
|
+
ignores every argument and returns the current time as a String. Constructing
|
|
907
|
+
it copies an existing Date's `[[DateValue]]` without converting it, parses a
|
|
908
|
+
String argument, converts any other single argument through `ToPrimitive` then
|
|
909
|
+
`ToNumber`, and otherwise converts each of the seven components in order before
|
|
910
|
+
`OrdinaryCreateFromConstructor` reads the new target's `prototype`.
|
|
911
|
+
`%Date.prototype%` is an ordinary object with no `[[DateValue]]`, so every
|
|
912
|
+
slot-reading method rejects it.
|
|
913
|
+
|
|
914
|
+
The realm's local time zone is UTC. `LocalTZA` is the constant +0, so
|
|
915
|
+
`LocalTime` and `UTC` are identities on a finite time value,
|
|
916
|
+
`getTimezoneOffset` reports +0, and every local getter agrees with its UTC
|
|
917
|
+
counterpart. That is a host choice ECMA-262 permits; the clock adapter has no
|
|
918
|
+
time-zone capability.
|
|
919
|
+
|
|
920
|
+
The component reads no host clock. The current time is the realm's epoch
|
|
921
|
+
real-time capability through `oseo_clock_real_time`, rounded down to its
|
|
922
|
+
millisecond and passed through `TimeClip`. An adapter without real time reports
|
|
923
|
+
the owned `OSEO2001` diagnostic “The host real-time clock is unavailable.”
|
|
924
|
+
Reading it opens the realm's clock adapter if nothing has yet but never takes
|
|
925
|
+
the scheduler's monotonic origin.
|
|
926
|
+
|
|
927
|
+
The forty-four prototype methods cover the eighteen getters, the fifteen
|
|
928
|
+
setters, `toDateString`, `toISOString`, `toJSON`, the three locale methods,
|
|
929
|
+
`toString`, `toTimeString`, `toUTCString`, `valueOf`, and
|
|
930
|
+
`[Symbol.toPrimitive]`. Each component setter reads the receiver's
|
|
931
|
+
`[[DateValue]]` first, then converts its first parameter whether or not the
|
|
932
|
+
call supplied it and each supplied trailing parameter in order. The NaN test
|
|
933
|
+
and every component the call does not supply read that one snapshot, so a
|
|
934
|
+
conversion that stores a new time value into the same Date does not change the
|
|
935
|
+
result. A year-first setter starts from +0 when the snapshot is NaN, and every
|
|
936
|
+
other window leaves the slot untouched and reports NaN.
|
|
937
|
+
|
|
938
|
+
ECMA-402 is outside this claim, so each locale method reports the text of the
|
|
939
|
+
operation it localizes. `Date.parse` accepts the Date Time String Format of
|
|
940
|
+
21.4.1.32, including expanded years and UTC offsets, and additionally recovers
|
|
941
|
+
this realm's own `toString` and `toUTCString` texts, which is the non-normative
|
|
942
|
+
recommendation of 21.4.3.2. `Object.prototype.toString` reports the `Date`
|
|
943
|
+
builtin tag, and `ToPrimitive` on a Date reaches `OrdinaryToPrimitive` through
|
|
944
|
+
the shared conversion *runtime\_primitive.c* now exports. One built-in code
|
|
945
|
+
range, forty-eight code IDs, and two intrinsic slots are added; the
|
|
946
|
+
generated-code ABI gains no entry point.
|
|
947
|
+
|
|
948
|
+
The `m5-102` ABI materializes %String.prototype%[`Symbol.iterator`] and
|
|
949
|
+
`%StringIteratorPrototype%`. The method snapshots `ToString(this)` and its
|
|
950
|
+
branded iterator advances through UTF-16 by Unicode code point, pairing a lead
|
|
951
|
+
and trailing surrogate while preserving lone surrogates. The iterator target is
|
|
952
|
+
collector-traced and cleared at permanent exhaustion. Two code IDs are
|
|
953
|
+
allocated inside the existing iterator range and three intrinsic slots are
|
|
954
|
+
added; the generated-code ABI gains no entry point.
|
|
955
|
+
|
|
956
|
+
The `m5-104` ABI materializes `%Set%`, `%Set.prototype%`, and
|
|
957
|
+
`%SetIteratorPrototype%`. A Set owns an insertion-ordered element vector whose
|
|
958
|
+
deleted slots remain as iterator tombstones and whose lookup uses
|
|
959
|
+
SameValueZero. Its constructor calls the instance's observable `add` method,
|
|
960
|
+
closes the input iterator after an abrupt add, and selects a derived
|
|
961
|
+
constructor's prototype through the generic property path. Live iterators and
|
|
962
|
+
`forEach` observe deletion, append, clear, and re-insertion without losing
|
|
963
|
+
their forward cursor. Public runtime layout is unchanged; the runtime adds
|
|
964
|
+
internal Set and Set iterator heap kinds.
|
|
965
|
+
|
|
966
|
+
The `m5-107` ABI adds the collector-only weak-edge checkpoint. Ephemeron
|
|
967
|
+
entries park on unmarked key objects and activate through the ordinary worklist
|
|
968
|
+
to a fixed point. Dead weak targets then clear and dead ephemeron entries
|
|
969
|
+
unlink before sweep, so the sweep reclaims each dead entry record.
|
|
970
|
+
|
|
971
|
+
Marked finalization registries append each collection's eligible cells, sorted
|
|
972
|
+
by registration order, to a rooted context FIFO without allocating or invoking
|
|
973
|
+
callbacks during collection. A consumed cell unlinks from its registry at the
|
|
974
|
+
next collection. Nine private runtime helpers let the later weak-collections
|
|
975
|
+
component create these records and consume cleanup records into rooted slots.
|
|
976
|
+
No JavaScript global, intrinsic, built-in code ID, or generated-code operation
|
|
977
|
+
is added at this checkpoint.
|
|
978
|
+
|
|
979
|
+
The entry chain serves collector traversal rather than JavaScript lookup. The
|
|
980
|
+
later component owns an address-keyed index and the job-scoped strong root
|
|
981
|
+
required by `WeakRef.prototype.deref`, together with its next ABI increment.
|
|
982
|
+
|
|
983
|
+
The `m5-110` ABI adds the Set composition methods `union`, `intersection`,
|
|
984
|
+
`difference`, `symmetricDifference`, `isSubsetOf`, `isSupersetOf`, and
|
|
985
|
+
`isDisjointFrom` over GetSetRecord. Each validates its Set receiver, reads a
|
|
986
|
+
set-like operand's `size`, `has`, and `keys`. `union` and `symmetricDifference`
|
|
987
|
+
always walk `keys`; `intersection`, `difference`, and `isDisjointFrom` choose a
|
|
988
|
+
`has` or `keys` walk by comparing sizes; and `isSubsetOf` and `isSupersetOf`
|
|
989
|
+
answer `false` from sizes before a `has` or a `keys` walk respectively.
|
|
990
|
+
Constructive results are fresh Sets on the realm's `%Set.prototype%`. Seven
|
|
991
|
+
code IDs are allocated inside the existing Set range; no intrinsic slot, heap
|
|
992
|
+
kind, public layout, or generated-code entry point is added.
|
|
993
|
+
|
|
994
|
+
The `m5-112` ABI adds the TypedArray iteration methods `every`, `some`,
|
|
995
|
+
`forEach`, `map`, `filter`, `reduce`, and `reduceRight`. Each validates its
|
|
996
|
+
receiver and snapshots the view length before checking the callback, then reads
|
|
997
|
+
every snapshot index through the existing integer-indexed element getter
|
|
998
|
+
without a hole test, so a callback that detaches or shrinks the buffer only
|
|
999
|
+
makes later reads `undefined`. `map` species-creates before its first callback
|
|
1000
|
+
and `filter` collects first and species-creates with the captured count;
|
|
1001
|
+
`reduce` and `reduceRight` share one bidirectional snapshot walk. Seven code
|
|
1002
|
+
IDs are allocated inside the existing TypedArray range; no intrinsic slot, heap
|
|
1003
|
+
kind, public layout, or generated-code entry point is added.
|
|
1004
|
+
|
|
1005
|
+
The `m5-113` ABI materializes `WeakMap`, `WeakSet`, `WeakRef`, and
|
|
1006
|
+
`FinalizationRegistry` in *runtime\_weak\_collection.c*. Each source-visible
|
|
1007
|
+
object wraps one collector weak record. Ephemeron tables gain an address-keyed
|
|
1008
|
+
index that deletion and collector unlinking keep synchronized, and finalization
|
|
1009
|
+
cells gain weak unregister tokens. The public context gains the job-scoped
|
|
1010
|
+
KeptAlive set behind `WeakRef` construction and `deref`.
|
|
1011
|
+
|
|
1012
|
+
The job queue clears that set before every promise job. The event loop clears
|
|
1013
|
+
it before every timer turn and after each script or timer turn and its promise
|
|
1014
|
+
jobs, then runs queued cleanup records as separate jobs in queue order before
|
|
1015
|
+
the next timer, including each timer an internal await drives.
|
|
1016
|
+
|
|
1017
|
+
The `m5-114` ABI adds the TypedArray search and join methods `find`,
|
|
1018
|
+
`findIndex`, `findLast`, `findLastIndex`, `includes`, `indexOf`, `lastIndexOf`,
|
|
1019
|
+
`join`, and `toLocaleString`. Each validates its receiver and snapshots the
|
|
1020
|
+
view length first. The predicate searches and `includes` read every visited
|
|
1021
|
+
snapshot index through the integer-indexed element getter, `indexOf` and
|
|
1022
|
+
`lastIndexOf` also test integer-indexed presence, and an empty view answers
|
|
1023
|
+
before fromIndex is converted. `join` converts its separator after the snapshot
|
|
1024
|
+
and `toLocaleString` forwards the outer locales and options to each element's
|
|
1025
|
+
method; both render an invalidated index as an empty field and share the Array
|
|
1026
|
+
stringification stack for re-entry. Nine code IDs are allocated inside the
|
|
1027
|
+
existing TypedArray range; no intrinsic slot, heap kind, public layout, or
|
|
1028
|
+
generated-code entry point is added.
|
|
1029
|
+
|
|
1030
|
+
The `m5-115` ABI adds ordinary `with`, `toSpliced`, and `toReversed` functions
|
|
1031
|
+
to `%Array.prototype%`. Each converts its receiver, snapshots its array-like
|
|
1032
|
+
length, allocates a plain realm Array without reading `constructor` or
|
|
1033
|
+
`Symbol.species`, and copies retained indices with Get followed by
|
|
1034
|
+
CreateDataProperty. Holes become own `undefined` properties, inherited values
|
|
1035
|
+
are copied, and the original receiver is never written. `toReversed` reads in
|
|
1036
|
+
descending source order, `toSpliced` skips deleted entries, and `with` skips
|
|
1037
|
+
the replaced index. Three code IDs come from the existing Array range; the
|
|
1038
|
+
generated-code ABI gains no entry point.
|
|
1039
|
+
|
|
1040
|
+
The `m5-116` ABI completes the `Symbol` intrinsic with `for`, `keyFor`, and the
|
|
1041
|
+
`%Symbol.prototype%` methods, description getter, `Symbol.toPrimitive` method,
|
|
1042
|
+
and tag. The GlobalSymbolRegistry is a process-wide open-addressed table of
|
|
1043
|
+
immutable UTF-16 keys that is never freed. The public context gains the
|
|
1044
|
+
`registered_symbols` table of one collector-rooted representative per entry, so
|
|
1045
|
+
`Symbol.for` returns the same heap value on every call.
|
|
1046
|
+
|
|
1047
|
+
The registry entry, not the heap value, is the identity. Strict and loose
|
|
1048
|
+
equality, SameValue, SameValueZero, property keys, and Map and Set keys treat
|
|
1049
|
+
two contexts' representatives of one entry as one symbol. A property key, a Map
|
|
1050
|
+
key, and a Set element are always the storing context's own representative. A
|
|
1051
|
+
value position, such as an ordinary property value, an array element, a Map
|
|
1052
|
+
value, or a settled promise's result, keeps whatever representative reached it.
|
|
1053
|
+
A representative therefore outlives the context that created it: destroying a
|
|
1054
|
+
context takes its representatives and their descriptions out of that heap
|
|
1055
|
+
rather than freeing them, and every store another context made stays readable
|
|
1056
|
+
and keeps naming the same registry entry.
|
|
1057
|
+
|
|
1058
|
+
Six code IDs are allocated inside the existing Symbol range and six intrinsic
|
|
1059
|
+
slots are added; no heap kind or generated-code entry point is. A value can be
|
|
1060
|
+
held weakly when it is an object or an unregistered symbol. A symbol the
|
|
1061
|
+
registry returned is registered, and `WeakMap.prototype.set`,
|
|
1062
|
+
`WeakSet.prototype.add`, `WeakRef`, and
|
|
1063
|
+
`FinalizationRegistry.prototype.register` and `unregister` reject it.
|
|
1064
|
+
|
|
1065
|
+
The `m5-117` ABI adds the TypedArray mutation and copying methods `copyWithin`,
|
|
1066
|
+
`fill`, `reverse`, `slice`, `toReversed`, and `with`. Each validates its
|
|
1067
|
+
receiver and snapshots the view length before converting an argument. `fill`
|
|
1068
|
+
then revalidates unconditionally, and `copyWithin` and `slice` revalidate only
|
|
1069
|
+
when their clamped count is positive. Each throws a `TypeError` on an
|
|
1070
|
+
out-of-bounds view and clamps its write to the bytes the Data Block still holds.
|
|
1071
|
+
|
|
1072
|
+
`with` instead answers IsValidIntegerIndex against the view its conversions
|
|
1073
|
+
left behind and throws a `RangeError` when the index no longer addresses an
|
|
1074
|
+
element. `slice` builds its result through TypedArraySpeciesCreate;
|
|
1075
|
+
`toReversed` and `with` allocate the receiver's own element kind without
|
|
1076
|
+
consulting `Symbol.species`. `reverse`, `toReversed`, the same-kind branch of
|
|
1077
|
+
`slice`, and the surviving prefix of `with` move raw bytes, so an element's
|
|
1078
|
+
exact encoding survives. Six code IDs are allocated inside the existing
|
|
1079
|
+
TypedArray range; no intrinsic slot, heap kind, public layout, or
|
|
1080
|
+
generated-code entry point is added.
|
|
1081
|
+
|
|
1082
|
+
The `m5-118` ABI adds `String.prototype.repeat`, `padStart`, `padEnd`,
|
|
1083
|
+
`isWellFormed`, and `toWellFormed` within the existing String component and
|
|
1084
|
+
built-in code range. Repetition and padding enforce the reviewed maximum UTF-16
|
|
1085
|
+
length before allocation, padding converts its filler only when padding is
|
|
1086
|
+
needed, and the well-formedness pair detects or replaces lone surrogates
|
|
1087
|
+
without disturbing valid pairs. The generated-code ABI gains no entry point.
|
|
1088
|
+
|
|
1089
|
+
The `m5-119` ABI materializes the callable and constructible `%Boolean%`, its
|
|
1090
|
+
false-valued prototype, branded wrapper objects, and the prototype's branded
|
|
1091
|
+
`toString` and `valueOf` methods in *runtime\_boolean.c*. Three code IDs use a
|
|
1092
|
+
new Boolean built-in range, and three intrinsic slots are added. The public
|
|
1093
|
+
context layout expands with those slots; the generated-code ABI gains no entry
|
|
1094
|
+
point.
|
|
1095
|
+
|
|
1096
|
+
The `m5-120` ABI completes PromiseResolve for native Promise values. It reads
|
|
1097
|
+
the value's `constructor` through ordinary property access and reuses the value
|
|
1098
|
+
only when that result is the selected constructor. A different constructor
|
|
1099
|
+
creates and settles a fresh capability, and an abrupt getter propagates before
|
|
1100
|
+
capability construction. Non-Promise thenables skip this constructor read.
|
|
1101
|
+
Await and asynchronous-generator drivers deliver that abrupt completion through
|
|
1102
|
+
their existing rejection or throw continuation instead of returning it
|
|
1103
|
+
synchronously. No built-in code ID, intrinsic slot, heap kind, public layout,
|
|
1104
|
+
or generated-code entry point is added.
|
|
1105
|
+
|
|
1106
|
+
The `m5-121` ABI adds `%TypedArray.prototype%.sort` and `toSorted`. Both
|
|
1107
|
+
validate a supplied comparator before the receiver, capture the validated
|
|
1108
|
+
length and elements, and run one stable merge sort. The default comparator is
|
|
1109
|
+
numeric: it orders `NaN` last and negative zero before positive zero for Number
|
|
1110
|
+
kinds and compares BigInt values directly. A supplied comparator result passes
|
|
1111
|
+
through ToNumber, with `NaN` treated as equality, and an abrupt completion
|
|
1112
|
+
prevents writeback. `sort` writes back to and returns its receiver; `toSorted`
|
|
1113
|
+
allocates a same-kind result before collecting elements and does not consult
|
|
1114
|
+
`constructor` or `Symbol.species`. Two code IDs are allocated inside the
|
|
1115
|
+
existing TypedArray range; no intrinsic slot, heap kind, public layout, or
|
|
1116
|
+
generated-code entry point is added.
|
|
1117
|
+
|
|
1118
|
+
The `m5-122` ABI adds `oseo_unresolvable_cell_create`, which creates the hidden
|
|
1119
|
+
cell standing for one unresolvable global reference. Reading that cell throws a
|
|
1120
|
+
catchable `ReferenceError` whose message is a generated static string naming
|
|
1121
|
+
the reference; nothing writes it, and the string needs no tracing.
|
|
1122
|
+
`oseo_global_object_create` now also installs the global object's own writable,
|
|
1123
|
+
non-enumerable, configurable `globalThis` property after every admitted
|
|
1124
|
+
intrinsic. `oseo_context_print_thrown` reports an unhandled rejection whose
|
|
1125
|
+
reason is an intrinsic error instance with the rejection boundary text and that
|
|
1126
|
+
instance's kind marker. No built-in code ID, intrinsic slot, or heap kind is
|
|
1127
|
+
added.
|
|
1128
|
+
|
|
1129
|
+
The `m5-124` ABI adds `%TypedArray%.from` and `%TypedArray%.of`. Both require a
|
|
1130
|
+
constructor receiver and construct through TypedArrayCreateFromConstructor,
|
|
1131
|
+
which `subarray`, `map`, `filter`, and `slice` now share through
|
|
1132
|
+
TypedArraySpeciesCreate: Construct, ValidateTypedArray, and a minimum-length
|
|
1133
|
+
check for one Number argument. `from` checks its mapper before reading the
|
|
1134
|
+
source's `Symbol.iterator` method, drains an iterable source into a rooted
|
|
1135
|
+
argument list before construction, and reads an array-like source one index at
|
|
1136
|
+
a time after construction; `of` stores its arguments in order. Every value goes
|
|
1137
|
+
through TypedArraySetElement. The TypedArray deferred-surface diagnostics and
|
|
1138
|
+
the lookup, deletion, and own-key checks that consulted them are removed. Two
|
|
1139
|
+
code IDs are allocated inside the existing TypedArray range; no intrinsic slot,
|
|
1140
|
+
heap kind, public layout, or generated-code entry point is added.
|
|
1141
|
+
|
|
1142
|
+
The `m5-125` ABI moves `Date.now()`, argumentless `Date` construction, and
|
|
1143
|
+
`Date()` from the Date component's own C11 clock read onto
|
|
1144
|
+
`oseo_clock_real_time`. Their unavailable-clock diagnostic now reads “The host
|
|
1145
|
+
real-time clock is unavailable.” No entry point, built-in code ID, intrinsic
|
|
1146
|
+
slot, heap kind, or public layout is added.
|
|
1147
|
+
|
|
1148
|
+
The `m5-131` ABI records deferred synchronous iterator-next callability.
|
|
1149
|
+
`oseo_iterator_get` captures the `next` property once, including an absent or
|
|
1150
|
+
non-callable value, and preserves getter errors as acquisition errors.
|
|
1151
|
+
`oseo_iterator_next` calls the recorded value through the generic call ABI;
|
|
1152
|
+
that call owns the first-step `TypeError`. The iterator and captured value
|
|
1153
|
+
remain roots across a yielded assignment target and collection. Replacing the
|
|
1154
|
+
property does not replace the captured value. A generator return or throw
|
|
1155
|
+
before the first step can close the iterator without calling `next`. Direct
|
|
1156
|
+
asynchronous acquisition remains unchanged; Async-from-Sync fallback uses
|
|
1157
|
+
synchronous acquisition. No entry point, public layout, heap kind, intrinsic
|
|
1158
|
+
slot, or built-in code ID is added.
|
|
1159
|
+
|
|
1160
|
+
The `m5-132` ABI orders TypedArray construction from a primitive first argument
|
|
1161
|
+
as ECMA-262 does. A concrete constructor still rejects an undefined new target
|
|
1162
|
+
first. It then runs ToIndex on that argument before AllocateTypedArray reads
|
|
1163
|
+
the new target's `prototype`, so a Symbol or BigInt `TypeError` and an index
|
|
1164
|
+
`RangeError` win over a throwing prototype getter or Proxy `get` trap. A length
|
|
1165
|
+
the host cannot allocate still fails after the prototype read. Zero arguments,
|
|
1166
|
+
`ArrayBuffer`, TypedArray, iterable, and array-like sources keep reading the
|
|
1167
|
+
prototype before any argument conversion, iteration, or element read. No entry
|
|
1168
|
+
point, public layout, heap kind, intrinsic slot, or built-in code ID is added.
|
|
1169
|
+
|
|
1170
|
+
The `m5-133` ABI adds `Float16Array`, the twelfth concrete TypedArray
|
|
1171
|
+
constructor. Element kind `OSEO_TYPED_ARRAY_FLOAT16`, realm slots
|
|
1172
|
+
`OSEO_INTRINSIC_FLOAT16_ARRAY_PROTOTYPE` (271) and
|
|
1173
|
+
`OSEO_INTRINSIC_FLOAT16_ARRAY` (272), and the TypedArray range's next free
|
|
1174
|
+
constructor code ID are appended, so every existing kind, slot, and code ID
|
|
1175
|
+
keeps its value. Elements use the exact binary16 encoder and decoder of
|
|
1176
|
+
DataView's `getFloat16` and `setFloat16`, which this component now exports
|
|
1177
|
+
internally. The cluster's in-progress marker is the last constructor it builds,
|
|
1178
|
+
now Float16Array. `Atomics` rejects the new kind. No entry point, public
|
|
1179
|
+
layout, or heap kind is added.
|
|
1180
|
+
|
|
1181
|
+
The `m5-135` ABI admits Unicode group names in dynamically constructed
|
|
1182
|
+
patterns. *runtime\_unicode\_tables.h* gains the pinned `ID_Start` and
|
|
1183
|
+
`ID_Continue` inversion lists, which *runtime\_string.c* exposes as two
|
|
1184
|
+
internal predicates. The validator and the dynamic program builder share one
|
|
1185
|
+
RegExpIdentifierName decoder, so escaped and written spellings name the same
|
|
1186
|
+
group in duplicate checks, named references, and `groups` keys, and a name
|
|
1187
|
+
outside those properties is a `SyntaxError` rather than the profile boundary.
|
|
1188
|
+
Constructing a RegExp from a branded RegExp whose program the build compiled
|
|
1189
|
+
ahead of time borrows that static program when the new flags agree on `i`, `m`,
|
|
1190
|
+
`s`, `u`, and `v`; every other copy still parses its source dynamically. No
|
|
1191
|
+
entry point, public layout, heap kind, intrinsic slot, or built-in code ID is
|
|
1192
|
+
added.
|
|
1193
|
+
|
|
1194
|
+
The `m5-136` ABI records proper tail calls. `OSEO_STATUS_TAIL_CALL` reports
|
|
1195
|
+
that a PrepareForTailCall site recorded the call it owes in the context.
|
|
1196
|
+
`oseo_tail_call` and `oseo_tail_call_derived` throw for a value that is not
|
|
1197
|
+
callable, as an ordinary call does, and otherwise record the callee, receiver,
|
|
1198
|
+
copied arguments, running realm, and, for a derived class constructor, its
|
|
1199
|
+
`this` binding cell. `oseo_call_function` and `oseo_call_complete` perform
|
|
1200
|
+
recorded calls in a loop, one rooted step at a time, so a chain of tail calls
|
|
1201
|
+
holds one step's native stack, call depth, frame budget, and roots.
|
|
1202
|
+
|
|
1203
|
+
`Function.prototype.call`, `Function.prototype.apply`, and `Reflect.apply`
|
|
1204
|
+
record their final call, as their PrepareForTailCall steps require, and the
|
|
1205
|
+
[[Call]] of a bound function or a Proxy forwards the same way because it
|
|
1206
|
+
creates no execution context. A non-tail call through a bound function or Proxy
|
|
1207
|
+
therefore no longer adds a call-depth level for that wrapper. [[Construct]] is
|
|
1208
|
+
unchanged. The context gains one private record pointer. The existing host-tail
|
|
1209
|
+
entry points record direct `console.log`, `setTimeout`, and `clearTimeout`
|
|
1210
|
+
calls.
|
|
1211
|
+
|
|
1212
|
+
The unpublished `m5-137` composition completes that contract with
|
|
1213
|
+
`OSEO_TAIL_HOST_CLEAR_TIMEOUT = 3`; values 1 and 2, all layouts, status values,
|
|
1214
|
+
and function signatures stay unchanged. Arguments finish before frame release.
|
|
1215
|
+
The clear-timeout step passes its first argument, or undefined when absent, to
|
|
1216
|
+
`oseo_clear_timeout`; evaluated extra arguments are ignored. Only numeric
|
|
1217
|
+
handles cancel a timer, and the result is undefined. Ordinary calls retain
|
|
1218
|
+
their direct entry point.
|
|
1219
|
+
|
|
1220
|
+
The `m5-137` ABI adds four context counts for published ephemeron tables,
|
|
1221
|
+
weak-reference records, finalization registries, and finalization cells.
|
|
1222
|
+
Publication increments a count only after linking its object, and sweep
|
|
1223
|
+
decrements it when removing that object. Consumed and unreachable records
|
|
1224
|
+
remain counted until sweep. The collector skips its owner-local weak-edge,
|
|
1225
|
+
cleanup scheduling, and registry compaction scans only when their record kinds
|
|
1226
|
+
are absent. Root and ephemeron fixed-point tracing still visit foreign objects,
|
|
1227
|
+
and collection policy and phase order do not change. The context layout
|
|
1228
|
+
changes, so native artifacts must use the matching runtime headers.
|
|
1229
|
+
|
|
1230
|
+
The `m5-139` ABI adds an inline heap-slot bitmap to each environment. Creation
|
|
1231
|
+
initializes every slot and bit, setting a slot updates its bit without
|
|
1232
|
+
allocating or collecting, and cloning copies slots and bits into one fresh
|
|
1233
|
+
allocation. Tracing visits bitmap words and their heap-valued slots; it
|
|
1234
|
+
preserves every strong edge without rescanning primitive slots. The bitmap adds
|
|
1235
|
+
one `size_t` field and `ceil(slot_count / 64)` words of `uint64_t` storage to
|
|
1236
|
+
each environment.
|
|
1237
|
+
|
|
1238
|
+
For valid-size requests, allocation attempts, safepoints and forced-collection
|
|
1239
|
+
policy remain unchanged. The overflow guard rejects impossible slot counts
|
|
1240
|
+
before allocation or GC. Root scanning and weak-edge phase order remain
|
|
1241
|
+
unchanged. This is a source-only candidate; native correctness and workload
|
|
1242
|
+
benefit remain unmeasured.
|
|
1243
|
+
|
|
1244
|
+
The `m5-140` ABI adds one private string-table pointer to the context. A string
|
|
1245
|
+
of at most 32 code units that the context allocates is recorded in the table,
|
|
1246
|
+
and while that string lives, a later request for the same code units returns it
|
|
1247
|
+
instead of allocating, publishing, or reaching a safepoint. Strings are
|
|
1248
|
+
immutable and cannot be WeakRef targets or weak collection keys, so the sharing
|
|
1249
|
+
is not observable.
|
|
1250
|
+
|
|
1251
|
+
The table is weak: it roots nothing, and each collection removes the entries of
|
|
1252
|
+
the strings its sweep frees after marking is final, so an unrooted heap still
|
|
1253
|
+
collects to empty. Table growth uses the ordinary allocator without a
|
|
1254
|
+
safepoint, counts no allocation attempt, and on failure only leaves a string
|
|
1255
|
+
unshared. Context destruction releases the table. `oseo_function_create` keeps
|
|
1256
|
+
its own name and key strings out of the specialization allocation count whether
|
|
1257
|
+
the table shares them or not.
|
|
1258
|
+
|
|
1259
|
+
`oseo_iterator_next` performs a step whose captured next method is the
|
|
1260
|
+
intrinsic `%ArrayIteratorPrototype%.next` and whose receiver is an array
|
|
1261
|
+
iterator without creating the iterator result object. It enters the next
|
|
1262
|
+
method's realm and one call level as [[Call]] would, and performs the same
|
|
1263
|
+
`length` and element `Get` steps in the same order. The skipped object would be
|
|
1264
|
+
fresh, with own `done` and `value` data properties, so IteratorComplete and
|
|
1265
|
+
IteratorValue observe nothing else. Any other next method, including a
|
|
1266
|
+
replacement installed before GetIterator read it, takes the generic path.
|
|
1267
|
+
|
|
1268
|
+
Lexical bindings use a private uninitialized sentinel for runtime TDZ checks.
|
|
1269
|
+
Catchable runtime-generated language errors are instances of the named error
|
|
1270
|
+
intrinsics with the applicable `TypeError`, `RangeError`, or `ReferenceError`
|
|
1271
|
+
identity and an own `message` property. Resource and host failures retain
|
|
1272
|
+
non-catchable diagnostics.
|
|
1273
|
+
|
|
1274
|
+
Power-of-two radix strings are rounded once from their exact integer value into
|
|
1275
|
+
binary64.
|
|
1276
|
+
|
|
1277
|
+
Numeric coercion distinguishes an ordinary `NaN` conversion from temporary
|
|
1278
|
+
buffer allocation failure. Allocation failure propagates as an abrupt
|
|
1279
|
+
`OSEO2001` result through arithmetic and relational operations.
|
|
1280
|
+
|
|
1281
|
+
String construction checks its combined UTF-16 length before allocation and
|
|
1282
|
+
throws a catchable `RangeError` above the host-compatible ceiling. Native
|
|
1283
|
+
allocation failure remains an `OSEO2001` diagnostic.
|
|
1284
|
+
|
|
1285
|
+
Declared-function calls have a deterministic maximum active depth of 256. The
|
|
1286
|
+
runtime returns an owned `OSEO2001` diagnostic before entering another C frame
|
|
1287
|
+
when that limit is reached.
|
|
1288
|
+
|
|
1289
|
+
Root slot arrays are allocated independently of the process stack. Allocation
|
|
1290
|
+
failure propagates as `OSEO2001`. The script and active declared functions also
|
|
1291
|
+
have a deterministic aggregate limit of 32,768 root slots. Exceeding this
|
|
1292
|
+
native-frame budget fails with `OSEO2001` before generated C is entered.
|
|
1293
|
+
|
|
1294
|
+
The context ABI includes private inline small-integer recognition, unboxing,
|
|
1295
|
+
checked addition, and boxing primitives. Checked addition validates the signed
|
|
1296
|
+
48-bit range before using C signed arithmetic. Test builds can separately
|
|
1297
|
+
report guard, generic-addition, allocation, and collection counters; ordinary
|
|
1298
|
+
program output cannot observe them. The context also carries diagnostic source
|
|
1299
|
+
identifiers with explicit byte lengths, heap-backed root-frame ownership, and
|
|
1300
|
+
active frame-budget accounting. Embedded null bytes are preserved during native
|
|
1301
|
+
error output.
|
|
1302
|
+
|
|
1303
|
+
The historical Host `m5-140` ABI composes the `m5-139` environment bitmap with
|
|
1304
|
+
Host Script realm layout: persistent `global_lexicals`, Script evaluator
|
|
1305
|
+
metadata and host builtin identities. Bitmap allocation, slot updates, cloning
|
|
1306
|
+
and tracing retain their final implementation. Host lexical installation uses
|
|
1307
|
+
the environment APIs, while realm tracing retains the lexical-record root. This
|
|
1308
|
+
layout composition introduces no new collector algorithm. Fresh combined native
|
|
1309
|
+
execution is required separately from source preparation.
|
|
1310
|
+
|
|
1311
|
+
The combined `m5-141` ABI retains the TCO cost fix's `m5-140` weak string table
|
|
1312
|
+
and iterator path together with the Host Script realm additions. Both source
|
|
1313
|
+
branches used `m5-140` independently, so this composition uses the next unused
|
|
1314
|
+
identity after Main and both branches. Their ABI history notes retain their
|
|
1315
|
+
original source identities.
|
|
1316
|
+
|
|
1317
|
+
ABI `m5-142` adds `oseo_private_name_bind`. It replaces a private binding with
|
|
1318
|
+
a fresh cell and initializes it to a new private identity within one runtime
|
|
1319
|
+
call. The helper roots its environment and cell across allocation, then
|
|
1320
|
+
releases its intermediate roots before returning. Earlier class closures retain
|
|
1321
|
+
their original cells. The native frame ceiling, callable cost multiplier and
|
|
1322
|
+
general declaration charges stay unchanged.
|
|
1323
|
+
|
|
1324
|
+
The `m5-143` ABI exports `oseo_to_object` for generated `with` entry, and
|
|
1325
|
+
`m5-144` adds the Array-cost archive compositions below. Both source branches
|
|
1326
|
+
used `m5-142` or `m5-143` independently of the landed `m5-142` private-name
|
|
1327
|
+
helper, so this composition carries all three as `m5-144`.
|
|
1328
|
+
|
|
1329
|
+
The `m5-144` ABI adds archive compositions for generated binding reads,
|
|
1330
|
+
property-key conversion, and ordinary property gets. Each native call selects
|
|
1331
|
+
its operation statically. A call-site record supplies root indices and its
|
|
1332
|
+
source position; it has no opcode or dispatch loop. The caller keeps the same
|
|
1333
|
+
registered frame and live operands. Each composition performs the existing
|
|
1334
|
+
runtime calls and stores the result in the same output root, including a
|
|
1335
|
+
language throw. A failed environment lookup returns before the binding read and
|
|
1336
|
+
output store, retaining the generated direct-abrupt route. Fragment code uses
|
|
1337
|
+
the same compositions after its existing relocated location call. These helpers
|
|
1338
|
+
introduce no collection point, language call, or specialization policy. The
|
|
1339
|
+
existing runtime calls retain their generic behavior.
|
|
1340
|
+
|
|
1341
|
+
ABI `m5-145` adds `agent_can_block` to `OseoContext`. The main test262 agent's
|
|
1342
|
+
generated setup selects false for `CanBlockIsFalse`; ordinary contexts and
|
|
1343
|
+
child agents initialize true, and realms retain their owning context's policy.
|
|
1344
|
+
`Atomics.wait` checks it after argument validation and conversion, before
|
|
1345
|
+
comparing memory. `Atomics.waitAsync` is unchanged.
|
|
1346
|
+
|
|
1347
|
+
[activity audit]: https://github.com/dahlia/oseo/blob/main/docs/sanitizer-activity.md
|
|
1348
|
+
|
|
1349
|
+
|
|
1350
|
+
With binding object boxing
|
|
1351
|
+
--------------------------
|
|
1352
|
+
|
|
1353
|
+
The `m5-143` ABI exports `oseo_to_object` for the generated with entry. It uses
|
|
1354
|
+
the same ToObject implementation as the intrinsic built-ins: objects retain
|
|
1355
|
+
identity, primitives receive wrappers with their intrinsic prototype, and null
|
|
1356
|
+
or undefined throws TypeError. String wrappers carry their own indexed
|
|
1357
|
+
properties and length.
|
|
1358
|
+
|
|
1359
|
+
The compiler roots the result before initializing the with environment, so
|
|
1360
|
+
repeated lookups and escaped closures retain one binding object. The helper
|
|
1361
|
+
does not read a mutable JavaScript `Object` binding or invoke primitive
|
|
1362
|
+
conversion hooks.
|
|
1363
|
+
|
|
1364
|
+
ABI `m5-146` adds a context pointer to the saved caller realm of the active
|
|
1365
|
+
ordinary call. The matching realm scope roots that realm until return.
|
|
1366
|
+
|
|
1367
|
+
Derived constructor completion errors use the saved caller realm, while errors
|
|
1368
|
+
raised by the body retain the callee realm. A pending derived tail call retains
|
|
1369
|
+
and traces its constructor caller realm separately from the tail call's running
|
|
1370
|
+
realm. It then checks its final result in that caller. Nested calls restore the
|
|
1371
|
+
previous scope. This follows `m5-145`, the non-blocking-agent policy above.
|
|
1372
|
+
|
|
1373
|
+
ABI `m5-147` adds `unhandled_rejection_policy` to `OseoContext`, as [ADR 0030]
|
|
1374
|
+
records. Every context initializes it to the fatal policy.
|
|
1375
|
+
|
|
1376
|
+
Under the observe policy, `oseo_rejection_checkpoint` still marks each
|
|
1377
|
+
unhandled rejected promise reported and counts it. It then returns a normal
|
|
1378
|
+
completion instead of the first reason. Only generated setup compiled with the
|
|
1379
|
+
test262 observation option selects observe.
|
|
1380
|
+
|
|
1381
|
+
The agent cluster records the main context's policy at installation, and each
|
|
1382
|
+
child agent copies it before running its program. Timer and cleanup callback
|
|
1383
|
+
throws, host diagnostics, and a rejected entry completion are unchanged.
|
|
1384
|
+
|
|
1385
|
+
ABI `m5-148` adds the runtime module evaluation driver in *runtime\_module.c*,
|
|
1386
|
+
the `module_table` field of `OseoContext`, and the generated-code entry
|
|
1387
|
+
`oseo_module_graph_evaluate`. A module graph's script calls that entry once,
|
|
1388
|
+
after it has instantiated every module environment. The arguments are the entry
|
|
1389
|
+
index, the module count, and per module its evaluator, a top-level await flag,
|
|
1390
|
+
its namespace from ABI `m5-159` on, its requested module count, and the
|
|
1391
|
+
requested module indices in source order.
|
|
1392
|
+
The entry returns the entry module's top-level capability promise, which the
|
|
1393
|
+
event loop treats as the entry task's completion.
|
|
1394
|
+
|
|
1395
|
+
The driver implements Evaluate, InnerModuleEvaluation, ExecuteAsyncModule,
|
|
1396
|
+
GatherAvailableAncestors, AsyncModuleExecutionFulfilled, and
|
|
1397
|
+
AsyncModuleExecutionRejected of ECMA-262 16th edition clause 16.2.1.6. Each
|
|
1398
|
+
table entry keeps the Cyclic Module Record state: status, DFS and ancestor
|
|
1399
|
+
indices, cycle root, async evaluation order, pending dependency count, async
|
|
1400
|
+
parent list, top-level capability, and evaluation error. The module async
|
|
1401
|
+
evaluation count lives in the table and is never reset. An asynchronous
|
|
1402
|
+
evaluator's result promise is its ExecuteAsyncModule capability, and the
|
|
1403
|
+
driver attaches the fulfilled and rejected steps as an `OSEO_REACTION_MODULE`
|
|
1404
|
+
reaction. That reaction reads no `then`, creates no derived promise, and runs
|
|
1405
|
+
its job in the evaluator's realm. A language throw from a synchronous evaluator
|
|
1406
|
+
becomes the recorded evaluation error; a runtime diagnostic still ends the
|
|
1407
|
+
program.
|
|
1408
|
+
|
|
1409
|
+
`oseo_module_evaluate` performs Evaluate on one installed entry and returns its
|
|
1410
|
+
cycle root's top-level capability promise, creating it when absent. A
|
|
1411
|
+
capability created for a root that has already finished evaluating settles at
|
|
1412
|
+
once. *tests/runtime-module-driver.test.ts* drives it directly with C
|
|
1413
|
+
evaluators.
|
|
1414
|
+
|
|
1415
|
+
ABI `m5-159` adds static-specifier `import()`. Each table entry gains a
|
|
1416
|
+
namespace argument after the top-level await flag: the module's namespace
|
|
1417
|
+
object, or `undefined` for a module no `import()` names. An entry index equal
|
|
1418
|
+
to the module count installs the table without evaluating any module, for a
|
|
1419
|
+
Script whose `import()` calls are its only requests. The generated-code entry
|
|
1420
|
+
`oseo_module_import` takes one argument, the target's table index, and
|
|
1421
|
+
performs EvaluateImportCall. It returns a new promise from the current realm's
|
|
1422
|
+
intrinsic `%Promise%` and queues ContinueDynamicImport's first step at once,
|
|
1423
|
+
because the host completes HostLoadImportedModule synchronously from the
|
|
1424
|
+
table. That step, an `OSEO_REACTION_IMPORT_EVALUATE` reaction job, runs
|
|
1425
|
+
Evaluate on the target and attaches an `OSEO_REACTION_IMPORT_SETTLE` reaction
|
|
1426
|
+
to the returned promise. The second step resolves the call's promise with the
|
|
1427
|
+
namespace through ordinary promise resolution, so an exported `then` is
|
|
1428
|
+
honored, or rejects it with the evaluation error. Both reactions carry the
|
|
1429
|
+
call's promise in `capability` and the table index in `index`, and run in the
|
|
1430
|
+
target evaluator's realm. Evaluate reached from a job that a running
|
|
1431
|
+
evaluator drains, as an asynchronous iteration step in synchronous code does,
|
|
1432
|
+
reports an `OSEO2001` diagnostic instead of entering the driver twice.
|
|
1433
|
+
|
|
1434
|
+
The context owns the table for the life of the program. The collector traces
|
|
1435
|
+
every entry's evaluator, namespace, top-level capability, and evaluation
|
|
1436
|
+
error, so a cached error stays reachable. InnerModuleEvaluation, ancestor
|
|
1437
|
+
gathering, and rejection propagation walk explicit stacks, so graph depth never
|
|
1438
|
+
consumes native stack. The DFS stack, its frames, async parent lists, and the
|
|
1439
|
+
sorted ancestor list hold only table indices in untraced memory.
|
|
1440
|
+
|
|
1441
|
+
ABI `m5-149` adds the legacy `caller` and `arguments` properties of
|
|
1442
|
+
[ADR 0034]. Generated code creates a non-strict function through
|
|
1443
|
+
`oseo_function_create_non_strict`, which marks it non-strict; only a non-strict
|
|
1444
|
+
`function` that is neither async nor a generator gets the two properties.
|
|
1445
|
+
`OseoContext` gains `activation`, the head of a chain of `OseoActivation`
|
|
1446
|
+
records on the native stack, and `legacy_function_keys`, the two key strings.
|
|
1447
|
+
Every call through the generic call path links a record naming the callee and
|
|
1448
|
+
its received arguments, except `Function.prototype.call`, `apply`,
|
|
1449
|
+
`Reflect.apply`, and `Reflect.construct`, which stay transparent. The tail call
|
|
1450
|
+
trampoline links a boundary record per step, and each generator and async
|
|
1451
|
+
resumption links one for its function. The collector traces the chain.
|
|
1452
|
+
|
|
1453
|
+
Both properties are non-writable, non-enumerable, and configurable, and stay
|
|
1454
|
+
outside the property vector while live: `OseoFunction.legacy_live` says which
|
|
1455
|
+
are, and `legacy_arguments_position` keeps the own-key rank of a live
|
|
1456
|
+
`arguments`. A definition, including one from `Object.freeze` or
|
|
1457
|
+
`Object.seal`, moves a live property into the vector with its present value,
|
|
1458
|
+
and a delete clears its bit. An active function's `arguments` is created at
|
|
1459
|
+
the sites that hand a value to code, because a property query does not
|
|
1460
|
+
allocate.
|
|
1461
|
+
|
|
1462
|
+
ABI `m5-150` adds the Annex B global functions `escape` and `unescape` to
|
|
1463
|
+
*runtime\_uri.c*. They take the realm intrinsic slots `OSEO_INTRINSIC_ESCAPE`
|
|
1464
|
+
(273) and `OSEO_INTRINSIC_UNESCAPE` (274) and the two code IDs below the URI
|
|
1465
|
+
handling functions in the URI range. The global object binds both as writable,
|
|
1466
|
+
non-enumerable, configurable properties in every realm. The generated-code ABI
|
|
1467
|
+
gains no entry point.
|
|
1468
|
+
|
|
1469
|
+
The same ABI adds the Annex B `String.prototype` methods to *runtime\_string.c*:
|
|
1470
|
+
`substr` and the thirteen HTML methods from `anchor` through `sup` take
|
|
1471
|
+
fourteen code IDs in the String range, and `trimLeft` and `trimRight` are
|
|
1472
|
+
further properties whose values are the existing `trimStart` and `trimEnd`
|
|
1473
|
+
functions. The node adds no intrinsic slot, heap kind, component, or
|
|
1474
|
+
generated-code entry point.
|
|
1475
|
+
|
|
1476
|
+
The same ABI adds the Annex B `Date.prototype.getYear` and `setYear` to
|
|
1477
|
+
*runtime\_date.c* as the method table's entries 44 and 45, after
|
|
1478
|
+
`[Symbol.toPrimitive]`, so `OSEO_DATE_METHOD_COUNT` becomes 46 and the Date
|
|
1479
|
+
range uses two more code IDs. `toGMTString` is a further property whose value
|
|
1480
|
+
is the existing `toUTCString` function. No intrinsic slot, heap kind,
|
|
1481
|
+
component, or generated-code entry point is added.
|
|
1482
|
+
|
|
1483
|
+
ABI `m5-153` gives the `Object.prototype.__proto__` accessor its bodies and
|
|
1484
|
+
installs `__defineGetter__`, `__defineSetter__`, `__lookupGetter__`, and
|
|
1485
|
+
`__lookupSetter__` in every realm. *runtime\_object\_builtin.c* creates them
|
|
1486
|
+
after the seven core `Object.prototype` properties, in clause order, with the
|
|
1487
|
+
Object range's code IDs 32 through 37 below its last ID. The getter is
|
|
1488
|
+
ToObject followed by [[GetPrototypeOf]]; the setter ignores a primitive
|
|
1489
|
+
receiver or a prototype that is neither an object nor `null`, and throws a
|
|
1490
|
+
`TypeError` when [[SetPrototypeOf]] refuses. The define methods call
|
|
1491
|
+
DefinePropertyOrThrow with an enumerable, configurable accessor half, and the
|
|
1492
|
+
lookup methods walk [[GetOwnProperty]] and [[GetPrototypeOf]], so Proxy traps
|
|
1493
|
+
run on both. The accessor is an ordinary property-vector entry: [[Get]],
|
|
1494
|
+
[[Set]], `Reflect.set`, `super` assignment, Proxy forwarding, and
|
|
1495
|
+
`Object.assign` call it like any other accessor, and descriptors, integrity
|
|
1496
|
+
levels, deletion, and for-in treat it as one. No intrinsic slot, heap kind,
|
|
1497
|
+
component, or generated-code entry point is added.
|
|
1498
|
+
|
|
1499
|
+
Without an ABI change, the dynamic pattern validator in *runtime\_regexp.c* and
|
|
1500
|
+
the program compiler in *runtime\_regexp\_matcher.c* follow Annex B's pattern
|
|
1501
|
+
grammar for a pattern without `u` or `v`, as the build-time parser does. Both
|
|
1502
|
+
read a decimal escape against the capture count of the whole pattern, and
|
|
1503
|
+
a quantified lookahead repeats through the ordinary quantifier prologue. An
|
|
1504
|
+
identity escape no longer consults `ID_Continue`, so a non-ASCII identity
|
|
1505
|
+
escape compiles instead of returning `OSEO2001`. The validator also stopped
|
|
1506
|
+
reading a `-` after a completed class range as the start of another range.
|
|
1507
|
+
|
|
1508
|
+
ABI `m5-158` adds `RegExp.prototype.compile` of Annex B. It takes
|
|
1509
|
+
`OSEO_REGEXP_COMPILE_CODE_ID`, the RegExp range last minus 21, below the
|
|
1510
|
+
symbol-method block. It reinitializes the receiver through the constructor's
|
|
1511
|
+
RegExpInitialize, borrowing the program of a RegExp pattern whose parse flags
|
|
1512
|
+
agree, and then sets `lastIndex` to 0. It adds no intrinsic slot, heap kind,
|
|
1513
|
+
component, or generated-code entry point.
|
|
1514
|
+
|
|
1515
|
+
[ADR 0030]: https://github.com/dahlia/oseo/blob/main/docs/adr/0030-test262-unhandled-rejection-policy.md
|
|
1516
|
+
[ADR 0034]: https://github.com/dahlia/oseo/blob/main/docs/adr/0034-legacy-function-caller-contract.md
|
|
1517
|
+
|
|
1518
|
+
|
|
1519
|
+
ECMAScript 2026 built-ins
|
|
1520
|
+
-------------------------
|
|
1521
|
+
|
|
1522
|
+
ABI `m5-151` adds `Error.isError` as an own function property of `%Error%`
|
|
1523
|
+
with the error component's code ID below `Error.prototype.toString`. It returns
|
|
1524
|
+
the `[[ErrorData]]` flag of an object's header and `false` for every other
|
|
1525
|
+
value. It reads no property, so a proxy answers `false` without consulting its
|
|
1526
|
+
target or handler. The generated-code ABI gains no entry point.
|
|
1527
|
+
|
|
1528
|
+
ABI `m5-151` also appends `Math.sumPrecise` to the Math code range, after
|
|
1529
|
+
`trunc`, so the earlier Math code IDs keep their values. It accumulates every
|
|
1530
|
+
finite operand exactly in a 35-limb two's-complement integer of
|
|
1531
|
+
2<sup>-1074</sup> units, enough for 2<sup>53</sup> operands below
|
|
1532
|
+
2<sup>1024</sup>, and rounds once with ties to even, so a sum at or beyond
|
|
1533
|
+
2<sup>1024</sup> − 2<sup>970</sup> becomes an infinity. NaN, opposite
|
|
1534
|
+
infinities, and the `-0` start state follow the edition's state machine. A
|
|
1535
|
+
non-Number value closes the iterator before its `TypeError` propagates.
|
|
1536
|
+
|
|
1537
|
+
ABI `m5-151` also adds `getOrInsert` and `getOrInsertComputed` to
|
|
1538
|
+
`%Map.prototype%` and `%WeakMap.prototype%`, with the Map and weak collection
|
|
1539
|
+
components' next code IDs. The four functions own no intrinsic slot, so the
|
|
1540
|
+
intrinsic table keeps its size; the WeakMap method table marks them with the
|
|
1541
|
+
`OSEO_INTRINSIC_COUNT` sentinel. The Map forms canonicalize `-0` to `+0` before
|
|
1542
|
+
the lookup, and the WeakMap forms reject a key that CanBeHeldWeakly refuses
|
|
1543
|
+
before anything else. The computed forms call the callback with `undefined` as
|
|
1544
|
+
the receiver and the key as the one argument, only when the key is absent, and
|
|
1545
|
+
then look the key up again, so a record the callback created takes the computed
|
|
1546
|
+
value. The WeakMap forms store through the existing ephemeron table.
|
|
1547
|
+
|
|
1548
|
+
ABI `m5-151` also adds `Iterator.concat` as an own function property of
|
|
1549
|
+
`%Iterator%` with the iterator component's next code ID and no intrinsic slot.
|
|
1550
|
+
Its result is an iterator helper of the new `OSEO_ITERATOR_HELPER_CONCAT` kind,
|
|
1551
|
+
so it inherits from `%IteratorHelperPrototype%` and reuses the helper's traced
|
|
1552
|
+
fields: an internal array of method and iterable pairs in `callback`, the pair
|
|
1553
|
+
count in `remaining`, the next pair in `counter`, and the forwarded iterator in
|
|
1554
|
+
the inner fields. It has no underlying iterator, so `return` before the first
|
|
1555
|
+
step closes nothing and `return` at a yield closes only the forwarded
|
|
1556
|
+
iterator. No heap kind or traced field is added.
|
|
1557
|
+
|
|
1558
|
+
ABI `m5-152` adds `Iterator.zip` and `Iterator.zipKeyed` as own function
|
|
1559
|
+
properties of `%Iterator%` with the iterator component's next two code IDs and
|
|
1560
|
+
no intrinsic slot. Their results are iterator helpers of the new
|
|
1561
|
+
`OSEO_ITERATOR_HELPER_ZIP` kind and reuse the helper's traced fields:
|
|
1562
|
+
`callback` holds an internal array with one iterator, `next` method, and
|
|
1563
|
+
padding triple per input, where a null iterator has left the open set;
|
|
1564
|
+
`remaining` holds the input count, `counter` the mode, and `underlying_next`
|
|
1565
|
+
the key array of `zipKeyed`. A zip helper has no underlying iterator, so its
|
|
1566
|
+
`return` closes the open inputs from the last to the first instead. The
|
|
1567
|
+
`zipKeyed` walk reads `[[GetOwnProperty]]` through the new
|
|
1568
|
+
`oseo_internal_own_property_enumerable`, which answers for proxies and
|
|
1569
|
+
ordinary objects alike. No heap kind or traced field is added.
|
|
1570
|
+
|
|
1571
|
+
ABI `m5-154` adds `Array.fromAsync` as an own function property of `%Array%`,
|
|
1572
|
+
defined after `from`, with the array component's code ID 41 below the range
|
|
1573
|
+
top and no intrinsic slot. It runs the edition's closure as a state machine
|
|
1574
|
+
over one 13-slot environment record that holds the result promise, the
|
|
1575
|
+
receiver, the mapper and its `thisArg`, the iterator record or array-like
|
|
1576
|
+
object, the target, the index and length, the suspended phase, the pending
|
|
1577
|
+
close error, and the two reactions. Every Await performs PromiseResolve with
|
|
1578
|
+
`%Promise%` and attaches those reactions, code IDs 42 and 43, which resume the
|
|
1579
|
+
closure in a promise job. Because a function captures a copy of its creation
|
|
1580
|
+
environment, each reaction's environment is a one-slot holder that refers to
|
|
1581
|
+
the shared record. A synchronous iterable goes through the internal
|
|
1582
|
+
Async-from-Sync wrapper, which `oseo_internal_async_from_sync_wrap` now exposes
|
|
1583
|
+
to the array component. No heap kind or traced field is added, and the
|
|
1584
|
+
generated-code ABI gains no entry point.
|
|
1585
|
+
|
|
1586
|
+
ABI `m5-154` adds `JSON.rawJSON` and `JSON.isRawJSON` as own function
|
|
1587
|
+
properties of the JSON namespace, defined after `stringify`, with the JSON
|
|
1588
|
+
component's code IDs 2 and 3 below the range top and no intrinsic slot.
|
|
1589
|
+
`[[IsRawJSON]]` is a new `raw_json` flag in the heap object header, which
|
|
1590
|
+
`oseo_internal_publish_heap` clears for every heap object, so the answer needs
|
|
1591
|
+
no lookup and holds across realms. `JSON.rawJSON` sets it on a frozen
|
|
1592
|
+
null-prototype object with one `rawJSON` property, and `JSON.stringify` emits
|
|
1593
|
+
that property's text unchanged once `toJSON` and the replacer have run.
|
|
1594
|
+
|
|
1595
|
+
With a callable reviver, the `JSON.parse` parser also builds a JSON Parse
|
|
1596
|
+
Record for every value: a four-slot environment that holds the value, the
|
|
1597
|
+
code-unit offsets of its source text, and its children, an internal array for
|
|
1598
|
+
an array and a null-prototype map from member name to record for an object.
|
|
1599
|
+
Internalization passes a fresh context object as the reviver's third argument
|
|
1600
|
+
and gives it a `source` property only for a primitive whose holder still has
|
|
1601
|
+
the parsed value. No heap kind or traced field is added, and the
|
|
1602
|
+
generated-code ABI gains no entry point.
|
|
1603
|
+
|
|
1604
|
+
ABI `m5-155` adds the Uint8Array base64 and hex functions. `fromBase64` and
|
|
1605
|
+
`fromHex` are own properties of `%Uint8Array%`, and `toBase64`,
|
|
1606
|
+
`setFromBase64`, `toHex`, and `setFromHex` of `%Uint8Array.prototype%`. They
|
|
1607
|
+
take the six typed array code IDs after Float16Array's constructor and own no
|
|
1608
|
+
intrinsic slot. The typed array component installs them only while it builds
|
|
1609
|
+
the `Uint8Array` pair. Decoding and encoding run over work buffers, which
|
|
1610
|
+
never collect, so no user code or collection runs between a view's bounds
|
|
1611
|
+
check and the copy into its Data Block. `setFromBase64` and `setFromHex`
|
|
1612
|
+
write the bytes decoded before a malformed character and then throw the
|
|
1613
|
+
`SyntaxError`. No heap kind or traced field is added, and the generated-code
|
|
1614
|
+
ABI gains no entry point.
|
|
1615
|
+
|
|
1616
|
+
ABI `m5-155` also appends `Atomics.pause` to the Atomics code range, after
|
|
1617
|
+
`xor`, so the earlier Atomics code IDs keep their values. It accepts an
|
|
1618
|
+
undefined count or an integral Number without coercion, executes one processor
|
|
1619
|
+
hint, and returns `undefined`. The hint is PAUSE on x86-64 and YIELD on
|
|
1620
|
+
AArch64, the choice each compiler target description records as
|
|
1621
|
+
`atomicsPauseHint`; the runtime fails to build for any other architecture.
|
|
1622
|
+
|
|
1623
|
+
|
|
1624
|
+
Annex B block-level functions
|
|
1625
|
+
-----------------------------
|
|
1626
|
+
|
|
1627
|
+
ABI `m5-156` adds a final `web_legacy_functions` parameter to
|
|
1628
|
+
`oseo_global_object_create`. It is `NULL` when no entry needs it, or a table
|
|
1629
|
+
parallel to the binding names that marks the block-level function names
|
|
1630
|
+
Annex B.3.2.2 binds as vars. A marked entry skips the checks that reject a
|
|
1631
|
+
declaration with a `TypeError` or `SyntaxError`. Creation leaves its cell
|
|
1632
|
+
detached from the global object when an earlier Script's lexical declaration
|
|
1633
|
+
holds the name, or when the object is not extensible and lacks the property;
|
|
1634
|
+
otherwise it binds the entry the way it binds a `var`. Unmarked entries behave
|
|
1635
|
+
as before.
|
|
1636
|
+
|
|
1637
|
+
ABI `m5-157` adds the explicit resource management built-ins. The well-known
|
|
1638
|
+
symbol table grows from thirteen to fifteen entries: `Symbol.asyncDispose` at
|
|
1639
|
+
index 13 and `Symbol.dispose` at index 14, after the older entries, so their
|
|
1640
|
+
indexes do not move. `SuppressedError` is the ninth error kind
|
|
1641
|
+
(`OSEO_ERROR_SUPPRESSED`), with realm slots 275 and 276; its construct code ID
|
|
1642
|
+
takes the error range's ninth constructor place, which moves the
|
|
1643
|
+
`Error.prototype.toString` and `Error.isError` code IDs down by one. It sets
|
|
1644
|
+
`[[ErrorData]]`, defines `message` only for a defined argument, and installs no
|
|
1645
|
+
`cause`.
|
|
1646
|
+
|
|
1647
|
+
*runtime\_disposal.c* owns the new code range 30. `DisposableStack` and
|
|
1648
|
+
`AsyncDisposableStack` take realm slots 277 through 280 and share one heap
|
|
1649
|
+
kind, `OSEO_HEAP_DISPOSABLE_STACK` (41). A stack points at a separate
|
|
1650
|
+
capability record of the same kind, which holds the DisposeCapability as a
|
|
1651
|
+
host buffer of traced triples (value, method, and a flags Number for the hint,
|
|
1652
|
+
`adopt`, and the `Symbol.dispose` fallback of an asynchronous hint), plus one
|
|
1653
|
+
DisposeResources in progress: the completion, and for the asynchronous form
|
|
1654
|
+
the cursor, the needsAwait and hasAwaited flags, the purpose of the pending
|
|
1655
|
+
Await, the promise to settle, and the two internal reactions that resume it.
|
|
1656
|
+
The collector traces the capability pointer, the triples, and the four value
|
|
1657
|
+
fields. `use` captures the capability record before it reads the dispose
|
|
1658
|
+
method, and `move` gives that record to a new stack created from the running
|
|
1659
|
+
realm's intrinsic prototype and the receiver a fresh one, so a getter that
|
|
1660
|
+
moves the stack still adds its resource to the moved stack.
|
|
1661
|
+
`%Iterator.prototype%[@@dispose]` and
|
|
1662
|
+
`%AsyncIteratorPrototype%[@@asyncDispose]` own no intrinsic slot; the second
|
|
1663
|
+
calls `return` with no arguments, as the pinned test262 requires, where the
|
|
1664
|
+
pinned Node.js passes `undefined`.
|
|
1665
|
+
|
|
1666
|
+
ABI `m5-157` also adds the generated-code operations of `using` and
|
|
1667
|
+
`await using` scopes, `oseo_dispose_scope_create`, `_add`, `_dispose`,
|
|
1668
|
+
`_begin`, `_awaiting`, `_await_value`, `_continue`, and `_result`. A scope's
|
|
1669
|
+
capability is a record of the disposable stack heap kind that no source value
|
|
1670
|
+
reaches.
|
|
1671
|
+
The synchronous `dispose` runs DisposeResources from the cleanup region's
|
|
1672
|
+
saved completion. The asynchronous form keeps the same record state, but its
|
|
1673
|
+
run stops at every Await and leaves the operand in a traced field; generated
|
|
1674
|
+
code awaits it in its own suspended frame and passes the settlement back, so
|
|
1675
|
+
each Await happens in the frame exactly where the edition places it and an
|
|
1676
|
+
empty scope finishes without one. Both forms report a throw only when a
|
|
1677
|
+
dispose method failed, so an incoming throw is resumed with its own
|
|
1678
|
+
diagnostic location.
|