Commit Graph
3728 Commits
Author SHA1 Message Date
Chris Tate 47671d5bed Give the fs corpus programs per-process scratch directories
5568-fs-cp-errors built its fixture in a /tmp directory named after the
program file, which it deletes and recreates. The Node oracle and the
native runs of one program run at the same time, so two runs with the
same name deleted each other's files and the program exited 1 on
random shards. Its root, and that of the five other corpus programs
that name a /tmp/scr-* directory after the program file alone, now
ends in the process id, as 5571-fs-cp-deep's does.
2026-10-21 15:54:23 -05:00
Chris Tate 621b7cfe58 Build the native compiler with profile-guided optimization (#1707) 2026-10-21 15:36:42 -05:00
Chris Tate 2b48451cf4 Build the native compiler with profile-guided optimization 2026-10-21 15:33:37 -05:00
Chris Tate 1c2b80040b Deliver queued worker messages before immediates, as Node does (#1682) 2026-10-21 15:05:13 -05:00
Chris Tate 4140bcefe2 Walk AST subtrees by their node ranges (#1706) 2026-10-21 15:04:21 -05:00
Chris Tate ca68d63c1c Finish a worker message batch before port messages, and count queued messages as they arrive
- Port messages that a 'message' listener posts while more worker
  messages are queued are delivered after those messages and before
  setImmediate callbacks, as in Node. The ports' poll phase waits while a
  batch's next message is queued, and the loop pass continues once more
  after the batch when a port has something to deliver.
- A mailbox counts its queued events per kind as they are posted and
  taken, so starting a batch reads the count instead of scanning the
  queue under the lock. Messages that alternate with a worker's captured
  stdout or stderr start a batch each, which made delivery quadratic:
  20000 such messages took 5.6 s to drain, and now take 0.5 s (Node 0.57 s).
- The continue hook passes on that the batch's next message is at the
  head, so the dispatch that follows does not lock the mailbox again.
- Corpus 6212 checks the order of worker messages, a MessageChannel
  message posted by the first listener, and setImmediate against Node.
  6211's costs are now taken from its CI timings.
2026-10-21 15:00:22 -05:00
Chris Tate 7ff0ea472d Walk AST subtrees by their node ranges 2026-10-21 14:59:26 -05:00
Chris Tate 543639bdbd Shorten the cycle collector's per-object paths (#1705) 2026-10-21 14:28:10 -05:00
Chris Tate a1f87d817e Resolve the stream-construction fixture's file read on close (#1704) 2026-10-21 14:27:24 -05:00
Chris Tate c1b413e5cc Shorten the cycle collector's per-object paths
markGray's edge visitor kept a stack frame on every call, though most
edges end at an object that is skipped or already gray. Those now return
without one, and the first visit and skipped cross-generation edges
tail-call out of line, as the scan visitors already do.

The walks no longer call the dense-array walker for an empty array. The
routing of nursery candidates past bypassed levels inlines its bypass
test, and the end of each pass tests its work vectors' capacity inline.
What is collected, and when, is unchanged.
2026-10-21 14:25:23 -05:00
Chris Tate 3b35db6b6b Resolve the stream-construction fixture's file read on close
readFileStream resolved on 'end' while its 'close' listener printed
"released". 'close' follows 'end' once the descriptor is closed, so the
line landed wherever that completion fell among the child processes
the fixture starts next, and the comparison with Node depended on
timing. The read now resolves from its 'close' listener, after the line
is printed.
2026-10-21 14:24:57 -05:00
Chris Tate 27855a3835 Resolve conditional member types over literal class type arguments (#1669) 2026-10-21 14:23:50 -05:00
Chris Tate ca31b48bfd Revisit only the changed sites of the optional-read fixed point (#1703) 2026-10-21 14:22:33 -05:00
Chris Tate 558fb7c8ba Bind only conditional-dependent class type arguments as checker types
A generic class instance now binds a type parameter to its checker type
only when a conditional type in the class depends on it, and that checker
type keys the instance. Before, every type argument was bound while only
literal arguments of those parameters were in the key, so two instances
such as Holder<R, "a"> and Holder<R, "b"> with a `T[K]` field shared the
first instance's layout. The other parameters get no checker binding, so
member types that depend on their literal identity stay unresolved, as
before.

Detection now follows the type aliases and interfaces a member's type
refers to, so a conditional wrapped in a union alias, such as
`(K extends "required" ? T : T | undefined) | null`, also separates the
instances.
2026-10-21 14:20:20 -05:00
Chris Tate 453bcf8e38 Revisit only the changed sites of the optional-read fixed point 2026-10-21 14:19:48 -05:00
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