Commit Graph
5492 Commits
Author SHA1 Message Date
Chris Tate 06f7b8631f Merge perf/shape-overlay-cost 2026-10-26 11:53:34 -05:00
Chris Tate d163df4674 Merge perf/shape-table-dispatch 2026-10-26 11:18:17 -05:00
Chris Tate 6622ae4e22 Merge perf/static-objects 2026-10-26 11:10:12 -05:00
Chris Tate 37131030ff Merge perf/shape-overlay-core 2026-10-26 11:01:59 -05:00
Chris Tate d5dc896576 Merge main 2026-10-26 10:53:46 -05:00
Chris Tate cd4950c25f Never let the shape overlay break compilation (#2219) 2026-10-26 10:19:06 -05:00
Chris Tate 26b2fdcc67 Read IR nodes' fields by name in three llvm-emit passes (#2336) 2026-10-26 10:17:48 -05:00
Chris Tate 1947bf66c7 Release a substitution's operands when it returns (#2337) 2026-10-26 10:17:28 -05:00
Chris Tate c1ad72e1a4 Build the candidate's own compiler source in the zero-cost gate (#2339) 2026-10-26 10:15:57 -05:00
Malte UblandClaude Opus 5.5 5aa6699b3d Build the candidate's own compiler source in the zero-cost gate
The self program compiles the compiler source of the checkout the programs
come from (the baseline by default), so a change adding compiler code the
self-hosted frontend cannot lower passed the gate and failed CI's
self-hosting tests. With the self set, the gate now also builds the
candidate's packages/compiler/src/native/cli.ts with the candidate (LLVM
only, not compared) and fails when that build fails.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 07:09:02 -07:00
Chris Tate 823ebd50dc Resolve each shipped declaration path once (#2335) 2026-10-26 08:42:47 -05:00
Chris Tate b1614d6e75 Release a substitution's operands when it returns
The temps a regex replace or replaceAll consumed (the subject that a
previous substitution in a chain produced, a computed replacement) were
released at the end of the statement. A chain of substitutions over a
large string therefore held every intermediate result until the last one
returned. The operands now live in a frame of their own that is released
right after the call, so a chain holds at most its current subject and
result.
2026-10-26 08:30:42 -05:00
Chris Tate f9b5533ee6 Read IR nodes' fields by name in three llvm-emit passes 2026-10-26 08:13:15 -05:00
Chris Tate f1298287d6 Resolve each shipped declaration path once
isFallbackDtsPath runs for every type lowering maps (isStdlibFile), and
since the fallback declarations moved into per-module files (#2256) it
asked declarationPath for the fallback module directory each time. Without
an installed declaration root, each answer resolved
@scriptc/compiler/scriptc-node-fallback.d.ts through Node's module
resolver. Lowering three.js's buffers-animation fixture went from 6.3 s to
43 s. declarationPath now keeps its answers by name until the declaration
root changes.
2026-10-26 07:58:58 -05:00
Chris Tate 7e6327740b Merge perf/static-objects 2026-10-26 07:53:16 -05:00
Chris Tate 52a228d0f5 Keep declarations a removed branch shares with another 2026-10-26 07:50:59 -05:00
Chris Tate 641f779fa3 Store identical runtime artifacts once and strip the copied CLI executables (#2301) 2026-10-26 07:06:31 -05:00
Chris Tate b221a13369 Reuse the completion callback a stream passes to its option callbacks (#2323) 2026-10-26 07:00:49 -05:00
Chris Tate de17158254 Merge main 2026-10-26 06:51:26 -05:00
Chris Tate 636c7631b3 Keep program partitions local to the code an edit changes (#2328) 2026-10-26 06:35:05 -05:00
Chris Tate 067f146e87 Read builtin globals through the global object, and support Node's navigator (#2242) 2026-10-26 06:16:08 -05:00
Chris Tate a758ff1b4e Select sanitized runtime variants by unit, and skip stripping without llvm-strip
The native sanitizer build chose the variants to compile by artifact path.
Since the runtime pack stores identical objects once, two variants of a
unit can share a path, so it compiled such a unit for both variants and
linked it twice (duplicate symbols in the sanitized native bootstrap).
selectedRuntimeUnits now returns each selected unit with its variant;
selectRuntimePackArtifacts and the sanitizer both use it.

Staging the native CLI's assets ran llvm-strip unconditionally and failed
on hosts without it. Without llvm-strip on PATH, tsc-ts now keeps its
symbols and the build prints a warning; the release hosts install LLVM.
2026-10-26 06:02:01 -05:00
Chris Tate 7ae99f63bc Give stream option callbacks Node's callback identities
Node passes a stream's one onwrite function to every _write and _writev
call, and a new function to every _transform call. A write or writev
option callback now receives the same closure on every call
(scr_stream_write_closure), kept or not, so a Set, WeakSet or WeakMap
finds it again. A reused transform, flush, final, construct or destroy
callback is first forgotten by weak collections, as at its free, so a
WeakSet or WeakMap that recorded the previous call's callback does not
find it on the next call.
2026-10-26 05:52:57 -05:00
Chris Tate e559baacde Skip repeated probes in lowering (#2330) 2026-10-26 05:47:59 -05:00
Chris Tate a684543b58 Merge perf/shape-overlay-core 2026-10-26 05:42:45 -05:00
Chris Tate 30668f19ba Make the shape overlay's facts sound on the real-package suites (#2230) 2026-10-26 05:38:44 -05:00
Chris Tate 66b6ca53ce Load a Node module's fallback declarations only when the program names it (#2256) 2026-10-26 05:37:36 -05:00
Chris Tate b8aaa5985a Merge main 2026-10-26 05:23:00 -05:00
Chris Tate addecf6a02 Skip repeated probes in lowering 2026-10-26 05:17:10 -05:00
Chris Tate 2d2343e36f Keep program partitions local to the code an edit changes 2026-10-26 05:03:24 -05:00
Chris Tate 9c3b336f76 Import callees of up to 40 instructions across program partitions (#2325) 2026-10-26 04:50:47 -05:00
Chris Tate 9f51ab61d9 Keep the integers of typed-array reads in locals for indices and loop guards (#2327) 2026-10-26 04:40:10 -05:00
Chris Tate 4553941d84 Merge main 2026-10-26 04:25:15 -05:00
Chris Tate ddf5b1f8e0 Keep the integers of typed-array reads in locals for indices and loop guards
A local that only holds exact integers or NaN, such as one assigned from
an integer typed-array read, now keeps whether it is NaN beside its
integer view. Its reads, and sums, differences and products of them,
carry an i64 that holds the integer whenever the number is not NaN, so
an index check or a counted loop's guard tests that integer and the
ordered bit instead of converting the double back and checking that it
is an exact integer.
2026-10-26 04:08:25 -05:00
Chris Tate 2ad699c98a Compile classes that extend Array (#2059) 2026-10-26 03:57:16 -05:00
Chris Tate ae3d388869 Merge main 2026-10-26 03:53:02 -05:00
Chris Tate ba2aadcb81 Import callees of up to 40 instructions across program partitions
The thin link imported a callee of up to 100 instructions, LLVM's default,
into every partition that calls it, and each partition then optimized and
compiled its imported copies again. Partitioned programs now import callees
of up to 40 instructions. Programs that compile as one module are
unchanged.
2026-10-26 03:32:39 -05:00
Chris Tate e289b03ddc Keep int32 fields in programs with adopting casts (#2324) 2026-10-26 03:27:40 -05:00
Chris Tate 0ba138b57e Merge main 2026-10-26 03:25:54 -05:00
Chris Tate 56e3f3e5a0 Update the npm cases that reading builtin module members as globals changes
require("buffer").Blob and timers.setTimeout now read as their global
spellings, so island-web-plumbing and misc-shims run past the SC2020
they stopped at and reach a later deferred SC1090: require() inside a
function in plumbing, and constructing a value that is not a program
class in misczoo. fetch-destructure reads fetch from the aliased global
object and matches Node.
2026-10-26 03:14:33 -05:00
Chris Tate eec525dc6a Fix eight compiler and type bug reports (#2319) 2026-10-26 03:10:55 -05:00
Chris Tate 6c1ddbf390 Keep int32 fields in programs with adopting casts 2026-10-26 02:57:52 -05:00
Chris Tate acf19e2652 Merge main 2026-10-26 02:53:26 -05:00
Chris Tate 7a8ec3f3d2 Hold locals and module globals whose declared type does not compile as checked dynamic slots (#2292) 2026-10-26 02:49:06 -05:00
Chris Tate ca3217fe99 Reuse the completion callback a stream passes to its option callbacks
Each call of a typed or untyped write, writev, transform, flush, final,
construct or destroy option callback allocated a closure and a box holding
the stream for its `callback` argument. The emitted thunks now take it
from scr_stream_done_closure, which keeps the last one on the stream state and
hands it out again while the stream holds its only reference and it has
no own properties. A callback the user kept (stored, or passed to
setImmediate or a promise) is not reused: the next call gets a new
closure, and the kept one keeps its own stream reference.

The cached closure holds the stream, so the stream drops it when it
emits 'close' and traces it, which lets the cycle collector reclaim a
stream dropped before it closes.

RUNTIME_ABI_VERSION goes from 46 to 47 for scr_stream_done_closure.
2026-10-26 02:48:03 -05:00
Chris Tate 7183a76422 Address review: missing strings in bindings and calls, evaluated recursive flags
- A string held in a binding or returned by a call can be a missing element
  read (undefined), so `head + PAD[j]` and `at(i) + PAD[j]` still add to NaN
  when both are missing. Only string literals, templates and sums with such
  an operand now count as always a string.
- `readdirSync(path, { recursive })` folds only the `true` and `false`
  keywords. Any other flag expression, including one typed as a literal,
  evaluates at run time for its effects and exceptions.
2026-10-26 02:42:04 -05:00
Chris Tate f52806988d Read typed-array header fields once at a speculative loop's entry (#2321) 2026-10-26 02:33:23 -05:00
Chris Tate 3512b288ad Order the native compiler's cold functions by how many builds run them (#2320) 2026-10-26 02:33:05 -05:00
Chris Tate 035d618517 Store a table entry for if/else chains that store literals to one element (#2317) 2026-10-26 02:21:51 -05:00
Chris Tate 8a37d54e65 Register classes and functions with dynamic slots when a reference flushes their type failures (#2293) 2026-10-26 02:14:26 -05:00