Repository navigation
Dynamic computed access: element arms, keyed write sites, interned character strings - #2956
Merged
Merged
Conversation
A computed read on a dynamic receiver gains BYTES and STR arms for an in-range integral Number key (scr_dyn_bytes_index_get / scr_dyn_string_index_get), and a three-parameter computed write is classified as a keyedSet site whose array and typed-array arms store through scr_dyn_index_set. Every other receiver, key and value falls through to the existing helper, so the assignment-failure mode, coercion errors and the prototype fence behave as before. One-character ASCII strings are interned into 128 shared cells, the same shape as the small-integer cells, so a character read no longer allocates. The executable and test build caches key on the emitted shape, and the bootstrap fast path routes around an opt-out so the full compiler sees it. SCRIPTC_DYN_INDEX_FASTPATH=0 restores the key path. The new corpus program exercises -0, NaN, fractional and out-of-range keys, numeric-looking string keys, holes, DataView, BigInt64Array, accessors on the prototype, and frozen and non-extensible stores.
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
The small-integer boxes have to exist before main, because their constructor runs unconditionally, and building the 128 character boxes there referenced the string unit's ASCII table. Every program then carried that 4 KiB table plus a page of padding, which pushed the static hello binary past its size limit on macOS. The character boxes are only reached through scr_dyn_new_str, which a program that never boxes a one-character string does not link, so fill each box where it is first used. A thread claims a box with an atomic compare-exchange and the fields are written before the complete state is published; a thread that finds the box being filled makes a box of its own, which the language cannot tell apart from the shared one.
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SCRIPTC_DYN_INDEX_FASTPATH=0as the opt-out, and the executable cache, the harness build keys and the bootstrap route all key on the emitted shape.