Skip to content

DFG/FTL: have the Date.now() intrinsic honor overridenDateNow - #257

Merged
Jarred-Sumner merged 2 commits into
mainfrom
farm/8e3a7d59/jsc-datenow-jit-override
Jun 30, 2026
Merged

Jarred-Sumner merged 2 commits into
mainfrom
farm/8e3a7d59/jsc-datenow-jit-override

Conversation

@robobun

@robobun robobun commented Jun 26, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Date.now() is tagged DateNowIntrinsic, so once a call site gets hot the DFG bytecode parser inlines it as a DateNow node. Both DFG and FTL lower that node to operationDateNow, which returned jsCurrentTime() and ignored JSGlobalObject::overridenDateNow. The LLInt/baseline host function dateNow reads the override, so as soon as a Date.now() call site tiered up, it started returning the real wall clock while the interpreter path still returned the overridden time. In Bun this showed up as a setSystemTime() override leaking out of JIT-compiled Date.now() callers (oven-sh/bun#32793).

Review (thanks @sosukesuzuki) pointed out two more problems with overridenDateNow:

  1. Its readers disagreed on what "no override is active" means. jsDateNow() (used by new Date()) checked overridenDateNow > -1, while dateNow, dateNowImpl, callDate, and my first cut of operationDateNow checked < 0. Same global state, different predicates, so Date.now() and new Date() could disagree.
  2. The -1 sentinel is unsound and lossy:
    • The DFG abstract interpreter proves DateNow yields SpecDoubleReal (a non-NaN double, DFGAbstractInterpreterInlines.h:1511). With the < 0 check, a NaN stored in overridenDateNow is returned as-is, so LLInt/baseline Date.now() returns NaN out of a node the JIT has proven never does. This is reachable from Bun today: jest.useFakeTimers({ now: NaN }) writes NaN into the field.
    • Every negative timestamp reads as "unset", so a pre-epoch override like setSystemTime(new Date("1960-01-01")) is silently ignored, and -1 itself (1969-12-31T23:59:59.999Z) can never be the frozen time.

Fix

  • operationDateNow takes the JSGlobalObject* (forwarded from the DFG and FTL call sites like operationRandom already does).
  • Every reader (dateNow, dateNowImpl, callDate, operationDateNow; constructDate already did) goes through the single helper JSGlobalObject::jsDateNow(). jsCurrentTime() now has exactly one caller in JavaScriptCore.
  • The "no override" sentinel is NaN (PNaN) instead of -1, and the helper is std::isnan(ms) ? jsCurrentTime() : ms. The result can never be NaN (either branch is non-NaN), so the SpecDoubleReal proof holds by construction, and every real double, including negative and -1, is a usable override.

Repro

Original tier divergence (oven-sh/bun#32793):

import { setSystemTime } from "bun:test";
const frozen = new Date("2024-01-09T00:00:00.000Z").getTime();
setSystemTime(frozen);
const readNow = () => Date.now();
for (let i = 0; i < 2_000_000; i++) {
  if (readNow() !== frozen) { console.log("diverged at", i); break; }
}

The NaN and pre-epoch cases from review:

import { jest, setSystemTime } from "bun:test";

jest.useFakeTimers({ now: NaN });
Date.now();            // NaN from LLInt/baseline; wall clock once DFG compiles it
new Date().getTime();  // wall clock (different sentinel predicate)

jest.useRealTimers();
setSystemTime(new Date("1960-01-01"));
Date.now();            // wall clock: the negative override is silently ignored

Verification

Built a debug Bun linked against this branch's JavaScriptCore (bun scripts/build.ts --webkit=local) and compared against the released Bun 1.4.0 (pinned WebKit, the parent of this branch).

Scenario Bun 1.4.0 (pinned WebKit) This branch
setSystemTime(ms) then 2M hot Date.now() calls diverged at iteration 16872 no divergence
setSystemTime(new Date("1960-01-01")) ignored (Date.now(), new Date(), Date() all wall clock) all three frozen at -315619200000
setSystemTime(new Date(-1)) ignored frozen at -1
setSystemTime(ms), tier up, then setSystemTime() to clear original bug masks it holds while frozen, unfreezes on clear
useFakeTimers({ now: NaN }) Date.now() is NaN until iteration 24099, then wall clock; new Date() wall clock never NaN, all readers agree from iteration 0

Bun's test/js/bun/test/{test-timers,fake-timers} and test/regression/issue/{25869,26284} suites pass against the branch. Three it.failing tests in test/js/bun/test/fake-timers/sinonjs/issue-207.test.ts (should floor negative now values, should floor negative start times, should handle ticks on the negative side of the Epoch) now pass; their MIGRATION_NOTES.md entries say they were blocked on "no support for negative initial time", which is exactly the -1 sentinel.

Required Bun-side change

Bun writes -1 to clear the override in three places. The Bun PR that bumps past this commit must switch them to NaN in the same PR (and can drop it.failing from the three issue-207.test.ts tests above):

--- a/src/jsc/bindings/JSMockFunction.cpp
+++ b/src/jsc/bindings/JSMockFunction.cpp
@@ JSMock__jsUseRealTimers
-    globalObject->overridenDateNow = -1;
+    globalObject->overridenDateNow = PNaN;
@@ JSMock__jsSetSystemTime
-    globalObject->overridenDateNow = (argument0.isNumber() && argument0.asNumber() >= 0) ? argument0.asNumber() : -1;
+    globalObject->overridenDateNow = (argument0.isNumber() && argument0.asNumber() >= 0) ? argument0.asNumber() : PNaN;
--- a/src/runtime/test_runner/timers/FakeTimers.rs
+++ b/src/runtime/test_runner/timers/FakeTimers.rs
@@ CurrentTime::clear
-        JSMock__setOverridenDateNow(global, -1.0);
+        JSMock__setOverridenDateNow(global, f64::NAN);

This is exactly the diff the verification above was run with. No other Bun code reads or writes overridenDateNow.

Date.now() is tagged DateNowIntrinsic, so once a call site gets hot the
DFG bytecode parser inlines it as a DateNow node. Both the DFG and FTL
lower that node to operationDateNow, which returned jsCurrentTime() and
ignored JSGlobalObject::overridenDateNow. The LLInt/baseline host
function (dateNow) reads the override, so after Date.now() tiered up it
began returning the real wall clock while the interpreter path still
returned the overridden time.

Pass the global object to operationDateNow and return overridenDateNow
when it is set, matching the dateNow host function. The DFG and FTL call
sites now forward the global object, mirroring operationRandom.

Fixes a case where a setSystemTime() override leaks into JIT-compiled
Date.now() callers (oven-sh/bun#32793).
@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@robobun, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 8 minutes and 45 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: d30fc021-106d-496a-9df6-dcd79a795041

📥 Commits

Reviewing files that changed from the base of the PR and between f72c015 and 5b388f9.

📒 Files selected for processing (4)
  • Source/JavaScriptCore/dfg/DFGOperations.cpp
  • Source/JavaScriptCore/dfg/DFGOperations.h
  • Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
  • Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Jun 26, 2026 •

Copy link
Copy Markdown

Preview Builds

Commit Release Date
c789dd38 autobuild-preview-pr-257-c789dd38 2026-06-29 13:20:37 UTC
5b388f92 autobuild-preview-pr-257-5b388f92 2026-06-26 23:50:39 UTC

@sosukesuzuki

Copy link
Copy Markdown
Member

@robobun The Claude review comments are right that ms < 0 ? jsCurrentTime() : ms breaks the DFG's SpecDoubleReal proof when the override is NaN (DFGAbstractInterpreterInlines.h proves DateNow is a non-NaN double), but switching only operationDateNow to jsDateNow() would re-introduce a tier divergence for that same edge case: host dateNow uses < 0 (returns NaN), while jsDateNow() uses > -1 (falls back to the wall clock).

Please unify all readers — dateNow, dateNowImpl, callDate, and operationDateNow — on a single helper so every tier reads the same value.

Also consider using NaN as the "unset" sentinel (std::isnan(ms) ? jsCurrentTime() : ms) instead of -1:

  • it fixes the soundness issue structurally (the override path can never return NaN), and
  • it makes pre-epoch overrides work — with the current sentinel, setSystemTime(new Date("1960-01-01")) (negative ms) is silently treated as unset, and -1 itself is a valid timestamp (1969-12-31T23:59:59.999Z).

…sentinel

The five readers of JSGlobalObject::overridenDateNow decided "is an override
active" with two different predicates: jsDateNow() (used by new Date())
checked `> -1`, while dateNow, dateNowImpl, callDate and operationDateNow
checked `< 0`. Route all of them through jsDateNow() so every tier and every
entry point reads the same value. jsCurrentTime() now has exactly one caller
in JavaScriptCore.

Switch the "no override" sentinel from -1 to NaN:

- Soundness: the DFG abstract interpreter proves DateNow yields
  SpecDoubleReal (a non-NaN double), but a NaN stored in overridenDateNow
  passed the `ms < 0` check and was returned as-is, so LLInt/baseline
  Date.now() returned NaN while DFG/FTL returned the wall clock. This is
  reachable from Bun via jest.useFakeTimers({ now: NaN }). With
  `std::isnan(ms) ? jsCurrentTime() : ms` the result can never be NaN, so
  the type proof holds by construction.

- Pre-epoch overrides work: every negative timestamp used to read as
  "unset", so setSystemTime(new Date("1960-01-01")) was silently ignored,
  and -1 itself (1969-12-31T23:59:59.999Z) could never be the frozen time.

Bun's writers (src/jsc/bindings/JSMockFunction.cpp and
src/runtime/test_runner/timers/FakeTimers.rs) store -1 to clear the
override; the Bun PR that bumps past this commit must switch those to NaN.
@robobun

robobun commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator Author

@sosukesuzuki done in c789dd3, thanks for catching this.

  • All four readers (dateNow, dateNowImpl, callDate, operationDateNow) now go through JSGlobalObject::jsDateNow(). constructDate already did, so jsCurrentTime() now has exactly one caller in JavaScriptCore.
  • The sentinel is NaN (PNaN), and jsDateNow() is std::isnan(ms) ? jsCurrentTime() : ms. Neither branch can produce NaN, so the SpecDoubleReal proof holds regardless of what gets written into the field, and every real double (including negatives and -1) is a usable override.

While verifying I found the NaN case is reachable from Bun's public API today. jest.useFakeTimers({ now: NaN }) (or { now: new Date("invalid") }) stores NaN into overridenDateNow. On Bun 1.4.0 that makes Date.now() return NaN from LLInt/baseline (the ms < 0 check passes it through), while new Date() returns the wall clock (the > -1 check), and once the Date.now() call site tiers up it flips to the wall clock too. With the NaN sentinel, NaN reads as "no override" and every reader agrees from the first call.

Verification (the full before/after table is in the PR body): I built a debug Bun linked against this branch (bun scripts/build.ts --webkit=local) plus the Bun-side writer change below. The original 2M-iteration tier-up repro no longer diverges, pre-epoch setSystemTime(new Date("1960-01-01")) now actually freezes Date.now(), new Date(), and Date(), and three it.failing tests in Bun's own test/js/bun/test/fake-timers/sinonjs/issue-207.test.ts (should floor negative now values, should floor negative start times, should handle ticks on the negative side of the Epoch) now pass. Their MIGRATION_NOTES.md entries say they were blocked on "no support for negative initial time", which was the -1 sentinel.

Because Bun writes -1 to clear the override, the oven-sh/bun PR that bumps past this commit needs this companion in the same PR (no other Bun code reads or writes overridenDateNow):

 src/jsc/bindings/JSMockFunction.cpp
@@ JSMock__jsUseRealTimers
-    globalObject->overridenDateNow = -1;
+    globalObject->overridenDateNow = PNaN;
@@ JSMock__jsSetSystemTime
-    globalObject->overridenDateNow = (argument0.isNumber() && argument0.asNumber() >= 0) ? argument0.asNumber() : -1;
+    globalObject->overridenDateNow = (argument0.isNumber() && argument0.asNumber() >= 0) ? argument0.asNumber() : PNaN;

 src/runtime/test_runner/timers/FakeTimers.rs
@@ CurrentTime::clear
-        JSMock__setOverridenDateNow(global, -1.0);
+        JSMock__setOverridenDateNow(global, f64::NAN);

Happy to open that Bun PR (the WebKit bump, the writer change, a regression test for oven-sh/bun#32793, and dropping the three it.failing markers) once this lands and an autobuild exists.

@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown

Caution

Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted.

Error details
{}

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

c789dd3 addresses my earlier soundness concern — every reader now goes through jsDateNow() and the NaN sentinel makes SpecDoubleReal hold by construction. I'm not auto-approving since this touches DFG/FTL lowering and changes the embedder-facing sentinel (requires the coordinated Bun-side writer change), so leaving final sign-off to a human.

Extended reasoning...

Overview

The PR makes operationDateNow (the DFG/FTL lowering of the DateNow intrinsic) honor JSGlobalObject::overridenDateNow, fixing a tier divergence where Date.now() returned the wall clock once a call site tiered up while LLInt/Baseline returned the frozen time. After review feedback, c789dd3 unified all readers (dateNow, dateNowImpl, callDate, operationDateNow, and the existing constructDate) on JSGlobalObject::jsDateNow(), and switched the "no override" sentinel from -1 to PNaN. Six files touched: the JIT operation declaration/definition, the DFG and FTL call sites, DateConstructor.cpp, and JSGlobalObject.h.

Security risks

None identified. The change reads a trusted embedder-set double and routes it through an existing helper; no untrusted input, parsing, auth, or memory-safety surface is introduced. The SpecDoubleReal invariant that the DFG abstract interpreter relies on is now structurally guaranteed (std::isnan(ms) ? jsCurrentTime() : ms can never yield NaN), which is strictly safer than before.

Level of scrutiny

High. This is JavaScriptCore JIT-tier code: it changes a JIT operation signature, the DFG SpeculativeJIT and FTL LowerDFGToB3 call sites, and an invariant the abstract interpreter proves about DateNow. It also changes the semantics of an embedder-facing field — the sentinel for "no override" moves from -1 to PNaN, which is a deliberate cross-repo ABI break requiring the companion Bun change spelled out in the PR body. That coordination, plus the JIT-correctness surface, puts this outside the bar for bot auto-approval even though the diff itself is small and the reasoning is sound.

Other factors

  • My two earlier inline comments on the first revision (NaN breaking the SpecDoubleReal proof; suggestion to reuse jsDateNow()) are fully addressed by c789dd3. The remaining cross-realm note was flagged as non-blocking and matches the existing ArithRandom precedent.
  • A human maintainer (sosukesuzuki) is already engaged, requested the unification + NaN-sentinel approach, and has not yet re-reviewed the follow-up commit; final sign-off naturally belongs there.
  • The author has run end-to-end verification against a locally linked Bun and the relevant test suites, and documented the required Bun-side diff so the WebKit bump can land atomically with the writer change.

@Jarred-Sumner
Jarred-Sumner merged commit 8ea8da7 into main Jun 30, 2026
49 checks passed
robobun added a commit to oven-sh/bun that referenced this pull request Jun 30, 2026
…cc3d833c)

Add a regression test for #32793: a Date.now() call site that tiers into
the DFG/FTL used to stop honoring the setSystemTime() override, because
operationDateNow returned the wall clock instead of going through
JSGlobalObject::jsDateNow(). Fixed upstream of Bun in oven-sh/WebKit#257,
which this bump delivers.
robobun added a commit to oven-sh/bun that referenced this pull request Jun 30, 2026
oven-sh/WebKit#257 changed the "no override is active" sentinel on
JSGlobalObject::overridenDateNow from -1 to NaN, so writing -1 in the
jest.useRealTimers() and setSystemTime() reset paths now leaves Date.now()
frozen at -1 ms (1969-12-31T23:59:59.999Z) instead of returning to the
real clock. Write NaN instead.

The old >= 0 gate in JSMock__jsSetSystemTime existed only to serve the -1
sentinel, and it silently dropped every pre-epoch and zero override. With
the NaN sentinel any real timestamp is a valid override, so
setSystemTime(-1) and setSystemTime(new Date("1960-01-01")) now work, and
test/js/bun/test/test-timers.test.ts gains a test that fails on Bun 1.4.0.

Delete JSMock__jsUseRealTimers: nothing registers it. jest.useRealTimers
is the Rust use_real_timers in FakeTimers.rs.
Jarred-Sumner pushed a commit to oven-sh/bun that referenced this pull request Jul 1, 2026
Bumps `vendor/WebKit` to upstream `WebKit/WebKit@d81bcc3d833c`
(2026-06-30). 887 upstream commits since the last Bun sync point
(`b5ba38a21e17`, 2026-06-16); 117 touch `Source/JavaScriptCore`, 54
touch `Source/WTF`, 10 touch `Source/bmalloc`.

The fork-side work is split across two merge PRs:

- oven-sh/WebKit#261: `b5ba38a21e17` to `ce481c4cfedb`, merged as
`0d9ee56ba4f6`.
- oven-sh/WebKit#263: `ce481c4cfedb` to `d81bcc3d833c`, based on the
fork's current `main`, so it also carries oven-sh/WebKit#257 and
oven-sh/WebKit#262, which landed on the fork between the two merges and
which fix real Bun bugs (see below).

> [!NOTE]
> oven-sh/WebKit#263 has landed on `main` as `c9ad5813fd23`, and
`WEBKIT_VERSION` now points at that commit's release,
`autobuild-c9ad5813fd23bd8b98b0738abc3d037ec716aa92`. Nothing else is
pending on the WebKit side. It was landed as a squash rather than a
merge commit, but `c9ad5813fd23`'s git tree is byte-identical to the
preview head `f652829d78`'s tree (verified: both are `470eee60f5`), so
the final artifacts are built from exactly the source all of the
verification below ran against. The squash does drop the upstream parent
link, so whoever does the next fork upgrade will need a merge-base fixup
like the one that followed oven-sh/WebKit#251.

Fixes #32793

## Bun changes required by this upgrade

### From `b5ba38a2 -> ce481c4c`: three builtin rewrites

Upstream removed three bytecode intrinsics that Bun's built-in JS
modules use (https://bugs.webkit.org/show_bug.cgi?id=318076 and
https://bugs.webkit.org/show_bug.cgi?id=318028). Bumping the version
without these rewrites aborts on every `Buffer.from()` call:

```
ASSERTION FAILED: Private symbol not found: tryGetByIdWithWellKnownSymbol(value, "toPrimitive");
```

and on `new console.Console(stream).table(...)` (the global
`console.table` is native and was unaffected).

- `src/js/builtins/JSBufferConstructor.ts`:
`$tryGetByIdWithWellKnownSymbol(value, "toPrimitive")` becomes an
ordinary `value[Symbol.toPrimitive]` read, which is exactly what Node's
`lib/buffer.js` does. The removed intrinsic never invoked accessors, so
this is also a Node-compat improvement: a getter-defined
`Symbol.toPrimitive` is now honored.
`test/js/node/buffer-from-symbol-to-primitive.test.ts` covers it and
fails on the released Bun.
- `src/js/builtins/ConsoleObject.ts`: `$isMapIterator` /
`$isSetIterator` become `require("node:util/types").isMapIterator /
isSetIterator`, which is exactly what Node's
`internal/console/constructor.js` does.
`test/js/node/console/console-table-iterators.test.ts` is a snapshot
test that passes on both the released Bun and this branch, proving the
rewrite is behavior-preserving (there was no prior coverage for
`Console#table` on a Map/Set iterator).
- `src/js/builtins.d.ts`: the declarations for all ten removed
intrinsics are deleted so nothing reaches for them again.

### From oven-sh/WebKit#257: `jest` fake-time code must use the new
`NaN` sentinel

oven-sh/WebKit#257 changed the "no override is active" sentinel on
`JSGlobalObject::overridenDateNow` from `-1` to `NaN` (see
`JSGlobalObject::jsDateNow()`). Bun's reset paths still wrote `-1`,
which the new semantics read as a *live* override frozen at `-1` ms, so
`jest.useRealTimers()` and `setSystemTime()` with no argument left
`Date.now()` stuck at `1969-12-31T23:59:59.999Z`.
`test/js/bun/test/test-timers.test.ts` ("we can go back in time") caught
this against a Bun built from the #263 artifact.

- `src/runtime/test_runner/timers/FakeTimers.rs`: `CurrentTime::clear`
(the `jest.useRealTimers()` path) writes `f64::NAN` instead of `-1.0`.
- `src/jsc/bindings/JSMockFunction.cpp`, `JSMock__jsSetSystemTime`: the
reset value becomes `PNaN`. The old `>= 0` / `std::isnormal()` gating
existed only to serve the `-1` sentinel and silently dropped every
pre-epoch and zero override (a bug the #257 review called out); with the
`NaN` sentinel every real timestamp is a valid override, so
`setSystemTime(-1)` and `setSystemTime(new Date("1960-01-01"))` now
work. A new test in `test/js/bun/test/test-timers.test.ts` covers the
pre-epoch, zero, `-1`, and no-argument-reset cases and fails on Bun
1.4.0.
- Deleted `JSMock__jsUseRealTimers` from `JSMockFunction.cpp`: nothing
registers it (`jest.useRealTimers` is the Rust `use_real_timers` in
`FakeTimers.rs`), and it was the third place that would have needed the
sentinel change.

`ce481c4c -> d81bcc3d` itself (the 84 upstream commits) requires
nothing: no bytecode intrinsics changed, `JSType.h` did not change, and
the only WebCore code-generator change is to a helper Bun does not use.

## Bun bugs fixed by the fork-side commits this carries

- oven-sh/WebKit#257: `Date.now()` is tagged `DateNowIntrinsic`, so a
hot call site is inlined by the DFG/FTL as a `DateNow` node, and
`operationDateNow` returned the wall clock instead of reading
`JSGlobalObject::overridenDateNow`. A `setSystemTime()` override
therefore silently wore off as soon as a `Date.now()` call site tiered
up (#32793). `test/regression/issue/32793.test.ts` spawns the loop from
that issue and asserts the override never diverges; on the released Bun
it diverges at iteration 99, and it also fails against a build of this
branch's previous pin (`0d9ee56ba4f6`, which predates #257), so the test
isolates exactly this commit.
- oven-sh/WebKit#262: a top-level `import()` whose embedder fetch
rejects with a value that is not an `ErrorInstance` (a single-message
transpile failure rejects with a `BuildMessage`) poisoned its module
registry entry, and every later importer of the same file hung forever.
The Bun-side regression test lives in #33149, which also pins a WebKit
preview; once this lands, #33149 reduces to its test plus its
`scripts/sync-webkit-source.ts` improvement.

## Why the regression tests are spawned fixtures

Without the three builtin rewrites, a Bun built against this WebKit
aborts on the first `Buffer.from()` call:

```
ASSERTION FAILED: Private symbol not found: tryGetByIdWithWellKnownSymbol(value, "toPrimitive");
```

`Buffer.from` is fundamental enough that this takes down the `bun test`
runner itself, before any test file finishes loading and before the
JUnit reporter can write anything. So
`buffer-from-symbol-to-primitive.test.ts` and
`console-table-iterators.test.ts` live in two small files of their own
and spawn a child Bun instead of calling the affected APIs in process: a
child abort becomes an ordinary `exitCode`/`stdout` assertion failure,
whereas an in-process call takes the parent test runner down with it and
reports nothing. Their fail-before is "this branch minus the `src/js/`
rewrites", which is a deterministic SIGABRT:

```sh
git checkout $(git merge-base HEAD origin/main) -- src/js/   # keep scripts/ (the WEBKIT_VERSION bump)
bun bd test test/js/node/buffer-from-symbol-to-primitive.test.ts
# => ASSERTION FAILED: Private symbol not found: tryGetByIdWithWellKnownSymbol(...)  (SIGABRT)
git checkout HEAD -- src/js/
```

`test/js/bun/test/test-timers.test.ts` is the equivalent fail-before for
the sentinel change: with the `src/` diff reverted but the new WebKit
kept, both "we can go back in time" and the new `setSystemTime` test
fail.

`test/regression/issue/32793.test.ts` is different from all of the
above: its fix lives entirely in the vendored engine, selected by
`scripts/build/deps/webkit.ts` rather than by anything under `src/`. So
its before/after is a function of which WebKit artifact is linked, not
of the `src/` diff: it fails on the released Bun (1.4.0), fails against
this branch built with the previous pin `0d9ee56ba4f6`, and passes
against this branch built with the #263 artifact.

## Verification

All of the following were run against a debug Bun built from this branch
and the `autobuild-preview-pr-263-f652829d` artifact.

- The four test files this PR adds or modifies
(`test/js/bun/test/test-timers.test.ts`,
`test/regression/issue/32793.test.ts`,
`test/js/node/buffer-from-symbol-to-primitive.test.ts`,
`test/js/node/console/console-table-iterators.test.ts`): 5 tests, all
pass. Every one fails in the right "before" state as described above.
- Every test file in the repo that exercises `setSystemTime` /
`useFakeTimers` / `useRealTimers` / `advanceTimers*` (the blast radius
of the sentinel change):
`test/js/bun/test/fake-timers/fake-timers.test.ts`,
`test/js/bun/test/fake-timers/sinonjs/fake-timers.test.ts`,
`test/js/bun/cron/in-process-cron.test.ts`,
`test/regression/issue/25869.test.ts`,
`test/regression/issue/26284.test.ts`, and the five
`test/js/third_party/jsonwebtoken/*.test.js` suites. 249 pass, 1 todo, 0
fail.
- One more file turned out to be in that blast radius:
`test/js/bun/test/fake-timers/sinonjs/issue-207.test.ts`. The sentinel
change makes pre-epoch and negative clock values work, so its three
long-`.failing` tests ("should floor negative now values", "should floor
negative start times", "should handle ticks on the negative side of the
Epoch") started passing, which Bun's runner reports as a failure until
the stale marker is removed. `d2309c92c2` removes them; all ten tests in
the file pass against this branch.
- `test/js/node/buffer.test.js`: 539 pass, 1 pre-existing skip, 0 fail.
`test/js/node/console/console.test.ts`: 7 pass. Neither file is modified
by this PR.
- oven-sh/WebKit#263's preview build produced all 43 platform artifacts
with no job failures.

## Upstream changelog

<details>
<summary><code>ce481c4c</code> -> <code>d81bcc3d</code> (the new hop in
this revision)</summary>

Memory safety and security:

- `TypedArray.from()` out-of-bounds read via resizable `ArrayBuffer`
resize/transfer inside the `mapFn` callback
- Stale structure bit in `SlowPutArrayStorage`
- Do not cache property absence on dictionary structures
- Missing `codeBlock->m_lock` in `repatchGetBySlowPathCall`
- Insert a write barrier for `MultiPutByOffset` when it can reallocate
storage
- Unconditionally keep `OMGOSREntryCallee` alive while updating its
callsites
- Disallow defining private names on WasmGC objects
- Size limit on Yarr-generated code

Correctness:

- DFG spread did not account for `cellButterflyOnlyAtomStringsStructure`
- YarrJIT `negativeOffsetIndexedAddress` discarded the adjusted base
register
- `DFGArgumentsEliminationPhase::removeViaKill` did not reset the node
scan index between `InlineCallFrame`s

Other:

- An `ArrayStorage`-specific `GetByVal` DFG operation
- ES2022 private method support in the Web Inspector
- WTF: `TinyLRUCache::findIfCached` / `insert`

</details>

<details>
<summary>Security / correctness fixes (<code>b5ba38a2</code> ->
<code>ce481c4c</code>)</summary>

- Use-after-free after Wasm memory grow via a stale pointer folded by
DFGConstantFoldingPhase
- Keep `JSWebAssemblyMemory` alive from wasm-originated `JSArrayBuffer`s
(UAF)
- Use-after-free of `StreamingCompiler::m_ticket`
- `BBQCallee` kept alive between callsite collection and repatch
(upstreams and extends oven-sh/WebKit#210)
- `Array.from(arguments)` fast path bails out past
`MAX_STORAGE_VECTOR_LENGTH`
- `JSArray::fastFlat` bounds-checked against the maximum legal length
- `Array#flat` fast path was dropping prototype-backed holes in nested
arrays
- `Array.from(map.keys())` fast path was ignoring `Symbol.iterator`
overrides
- `RegExp#@@split` crash on a huge flags string
- `LiteralParser` takes the slow path if the original structure changes
- Missing exit-profile bails on some DFG nodes
- `IteratorClose` in `forEachInIterable` uses the Map/Set's own realm's
iterator structure
- YARR: JIT backreference with a non-BMP character was skipping the next
match start position
- Wasm Memory64: fix parsing of data segment init expressions
- Track `customSlotBase` for `CustomAccessorGetter` /
`CustomAccessorSetter`
- Set `MayStoreHole` appropriately; `"entries"` ArrayIterator emits
`ExitOK` before `NewArray`
- `poisonedDeadOSRExitValue` made crashier and on by default in debug
builds

</details>

<details>
<summary>Language features and spec alignment (<code>b5ba38a2</code> ->
<code>ce481c4c</code>)</summary>

- BigInt Math proposal implemented
- Temporal: spec-alignment passes across `PlainDate`, `PlainTime`,
`Duration`, `Instant`, plus a unified `ParseISODateTime`
- `Intl.PluralRules` reflects `compactDisplay` in its skeleton and
`resolvedOptions()`

</details>

<details>
<summary>Performance (<code>b5ba38a2</code> ->
<code>ce481c4c</code>)</summary>

JavaScript-visible fast paths:

- `JSON.stringify` space/indentation argument handled by
`FastStringifier`
- Fast path for the `RegExp#flags` getter; cached named-capture `groups`
Structure on `RegExp`
- Map/Set iterator `next` and `%RegExpStringIteratorPrototype%.next`
moved to C++
- int32 fast path in `parseInt` for short decimal strings
- `NumericStrings` int cache lookup inlined into DFG/FTL
`ToString(Int32)`
- `Object#isPrototypeOf` uses the `InstanceOf` DFG node
- `Object.freeze` / `seal` / `preventExtensions` no longer allocate
`ArrayStorage` for `NonArray` objects
- Map/Set `set` + `delete` churn no longer expands then immediately
shrinks
- Avoided an intermediate `StringImpl` allocation feeding
`StringBuilder` into `makeString`
- Wasm `intoCharCodeArray` bulk-copies 8-bit strings; unnecessary
watchpoints avoided
- `DFG::GetByVal` widens to `SpecBytecodeTop` instead of forcing an OSR
exit on an empty value profile

YARR (the RegExp engine):

- `latin1Table` for efficient Char8 filtering, reused for Char16 and the
interpreter
- `StringList` optimization when captures are unused; atom fast path
enabled for unicode patterns

JIT compile time (a large batch aimed at DFG/FTL/B3/Air throughput):

- Semi-NCA algorithm for `WTF::Dominators`; reverse post-order in
`WTF::Liveness` and B3 `ReduceStrength`; `SparseBitVector` in
`DFGLivenessAnalysis`
- Unified `SSACalculator`; dominance frontiers computed once per graph
- `AirFixObviousSpills`, `AirEliminateDeadCode`, `Air::RegLiveness`, and
the greedy register allocator all got cheaper
- B3 CSE reimplemented without `B3::Variable`; `B3::Value::effects` uses
a constant table
- `ReduceStrength` avoids fixed-point iteration; `InferSwitch` disabled
in B3 for Wasm
- Fixup-inserted `RegExp` primordial `TryGetById` chains replaced with a
single `CheckStructure`
- Parser: create save points only when actually needed
- Baseline/LLInt profile `op_unsigned` overflow and report int32
overflow to the DFG

</details>

<details>
<summary>WTF, bmalloc, and the build system (<code>b5ba38a2</code> ->
<code>ce481c4c</code>)</summary>

- `SaturatedArithmetic.h` and its APIs renamed to `Saturating` (Bun does
not use these directly)
- Checked arithmetic helpers now require two or more arguments
- `OrderedHashTable` load-factor policy aligned with `HashTable`
- `JSON::Value::dump` no longer corrupts large string values via
`PrintStream` truncation
- Structured clone: the remaining terminal JS value tags moved from
WebCore into JSC (`CloneSerializerBase.h` / `StructuredCloneTags.h`).
Bun keeps its own fork of `SerializedScriptValue.cpp`, so this is
additive.
- Workaround for a GCC 14+ false `-Wuninitialized` in `Variant`;
`[[msvc::no_unique_address]]` used on MSVC
- WTF / libpas exception codes changed to `0xbb08`
- libpas: per-heap tagging policy rework; `pas_deallocate` split into
inline-only and casual variants; PGO applied to WTF/bmalloc
- CMake: prefix headers expanded, headermap generation reworked, stale
staged headers pruned, and the Darwin platform block in `BPlatform.h` /
`pas_platform.h` no longer excludes CMake builds (restored in the fork,
see oven-sh/WebKit#261; without it the Linux-to-macOS cross lane fails
to link `gigacageEnabledForProcess`)

</details>
liooil pushed a commit to liooil/poly that referenced this pull request Aug 7, 2026
Bumps `vendor/WebKit` to upstream `WebKit/WebKit@d81bcc3d833c`
(2026-06-30). 887 upstream commits since the last Bun sync point
(`b5ba38a21e17`, 2026-06-16); 117 touch `Source/JavaScriptCore`, 54
touch `Source/WTF`, 10 touch `Source/bmalloc`.

The fork-side work is split across two merge PRs:

- oven-sh/WebKit#261: `b5ba38a21e17` to `ce481c4cfedb`, merged as
`0d9ee56ba4f6`.
- oven-sh/WebKit#263: `ce481c4cfedb` to `d81bcc3d833c`, based on the
fork's current `main`, so it also carries oven-sh/WebKit#257 and
oven-sh/WebKit#262, which landed on the fork between the two merges and
which fix real Bun bugs (see below).

> [!NOTE]
> oven-sh/WebKit#263 has landed on `main` as `c9ad5813fd23`, and
`WEBKIT_VERSION` now points at that commit's release,
`autobuild-c9ad5813fd23bd8b98b0738abc3d037ec716aa92`. Nothing else is
pending on the WebKit side. It was landed as a squash rather than a
merge commit, but `c9ad5813fd23`'s git tree is byte-identical to the
preview head `f652829d78`'s tree (verified: both are `470eee60f5`), so
the final artifacts are built from exactly the source all of the
verification below ran against. The squash does drop the upstream parent
link, so whoever does the next fork upgrade will need a merge-base fixup
like the one that followed oven-sh/WebKit#251.

Fixes #32793

## Bun changes required by this upgrade

### From `b5ba38a2 -> ce481c4c`: three builtin rewrites

Upstream removed three bytecode intrinsics that Bun's built-in JS
modules use (https://bugs.webkit.org/show_bug.cgi?id=318076 and
https://bugs.webkit.org/show_bug.cgi?id=318028). Bumping the version
without these rewrites aborts on every `Buffer.from()` call:

```
ASSERTION FAILED: Private symbol not found: tryGetByIdWithWellKnownSymbol(value, "toPrimitive");
```

and on `new console.Console(stream).table(...)` (the global
`console.table` is native and was unaffected).

- `src/js/builtins/JSBufferConstructor.ts`:
`$tryGetByIdWithWellKnownSymbol(value, "toPrimitive")` becomes an
ordinary `value[Symbol.toPrimitive]` read, which is exactly what Node's
`lib/buffer.js` does. The removed intrinsic never invoked accessors, so
this is also a Node-compat improvement: a getter-defined
`Symbol.toPrimitive` is now honored.
`test/js/node/buffer-from-symbol-to-primitive.test.ts` covers it and
fails on the released Bun.
- `src/js/builtins/ConsoleObject.ts`: `$isMapIterator` /
`$isSetIterator` become `require("node:util/types").isMapIterator /
isSetIterator`, which is exactly what Node's
`internal/console/constructor.js` does.
`test/js/node/console/console-table-iterators.test.ts` is a snapshot
test that passes on both the released Bun and this branch, proving the
rewrite is behavior-preserving (there was no prior coverage for
`Console#table` on a Map/Set iterator).
- `src/js/builtins.d.ts`: the declarations for all ten removed
intrinsics are deleted so nothing reaches for them again.

### From oven-sh/WebKit#257: `jest` fake-time code must use the new
`NaN` sentinel

oven-sh/WebKit#257 changed the "no override is active" sentinel on
`JSGlobalObject::overridenDateNow` from `-1` to `NaN` (see
`JSGlobalObject::jsDateNow()`). Bun's reset paths still wrote `-1`,
which the new semantics read as a *live* override frozen at `-1` ms, so
`jest.useRealTimers()` and `setSystemTime()` with no argument left
`Date.now()` stuck at `1969-12-31T23:59:59.999Z`.
`test/js/bun/test/test-timers.test.ts` ("we can go back in time") caught
this against a Bun built from the #263 artifact.

- `src/runtime/test_runner/timers/FakeTimers.rs`: `CurrentTime::clear`
(the `jest.useRealTimers()` path) writes `f64::NAN` instead of `-1.0`.
- `src/jsc/bindings/JSMockFunction.cpp`, `JSMock__jsSetSystemTime`: the
reset value becomes `PNaN`. The old `>= 0` / `std::isnormal()` gating
existed only to serve the `-1` sentinel and silently dropped every
pre-epoch and zero override (a bug the #257 review called out); with the
`NaN` sentinel every real timestamp is a valid override, so
`setSystemTime(-1)` and `setSystemTime(new Date("1960-01-01"))` now
work. A new test in `test/js/bun/test/test-timers.test.ts` covers the
pre-epoch, zero, `-1`, and no-argument-reset cases and fails on Bun
1.4.0.
- Deleted `JSMock__jsUseRealTimers` from `JSMockFunction.cpp`: nothing
registers it (`jest.useRealTimers` is the Rust `use_real_timers` in
`FakeTimers.rs`), and it was the third place that would have needed the
sentinel change.

`ce481c4c -> d81bcc3d` itself (the 84 upstream commits) requires
nothing: no bytecode intrinsics changed, `JSType.h` did not change, and
the only WebCore code-generator change is to a helper Bun does not use.

## Bun bugs fixed by the fork-side commits this carries

- oven-sh/WebKit#257: `Date.now()` is tagged `DateNowIntrinsic`, so a
hot call site is inlined by the DFG/FTL as a `DateNow` node, and
`operationDateNow` returned the wall clock instead of reading
`JSGlobalObject::overridenDateNow`. A `setSystemTime()` override
therefore silently wore off as soon as a `Date.now()` call site tiered
up (#32793). `test/regression/issue/32793.test.ts` spawns the loop from
that issue and asserts the override never diverges; on the released Bun
it diverges at iteration 99, and it also fails against a build of this
branch's previous pin (`0d9ee56ba4f6`, which predates #257), so the test
isolates exactly this commit.
- oven-sh/WebKit#262: a top-level `import()` whose embedder fetch
rejects with a value that is not an `ErrorInstance` (a single-message
transpile failure rejects with a `BuildMessage`) poisoned its module
registry entry, and every later importer of the same file hung forever.
The Bun-side regression test lives in #33149, which also pins a WebKit
preview; once this lands, #33149 reduces to its test plus its
`scripts/sync-webkit-source.ts` improvement.

## Why the regression tests are spawned fixtures

Without the three builtin rewrites, a Bun built against this WebKit
aborts on the first `Buffer.from()` call:

```
ASSERTION FAILED: Private symbol not found: tryGetByIdWithWellKnownSymbol(value, "toPrimitive");
```

`Buffer.from` is fundamental enough that this takes down the `bun test`
runner itself, before any test file finishes loading and before the
JUnit reporter can write anything. So
`buffer-from-symbol-to-primitive.test.ts` and
`console-table-iterators.test.ts` live in two small files of their own
and spawn a child Bun instead of calling the affected APIs in process: a
child abort becomes an ordinary `exitCode`/`stdout` assertion failure,
whereas an in-process call takes the parent test runner down with it and
reports nothing. Their fail-before is "this branch minus the `src/js/`
rewrites", which is a deterministic SIGABRT:

```sh
git checkout $(git merge-base HEAD origin/main) -- src/js/   # keep scripts/ (the WEBKIT_VERSION bump)
bun bd test test/js/node/buffer-from-symbol-to-primitive.test.ts
# => ASSERTION FAILED: Private symbol not found: tryGetByIdWithWellKnownSymbol(...)  (SIGABRT)
git checkout HEAD -- src/js/
```

`test/js/bun/test/test-timers.test.ts` is the equivalent fail-before for
the sentinel change: with the `src/` diff reverted but the new WebKit
kept, both "we can go back in time" and the new `setSystemTime` test
fail.

`test/regression/issue/32793.test.ts` is different from all of the
above: its fix lives entirely in the vendored engine, selected by
`scripts/build/deps/webkit.ts` rather than by anything under `src/`. So
its before/after is a function of which WebKit artifact is linked, not
of the `src/` diff: it fails on the released Bun (1.4.0), fails against
this branch built with the previous pin `0d9ee56ba4f6`, and passes
against this branch built with the #263 artifact.

## Verification

All of the following were run against a debug Bun built from this branch
and the `autobuild-preview-pr-263-f652829d` artifact.

- The four test files this PR adds or modifies
(`test/js/bun/test/test-timers.test.ts`,
`test/regression/issue/32793.test.ts`,
`test/js/node/buffer-from-symbol-to-primitive.test.ts`,
`test/js/node/console/console-table-iterators.test.ts`): 5 tests, all
pass. Every one fails in the right "before" state as described above.
- Every test file in the repo that exercises `setSystemTime` /
`useFakeTimers` / `useRealTimers` / `advanceTimers*` (the blast radius
of the sentinel change):
`test/js/bun/test/fake-timers/fake-timers.test.ts`,
`test/js/bun/test/fake-timers/sinonjs/fake-timers.test.ts`,
`test/js/bun/cron/in-process-cron.test.ts`,
`test/regression/issue/25869.test.ts`,
`test/regression/issue/26284.test.ts`, and the five
`test/js/third_party/jsonwebtoken/*.test.js` suites. 249 pass, 1 todo, 0
fail.
- One more file turned out to be in that blast radius:
`test/js/bun/test/fake-timers/sinonjs/issue-207.test.ts`. The sentinel
change makes pre-epoch and negative clock values work, so its three
long-`.failing` tests ("should floor negative now values", "should floor
negative start times", "should handle ticks on the negative side of the
Epoch") started passing, which Bun's runner reports as a failure until
the stale marker is removed. `d2309c92c2` removes them; all ten tests in
the file pass against this branch.
- `test/js/node/buffer.test.js`: 539 pass, 1 pre-existing skip, 0 fail.
`test/js/node/console/console.test.ts`: 7 pass. Neither file is modified
by this PR.
- oven-sh/WebKit#263's preview build produced all 43 platform artifacts
with no job failures.

## Upstream changelog

<details>
<summary><code>ce481c4c</code> -> <code>d81bcc3d</code> (the new hop in
this revision)</summary>

Memory safety and security:

- `TypedArray.from()` out-of-bounds read via resizable `ArrayBuffer`
resize/transfer inside the `mapFn` callback
- Stale structure bit in `SlowPutArrayStorage`
- Do not cache property absence on dictionary structures
- Missing `codeBlock->m_lock` in `repatchGetBySlowPathCall`
- Insert a write barrier for `MultiPutByOffset` when it can reallocate
storage
- Unconditionally keep `OMGOSREntryCallee` alive while updating its
callsites
- Disallow defining private names on WasmGC objects
- Size limit on Yarr-generated code

Correctness:

- DFG spread did not account for `cellButterflyOnlyAtomStringsStructure`
- YarrJIT `negativeOffsetIndexedAddress` discarded the adjusted base
register
- `DFGArgumentsEliminationPhase::removeViaKill` did not reset the node
scan index between `InlineCallFrame`s

Other:

- An `ArrayStorage`-specific `GetByVal` DFG operation
- ES2022 private method support in the Web Inspector
- WTF: `TinyLRUCache::findIfCached` / `insert`

</details>

<details>
<summary>Security / correctness fixes (<code>b5ba38a2</code> ->
<code>ce481c4c</code>)</summary>

- Use-after-free after Wasm memory grow via a stale pointer folded by
DFGConstantFoldingPhase
- Keep `JSWebAssemblyMemory` alive from wasm-originated `JSArrayBuffer`s
(UAF)
- Use-after-free of `StreamingCompiler::m_ticket`
- `BBQCallee` kept alive between callsite collection and repatch
(upstreams and extends oven-sh/WebKit#210)
- `Array.from(arguments)` fast path bails out past
`MAX_STORAGE_VECTOR_LENGTH`
- `JSArray::fastFlat` bounds-checked against the maximum legal length
- `Array#flat` fast path was dropping prototype-backed holes in nested
arrays
- `Array.from(map.keys())` fast path was ignoring `Symbol.iterator`
overrides
- `RegExp#@@split` crash on a huge flags string
- `LiteralParser` takes the slow path if the original structure changes
- Missing exit-profile bails on some DFG nodes
- `IteratorClose` in `forEachInIterable` uses the Map/Set's own realm's
iterator structure
- YARR: JIT backreference with a non-BMP character was skipping the next
match start position
- Wasm Memory64: fix parsing of data segment init expressions
- Track `customSlotBase` for `CustomAccessorGetter` /
`CustomAccessorSetter`
- Set `MayStoreHole` appropriately; `"entries"` ArrayIterator emits
`ExitOK` before `NewArray`
- `poisonedDeadOSRExitValue` made crashier and on by default in debug
builds

</details>

<details>
<summary>Language features and spec alignment (<code>b5ba38a2</code> ->
<code>ce481c4c</code>)</summary>

- BigInt Math proposal implemented
- Temporal: spec-alignment passes across `PlainDate`, `PlainTime`,
`Duration`, `Instant`, plus a unified `ParseISODateTime`
- `Intl.PluralRules` reflects `compactDisplay` in its skeleton and
`resolvedOptions()`

</details>

<details>
<summary>Performance (<code>b5ba38a2</code> ->
<code>ce481c4c</code>)</summary>

JavaScript-visible fast paths:

- `JSON.stringify` space/indentation argument handled by
`FastStringifier`
- Fast path for the `RegExp#flags` getter; cached named-capture `groups`
Structure on `RegExp`
- Map/Set iterator `next` and `%RegExpStringIteratorPrototype%.next`
moved to C++
- int32 fast path in `parseInt` for short decimal strings
- `NumericStrings` int cache lookup inlined into DFG/FTL
`ToString(Int32)`
- `Object#isPrototypeOf` uses the `InstanceOf` DFG node
- `Object.freeze` / `seal` / `preventExtensions` no longer allocate
`ArrayStorage` for `NonArray` objects
- Map/Set `set` + `delete` churn no longer expands then immediately
shrinks
- Avoided an intermediate `StringImpl` allocation feeding
`StringBuilder` into `makeString`
- Wasm `intoCharCodeArray` bulk-copies 8-bit strings; unnecessary
watchpoints avoided
- `DFG::GetByVal` widens to `SpecBytecodeTop` instead of forcing an OSR
exit on an empty value profile

YARR (the RegExp engine):

- `latin1Table` for efficient Char8 filtering, reused for Char16 and the
interpreter
- `StringList` optimization when captures are unused; atom fast path
enabled for unicode patterns

JIT compile time (a large batch aimed at DFG/FTL/B3/Air throughput):

- Semi-NCA algorithm for `WTF::Dominators`; reverse post-order in
`WTF::Liveness` and B3 `ReduceStrength`; `SparseBitVector` in
`DFGLivenessAnalysis`
- Unified `SSACalculator`; dominance frontiers computed once per graph
- `AirFixObviousSpills`, `AirEliminateDeadCode`, `Air::RegLiveness`, and
the greedy register allocator all got cheaper
- B3 CSE reimplemented without `B3::Variable`; `B3::Value::effects` uses
a constant table
- `ReduceStrength` avoids fixed-point iteration; `InferSwitch` disabled
in B3 for Wasm
- Fixup-inserted `RegExp` primordial `TryGetById` chains replaced with a
single `CheckStructure`
- Parser: create save points only when actually needed
- Baseline/LLInt profile `op_unsigned` overflow and report int32
overflow to the DFG

</details>

<details>
<summary>WTF, bmalloc, and the build system (<code>b5ba38a2</code> ->
<code>ce481c4c</code>)</summary>

- `SaturatedArithmetic.h` and its APIs renamed to `Saturating` (Bun does
not use these directly)
- Checked arithmetic helpers now require two or more arguments
- `OrderedHashTable` load-factor policy aligned with `HashTable`
- `JSON::Value::dump` no longer corrupts large string values via
`PrintStream` truncation
- Structured clone: the remaining terminal JS value tags moved from
WebCore into JSC (`CloneSerializerBase.h` / `StructuredCloneTags.h`).
Bun keeps its own fork of `SerializedScriptValue.cpp`, so this is
additive.
- Workaround for a GCC 14+ false `-Wuninitialized` in `Variant`;
`[[msvc::no_unique_address]]` used on MSVC
- WTF / libpas exception codes changed to `0xbb08`
- libpas: per-heap tagging policy rework; `pas_deallocate` split into
inline-only and casual variants; PGO applied to WTF/bmalloc
- CMake: prefix headers expanded, headermap generation reworked, stale
staged headers pruned, and the Darwin platform block in `BPlatform.h` /
`pas_platform.h` no longer excludes CMake builds (restored in the fork,
see oven-sh/WebKit#261; without it the Linux-to-macOS cross lane fails
to link `gigacageEnabledForProcess`)

</details>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants