Commit Graph
3841 Commits
Author SHA1 Message Date
Malte Ubl 313dcae7c2 Merge remote-tracking branch 'origin/ni/1-libnode-loader' into ni/13-libnode-packs 2026-10-22 05:31:04 -07:00
Malte Ubl d5a2fac92b Merge remote-tracking branch 'origin/main' into ni/1-libnode-loader 2026-10-22 05:30:31 -07:00
Chris Tate e790de2f68 Keep the slots of short known-count arrays in the array's block (#1746) 2026-10-21 23:26:08 -05:00
Chris Tate 46bee64635 Test runtime classes' dispatch branches before their subclasses' (#1747) 2026-10-21 23:25:16 -05:00
Chris Tate c22302cfae Test runtime classes' dispatch branches before their subclasses' 2026-10-21 23:22:03 -05:00
Chris Tate 56880e110c Keep the slots of short known-count arrays in the array's block
An array constructed with a known element count of up to 16 (array
literals, copies, slices and the arrays the runtime builds) keeps its
slots in its own block, as empty arrays built for appends already do, so
it costs one allocation and one free.

scr_arr_make_ops is inlined into its two constructors, so the size class
of scr_arr_new_ops_small folds to a table index. It writes the element
ops id with the other header fields and records ops past the registry
in the array's ext after the storage is set up: the ext pointer precedes
the dense allocation, so inline slots must move out before the ext is
created.
2026-10-21 23:19:57 -05:00
Chris Tate f686669aa4 Renumber the fiberless plain-call corpus program to 7103 (#1745) 2026-10-21 22:36:24 -05:00
Chris Tate 3e8f1bc608 Renumber the fiberless plain-call corpus program to 7103 2026-10-21 22:34:17 -05:00
Chris Tate f5d6f7aed7 Run never-suspending async calls in place from stackless async bodies (#1744) 2026-10-21 22:24:51 -05:00
Chris Tate 2c5771e98c Run never-suspending async calls in place from stackless async bodies 2026-10-21 22:19:38 -05:00
Chris Tate 2a48d46da3 Key weak collections by net sockets and servers, and carry the socket in undici client diagnostics (#1742) 2026-10-21 22:14:27 -05:00
Malte Ubl 43cd8dea21 Merge ni/1-libnode-loader into ni/13-libnode-packs 2026-10-21 20:12:41 -07:00
Chris Tate d0d132080c Skip candidate buffering for classes whose trace visits nothing (#1743) 2026-10-21 22:11:25 -05:00
Chris Tate 4100cd3c04 Never buffer instances of classes whose trace visits nothing
A class carries the collector header when any class in its hierarchy can
be on a cycle, so instances of classes whose own fields hold nothing
cycle-capable were buffered as candidates and walked by every level. Such
an object has no traced children and is never on a cycle.

Their descriptors now name scr_cyc_no_children, and they are allocated
with buf set to SCR_CYC_ACYCLIC. That value has the buffered bit set, so
a release that leaves the object alive makes no call; scr_cyc_is_buffered
is false for it, and an emitted death or publication mark takes the object
out of a candidate buffer only when buf is below -1. A pass that walks
such an object as a child restores the value when it survives.
2026-10-21 22:08:30 -05:00
Chris Tate b0802dccc2 Give shared helpers the location of their earliest use (#1740) 2026-10-21 22:08:16 -05:00
Malte Ubl 680af076cf Merge remote-tracking branch 'origin/main' into ni/1-libnode-loader
# Conflicts:
#	packages/compiler/src/diagnostics/diagnostic.ts
#	packages/compiler/src/index.ts
2026-10-21 20:07:52 -07:00
Chris Tate e80be9c2e5 Keep properties untyped code adds to typed object literals (#1733) 2026-10-21 22:06:32 -05:00
Malte UblandClaude Opus 5.5 fc551c4a8b Key weak collections by net sockets and servers, and carry the socket in undici client diagnostics
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 20:06:28 -07:00
Chris Tate d5688d7dc5 Give shared helpers the location of their earliest use 2026-10-21 22:02:39 -05:00
Chris Tate 71d5e92dc0 Address review feedback on properties untyped code adds to typed objects 2026-10-21 22:02:22 -05:00
Chris Tate 10820d488c Support SNICallback in tls.createServer (#1700) 2026-10-21 22:00:41 -05:00
Chris Tate ca446b2c30 Read the tls.createServer SNICallback in source order
The runtime call reads the cert and key options before the SNICallback,
so a cert or key initializer after the callback that reassigned the
callback's binding changed the callback the server used, and the server
could serve the wrong certificate. When SNICallback comes before a cert
or key entry, the callback is now saved just before the next of them is
evaluated. With the callback read in order, a callback expression with
side effects lowers instead of being refused.
2026-10-21 21:56:08 -05:00
Chris Tate 0e600da0a7 Count loops bounded by a string's length in integers (#1738) 2026-10-21 21:45:21 -05:00
Chris Tate 71e118be7b Count loops bounded by a string's length in integers
A counted for loop needs a stable limit to run its counter in integer
storage. Array lengths qualified when the loop provably keeps them, but
a string's length did not, so `for (let i = 0; i < s.length; i++)`
kept a double counter and evaluated the length, through the UTF-16
mapping of a non-ASCII string, on every iteration. A string's length
cannot change, so it is now stable whenever the string's binding is
not rebound in the loop or boxed.
2026-10-21 21:42:23 -05:00
Chris Tate db4eb50013 Convert unions of primitives with unary + (#1737) 2026-10-21 21:34:19 -05:00
Chris Tate 04401b6c92 Keep int32 fields of classes whose prototypes are named for inspection (#1736) 2026-10-21 21:31:22 -05:00
Chris Tate baa8fbdafe Hold any non-nullish value in an empty object type inferred from a literal (#1716) 2026-10-21 21:30:54 -05:00
Chris Tate c0014f683d Convert unions of primitives with unary + 2026-10-21 21:29:59 -05:00
Chris Tate 487f536a29 Keep int32 fields of classes whose prototypes are named for inspection
dyn.nameClassPrototype sets the class name on a class's runtime prototype
object and stores no property. The int32 field analysis did not list it as
read-only, so every program that gave a class a runtime prototype counted a
dynamic store that can name any property, and the number fields of every
class reaching dynamic code were stored as doubles.
2026-10-21 21:28:46 -05:00
Chris Tate 4a5ddadd3d Memoize an empty literal's type separately as a union arm
The type mapper maps the type inferred from an empty object literal to the
empty record as an arm of an unreduced union and to a checked-dynamic
value elsewhere, but both answers shared one memo entry. Once the type had
been mapped on its own, a union such as `typeof empty | DataView` reused
the dynamic answer for its arm and refused (SC2009). The memo key now
includes whether the mapping is for such an arm.
2026-10-21 21:28:27 -05:00
Chris Tate b49804d789 Lower to the same IR whatever order reachable bodies lower in (#1734) 2026-10-21 21:12:08 -05:00
Chris Tate 388523cee4 Address review feedback on the lowering-order check 2026-10-21 21:09:39 -05:00
Chris Tate 06b1b4fc81 Leave SC6101 out of the native compiler's self-builds (#1735) 2026-10-21 20:39:23 -05:00
Chris Tate 3b7f33c223 Leave SC6101 out of the native compiler's self-builds
The compiler's own source has 24 likely-hot functions that use untyped
values, so its self-builds now print SC6101. The native bootstrap
contracts compare stderr exactly; the rebuilds of the compiler entry pass
--no-dynamic-tier-warning, which changes no IR or LLVM output.
2026-10-21 20:35:09 -05:00
Chris Tate 3b5e233618 Lower to the same IR whatever order reachable bodies lower in 2026-10-21 20:28:16 -05:00
Chris Tate ec370196e0 Pass undefined as the zlib callback result on errors (#1689) 2026-10-21 20:24:46 -05:00
Chris Tate 37cdd92755 Keep properties untyped code adds to typed object literals 2026-10-21 20:23:53 -05:00
Chris Tate 6f0d047e8e Pass a reassigned zlib callback result on to typed functions
On the error path, a callback's result reads from a checked-dynamic
slot. Passing it on into a Buffer parameter still handed over the
adapter's original value, so after `if (!out) out = Buffer.from(...)`
a typed callee received the absent Buffer instead of the fallback and
crashed. The forward now tests the slot: while it holds undefined the
callee gets the absent Buffer, and otherwise the Buffer the slot holds.
2026-10-21 20:21:31 -05:00
Chris Tate 84036ecdc3 Lower a super() call that leads an if condition's comma chain (#1732) 2026-10-21 20:16:42 -05:00
Chris Tate e7c689ca1d Print class instances with their class name when instanceof sees unknown values (#1731) 2026-10-21 20:13:25 -05:00
Chris Tate 9b165aa044 Lower a super() call that leads an if condition's comma chain 2026-10-21 20:12:26 -05:00
Chris Tate 143c80eb1c Print class instances with their class name when instanceof sees unknown values 2026-10-21 20:10:43 -05:00
Chris Tate 2c5e83ced9 Skip the pending test after callbacks that cannot throw (#1730) 2026-10-21 20:10:25 -05:00
Chris Tate 1c03c0c17f Skip the pending test after callbacks that cannot throw
An array helper specialized for its callback calls the callback's
function directly once the closure's entry matches it, and falls back to
the entry otherwise. Both paths were followed by the pending-exception
test. When the direct target is outside the may-throw set, only the
fallback can leave an exception pending, so the test now runs behind a
guard that is true on that path alone; a known closure called directly
skips it. Worker programs keep the test on every path, where it also
observes termination.
2026-10-21 20:07:00 -05:00
Chris Tate be48947dbd Read a class branch's own-property bag from its receiver (#1727) 2026-10-21 20:03:14 -05:00
Chris Tate 706eebe9c6 Keep constructor types of fetched provenance sources unmapped (#1728) 2026-10-21 19:55:27 -05:00
Malte UblandClaude Opus 5.5 e7f3b205c3 Fetch the CI dev libnode from scriptc's mirror first
The prerelease libnode-dev-24.22.1 mirrors the dockfries v24.22.1 libnode,
Node's v24.22.1 headers and Node's license byte for byte, as CI-only inputs
(not a scriptc release). dev-pack.json lists the mirror first and the
original locations after it; fetch-dev-pack.mjs takes the first source
whose bytes match the pinned sha256 and logs which one it used.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 17:53:28 -07:00
Malte UblandClaude Opus 5.5 79931be198 Keep installed libnode packs out of the executable cache key
An installed @scriptc/libnode-<platform> pack versions in lockstep with
the compiler, whose version every executable cache key already holds;
keying on it as well made the full compiler's key differ from the
bootstrap's routed key wherever a pack directory was present, so routed
cache hits stopped. Only directories with a manifest.json count as
installed packs, so an unbuilt workspace package is not one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 17:52:22 -07:00
Malte UblandClaude Opus 5.5 27b27fd5a8 Pass the stack limit of bridge ABI 2 in the libnode smoke test
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 17:52:22 -07:00
Malte UblandClaude Opus 5.5 75aa8509f6 Assemble libnode packs with NI-1's build-pack.mjs and run island tests in CI
Stack the libnode packs on the in-process loader (#1685) and use its
pack assembler and manifest format instead of a second one:
build-pack.mjs keeps its CLI and fields (schema, nodeVersion,
moduleVersion, bridgeAbi, platform, arch, files), adds the libnode and
bridge names, strips and (on macOS) re-signs the bridge and links it with
-z defs, and exports buildPack(), which the platform packs call with their
package, target and build inputs as extra manifest fields.

libnodeRecord falls back to the installed @scriptc/libnode-<platform>
pack, found from the entry's directory and then next to the compiler,
when neither --libnode nor SCRIPTC_LIBNODE names one.

The Linux test lanes restore the libnode build that the libnode-packs
workflow cached, assemble the linux-x64 pack from it in seconds
(build.mjs --from-cache never builds Node) and export SCRIPTC_LIBNODE, so
the Node island corpus and harness tests run instead of skipping.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 17:52:22 -07:00