Commit Graph
3757 Commits
Author SHA1 Message Date
Chris Tate eca0cab8a2 Give the sanitized Effect pilot tests a longer timeout (#1723) 2026-10-21 18:33:42 -05:00
Chris Tate 2054ea51bb Give the sanitized Effect pilot tests a longer timeout 2026-10-21 18:31:16 -05:00
Chris Tate 21a2bb3de8 Replace every match of a block in one-character replace chains (#1722) 2026-10-21 17:40:52 -05:00
Chris Tate dfdc610c59 Replace every match of a block in one-character replace chains
Chains of global one-character replacements (the HTML-escape idiom) run
as one scr_str_replace_chars call. It searched for the next match eight
bytes at a time and started the search over after each replacement.

It now reads 16-byte blocks with SSE2 or NEON (8-byte words elsewhere on
little-endian hosts) and replaces every match of a block before reading
the next one. The table of characters and replacements is kept for the
next call with the same immortal operands, which are the literals the
compiler passes, instead of being rebuilt from the replacement text on
every call.
2026-10-21 17:36:58 -05:00
Chris Tate 1d5a0c745a Speed up JSON.parse and JSON.stringify scanning (#1721) 2026-10-21 17:34:58 -05:00
Chris Tate 79a7120e5f Speed up JSON.parse and JSON.stringify scanning
- The number and whitespace scanners keep the cursor in locals and write
  p->pos once: the runtime builds without strict aliasing, so a loop on
  p->pos stored it after every byte.
- Typed arrays gather parsed elements in a 32-slot run and append them
  with scr_arr_push_many instead of one push per element.
- The string scan shared by parse and stringify takes the index of the
  first quote, backslash or control byte from the marked word on
  little-endian hosts, and checks the last 1-7 bytes of a string as one
  word, so a short plain string needs no byte loop.
- Typed record parsing computes once per record schema and parse which
  field names hold no byte JSON would escape, instead of testing the
  name on every direct key match.
- The mantissa converts to double through int64, and the positioned
  error report stays out of line.
2026-10-21 17:31:02 -05:00
Chris Tate 4cf87366aa Refuse elements on Array.prototype (#1720) 2026-10-21 17:29:26 -05:00
Chris Tate 0950725949 Refuse elements on Array.prototype 2026-10-21 17:24:17 -05:00
Chris Tate 3d1c422b1c Lower a Buffer view of a dynamic typed-array value (#1719) 2026-10-21 17:23:58 -05:00
Chris Tate 8061060aff Lower a Buffer view of a dynamic typed-array value 2026-10-21 17:20:50 -05:00
Chris Tate 75436e9c86 Walk a file once for the references of its function declarations (#1717) 2026-10-21 17:20:00 -05:00
Chris Tate b22332e4c9 Fix the compiler crash on recursive type aliases in generic signatures (#1718) 2026-10-21 17:19:41 -05:00
Chris Tate a7a42640dc Stop the type-parameter walk at recursive aliases in signatures
mentionsTypeParameter walked union constituents and type arguments
without remembering the types on its path. A parameter typed with an
alias that reaches itself through its own type arguments, such as
`type Tree = string | Tree[]` in `function f<T>(x: T, ...trees:
Tree[])`, recursed until the compiler ran out of stack. The walk now
skips a type it has already entered; a type parameter reached through
any other path is still found.
2026-10-21 17:17:15 -05:00
Chris Tate 70aed0f133 Walk a file once for the references of its function declarations 2026-10-21 17:17:02 -05:00
Chris Tate 8428bed383 Call an observed prototype method through a bag that does not hold it (#1712) 2026-10-21 17:04:57 -05:00
Chris Tate d0a581f837 Keep class methods on structural views asserted from unknown (#1713) 2026-10-21 17:03:38 -05:00
Chris Tate d6f857bb1d Keep class methods on structural views asserted from unknown 2026-10-21 16:59:02 -05:00
Chris Tate fa7aa25078 Call an observed prototype method through a bag that does not hold it
A dynamic method call on a class instance whose method name the program
also reads through a prototype (`X.prototype.map` anywhere) uses the
observed prototype slot: the callback descriptor read the method from the
instance's property bag, on the assumption that the bag answers every
read through the class prototype. An instance whose bag was built before
the class had prototype data reads as a fresh empty object, so the read
answered undefined and the call threw "... is not a function" (fast-check's
`integer({ min, max }).map(...)` once its result reaches the call through a
dynamic value).

The descriptor now reads the bag when the bag holds the name, own or
through its prototype, and otherwise the class's prototype data.
2026-10-21 16:58:37 -05:00
Chris Tate 5954d475b7 Record TypeScript 7 baselines for the string field corpus program (#1711) 2026-10-21 16:49:19 -05:00
Chris Tate 228c64a282 Record TypeScript 7 baselines for the string field corpus program
The TypeScript 7 parity lane checks every corpus program against a
recorded preflight and order baseline. 6950-string-field-fast-paths.ts
arrived without one; this records it from the current native lane.
2026-10-21 16:46:53 -05:00
Chris Tate 4124e2a501 Convert global isFinite's argument with ToNumber (#1662) 2026-10-21 16:37:03 -05:00
Chris Tate bbb37ae03b Read a spread's elements before an earlier argument converts
When the Math functions evaluate their arguments into temporaries before
converting (an earlier argument whose ToNumber can run valueOf), a spread
argument's array is now copied where it is evaluated. Before, the
temporary held the array itself and its elements were read after the
conversions, so a valueOf that changed the array changed the values
passed, while JavaScript reads a spread's elements during argument
evaluation.
2026-10-21 16:34:37 -05:00
Chris Tate baa9af6be1 Speed up split, indexOf, slice and Number() on ASCII fields (#1710) 2026-10-21 16:16:14 -05:00
Chris Tate ea4d570e59 Speed up split, indexOf, slice and Number() on ASCII fields
Number() of a string with an optional sign and 1 to 15 digits returns
the integer directly; every other string keeps the full StringToNumber
grammar, out of line.

split() with a separator collects its first batch of pieces before
creating the result, so the result is an inline array of exactly that
size, filled in place. A split's default limit skips the uint32
conversion, and pieces of a proven-ASCII string are created ASCII,
including the scratch pieces of split loops.

indexOf() from the start of a proven-ASCII string searches bytes
directly, and slice() of one skips the UTF-16 index map. The one-byte
case of the byte search reaches memchr without a stack frame.
2026-10-21 16:12:52 -05:00
Chris Tate 2ca85a3d4c Give the fs corpus programs per-process scratch directories (#1709) 2026-10-21 15:56:38 -05:00
Chris Tate f6f00d8b05 Collect the compiler's heap as lowering and LLVM emission grow it (#1708) 2026-10-21 15:54:44 -05:00
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 692569a804 Collect the compiler's heap as lowering and LLVM emission grow it 2026-10-21 15:50:32 -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