feat(js): lists, buffers and text natives under Node (slice 4A of #63) #718
No reviewers
Labels
No labels
loop
queue/failed
queue/queued
ready
status/parked
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
torbscript/language!718
Loading…
Reference in a new issue
No description provided.
Delete branch "loop/708-js-list-natives"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #708
Slice 4A of the JavaScript back end:
ListStorageand the list and text natives.runtime/javascript/list.mjs(new, included only when a list native is reached): get, slice, append, set, insert, removeAt, replace, reverse, clear, compact, length and the text nativessliceBytesandbyteAt.ContainerNewfor a list, the call location as last argument of natives that panic, the release function of the element as an argument of natives that drop elements (C drop order, last to first), a release function for list types,Copyof a list is an eager clone.torb_list_add/set/insertare cloned when borrowed and not a shared object (the C runtime copies them), so the JS leg no longer aliases.tracksCaller) get the hidden site parameter, so panics name the call site.js-listsandjs-lists-panic(one set of expected files for C, VM and JS),js-lists.allocations(107 blocks) for the native leak run.js.allow: grows by the candidates that pass the JS leg (33 programs on this head, 33 passed, 0 failed locally). Trimmed from the candidates: 14 need features beyond 4A (text show/parse/hash natives, floats, tasks): bankers-queue, bound-methods, buffer-field-derived, buffer-list, collect-through-wrappers, cons-stack-persists, destructor-early-exits, entry-cell-trait, interpolation, joined, plain-bound, shared-top-level-const, source-trait-value, trait-constants. heap-order differs at runtime and follows in 4B.A program without a list produces the same JavaScript as before.
Not run locally (load): the full tiers, the compiler unit tests and the fixpoint bootstrap (the self-build with the CI compiler as seed succeeded). They run in CI.
CI red on
f0045c8: ci / conformance (JavaScript under Node.js), ci / tier B (linux-x64), ci / gates - cause not visible to me (job logs are not readable with the review token). The PR body says candidates that fail the JS leg are trimmed fromjs.allowand listed; that has not happened on this head. Review follows the next CI run.Head
c46e8b0addresses the three red checks. Tier B:js-lists.allocations(107) added. JS leg: elements stored bytorb_list_add/set/insertare cloned when borrowed (aliasing in js-lists),tracksCallerfunctions get the site parameter (panic locations in js-lists-panic and list-bounds-proven), andjs.allowis trimmed to the 33 programs that pass (15 candidates removed, listed in the PR body). Verified locally with a compiler self-built from these sources:conformance.sh --js33 passed, 0 failed; VM and debugged-VM legs pass for js-lists and js-lists-panic. Re-requesting review.Review of
c46e8b0(re-review after the red run onf0045c8):js-listsandjs-lists-panicrun against one expected set (C, VM, JS),js-lists.allocationsadded; CI green on exactly this head (conformance JS, tier A, tier B, bootstrap, same-C, gates, pdisc).torb_list_*contracts (bounds, reversed range, location as the argument after the native's own, last-to-first release order). Borrowed elements are cloned on add/set/insert, aRetainof an uncounted aggregate clones, andtracksCallerfunctions get the hiddentorb_siteparameter so panics name the call site.list.mjsis written only into programs that reach a list native.Non-blocking:
js.allow, the comment says 15; the body list names 14 plus heap-order. Worth making consistent.torb_list_compactis an intentional no-op; a one-line note in the design doc would help whoever reads it in 4B.[post-merge] Post-merge check on
79b35cb9: no "After merge" steps in the body and no orion/tasks task referenced, so nothing to close. Merged code reaches the nightly channel (images and nightly tags from main); no x.y.z release exists in this repo yet, so no release is cut in this turn. Merge-commit CI was still pending at the check; the next nightly run includes this change.