Commit Graph
3711 Commits
Author SHA1 Message Date
Chris Tate 7c235ce72b Stop importing runtime bitcode into program builds (#1701) 2026-10-21 14:13:58 -05:00
Chris Tate fc38e62791 Stop importing runtime bitcode into program builds 2026-10-21 14:10:23 -05:00
Chris Tate 3a139a8d40 Negotiate ALPN and bound the TLS version in tls.connect and tls.createServer (#1664) 2026-10-21 13:52:22 -05:00
Chris Tate 9e751b3d38 Give arrays of a known final length exact dense capacity (#1699) 2026-10-21 13:31:21 -05:00
Chris Tate 320abb066e Fix Readable.push and write of string | null and Buffer | null chunks (#1698) 2026-10-21 13:27:12 -05:00
Chris Tate 1d6f26a071 Give arrays of a known final length exact dense capacity 2026-10-21 13:26:50 -05:00
Chris Tate 23ec584deb Read nullable union chunks of push and write by their representation
Readable.push and Writable.write with a union chunk (Buffer, string and
null arms) read the chunk's tag and payload from a tagged union box. A
union with one reference arm and null, such as `string | null` or
`Buffer | null`, is the arm pointer itself, so `push(line)` with
`line: string | null` and `push(done ? null : text)` read past the
string and crashed. Both now read the tag and payload with unionTag and
unionPeek, as the other union consumers do. unshift and end refuse
union chunks and are unchanged.
2026-10-21 13:24:10 -05:00
Chris Tate a4d32a8e38 Use the default TLS version bound for null minVersion and maxVersion in tls.createServer
tls.createServer validated minVersion and maxVersion with its own loop,
which threw ERR_TLS_INVALID_PROTOCOL_VERSION for null. It now uses the
same check as tls.connect, where null and undefined select the default
bound, as in Node.
2026-10-21 13:22:56 -05:00
Chris Tate 5e30e13c87 Read ASCII characters of strings inline in charAt and indexing (#1697) 2026-10-21 13:16:06 -05:00
Chris Tate 7821dccba2 Shrink the array header to 32 bytes (#1695) 2026-10-21 13:14:21 -05:00
Chris Tate 5c851762d6 Read ASCII characters of strings inline in charAt and indexing
charAt and s[i] on a string proven ASCII at an exact in-range index now
return the character from a module-level table of the 128 one-character
strings, emitted with the helper as immortal literals with the same
capacity word and key hash as the runtime's single-character statics.
An exact integer index (a counted-loop counter) skips the double
conversion. Every other string or index calls scr_str_char_at as before.
2026-10-21 13:12:24 -05:00
Chris Tate 96f31cbc18 Shrink the array header to 32 bytes
An array's element ops are a registry id in `spare` instead of a pointer
field: descriptors get their id on their first array (emitted descriptors
are writable for it), and a program with more element types than the id
holds keeps the rest in the array's out-of-line storage.

The out-of-line storage (sparse indices, noncanonical numeric properties,
match metadata) is no longer a header field. An array that has it keeps
its pointer in the 8 bytes before its dense allocation and sets
SCR_ARR_HAS_EXT; such an array always has a dense allocation of its own
(inline slots move out, an empty array gets the prefix alone), and every
allocation, reallocation and free of the dense storage accounts for the
prefix.

Loops over elements look the ops up once, and the state lookup below the
dense capacity reads no out-of-line storage.
2026-10-21 13:04:07 -05:00
Chris Tate 56ff099115 Document when builds use multiple cores (#1694) 2026-10-21 12:55:10 -05:00
Chris TateandQuino Terrasa 1bf49286d1 Document when builds use multiple cores
How It Works gains a Build parallelism section: the frontend runs on one thread, executables divide into
partitions by the size of their LLVM text, the LLVM helper compiles partitions on a thread per hardware thread,
what dev and optimized builds run in parallel and in order, what a rebuild compiles again, and what
profile-guided optimization adds to build time. The CLI reference links to it from --emit, --optimization,
--profile-use, SCRIPTC_CACHE_DIR, and Profile-guided optimization.

Fixes #1340

Co-authored-by: Quino Terrasa <26749475+espetro@users.noreply.github.com>
2026-10-21 12:50:36 -05:00
Chris Tate 975eda9646 Link scr_bytes_dyn.c into libraries (#1693) 2026-10-21 12:40:07 -05:00
Chris Tate d8265b2209 Link scr_bytes_dyn.c into libraries 2026-10-21 12:35:58 -05:00
Chris Tate a437102af6 Keep object literals' key order through IR rewrites and on shapes typed JSON.parse also builds (#1607) 2026-10-21 12:28:31 -05:00
Chris Tate 0739b81f7a Group record-flow references by symbol once per name (#1690) 2026-10-21 12:22:44 -05:00
Chris Tate 293facfdf6 Group record-flow references by symbol once per name 2026-10-21 12:20:12 -05:00
Chris Tate ef5fc0fb2c Grow small map entry arrays through 1, 2, 3, 4, 6, 8, 12 and 16 slots (#1688) 2026-10-21 12:09:50 -05:00
Chris Tate d59ec3251e Grow small map entry arrays through 1, 2, 3, 4, 6, 8, 12 and 16 slots 2026-10-21 12:06:08 -05:00
Chris Tate e6a9e705f8 Keep the write-target AST getters out of the generated region (#1687) 2026-10-21 11:54:17 -05:00
Malte UblandClaude Opus 5.5 86f968c05f Test the key-order pass with checked conversions and IR rewrites
A shape only checked conversions build keeps today's table; one an object
literal also builds takes the literal's order; a literal the IR mapper
rebuilds keeps its witness.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 09:53:39 -07:00
Chris Tate b45b8e0898 Call an object's own or inherited toString in template literals and join (#1655) 2026-10-21 11:50:36 -05:00
Chris Tate cf1e79b5f9 Keep the write-target AST getters out of the generated region 2026-10-21 11:49:05 -05:00
Chris Tate 6848ae8348 Read AST node words through a Uint32Array (#1681) 2026-10-21 11:45:07 -05:00
Chris Tate 04435a70ac Address the second round of review comments on prototype toString conversions 2026-10-21 11:44:13 -05:00
Chris Tate 86aee1e81a Support TypedArray.of (#1658) 2026-10-21 11:42:08 -05:00
Chris Tate d45f331907 Return the pages faulted in past a parked arena's frontiers (#1668) 2026-10-21 11:36:27 -05:00
Chris Tate 23febaddf8 Collect the frontend's cycles when the native compiler disposes it (#1671) 2026-10-21 11:30:00 -05:00
Chris Tate 5484c1254b Answer catch-binding instanceof for values thrown as unknown (#1674) 2026-10-21 11:27:19 -05:00
Chris Tate 3725f8c254 Compute emitter module facts once per module (#1676) 2026-10-21 11:24:18 -05:00
Chris Tate cdcf69c728 Give ProgramLifetime class instances a 32-bit header and packed fields (#1651) 2026-10-21 11:21:22 -05:00
Chris Tate 9a504b6f0d Share one listener list between typed and untyped uses of an EventEmitter (#1563) 2026-10-21 11:18:16 -05:00
Chris Tate b104643a95 Accept defaulted callbacks in literals under an erased generic member (#1666) 2026-10-21 11:15:39 -05:00
Chris Tate e34e5edfd5 Run Buffer methods on Buffers held as checked-dynamic values (#1659) 2026-10-21 11:15:06 -05:00
Chris Tate c8193b9486 Unwrap tsc's interop helpers around builtin modules in packages (#1683) 2026-10-21 11:14:39 -05:00
Chris Tate c9d206ee3e Run the frontend of a first executable build in a child process (#1649) 2026-10-21 11:10:14 -05:00
Chris Tate f2f0617c79 Support fs.promises.rm options (#1673) 2026-10-21 11:08:38 -05:00
Chris Tate cf92d4f03a Read cached LLVM in parts on warm builds (#1661) 2026-10-21 11:05:01 -05:00
Chris Tate e80aea730e Convert string index arguments without libm calls (#1672) 2026-10-21 11:04:26 -05:00
Chris Tate cd38fd2248 Bridge events whose typed listeners take no parameters
An event that typed code only listened to with a listener taking no
parameters had no bridge entry: the scan marked a listener as typed only
when one of its parameters was not a checked-dynamic value. Emitting the
event through an `any` reference then threw instead of calling the
listener. A TypeScript listener with no parameters now marks the event as
typed. A JavaScript function without parameters still registers as before,
since it can read `arguments`.
2026-10-21 11:03:19 -05:00
Chris Tate aea358eed5 Freeze, seal and query functions through their property tables (#1657) 2026-10-21 11:01:40 -05:00
Chris Tate 4312b78ab5 Name the reason when a discovered WebAssembly module is not translated (#1660) 2026-10-21 10:59:44 -05:00
Chris Tate f8d7ec1864 Remove repeated lookups from the class dynamic-dispatch passes (#1663) 2026-10-21 10:59:12 -05:00
Chris Tate f496dd7209 Compile assignment and update targets wrapped in parentheses or non-null assertions (#1665) 2026-10-21 10:58:44 -05:00
Chris Tate 858328703b Name typed functions' property tables and keep runtime freezes data-only
The first Object.freeze, Object.seal or Object.preventExtensions of a typed
function creates its property table from the function's dynamic box. The
box had no name, so later `f.name` reads answered "". The box now carries
the function's JS name, as a closure flowing into any checked-dynamic slot
does.

The runtime's own callers (published values, os and node constants, the
private-range block list, Wasm exports) freeze data they built, and now
call scr_dyn_freeze_data, the freeze for values that are not functions.
Object.isFrozen, Object.isSealed and Object.isExtensible read a
function's existing table and answer false, false and true when it has
none. Fully typed programs therefore link no dynamic-tier object code
for these calls again.
2026-10-21 10:34:21 -05:00
Malte UblandClaude Opus 5.5 f793009ee5 Unwrap tsc's interop helpers around builtin modules in packages
tsc wraps every CommonJS import in its helpers: `const events_1 =
__importDefault(require("events"))`, `const path =
__importStar(require("path"))`. cjs-tsc-interop.ts reads such bindings of
program modules as plain require bindings, so the helper declarations go
dead, but a builtin module is not a program module: its binding kept the
helpers live, and their probe of the module's top-level `this`
(`(this && this.__importDefault) ||`) failed at load ("property access
through top-level 'this'"). That is the shape of hundreds of tsc-compiled
files in a typical dependency tree.

A builtin carries no `__esModule`, so `events_1.default` is the module and
the namespace copy reads the module's members. When every reference has
that form, a package-file stage now respells the binding as the plain
require() of the builtin and `x.default` as `x`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 08:11:47 -07:00
Chris Tate 87c87b3aba Merge pull request #1675 from vercel-labs/ctate/prepare-v0-4-c31b8d
Prepare v0.4.1 release
v0.4.1
2026-10-21 10:03:50 -05:00
Chris Tate e9c116859e Read AST node words through a Uint32Array
AstWireFile read every node field with DataView.getUint32 after checking
the index with Number.isInteger and a range compare. In the compiled
compiler the DataView read, Number.isInteger and its trunc are runtime
calls on every access, and parent, kind, next and data run on every child
of every walk.

The node table is now a Uint32Array: a view of the response when the
table starts on a 4-byte boundary on a little-endian host, otherwise a
copy decoded once with astU32. Each accessor checks its index with
index >>> 0 === index and the node count, which accepts the same indices
as before, and throws the same error through an out-of-line function.
Decoded strings are cached in an array indexed by string slot instead of
a Map. The checks of sibling, parent, list and named-child links are
unchanged and still run when each node is read.
2026-10-21 10:02:36 -05:00