Skip to content

Upgrade to upstream WebKit 1d4bed41aca8 - #992

Closed
robobun wants to merge 632 commits into
mainfrom
robobun/0ce9862d/upgrade-to-1d4bed41aca8
Closed

robobun wants to merge 632 commits into
mainfrom
robobun/0ce9862d/upgrade-to-1d4bed41aca8

Conversation

@robobun

@robobun robobun commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

  • The fork is 616 upstream commits behind since Upgrade to upstream WebKit e8f704815e94 #923. 105 touch JavaScriptCore, WTF or bmalloc.
  • Upstream rewrote code that the fork changes: microtask dispatch, weak handles, the proxy trap cache, the JSON.parse string cache, WTF::Atomics.

Fix

Background

Downsides

  • In Bun's CI (Upgrade WebKit to 1d4bed41aca8 bun#47811) a compiled program with a full heap sometimes did not end. With 3b77c53c69 the lane that showed it in 4 of 4 builds shows it in 0 of 3.
  • One more difference from upstream: a value definition calls the setter of a custom value (BUN-TEST-DIFFERENCES.md A11). A maintainer still decides it (Upgrade WebKit to 1d4bed41aca8 bun#47811).
  • An embedder must change every finalize() override, and opcode numbers move. Each weak handle does three atomic operations (+3.1% cycles for new ArrayBuffer(64), x64). jsc grows by 196,984 bytes (+0.32%).
Notes

Open: what Bun's CI shows with this engine

oven-sh/bun#47811 pins the build of da82a279b9: this branch without main, with the changes of dcaba855fc, 3b77c53c69, fec01eb589 and 09e949d324 on top. Its earlier CI builds had the builds of bcef3ec0b6, 62d643e3fe and fef6892630, which are the same with none, one and two of those changes.

Two questions for a maintainer are in oven-sh/bun#47811 (comment), with the numbers behind them: may a value definition install onmessage (the rule of dcaba855fc), and does the fork keep upstream's atomic weak handles (WebKit/WebKit@5edecbf3e9). Both decide code of this pull request.

The order of landing. WeakHandleOwner::finalize() returns void on main and in oven-sh/bun#47605, and FinalizeResult here and in oven-sh/bun#47811. Neither side compiles against the other. So this pull request must not merge while neither of the two Bun pull requests is on Bun's main. The order that follows /upgrade-webkit: oven-sh/bun#47605 lands, this pull request takes main and merges as a merge commit, and oven-sh/bun#47811 pins that commit.

  • A compiled program that fills its heap sometimes did not end: 3b77c53c69.

    • What CI showed: four CI builds of that pull request ran the tests before this commit. Debian 13 aarch64 had a test at its time limit in all four, Alpine 3.23 aarch64 in two, Debian 13 x64 and x64-asan in one. Each such test passed when its file ran again. The three builds with this commit (137304, 137328 and 137387) have none on any lane. That is a small sample: Upgrade WebKit to 1d4bed41aca8 bun#47811 says what closes it. Most of these tests run an executable with BUN_JSC_markedBlockCageSizeInMB=64 until it gets its RangeError, and one limits the Structure heap. The annotations of 28 builds of other pull requests from the same days have no such timeout. The test jobs here pass on arm64.
    • Bun's test harness now prints the threads of such a child. In build 137251 the main thread and JSC Heap Collector Thread both sleep in a futex wait without a time limit, neither uses the processor, and there is no helper thread.
    • The state: the collector thread waits in SlotVisitor::drainInParallelPassively() for the helpers to mark. Upstream starts the helpers when a collection begins. In a compiled image they start with the first work that is donated, and a collection of Heap::collectForExhaustedCage() starts none. So nobody marks, and nobody wakes the collector thread: under the stochastic scheduler, which a machine with four processors or more uses, the wait has no time limit. The mutator then waits in Heap::waitForCollector() for its next synchronous collection, which never begins.
    • How the collector thread gets there: Collector::runConcurrentPhase() lets it wait where the mutator has heap access and does not wait. The mutator is in that state when it stops waiting for a collection while the next one is in its concurrent phase already. It conducted the end of the first and the start of the next in one turn, and waitForCollector() then hands the conn over with the waiting bit clear.
    • The change: drainInParallelPassively() drains actively where no helper has started. Without compiled code the helpers have always started, so nothing changes there.
    • Test: testaot native collector/helpers/collector-thread-marks-beside-a-running-mutator-without-them. A heap finalizer keeps a collection in its epilogue until the thread of collectContinuously has asked for the next one. Local, Debug with ASAN: without the change the process sleeps in both threads in 3 of 3 runs, after half a second of processor time. With it the test passes in 2 s in 5 of 5 runs, and the 21 native collector tests pass.
    • Not new with the merge, by reading: before WebKit/WebKit@76ec268ed0 the same test of the mutator's state was inside drainInParallelPassively(). With a second source of requests (BUN_JSC_collectContinuously=1) an executable of Bun stops on x64 too: in 2 of 30 runs on a busy machine at a period of 0.5 ms without the change, and in 0 of 30 with it.
    • Not found: what asks for the second collection in the programs of Bun's tests, and why the old engine did not show it in CI. So the commit removes a deadlock that exists. That it is the one of those CI runs follows from one thread list and from the counts above. Nobody saw the route there, and I have no aarch64 machine to take a stack. The changes of this range in that path are WebKit/WebKit@d0f5aa9d1b (waitForCollector() without the collector's lock) and WebKit/WebKit@76ec268ed0 (who marks in the concurrent phase).
  • A store through a proxy without traps onto a custom value: dcaba855fc. Upstream changed this on purpose and tests it (JSTests/stress/reflect-set-proxy-receiver-custom-value.js): the property is redefined on the target and the native setter does not run. Bun's onmessage and onerror of the global object, Error.prepareStackTrace, Module.prototype.require and the exports of a compiled module are custom values whose setters keep state elsewhere, so test/js/web/web-globals.test.js failed in two tests and a later direct store did nothing either.

    • The commit puts one arm into validateAndApplyPropertyDescriptor(): a definition that gives a value and changes no attribute hands the value to the setter of a custom value that has one and is not read-only, with the holder and in the holder's realm. The property stays a custom value. A definition that changes an attribute, an accessor definition and delete replace it as before.
    • It is a difference from upstream on purpose: one expectation of upstream's test flips (Object.hasOwn(reified, 'value2')), and JSTests/BUN-TEST-DIFFERENCES.md has it as A11. A row of a static table that is not reified keeps upstream's result.
    • What changes without a proxy: Object.defineProperty(holder, name, { value }) reaches the setter too. For Error.prepareStackTrace that is what V8 does. For onmessage of the global object it installs a handler where an inert data property was left before.
    • A compiled object keeps such a property in its extra properties, an ordinary object that is nobody's holder. Object::defineOwnProperty() calls the setter itself, with the object. testaot native slot-exit/definitions-by-native-code fails without that part.
    • Local, Debug with ASAN: the new JSTests/stress/bun-definition-of-a-value-reaches-the-setter-of-a-custom-value.js and upstream's test pass in the default, eager and no-concurrent-JIT modes, and both fail without the commit. 230 runs of the stress tests that touch custom values or defineProperty pass. testaot run Source/JavaScriptCore/aot/tests: 5,860 passed, 1 failed (the instruction counter), 42 todo, as before.
    • fec01eb589 closes the one definition that went around the rule: a class field on an object that the constructor of the base class returned. putDirectWithReify() asks canPutDirectFast(), which refused only a property that is not configurable, and then called putDirect(). It refuses a custom value too now, so the slow path defines the property. Without it class extends Base { require = hook } over Bun's Module.prototype put the hook in the place of the custom value in the interpreter and in every JIT tier, and Object.defineProperty with the same descriptor did not. The stress test has both forms of the field, and fails on them with the jsc of fef6892630.
    • What the integrity levels do, the same before and after the merge: Object.preventExtensions() defines nothing. Object.seal() and Object.freeze() define each property again with configurable: false on most objects, which changes an attribute, so the custom value becomes a plain value. A JSFinalObject and a JSArray take one transition of the structure, which leaves a custom value what it is. A11 says so, and says when the rule can go: when Bun has no custom value with a setter left that a script sees as data. The stress test has the three levels.
    • The rule is +68/-1 lines in four files: runtime/JSObject.cpp +15, runtime/CommonSlowPaths.h +6, aot/object/AOTObjectMethodTable.cpp +44, aot/runtime/AOTPropertyRunOperations.cpp +3/-1.
    • In Bun with the build of 62d643e3fe (Upgrade WebKit to 1d4bed41aca8 bun#47811, debug build with ASAN): the two tests of web-globals.test.js pass again. New tests store to onmessage, onerror, Error.prepareStackTrace and Module.prototype.require in twelve ways that end in a definition, and to the exports of a compiled module in five. They pass, and each fails with the build of bcef3ec0b6.
  • The list of opcodes changed under the fork's bytecode optimizer: 09e949d324. Findings 1 and 2 of the review below have one cause: upstream added an opcode, BytecodeOptimizer.cpp has its switches over opcodes written by hand, and an opcode without a case compiles. No build and no test failed for either. A static_assert on a fingerprint of FOR_EACH_BYTECODE_ID (the names and the lengths, in order) now stops the build when the list changes, and its comment says what to do then. A count of the opcodes is not enough: one opcode more and one less leaves it as it was.

  • Every weak handle is atomic now (WebKit/WebKit@5edecbf3e9, taken as upstream has it). Three steps in the life of a handle are atomic read-modify-write operations: allocate, finalize, free. They guard WeakSet::finalizeDeadHandles(), which nothing in the fork or in Bun calls. jsc of the x64 lto-aot lane, 4d45755fed4a against fef6892630, cycles for each object, medians of 31 runs in turn: new ArrayBuffer(64) 582 to 599 (+3.1%), new Uint8Array(2048) 1,379 to 1,439 (+4.4%), and new Uint8Array(512), which has no weak handle, 276 to 276. Not measured on aarch64, where each step is a call of an outline-atomics helper. Whether the fork keeps this is the second question for the maintainers.

The merge of main

CI

Until main was merged in, the pull request conflicted with main and GitHub started no run for it. The first two runs below are ci.yml dispatched on the branch. A dispatched run builds the same lanes and publishes autobuild-<commit>.

First run, the merge commit 08d5b793e7 (41518658951): 80 jobs passed, 5 failed.

  • Every lane but two built: Linux glibc and musl, Android, FreeBSD, macOS and Windows, x64 and arm64.
  • The test jobs of x64 lto and of arm64 lto, lto-aot, lto-hardened and lto-hardened-aot passed: run-javascriptcore-tests, testaot, testFFI, and on arm64 testb3, testair, testmasm and TestWTF.
  • linux-amd64-lto-aot and linux-amd64-lto-hardened-aot did not build, so their test jobs and the release failed. They are the two lanes that compile testmasm for x86-64. Upstream's new testVectorDupElement() (WebKit/WebKit@22dc3983b6) calls MacroAssembler::supportsAVX() without an assembler and writes MacroAssembler::s_avx2CheckState. The fork has neither: an assembler has the CPU features of its policy. cc64b9e260 ports the test. Locally testmasm passes its 448 tests, testair passes, and upstream's new testb3 tests pass.

Second run, bcef3ec0b6 (41539454382): 85 jobs passed, none failed.

  • Every lane built, with the two that the first run lost, and the release autobuild-bcef3ec0b60be8b146bbd23a43fa38abd2359214 has its 77 assets. oven-sh/bun pins it.
  • All six test jobs passed: x64 lto, lto-aot and lto-hardened-aot, arm64 lto, lto-aot, lto-hardened and lto-hardened-aot. That is run-javascriptcore-tests with testaot, testb3, testair and testmasm, and testFFI and TestWTF.
  • The head is one commit further, 2edbf27734. It changes the arm of runInternalMicrotask() without USE(BUN_JSC_ADDITIONS), which no lane compiles, so no run was started for it.

Third run, 4c7a938f2e, the first run of the pull request itself (41575101974): 85 jobs passed, none failed, 2 skipped.

  • Every lane built, and the preview release autobuild-preview-pr-992-4c7a938f has its 77 assets.
  • All seven test jobs passed: x64 lto, lto-aot and lto-hardened-aot, arm64 lto, lto-aot, lto-hardened and lto-hardened-aot.

Fourth run, the head dcaba855fc (41608738924): 85 jobs passed, none failed, 2 skipped.

  • Every lane built, and the preview release autobuild-preview-pr-992-dcaba855 has its 77 assets.
  • All seven test jobs passed, with the new stress test and the new native test of testaot.
  • The same commit on top of 2edbf27734, which is this branch without main, is 62d643e3fe on the branch robobun/0ce9862d/upgrade-to-1d4bed41aca8-bun-main-engine (41608740449): 85 jobs passed, none failed, 2 skipped. Upgrade WebKit to 1d4bed41aca8 bun#47811 pins its release autobuild-62d643e3feb490b6224dc2fdd898451782790727 until the Bun side of main is in.

Fifth run, the head 3b77c53c69 (41651254168): 85 jobs passed, none failed, 2 skipped.

  • Every lane built, and all seven test jobs passed, with the new native test of the collector on x64 and arm64.
  • The same commit on the branch that Bun pins is fef6892630 (41651248464): 85 jobs passed, none failed, 2 skipped. Upgrade WebKit to 1d4bed41aca8 bun#47811 pins its release autobuild-fef6892630b298c1fa8c3f21b91e7717dd46e23b.

Sixth run, the head 09e949d324 (41719613544): 85 jobs passed, none failed, 2 skipped.

Sizes, jsc of the x64 lto-aot lane, 4d45755fed4a against bcef3ec0b6: the file goes from 61,513,656 to 61,710,640 bytes, .text from 37,511,443 to 37,680,579, .rodata from 14,943,289 to 14,947,273. The tarball goes from 397,405,577 to 401,803,221 bytes. bcef3ec0b6 against 62d643e3fe, which is the cost of dcaba855fc: .text goes from 37,680,579 to 37,681,763 bytes (+1,184), and .rodata, .data and .data.rel.ro do not change.

What the review of the merged tree found

After the merge compiled, every file that both sides changed, every upstream commit of the range and every conflict was read again for what the merge itself breaks: upstream code that goes around a rule of the fork, and fork code that follows a contract that upstream changed. A second reader tried to refute each finding. Eight held, and each has a commit.

What was wrong Seen as Commit
1 The fork's BytecodeOptimizer had no case for op_call_varargs_with_spread. It kept values that are live across f(a, ...b) in registers that the callee frame overwrites. --useBytecodeOptimizer=1, and what bun build --bytecode writes: a local read back as 1014 for 1000, or as a word of the callee's frame header. e17271fe1a
2 The opcode numbers moved and cachedTypesFormatRevision did not. A cache written before the merge is decoded with shifted opcodes where the embedder's version does not change: the jsc shell, a Bun built without BUN_WEBKIT_VERSION. 531a5a54e1
3 JSCellButterfly::createFromArray() shares copy-on-write storage since WebKit/WebKit@2d4cefa9da. Storage in an image has no cell in front of it. Read from the code: op_spread of interpreted code on an array of the image with Contiguous elements. No program of mine reached it. 4ebd4538d1
4 JSONCache kept long strings of both widths in one table and gave either to either text. An 8-bit text got 16-bit strings after a 16-bit text had the same value, and missed the table on every repeat. Values stayed equal. a25dd6b054
5 A sloppy store through a proxy without traps onto a locked property depended on what the proxy had cached. In a realm that locks built-ins: p.floor = f through new Proxy(Math, {}) was ignored the first time and threw from the second time on. 768023ae08
6 The call patchpoint of OMG asked for one register more than x86-64 has, for image code in BoundsChecking mode with six arguments in registers. bun build --compile --aot of a module without a memory that calls through its table with six i32: FATAL: no register for %tmp33, Stopped while compiling in BuildImage (allocateRegistersByGreedy). ab2c0c92fe
7 Upstream's new loop of Object.entries() over indexed properties did not look for the owed out-of-memory error of the cage. Read from the code. dbd4c0c9f0
8 stopIfNecessarySlow() asserted heap access behind collectInMutatorThread(), while the fork keeps the asserts at its start off. Read from the code. No caller without access was found in JavaScriptCore or in Bun. bcef3ec0b6
  • 1 and 4 have tests here: JSTests/stress/bytecode-optimizer-call-frames.js and JSTests/stress/bun-json-parse-long-string-has-the-width-of-its-text.js. 1, 5 and 6 have tests in the Bun pull request (Upgrade WebKit to 1d4bed41aca8 bun#47811), which fail with the engine of the merge commit.
  • The review found no defect in the hand-resolved conflicts of the microtask dispatcher, the weak handles, Atomics.h, the x64 CPU features, freeze and seal, and the WTF files.
  • The review on this pull request asked for one more: without USE(BUN_JSC_ADDITIONS) the dispatcher of microtasks named a fourth argument that it does not have there. 2edbf27734 passes an empty value in that arm.

Which of these commits are for upstream

None. Each commit repairs a place where upstream's new code meets code or a rule that only this fork has. Upstream's tree at 1d4bed41aca8 has none of the things in the right column.

Commit What only the fork has
cc64b9e260 A CPUFeatureSet for each assembler. Upstream's test uses the process-wide s_avx2CheckState.
e17271fe1a bytecode/BytecodeOptimizer.cpp
531a5a54e1 cachedTypesFormatRevision
4ebd4538d1 Copy-on-write storage in an image (isOutsideHeap())
a25dd6b054 A long JSON string that keeps the width of its text. Upstream narrows it (StringImpl::create8BitIfPossible()), so one table for both widths is right there.
768023ae08 The policy for locked properties
ab2c0c92fe Code for an image (codeForImage)
dbd4c0c9f0 throwOutOfMemoryErrorIfOwed()
bcef3ec0b6 A caller of stopIfNecessarySlow() without heap access. Upstream asserts access at its start.
2edbf27734 The arms of USE(BUN_JSC_ADDITIONS)
dcaba855fc A setter behind a custom value that keeps state elsewhere. Upstream tests the opposite result on purpose.
3b77c53c69 Helpers that start lazily, and collections that start none (Heap::collectForExhaustedCage())
fec01eb589 The rule of dcaba855fc
09e949d324 bytecode/BytecodeOptimizer.cpp

The review looked for defects of the merge. It found no defect in upstream's own code.

What needs a careful look

Weak handles (WebKit/WebKit@5edecbf3e9). WeakBlock::sweep() copies the value and the context out of the slot, marks the slot Finalized with a compare-and-swap, and then calls the finalizer with a handle to the copy.

  • A finalizer that returns KeepImpl can still clear its own Weak<> on the mutator, as the wrapper owners of WebCore do. Bun's finalizers do that (uncacheWrapper(), the self-deleting N-API reference), and they all return KeepImpl.
  • WeakImpl::asWeakImpl() is gone. Nothing of the fork's own code or of Bun used it.
  • WeakSet::lastChanceToFinalize() now repeats until no live handle is left, so a handle that a finalizer makes during VM teardown is finalized too.
  • The fork's ASAN unpoison of a dead cell before its finalizer runs (compiled image) moved from WeakBlock::finalize(), which is gone, into the loop of sweep().

The microtask dispatcher (WebKit/WebKit@9fadb87996). The old switch is 54 functions now.

  • Microtask.h: the fork's jobs are in upstream's X-macro list at the positions they had. No InternalMicrotask changes its number. Bun uses BunPerformMicrotaskJob and BunInvokeJobWithArguments by name.
  • Code that the fork had in a case is in the job's function: AsyncContextSwapScope around the jobs that run user code, the tail calls into compiled bodies, the result promise of PromiseFinallyReactionJob, the bare step of AsyncGeneratorDriverResume.
  • The dispatcher leaves with MUST_TAIL_CALL. With clang on Windows and the ahead-of-time compiler it is a real [[clang::musttail]], as the fork had it.

The heap's stop protocol (WebKit/WebKit@d39ac42a0f, WebKit/WebKit@d0f5aa9d1b, WebKit/WebKit@76ec268ed0). stopIfNecessarySlow() and waitForCollector() are upstream's new functions with the fork's changes applied again.

  • The two asserts on hasAccessBit and stoppedBit stay commented out, as since 2023.
  • Upstream's new assert says that no collection epilogue is pending in stopIfNecessarySlow(). That holds for a caller with heap access. The fork lets a caller in without access, and for it the epilogue can be pending until its next acquireAccess(). The assert has the condition || !(oldState & hasAccessBit) here.
  • The branches for a compiled image (collectInMutatorThreadUntilDone(), parkWhileWorldStateIs(), tryEnsureThreadForWork()) are the fork's.

Proxy (WebKit/WebKit@23777f3b79). Upstream caches all 13 traps in one byte each, and a [[Set]] whose receiver is a proxy without defineProperty and getOwnPropertyDescriptor traps defines on the target.

  • A compiled handler keeps its traps in fields, not in the Structure. Its cache entry is field * 2 + foundNothingWhileEmpty in the same byte, for a field below 127. A higher field takes the full lookup every time.
  • forwardsOwnPropertyDefinitionToTarget() is false for a compiled handler. AOT::RuntimeHooks::targetThatProxyDefinesOn() answers for it, as before.
  • definePropertyOnReceiver() keeps the fork's check of immutable properties on the receiver that the define reaches.

Object.freeze() and Object.seal() (WebKit/WebKit@7e80df541f). Upstream's fast paths take arrays now.

  • They do not take an object with immutable properties. That also keeps an array that is frozen in place out of the quick answers of Object.isFrozen() and Object.isSealed().
  • Object.freeze(array) goes to the fork's tryFreezeArrayInPlace() when the VM keeps dense arrays dense (ArrayStoragePolicy::KeepsDenseArraysDense). Upstream's path would convert the array.

JSON.parse (WebKit/WebKit@609fc1ce23, WebKit/WebKit@5eb574b25c). Upstream packs the entries of the string cache and adds a table of strings of 17 to 256 characters, which it matches against the bytes of the source.

  • A UTF-8 source (Bun.JSONL) takes a short entry only when its text is ASCII, as before. It never takes a long entry by its bytes: the bytes of the source are not the characters of the string.
  • JSONCache::findString() is back as the lookup of a short entry, for the JSON scanner of compiled programs.

Wasm (WebKit/WebKit@311da4540c, WebKit/WebKit@1d4bed41ac).

  • OMG: the non-tail indirect call switches the instance inside the patchpoint. The fork stores the callee-frame CodeBlock slot there. Code for an image cages the memory base through a scratch that is not the callee instance (finding 6).
  • IPInt: upstream's gates for ARM64E. The Linux arm64 lanes with signed return addresses (RETURN_ADDRESS_SIGNING) sign the two return addresses of the restore frame as before. The arm64 lto-hardened test jobs of the first run passed with it.

Seen on the way, not caused by the merge

  • testb3 testSinkValuesReadsStackSlotWhereWaysMeet builds invalid IR in its NoStackSlot form: ArgumentValueList::operator[] appends an ArgumentReg to the root block each time, and the test reads arguments[2] after the root block has its Branch. B3 validation stops a Debug testb3 there (B3Validate.cpp:113). The release lanes do not validate between phases, so CI does not see it.
  • With --keepDenseArraysDense=1 and no compiled code, a private brand on an array that is frozen in place trips ASSERT(oldStructure == newStructure->previousID()) in llint_slow_path_set_private_brand. The fork has the same code before the merge.

Local checks

  • Every file that the fork had not changed is identical to upstream's. Every file that upstream had not changed is identical to the fork's, but for the 20 files of the Atomics API, VM.cpp, DFGDoesGCCheck.h and AOTJSONScanner.h in the merge commit, and the files of the nine commits behind it. A script compared all paths of the four trees.
  • JSType.h, OptionsList.h, .github, the Dockerfiles and the structured clone sources are untouched. The builtins directory is untouched, so the numbers of the engine's builtins do not move: Bun's 1,853 engine IR tests pass unchanged (1,852 passed, 1 todo) with a Debug testaot of bcef3ec0b6.
  • The Debug ASAN jsc of bcef3ec0b6 runs the stress tests in their default mode with the options of their //@ lines: 1,053 runs pass, with the 53 tests that upstream added in this range and the fork's bytecode-optimizer-* and bun-* tests. Five runs do not start, because they give the shell less than 300 KB of stack or nest 300 scopes, and the frames of this configuration are large: stress/json-stringify-executing-in-reserved-zone.js, stress/module-graph-loading-stack-overflow.js, wasm/stress/tail-call-cross-instance-no-thunk-accumulation.js and the two runs of stress/bytecode-optimizer-static-scopes-deep-nesting.js. The release jsc of 4d45755fed4a passes all of them.
  • 15 of the tests that upstream added in this range fail with the release jsc of 4d45755fed4a and pass here. Among them: constant-folding-get-by-val-to-get-by-id-keeps-property-check.js (expected 3 got 4), string-replace-cached-replacement-changes-width.js, finalization-registry-dead-token-key-is-pruned.js, licm-has-indexed-property-array-mode-not-checked.js (SIGSEGV), wasm/stress/omg-cross-instance-indirect-call-bounds-checking-size.js and wasm/stress/bbq-tail-call-stack-shuffle-cycle.js.
  • Bun (main at 129f3c7a89 with the 36 finalize() overrides changed) builds against this branch as its local WebKit, Debug with ASAN, and runs.

Not compiled locally

  • Windows, macOS, arm64, Android, musl, and a build without the ahead-of-time compiler. CI compiled all of them for the merge commit.
  • Atomics.h has the fork's fallback for a libc++ without std::atomic_ref (Android NDK). It is written again on the new API. The Android lanes of the first run built it.

csaavedra and others added 30 commits October 30, 2026 08:31
…ests abort when org.a11y.Bus does not reply

https://bugs.webkit.org/show_bug.cgi?id=329569

Reviewed by Patrick Griffis.

GtkTestRunner overrides _setup_testing_environment() to check that the accessibility
bus is reachable and disable TestWebKitAccessibility otherwise, but that hook was
renamed to _setup_testing_environment_for_driver() in 298719@main, so the override has
not run since. Besides, the check threw away the address it got and treated an empty
address as success.

Meanwhile, TestMain.cpp unsets DBUS_SESSION_BUS_ADDRESS, so on the GTK bots, where there
is no $XDG_RUNTIME_DIR/bus, every test process autolaunches its own session bus and GTK
asks the org.a11y.Bus activated on that bus for the accessibility bus address. That
service fails there, and about 1% of the time it disconnects without replying, which
GTK reports with a g_warning() that is fatal under g_test, aborting the first WebViewTest
of the binary (/webkit/WebKitSettings/user-agent, /webkit/WebKitNetworkSession/ephemeral).

Port the override to the current hook and have it hand the tests the accessibility bus
address as AT_SPI_BUS_ADDRESS, which GTK, libatspi and WebKit all honour without asking
the session bus, so the test processes never call GetAddress at all. When the address
cannot be obtained, run the tests with GTK_A11Y=none, which stops GTK from asking too,
and skip TestWebKitAccessibility as before.

* Tools/Scripts/run-gtk-tests:
(GtkTestRunner.__init__):
(GtkTestRunner._query_accessibility_bus_address):
(GtkTestRunner._setup_testing_environment_for_driver):
(GtkTestRunner._ensure_accessibility_service_is_running): Deleted.
(GtkTestRunner._setup_testing_environment): Deleted.

Canonical link: https://commits.webkit.org/325253@main
https://bugs.webkit.org/show_bug.cgi?id=326378
rdar://189209518

Reviewed by Alexey Proskuryakov.

Dispatch `pointerDown`, `pointerUp` and `pointerMove` for pointer input sources
(mouse; pen and touch dispatch as mouse on Mac) through the shared `SimulatedInputDispatcher`.

BiDi runs opt into `SimulatedInputRunOptions`: viewport-origin coordinates are mapped to
the target navigable's viewport (computed by the web process in main-frame layout-viewport coordinates, the same way `computeElementLayout` converts points).
Move targets outside that viewport fail with "move target out of bounds".

`pointerMove` with a duration is interpolated, and a move to the current position dispatches nothing.
WebDriver Classic passes default options and is unchanged.

Fresh BiDi pointer sources start unpositioned at the target viewport's origin, so their first
move always dispatches. Each action keeps its own duration, and a `pointerMove` without one uses
the tick duration. `pointerUp` of a button that isn't pressed is a no-op.

Pressing a second button while one is held is not supported yet (the dispatcher models one button per source).
Back and Forward map to their platform buttons on Mac; other ports report them as unsupported
until their mappings are added (webkit.org/b/329449).

* Source/WebKit/UIProcess/Automation/BidiInputAgent.cpp:
(WebKit::Automation::BidiInputState::simulatedSource):
(WebKit::Automation::mouseButtonForW3CButton): Added.
(WebKit::Automation::translateTicksToKeyFrames):
Translate pointerDown, pointerUp, pointerMove and pointer pauses. Stamp each action's duration on its own entry,
and the tick duration on a pointerMove without one.

(WebKit::dispatchKeyFrames):
Run through `WebAutomationSession::runBidiInteractionSequence`.

* Source/WebKit/UIProcess/Automation/SimulatedInputDispatcher.h:
(WebKit::SimulatedInputViewport): Added.
(WebKit::SimulatedInputRunOptions): Added.
* Source/WebKit/UIProcess/Automation/SimulatedInputDispatcher.cpp:
(WebKit::SimulatedInputDispatcher::SimulatedInputDispatcher):
(WebKit::SimulatedInputDispatcher::~SimulatedInputDispatcher):
(WebKit::SimulatedInputDispatcher::currentLocationOfSource): Added.
(WebKit::SimulatedInputDispatcher::resolveLocation):
Map viewport-origin locations into the target viewport and check move target out of bounds when a viewport is given.

(WebKit::SimulatedInputDispatcher::transitionInputSourceToState):
Skip same-location mouse moves and interpolate pointerMove over its duration when opted in.

(WebKit::SimulatedInputDispatcher::startPointerMoveInterpolation): Added.
(WebKit::SimulatedInputDispatcher::pointerMoveInterpolationTimerFired): Added.
(WebKit::SimulatedInputDispatcher::finishPointerMoveInterpolation): Added.
(WebKit::SimulatedInputDispatcher::run):
(WebKit::SimulatedInputDispatcher::cancel):
(WebKit::SimulatedInputDispatcher::finishDispatching):
* Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::runBidiInteractionSequence): Added.
Fetch the target frame's viewport in main-frame coordinates and run with it.

(WebKit::WebAutomationSession::runInteractionSequence):
Take `SimulatedInputRunOptions`.

(WebKit::WebAutomationSession::performInteractionSequence):
(WebKit::WebAutomationSession::cancelInteractionSequence):
* Source/WebKit/UIProcess/Automation/WebAutomationSession.h:
* Source/WebKit/UIProcess/Automation/mac/WebAutomationSessionMac.mm:
(WebKit::automationMouseButtonToPlatformMouseButton):
* Source/WebKit/UIProcess/WebPageProxy.cpp:
* Source/WebKit/WebProcess/Automation/WebAutomationSessionProxy.cpp:
(WebKit::WebAutomationSessionProxy::frameViewportInLayoutViewport): Added.
* Source/WebKit/WebProcess/Automation/WebAutomationSessionProxy.h:
* Source/WebKit/WebProcess/Automation/WebAutomationSessionProxy.messages.in:

Canonical link: https://commits.webkit.org/325254@main
… cross-site iframes

https://bugs.webkit.org/show_bug.cgi?id=324418
rdar://153675532

Reviewed by Ben Nham.

With site isolation enabled, the edge colors that LocalFrameView::fixedContainerEdges samples
do not include the content of an iframe hosted by another process. The snapshot that
PageColorSampler::predominantColor takes of the main frame has no pixels for it.

Fix by making the edge a FrameIdentifier when the hit test lands in the content box of an
iframe whose content frame is a RemoteFrame. A fixed container with a visible background
color keeps using that color. The UI process sends SetFixedContainerEdgeSamplingSides to that
frame's process, which maps the layout viewport edge of the main frame into its own
coordinates and samples each requested side with PageColorSampler::predominantColor. A side
is sampled again only while it has found nothing (PredominantColorType::None), or when the
frame's process receives the sides again. The colors go to the UI process in
RemoteLayerTreeCommitBundle, where each FrameIdentifier is resolved to the frame's color and
given to the page client. The UI process derives the sides from the main frame's edges. While
the main frame reports the top edge as locked (Page::canSampleTopFixedContainerEdge), it does
not request the top side and keeps the resolved top color. It also drops the entry of a
destroyed frame. It also clears that state when a new document commits in the main frame.
LocalFrameView::fixedContainerEdges no longer copies a stored FrameIdentifier for the same
container when the hit is not over a remote frame.

PageColorSampler::predominantColor takes a LocalFrame. The strip rect and color finishing code
that fixedContainerEdges used move to PageColorSampler, so the iframe's process and the UI
process use the same code as the main frame's process.

Add tests for an iframe that navigates to the main frame's site and for a top edge that does
not change after scrolling. Remove the Skip expectations of the nine tests that landed before.

Tests: http/tests/site-isolation/edge-sampling-cross-site-iframe-navigated-same-site.html
       http/tests/site-isolation/edge-sampling-cross-site-iframe-top-locked.html

* LayoutTests/http/tests/site-isolation/edge-sampling-cross-site-iframe-navigated-same-site-expected.txt: Added.
* LayoutTests/http/tests/site-isolation/edge-sampling-cross-site-iframe-navigated-same-site.html: Added.
* LayoutTests/http/tests/site-isolation/edge-sampling-cross-site-iframe-top-locked-expected.txt: Added.
* LayoutTests/http/tests/site-isolation/edge-sampling-cross-site-iframe-top-locked.html: Added.
* LayoutTests/http/tests/site-isolation/resources/paint-on-message-frame.html: Added.
* LayoutTests/platform/ios/TestExpectations:
* LayoutTests/platform/mac-wk2/TestExpectations:
* Source/WebCore/page/LocalFrameView.cpp:
(WebCore::LocalFrameView::fixedContainerEdges const):
* Source/WebCore/page/Page.cpp:
(WebCore::Page::canSampleTopFixedContainerEdge const):
(WebCore::Page::updateFixedContainerEdges):
* Source/WebCore/page/Page.h:
* Source/WebCore/page/PageColorSampler.cpp:
(WebCore::PageColorSampler::fixedContainerSampleRect):
(WebCore::PageColorSampler::finishedFixedContainerColor):
(WebCore::PageColorSampler::predominantColor):
* Source/WebCore/page/PageColorSampler.h:
* Source/WebCore/platform/FixedContainerEdges.cpp:
(WebCore::FixedContainerEdges::hasFixedEdge const):
(WebCore::FixedContainerEdges::predominantColor const):
* Source/WebCore/platform/FixedContainerEdges.h:
* Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTree.serialization.in:
* Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeCommitBundle.h:
* Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeCommitBundle.mm:
(WebKit::RemoteLayerTreeCommitBundle::description const):
* Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in:
* Source/WebKit/UIProcess/Cocoa/PageClientImplCocoa.h:
* Source/WebKit/UIProcess/Cocoa/PageClientImplCocoa.mm:
(WebKit::PageClientImplCocoa::didUpdateFixedContainerEdges):
(WebKit::PageClientImplCocoa::didCommitMainFrameData): Deleted.
* Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm:
(WebKit::WebPageProxy::didCommitMainFrameData):
(WebKit::fixedContainerEdgeSamplingSides):
(WebKit::WebPageProxy::updateFixedContainerEdgeSampling):
(WebKit::WebPageProxy::didReceiveFixedContainerEdges):
(WebKit::WebPageProxy::resendFixedContainerEdgeSamplingSides):
(WebKit::WebPageProxy::resolveFixedContainerEdges):
(WebKit::WebPageProxy::resetFixedContainerEdgeSamplingForMainFrameLoad):
* Source/WebKit/UIProcess/PageClient.h:
* Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
* Source/WebKit/UIProcess/WebFrameProxy.cpp:
(WebKit::WebFrameProxy::commitProvisionalFrame):
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didDestroyFrame):
(WebKit::WebPageProxy::didCommitLoadForFrame):
(WebKit::WebPageProxy::resetState):
* Source/WebKit/UIProcess/WebPageProxy.h:
* Source/WebKit/UIProcess/WebPageProxyInternals.h:
* Source/WebKit/UIProcess/ios/PageClientImplIOS.h:
* Source/WebKit/UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::didCommitMainFrameData): Deleted.
* Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
(WebKit::WebPage::willCommitMainFrameData):
* Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::updateRendering):
* Source/WebKit/WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setFixedContainerEdgeSamplingSides):
(WebKit::fixedContainerEdgeSampleRect):
(WebKit::WebPage::sampleFixedContainerEdges):
* Source/WebKit/WebProcess/WebPage/WebPage.h:
* Source/WebKit/WebProcess/WebPage/WebPage.messages.in:

Canonical link: https://commits.webkit.org/325255@main
…t called it

https://bugs.webkit.org/show_bug.cgi?id=329433
rdar://191316639

Reviewed by Timothy Hatcher.

This patch stops Port.disconnect() from firing onDisconnect on the port
that called it. Chrome and Firefox fire onDisconnect only on the other end
of the connection.

WebExtensionAPIPort::disconnect() called fireDisconnectEventIfNeeded(),
which also calls the port's own listeners. disconnect() now marks the port
as disconnected, removes its onMessage listeners, and removes the port,
which still notifies the other end. fireDisconnectEventIfNeeded() calls
disconnect() and then fires the listeners, so a disconnect from the other
end behaves as before.

When runtime.connect(), runtime.connectNative(), tabs.connect(), or
runtime.connect() from a web page fails, the caller's port must still get
onDisconnect with port.error set. Those paths called disconnect(), and now
call fireDisconnectEventIfNeeded() instead, which is now public.

PortDisconnectFromContentScript and PortDisconnect now fail if the port
that called disconnect() gets onDisconnect. Their listeners only asserted
true before, so they passed either way. The new
ConnectWithoutListenersFiresOnDisconnectWithError test covers a failed
tabs.connect().

* Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPIPortCocoa.mm:
(WebKit::WebExtensionAPIPort::disconnect):
(WebKit::WebExtensionAPIPort::fireDisconnectEventIfNeeded):
* Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPITabsCocoa.mm:
(WebKit::WebExtensionAPITabs::connect):
* Source/WebKit/WebProcess/Extensions/API/WebExtensionAPIPort.h:
* Source/WebKit/WebProcess/Extensions/API/WebExtensionAPIRuntime.cpp:
(WebKit::WebExtensionAPIRuntime::connect):
(WebKit::WebExtensionAPIRuntime::connectNative):
(WebKit::WebExtensionAPIWebPageRuntime::connect):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/WKWebExtensionAPIRuntime.mm:
(TestWebKitAPI::TEST(WKWebExtensionAPIRuntime, PortDisconnectFromContentScript)):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/WKWebExtensionAPITabs.mm:
(TestWebKitAPI::TEST(WKWebExtensionAPITabs, PortDisconnect)):
(TestWebKitAPI::TEST(WKWebExtensionAPITabs, ConnectWithoutListenersFiresOnDisconnectWithError)):

Canonical link: https://commits.webkit.org/325256@main
…es to intrinsic width contributions in one place

https://bugs.webkit.org/show_bug.cgi?id=329252
<rdar://problem/191209134>

Reviewed by Antti Koivisto.

Every renderer stops clamping its own contributions; RenderBox now applies aspect-ratio transfer, border/padding, then
min/max-width in one shared step, with four renderers overriding the clamp for their special rules:
- RenderTable (max-width never below the min-content width),
- RenderTableCell (the quirks mode nowrap minimum),
- RenderReplaced (both of its clamps, merged) and
- RenderMathMLOperator (lspace and rspace go around the operator's box).

No change in behavior, except that an invisible operator's min-width and max-width now apply after its glyph width is taken out
of its contributions.

* Source/WebCore/rendering/RenderBlock.cpp:
(WebCore::RenderBlock::computeIntrinsicLogicalWidthContributions):
* Source/WebCore/rendering/RenderBox.cpp:
(WebCore::RenderBox::computeIntrinsicLogicalWidthContributionsIfNeeded):
(WebCore::RenderBox::computeIntrinsicLogicalWidthContributions):
(WebCore::RenderBox::constrainIntrinsicLogicalWidthContributionsByMinMax const):
(WebCore::RenderBox::constrainIntrinsicLogicalWidthsByMinMax const): Deleted.
* Source/WebCore/rendering/RenderBox.h:
* Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp:
(WebCore::RenderDeprecatedFlexibleBox::computeIntrinsicLogicalWidthContributions):
* Source/WebCore/rendering/RenderFileUploadControl.cpp:
(WebCore::RenderFileUploadControl::computeIntrinsicLogicalWidthContributions):
* Source/WebCore/rendering/RenderFragmentContainer.cpp:
(WebCore::RenderFragmentContainer::computeIntrinsicLogicalWidthContributions):
* Source/WebCore/rendering/RenderListBox.cpp:
(WebCore::RenderListBox::computeIntrinsicLogicalWidthContributions):
* Source/WebCore/rendering/RenderMenuList.cpp:
(WebCore::RenderMenuList::computeIntrinsicLogicalWidthContributions):
* Source/WebCore/rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::computeIntrinsicLogicalWidthContributions):
(WebCore::RenderReplaced::constrainIntrinsicLogicalWidthContributionsByMinMax const):
(WebCore::RenderReplaced::computeReplacedLogicalWidthRespectingMinMaxWidth const):
* Source/WebCore/rendering/RenderReplaced.h:
* Source/WebCore/rendering/RenderSlider.cpp:
(WebCore::RenderSlider::computeIntrinsicLogicalWidthContributions):
* Source/WebCore/rendering/RenderTable.cpp:
(WebCore::RenderTable::constrainIntrinsicLogicalWidthContributionsByMinMax const):
(WebCore::RenderTable::computeIntrinsicLogicalWidthContributions):
* Source/WebCore/rendering/RenderTable.h:
* Source/WebCore/rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::computeIntrinsicLogicalWidthContributions):
(WebCore::RenderTableCell::constrainIntrinsicLogicalWidthContributionsByMinMax const):
* Source/WebCore/rendering/RenderTableCell.h:
* Source/WebCore/rendering/RenderTextControl.cpp:
(WebCore::RenderTextControl::computeIntrinsicLogicalWidthContributions):
* Source/WebCore/rendering/mathml/RenderMathMLBlock.cpp:
(WebCore::RenderMathMLBlock::sizeAppliedToMathContent):
(WebCore::RenderMathMLBlock::intrinsicLogicalWidthContributionsForMathContent):
* Source/WebCore/rendering/mathml/RenderMathMLBlock.h:
* Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp:
(WebCore::RenderMathMLOperator::computeIntrinsicLogicalWidthContributions):
(WebCore::RenderMathMLOperator::constrainIntrinsicLogicalWidthContributionsByMinMax const):
* Source/WebCore/rendering/mathml/RenderMathMLOperator.h:
* Source/WebCore/rendering/mathml/RenderMathMLToken.cpp:
(WebCore::RenderMathMLToken::computeIntrinsicLogicalWidthContributions):

Canonical link: https://commits.webkit.org/325257@main
https://bugs.webkit.org/show_bug.cgi?id=329499
rdar://191358848

Reviewed by Ian Grunert.

clang-cl treats #import as the MSVC type-library directive and rejects
non-TLB targets. Switch the two Swift C++ bridging-header entries back
to #include so this file compiles on Windows.

* Source/WebKit/Modules/Internal/WebKitInternalCxx.h:

Canonical link: https://commits.webkit.org/325258@main
…:focus ring)

https://bugs.webkit.org/show_bug.cgi?id=187799
rdar://97642031

Reviewed by Taher Ali.

This patch aligns WebKit with Gecko / Firefox and Blink / Chromum.

SelfOutline phases ("SVG outlines are painted during Foreground") and only
passes Foreground to its children, so a legacy container never received
SelfOutline and its outline was never drawn. Shapes and images are unaffected
because they call paintOutline() from their Foreground paint.

Paint the container's outline during the Foreground phase instead, matching
LegacyRenderSVGShape and LegacyRenderSVGImage. This makes outlines (including
the default focus ring on a focused <a>) visible on <a>, <g> and nested <svg>.

NOTE: Layer Based SVG engine does not have this bug.

Thanks Karl for testcases.

Tests: imported/w3c/web-platform-tests/css/css-ui/outline-svg-a-001.html
       imported/w3c/web-platform-tests/css/css-ui/outline-svg-g-001.html
       imported/w3c/web-platform-tests/css/css-ui/outline-svg-g-auto-001.html
       imported/w3c/web-platform-tests/css/css-ui/outline-svg-nested-svg-001.html

* LayoutTests/imported/w3c/web-platform-tests/css/css-ui/outline-svg-a-001-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-ui/outline-svg-a-001.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-ui/outline-svg-g-001-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-ui/outline-svg-g-001.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-ui/outline-svg-g-auto-001-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-ui/outline-svg-g-auto-001.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-ui/outline-svg-nested-svg-001-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-ui/outline-svg-nested-svg-001.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-ui/outline-svg-container-001-ref.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-ui/outline-svg-container-auto-001-ref.html: Added.
* Source/WebCore/rendering/svg/legacy/LegacyRenderSVGContainer.cpp:
(WebCore::LegacyRenderSVGContainer::paint):

Canonical link: https://commits.webkit.org/325259@main
https://bugs.webkit.org/show_bug.cgi?id=329444
rdar://191325178

Reviewed by Simon Fraser.

calculateRects() builds the background and foreground rect of a layer
fragment, and both start from the same value: calculateBackgroundRect() and
calculateForegroundRect() each call calculateBackgroundClipRect() with the
same arguments. That function resolves the clip inherited from the ancestors
through backgroundClipRect() and parentClipRects(), which walks up the layer
tree again whenever the container's clip rects cannot be taken from the cache
(temporary clip rects, layers whose clip crosses a painting boundary).

calculateBackgroundClipRect() depends only on the layer's state and its
arguments, and nothing runs between the two calls in calculateRects(), so the
second result is always identical to the first. Compute it once and hand it to
both: calculateBackgroundRect() and calculateForegroundRect() get overloads that
take the already computed clip rect, and the existing signatures remain as thin
wrappers for the callers that need only one of the rects.

No behavior change, so no new tests; covered by existing layer, clip and
compositing tests.

* Source/WebCore/rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateBackgroundRect const):
(WebCore::RenderLayer::calculateForegroundRect const):
(WebCore::RenderLayer::calculateRects const):
* Source/WebCore/rendering/RenderLayer.h:

Canonical link: https://commits.webkit.org/325260@main
…ax-not-sent-cross-site.html and similar tests time out

https://bugs.webkit.org/show_bug.cgi?id=329522
rdar://191373254

Reviewed by Per Arne Vollan.

The tests navigate a.com/test.html to b.com, which redirects to a.com/test.html#runTest. Since
324723@main, the redirected navigation continues in the committed page, which is still showing
a.com/test.html, so FrameLoader treats it as a fragment navigation and only updates the URL. The
page is never reloaded, so the #runTest step never runs.

The HTML spec only decides whether a navigation is a fragment navigation at the start of navigate
(https://html.spec.whatwg.org/multipage/browsing-the-web.html#navigate), before anything is
fetched. Redirects are then followed while fetching
(https://html.spec.whatwg.org/multipage/browsing-the-web.html#create-navigation-params-by-fetching)
without checking for fragment navigation again. So skip the fragment navigation check for loads
continued after the provisional load started in another process.

* Source/WebCore/loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadWithDocumentLoader):

Canonical link: https://commits.webkit.org/325261@main
…l fails

https://bugs.webkit.org/show_bug.cgi?id=329519
rdar://191372328

Reviewed by Per Arne Vollan.

The test navigates a.com/1 to a.com/2 through a redirect to b.com. Since 324723@main, a navigation
redirected back to the committed page's process reuses the committed WebPage, so a.com/2 sees
a.com/1 as a same-origin previous document and exposes its unload timing. However, the spec requires
unload timing to be hidden when the navigation went through a cross-origin redirect.

The cross-origin redirect is missed because a.com/2 is loaded with a new network load that has no
redirects. Fix this by also checking DocumentLoader::hasCrossOriginRedirect(), which the UI process
actually sets through LoadParameters.

* Source/WebCore/loader/FrameLoader.cpp:
(WebCore::FrameLoader::commitProvisionalLoad):

Canonical link: https://commits.webkit.org/325262@main
…resh process has no response

https://bugs.webkit.org/show_bug.cgi?id=328708
rdar://problem/191118700

Reviewed by BJ Burg.

A cross-origin iframe loads its document in its provisional frame's process before the frame commits, but Network
instrumentation was registered for that process only at commit. When the process had no other registration for the page,
the UIProcess dropped the document's Network messages, and the frontend built its row from Page.frameNavigated alone, with
no request identifier, status, size or time. Network now registers the provisional frame's process when the frame is
created, as Page does, and ProxyingNetworkAgent::enable() does the same for existing provisional frames. A discarded
provisional load releases that registration, and ProxyingPageAgent::provisionalFrameDiscarded reports its frame as detached.

Tests: http/tests/site-isolation/inspector/network/cross-origin-iframe-fresh-process-document.html
       http/tests/site-isolation/inspector/network/cross-origin-iframe-in-process-kept-by-popup.html
       http/tests/site-isolation/inspector/network/enable-during-provisional-iframe-load-keeps-instrumentation.html
       http/tests/site-isolation/inspector/debugger/wasm-frame-placement.html

* LayoutTests/http/tests/site-isolation/inspector/debugger/wasm-frame-placement.html:
* LayoutTests/http/tests/site-isolation/inspector/network/cross-origin-iframe-fresh-process-document-expected.txt: Added.
* LayoutTests/http/tests/site-isolation/inspector/network/cross-origin-iframe-fresh-process-document.html: Added.
* LayoutTests/http/tests/site-isolation/inspector/network/cross-origin-iframe-in-process-kept-by-popup-expected.txt: Added.
* LayoutTests/http/tests/site-isolation/inspector/network/cross-origin-iframe-in-process-kept-by-popup.html: Added.
* LayoutTests/http/tests/site-isolation/inspector/network/enable-during-provisional-iframe-load-keeps-instrumentation-expected.txt: Added.
* LayoutTests/http/tests/site-isolation/inspector/network/enable-during-provisional-iframe-load-keeps-instrumentation.html: Added.
* LayoutTests/http/tests/site-isolation/inspector/network/resources/no-content.asis: Added.
* LayoutTests/http/tests/site-isolation/inspector/network/resources/provisional-load-test-utilities.js: Added.
(window.startPhase):
(window.childFrameWithQuery):
(window.loadAndExpectDocumentAndScriptResources):
(window.holdProvisionalLoad):
* Source/WebKit/UIProcess/Inspector/Agents/ProxyingNetworkAgent.cpp:
(Inspector::ProxyingNetworkAgent::enable):
* Source/WebKit/UIProcess/Inspector/Agents/ProxyingPageAgent.cpp:
(Inspector::ProxyingPageAgent::provisionalFrameDiscarded):
* Source/WebKit/UIProcess/Inspector/Agents/ProxyingPageAgent.h:
* Source/WebKit/UIProcess/Inspector/WebPageInspectorController.cpp:
(WebKit::WebPageInspectorController::didCommitProvisionalPage):
(WebKit::WebPageInspectorController::didCreateProvisionalFrame):
(WebKit::WebPageInspectorController::willDestroyProvisionalFrame):
(WebKit::WebPageInspectorController::didCommitProvisionalFrame):

Canonical link: https://commits.webkit.org/325263@main
…device descriptor

https://bugs.webkit.org/show_bug.cgi?id=329541
rdar://191381050

Reviewed by Mike Wyrzykowski.

wgpuAdapterRequestDevice() ignored WGPUDeviceDescriptor.uncapturedErrorCallbackInfo, so a C API
caller never learned of the errors that no error scope catches. ANGLE's WebGPU backend sets the
callback to log them, and the validation errors of the backend went unnoticed.

The C API now calls the callback as webgpu.h specifies: for each error that no error scope
catches, in the call that generates it and on its thread, with the device, the error type and
the message, and not once the device is lost. The uncaptured error callback of the C++ API
completes once, so the C API listens for the next error before it calls the callback, which may
generate one. A device may be used from one thread at a time, but not always the same one, so the
completion handler can be called on any thread.

The ANGLE end2end tests fail on a logged error, so 13 tests of the WebGPU backend that passed or
were skipped would fail on the errors that they hid. This must land after the fixes for them, or
they fail:
- Bug 329226: WebKit's WGSL compiler rejects for-loop initialization and update clauses whose
  left-hand side is in parentheses (GLSLTest.RemoveDynamicingIndexIndexPrecisionBug,
  TimerQueriesTest.* and TimerstampQueriesTest.TimestampBasic).
- The WebGPU backend advertises more uniform vectors than the 1023 struct members that
  WGSL implementations are required to support (GLSLTest.VerifyMaxVertexUniformVectors and
  GLSLTest.VerifyMaxFragmentUniformVectors).
- The WebGPU backend does not convert GL_UNSIGNED_BYTE indices from an element array
  buffer in WebGL contexts, which makes an out-of-range drawIndexed()
  (WebGLCompatibilityTest.LargeIndexRange).

WebKit has no test program for the C API. The tests are in TestWGSL, the test program of
WebGPU.framework's shader compiler, which now links WebGPU.framework.

* Source/WebGPU/WebGPU/Adapter.mm:
(listenForUncapturedErrors):
(wgpuAdapterRequestDevice):
* Tools/TestWebKitAPI/Configurations/TestWGSL.xcconfig:
* Tools/TestWebKitAPI/PlatformCocoa.cmake:
* Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* Tools/TestWebKitAPI/Tests/WebGPU/UncapturedErrorCallbackTests.cpp: Added.
(TestWebKitAPI::waitFor):
(TestWebKitAPI::requestAdapter):
(TestWebKitAPI::requestDevice):
(TestWebKitAPI::createInvalidBuffer):
(TestWebKitAPI::popErrorScope):
(TestWebKitAPI::TEST_F(WebGPUUncapturedErrorCallback, IsCalledInTheCallThatGeneratesTheError)):
(TestWebKitAPI::TEST_F(WebGPUUncapturedErrorCallback, IsCalledOnTheThreadThatGeneratesTheError)):
(TestWebKitAPI::TEST_F(WebGPUUncapturedErrorCallback, IsNotCalledForTheErrorsThatAnErrorScopeCatches)):
(TestWebKitAPI::TEST_F(WebGPUUncapturedErrorCallback, IsNotCalledAfterTheDeviceIsLost)):
(TestWebKitAPI::TEST_F(WebGPUUncapturedErrorCallback, IsOptional)):

Canonical link: https://commits.webkit.org/325264@main
https://bugs.webkit.org/show_bug.cgi?id=329438
rdar://191322795

Reviewed by Tim Horton.

In this patch, we teach WKAppKitGestureController how to show click highlights
that the web procecss sends. It does so by owning (and responding to) a
WKClickHighlightController.

WebViewImpl installs the highlight above the web content, and it's removed when
the page scrolls or when content-relative child windows are dismissed (for
example, when magnifying, swiping, or committing a load).

As a drive-by build fix, we move the default -webkit-tap-highlight-color from
RenderThemeIOS to RenderThemeCocoa, so that it's shared by all Cocoa platforms
that could possibly support the property.

Tests: AppKitGesturesTests.Basic.singleClickOnLinkShowsClickHighlight(scrollOffset:)
       AppKitGesturesTests.Basic.clickHighlightFadesOutAfterClick()
       AppKitGesturesTests.Basic.singleClickOnLargeClickableElementDoesNotShowClickHighlight()
       AppKitGesturesTests.Basic.singleClickOnLargeButtonShowsClickHighlight()
       AppKitGesturesTests.Basic.clickHighlightHonorsTransparentStyle()
       AppKitGesturesTests.Basic.singleClickOnTextFieldShowsClickHighlightUnlessFocused(focused:)
       AppKitGesturesTests.SiteIsolation.singleClickOnLinkInCrossSiteIframeShowsClickHighlight(mainFrameScrollOffset:)
       AppKitGesturesTests.InactiveWindow.singleClickIntoInactiveWindowDoesNotShowClickHighlight()

* Source/WebCore/rendering/RenderTheme.h:
* Source/WebCore/rendering/cocoa/RenderThemeCocoa.h:
* Source/WebCore/rendering/ios/RenderThemeIOS.h:
* Source/WebKit/UIProcess/API/mac/WKWebViewPrivateForTestingMac.h:
* Source/WebKit/UIProcess/API/mac/WKWebViewTestingMac.mm:
(-[WKWebView _clickHighlightRectForTesting]):
(-[WKWebView _isShowingClickHighlightForTesting]):
(-[WKWebView _clickHighlightColorForTesting]):
* Source/WebKit/UIProcess/Cocoa/WKClickHighlightController.h:
* Source/WebKit/UIProcess/Cocoa/WKClickHighlightController.mm:
(-[WKClickHighlightController highlightColor]):
(-[WKClickHighlightController isShowingHighlight]):
* Source/WebKit/UIProcess/mac/AppKitGestures/WKAppKitGestureController.h:
* Source/WebKit/UIProcess/mac/AppKitGestures/WKAppKitGestureController.mm:
(-[WKAppKitGestureController initWithView:]):
(-[WKAppKitGestureController _handleClickBegan:]):
(-[WKAppKitGestureController _handleClickEnded:]):
(-[WKAppKitGestureController _handleClickCancelled]):
(-[WKAppKitGestureController clickHighlightController]):
(-[WKAppKitGestureController didGetClickHighlightForRequest:color:quads:cornerRadii:nodeHasBuiltInClickHandling:]):
(-[WKAppKitGestureController clickHighlightController:installHighlightView:]):
(-[WKAppKitGestureController clickHighlightControllerContentScale:]):
(-[WKAppKitGestureController clickHighlightControllerCornerRadiusScale:]):
(-[WKAppKitGestureController clickHighlightControllerUnobscuredRect:]):
(-[WKAppKitGestureController clickHighlightControllerBoundaryRect:]):
(-[WKAppKitGestureController clickHighlightControllerIsPotentialClickInProgress:]):
(-[WKAppKitGestureController cancelClickHighlight]):
* Source/WebKit/UIProcess/mac/WebViewImpl.h:
* Source/WebKit/UIProcess/mac/WebViewImpl.mm:
(WebKit::WebViewImpl::pageDidScroll):
(WebKit::WebViewImpl::dismissContentRelativeChildWindowsFromViewOnly):
(WebKit::WebViewImpl::positionInformationDidChange):
(WebKit::WebViewImpl::installClickHighlightView):
* Tools/TestWebKitAPI/Helpers/cocoa/WebPage+Extras.swift:
(clickHighlightRect):
(isShowingClickHighlight):
(clickHighlightColor):
* Tools/TestWebKitAPI/Tests/WebKit/WebPage/AppKit Gesture Tests/BasicAppKitGesturesTests.swift:
* Tools/TestWebKitAPI/Tests/WebKit/WebPage/AppKit Gesture Tests/InactiveWindowAppKitGesturesTests.swift:
(AppKitGesturesTests.singleClickIntoInactiveWindowDoesNotShowClickHighlight):
* Tools/TestWebKitAPI/Tests/WebKit/WebPage/AppKit Gesture Tests/SiteIsolationAppKitGesturesTests.swift:
(AppKitGesturesTests.singleClickOnLinkInCrossSiteIframeShowsClickHighlight(_:)):

Canonical link: https://commits.webkit.org/325265@main
…veImage in a BitmapImage

https://bugs.webkit.org/show_bug.cgi?id=329505

Reviewed by Darin Adler.

Removes the ability for a BitmapImage to wrap a NativeImage.

* Source/WebCore/Sources.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/loader/images/bitmap/BitmapImage.cpp:
* Source/WebCore/loader/images/bitmap/BitmapImage.h:
* Source/WebCore/loader/images/bitmap/NativeImageSource.cpp: Removed.
* Source/WebCore/loader/images/bitmap/NativeImageSource.h: Removed.

Canonical link: https://commits.webkit.org/325266@main
https://bugs.webkit.org/show_bug.cgi?id=329497
<rdar://problem/191355757>

Reviewed by Tim Horton and Abrar Rahman Protyasha.

UnifiedPDFPlugin was the only client asking for layers with in-process backing store,
and it has not done so since 290867@main made shouldUseInProcessBackingStore() return false
on all platforms.

* Source/WebCore/platform/graphics/GraphicsLayerClient.h:
* Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp:
* Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h:
* Source/WebCore/platform/graphics/ca/PlatformCALayer.h:
* Source/WebCore/platform/graphics/ca/PlatformCALayer.mm:
* Source/WebCore/platform/graphics/ca/PlatformCALayerClient.h:
* Source/WebCore/platform/graphics/ca/TileGrid.cpp:
* Source/WebCore/platform/graphics/ca/TileGrid.h:
* Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
(WebKit::RemoteLayerBackingStore::processModelForLayer):
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/PDFPresentationController.h:
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/PDFPresentationController.mm:
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/PDFScrollingPresentationController.h:
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/PDFScrollingPresentationController.mm:
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.h:
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm:
* Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.mm:
(WebKit::PlatformCALayerRemote::ensureBackingStore):
All the layers of a process now have backing store in the same process, so a pooled layer's
backing store never needs to be replaced.

Canonical link: https://commits.webkit.org/325267@main
…ved frame target on reload

https://bugs.webkit.org/show_bug.cgi?id=327905
rdar://190261741

Reviewed by BJ Burg.

With site isolation every frame has a frame target, and the Sources sidebar rebuilt its whole tree and closed all
content views each time one was removed, so a reload did that once per iframe. In Type grouping mode (the default),
FrameTreeElement already removes the rows of the target's frame scripts, such as WebAssembly modules, so only remove
the target's scripts from the Extension, Extra and Anonymous Scripts folders. Path mode still rebuilds the tree.

Test: inspector/unit-tests/debugger-manager-frame-target-removal.html

* LayoutTests/inspector/unit-tests/debugger-manager-frame-target-removal-expected.txt: Added.
* LayoutTests/inspector/unit-tests/debugger-manager-frame-target-removal.html: Added.
* Source/WebInspectorUI/UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel.prototype._removeScriptsOfTarget): Added.
(WI.SourcesNavigationSidebarPanel.prototype._handleFrameWasRemoved):
(WI.SourcesNavigationSidebarPanel.prototype._handleTargetRemoved):

Canonical link: https://commits.webkit.org/325268@main
https://bugs.webkit.org/show_bug.cgi?id=329498
<rdar://problem/191356577>

Reviewed by Per Arne Vollan.

This is already compiled out on everything except Sequioa, and 321119@main
removed the last remaining runtime check that would use it.  The only remaining
possible users are those with custom preferences set, which I don't think we
need to try to support.

Without it, the web process never sends DidFirstLayerFlush, so remove the process-swap
flashing prevention that kept suspended pages alive until then. The accelerated compositing
mode messages are only sent by the coordinated graphics drawing areas, so don't compile
them for Cocoa.

The --remote-layer-tree option of run-webkit-tests and run-api-tests is kept as a no-op,
because bots still pass it.

* LayoutTests/http/tests/media/media-source/media-source-video-fit-fill.html:
* Source/WTF/wtf/PlatformEnable.h:
* Source/WebKit/Shared/DrawingAreaInfo.h:
* Source/WebKit/Shared/DrawingAreaInfo.serialization.in:
* Source/WebKit/Shared/WebPageCreationParameters.h:
* Source/WebKit/Shared/WebPageCreationParameters.serialization.in:
* Source/WebKit/SourcesCocoa.txt:
* Source/WebKit/UIProcess/DrawingAreaProxy.h:
* Source/WebKit/UIProcess/DrawingAreaProxy.messages.in:
* Source/WebKit/UIProcess/PageClient.h:
* Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h:
* Source/WebKit/UIProcess/SuspendedPageProxy.cpp:
(WebKit::SuspendedPageProxy::create):
(WebKit::SuspendedPageProxy::SuspendedPageProxy):
(WebKit::SuspendedPageProxy::didProcessRequestToSuspend):
(WebKit::SuspendedPageProxy::pageDidFirstLayerFlush): Deleted.
(WebKit::SuspendedPageProxy::pageIsClosedOrClosing const): Deleted.
(WebKit::SuspendedPageProxy::closeWithoutFlashing): Deleted.
* Source/WebKit/UIProcess/SuspendedPageProxy.h:
(WebKit::SuspendedPageProxy::isClosed const):
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::commitProvisionalPage):
(WebKit::WebPageProxy::creationParameters):
(WebKit::WebPageProxy::enterAcceleratedCompositingMode):
(WebKit::WebPageProxy::didFirstLayerFlush):
(WebKit::WebPageProxy::suspendCurrentPageIfPossible):
(WebKit::WebPageProxy::resetState):
(WebKit::WebPageProxy::didFirstLayerFlush): Deleted.
* Source/WebKit/UIProcess/WebPageProxy.h:
* Source/WebKit/UIProcess/ios/PageClientImplIOS.h:
* Source/WebKit/UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::enterAcceleratedCompositingMode): Deleted.
(WebKit::PageClientImpl::exitAcceleratedCompositingMode): Deleted.
(WebKit::PageClientImpl::updateAcceleratedCompositingMode): Deleted.
* Source/WebKit/UIProcess/mac/PageClientImplMac.h:
* Source/WebKit/UIProcess/mac/PageClientImplMac.mm:
(WebKit::PageClientImpl::enterAcceleratedCompositingMode): Deleted.
(WebKit::PageClientImpl::didFirstLayerFlush): Deleted.
(WebKit::PageClientImpl::exitAcceleratedCompositingMode): Deleted.
(WebKit::PageClientImpl::updateAcceleratedCompositingMode): Deleted.
* Source/WebKit/UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h: Removed.
* Source/WebKit/UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm: Removed.
* Source/WebKit/UIProcess/mac/WebViewImpl.h:
* Source/WebKit/UIProcess/mac/WebViewImpl.mm:
(WebKit::WebViewImpl::WebViewImpl):
(WebKit::WebViewImpl::createDrawingAreaProxy):
(WebKit::WebViewImpl::isUsingUISideCompositing const):
(WebKit::WebViewImpl::enterAcceleratedCompositingWithRootLayer): Deleted.
* Source/WebKit/WebKit.xcodeproj/project.pbxproj:
* Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::createScrollingCoordinator const):
(WebKit::WebChromeClient::ensureScrollbarsController const):
(WebKit::WebChromeClient::isUsingUISideCompositing const):
* Source/WebKit/WebProcess/WebPage/DrawingArea.cpp:
(WebKit::DrawingArea::create):
* Source/WebKit/WebProcess/WebPage/DrawingArea.h:
* Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
* Source/WebKit/WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):
(WebKit::WebPage::updateAfterDrawingAreaCreation):
(WebKit::WebPage::updatePreferences):
(WebKit::WebPage::isUsingUISideCompositing const):
* Source/WebKit/WebProcess/WebPage/WebPage.h:
* Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h: Removed.
* Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: Removed.
* Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationScrollingCoordinator.h: Removed.
* Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationScrollingCoordinator.mm: Removed.
* Tools/MiniBrowser/mac/SettingsController.h:
* Tools/MiniBrowser/mac/SettingsController.m:
* Tools/Scripts/compare-webkit-configurations:
* Tools/Scripts/run-api-tests:
* Tools/Scripts/webkitpy/api_tests/runner.py:
* Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py:
* Tools/Scripts/webkitpy/port/driver.py:
* Tools/TestWebKitAPI/Helpers/cocoa/UISideCompositingScope.h: Removed.
* Tools/TestWebKitAPI/Helpers/cocoa/UISideCompositingScope.mm: Removed.
* Tools/TestWebKitAPI/Runner/TestRunner.swift:
* Tools/TestWebKitAPI/Runner/TestWebKitAPI.swift:
* Tools/TestWebKitAPI/SourcesCocoa.txt:
* Tools/TestWebKitAPI/Tests/WebCore/cocoa/ScrollbarWidthCrash.mm:
* Tools/TestWebKitAPI/Tests/WebKit/WKPage/mac/WKThumbnailView.mm:
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/GPUProcess.mm:
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/UnifiedPDFTests.mm:
* Tools/WebKitTestRunner/Options.cpp:
* Tools/WebKitTestRunner/TestOptions.cpp:
* Tools/WebKitTestRunner/TestOptions.h:
* Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm:
* Tools/WebKitTestRunner/mac/main.mm:

Canonical link: https://commits.webkit.org/325269@main
…p shader causing GPU OOB

https://bugs.webkit.org/show_bug.cgi?id=316038
rdar://177078690

Reviewed by Dan Glastonbury.

For negative base vertices, we need to check the indices against the negative
value contained in the buffer so add an extra value to the hash key.

Negative baseVertex is supported but uncommon, no regression on existing sites
which defeated this cache, e.g., https://bug-302711-attachments.webkit.org/attachment.cgi?id=477420

Test: fast/webgpu/nocrash/fuzz-177078690.html

* LayoutTests/fast/webgpu/nocrash/fuzz-177078690-expected.txt: Added.
* LayoutTests/fast/webgpu/nocrash/fuzz-177078690.html: Added.
* Source/WebGPU/WebGPU/BindableResource.h:
(WebGPU::DrawIndexCacheContainerValue::DrawIndexCacheContainerValue):
* Source/WebGPU/WebGPU/Buffer.h:
* Source/WebGPU/WebGPU/Buffer.mm:
(WebGPU::makeKey):
(WebGPU::Buffer::canSkipDrawIndexedValidation const):
(WebGPU::Buffer::drawIndexedValidated):
* Source/WebGPU/WebGPU/RenderPassEncoder.mm:
(WebGPU::RenderPassEncoder::clampIndexBufferToValidValues):
(WebGPU::RenderPassEncoder::executeBundles):

Originally-landed-as: 316606.577@safari-7625-branch (62de387). rdar://191052498
Canonical link: https://commits.webkit.org/325270@main
…ies in bulk

https://bugs.webkit.org/show_bug.cgi?id=328642

Reviewed by Yusuke Suzuki.

Object.freeze, Object.seal, Object.isFrozen and Object.isSealed have a fast path
that works on the whole PropertyTable, but only for final objects without indexed
properties. Arrays take the generic loop, which creates an Identifier for each
index, gets its descriptor and defines it again.

This patch adds seal, freeze, isSealed and isFrozen to SparseArrayValueMap, uses
them in JSObject, and lets JSArray and final objects with indexed properties take
the fast path.

Sealing a prototype that has indexed properties no longer causes a bad time. The
generic loop did, although sealed elements stay writable.

                                    Baseline                  Patched

object-seal-array               11.9118+-0.3351     ^      3.7494+-0.1079        ^ definitely 3.1770x faster
object-freeze-array             13.3719+-0.1912     ^      4.0863+-0.2433        ^ definitely 3.2724x faster
object-freeze-array-is-frozen   55.7877+-1.1729     ^      2.0096+-0.0782        ^ definitely 27.7604x faster

Tests: JSTests/microbenchmarks/object-freeze-array-is-frozen.js
       JSTests/microbenchmarks/object-freeze-array.js
       JSTests/microbenchmarks/object-seal-array.js
       JSTests/stress/object-freeze-indexed-properties.js
       JSTests/stress/object-seal-indexed-properties.js

* JSTests/microbenchmarks/object-freeze-array-is-frozen.js: Added.
(test):
* JSTests/microbenchmarks/object-freeze-array.js: Added.
(test):
* JSTests/microbenchmarks/object-seal-array.js: Added.
(test):
* JSTests/stress/object-freeze-indexed-properties.js: Added.
* JSTests/stress/object-seal-indexed-properties.js: Added.
* JSTests/stress/resources/integrity-level-indexed-properties.js: Added.
(pushed):
(Derived):
(Species.get Symbol):
(Species):
(StampField):
(return):
(StampMethod):
(has):
(show):
(state):
(definePerProperty):
(run):
(compile):
(test):
(testExistingPrototype):
(testIntegrityLevel):
* Source/JavaScriptCore/runtime/JSObject.cpp:
(JSC::JSObject::enterDictionaryIndexingMode):
(JSC::JSObject::seal):
(JSC::JSObject::freeze):
(JSC::JSObject::isSealedWithArrayStorage):
(JSC::JSObject::isFrozenWithArrayStorage):
(JSC::JSObject::materializeLazyOwnProperties):
* Source/JavaScriptCore/runtime/JSObject.h:
(JSC::JSObject::isSealed):
(JSC::JSObject::isFrozen):
* Source/JavaScriptCore/runtime/ObjectConstructor.cpp:
(JSC::objectConstructorSeal):
(JSC::objectConstructorFreeze):
(JSC::JSC_DEFINE_HOST_FUNCTION):
* Source/JavaScriptCore/runtime/SparseArrayValueMap.cpp:
(JSC::SparseArrayValueMap::seal):
(JSC::SparseArrayValueMap::freeze):
(JSC::SparseArrayValueMap::isSealed const):
(JSC::SparseArrayValueMap::isFrozen const):
* Source/JavaScriptCore/runtime/SparseArrayValueMap.h:

Canonical link: https://commits.webkit.org/325271@main
https://bugs.webkit.org/show_bug.cgi?id=329602
rdar://191417276

Unreviewed build fix. Pass CMAKE_OSX_ARCHITECTURES when there is a
user-provided --arch given. Supports overriding the build's default
architecture from the command line using the existing argument.

* Tools/Scripts/webkitdirs.pm:
(generateBuildSystemFromCMakeProject):

Canonical link: https://commits.webkit.org/325272@main
https://bugs.webkit.org/show_bug.cgi?id=329591
rdar://191407965

Reviewed by Yusuke Suzuki.

Parser::parseSourceElements collects the source elements parsed in a local `sourceElements`. If
it encounters a "use strict" directive, it switches to strict mode and restarts the parse from
the beginning. If the "use strict" directive was preceded by other directives, those directives
are parsed again and end up duplicated in `sourceElements`.

This patch adds a statement to clear `sourceElements` before restart.

Test: JSTests/stress/use-strict-after-directives-not-duplicated.js
Canonical link: https://commits.webkit.org/325273@main
… narrow flex container

https://bugs.webkit.org/show_bug.cgi?id=329419
<rdar://problem/191301942>

Reviewed by Antti Koivisto.

    <div style="display: flex; width: 0px; height: 50px">
        <img src="300x150.png" style="width: 999px">
    </div>

The image should be 100px wide, the width its 50px stretched height gives it through its 2:1 aspect ratio. Instead it stays at its 300px natural width.

A replaced flex item's min-content size, which is its content size suggestion for min-width: auto, comes from its definite cross size through its aspect ratio.
computeContentBasedMinMainSize only used a definite preferred cross size there, so a stretched item with height: auto fell back to its natural width for its minimum width.

It now checks flexItemHasComputableAspectRatioAndCrossSizeIsConsideredDefinite, which also counts a definite stretched cross size, as the flex base size and the transferred size suggestion already do.

* LayoutTests/TestExpectations:
* Source/WebCore/layout/formattingContexts/flex/FlexFormattingContext.cpp:
(WebCore::FlexFormattingContext::computeContentBasedMinMainSize):

Canonical link: https://commits.webkit.org/325274@main
…ding writes

https://bugs.webkit.org/show_bug.cgi?id=329389

Reviewed by Sihui Liu.

Storage::synchronize() rebuilds the record filter from the record files
on disk, and only carries over the keys added while it runs. A record
stored before it started is left out when its file is written after the
traversal has passed its directory, so Storage::remove() skips its key
and the record stays on disk.

Carry over the keys of the pending and active write operations as well.

Outside of the creation of a storage, synchronize() only runs after a
shrink, which needs the disk cache to be over its capacity, so there is
no new test.

* Source/WebKit/NetworkProcess/cache/NetworkCacheStorage.cpp:
(WebKit::NetworkCache::Storage::synchronize):

Canonical link: https://commits.webkit.org/325275@main
https://bugs.webkit.org/show_bug.cgi?id=329582
rdar://191401756

Reviewed by Yusuke Suzuki.

Exclusive (memoryHog!) tests are meant to run alongside the parallel tests, one at
a time. But make only revisits a target's prerequisites after walking its whole goal,
so the chain did not start until every parallel test had been started, and then
ran alone at the end. Run the chain in a sub-make that shares make's job slots
instead. It starts right away and still runs one exclusive test at a time within
the -j limit.

Also stop piping every test's output through tee, awk and an exit-code side channel.
Each test script now redirects the test's output straight to its .out file and
reads $? directly. Silent tests print the prefixed output afterwards, only when
there is any. This removes several fork/execs per test.

On a 16-core M4 Max, JSTests/stress goes from 1305s to 851s wall with identical results.
After this change (memoryHog!) tests are still the long pole in the entire test run.
Running them in parallel makes them take 80% longer.

Canonical link: https://commits.webkit.org/325276@main
https://bugs.webkit.org/show_bug.cgi?id=329359
rdar://191252064

Reviewed by Brent Fulgham.

User agent override quirks are dropped when there is a custom user agent
set. This patch gives the user agent override quirks a higher precedence
to maintain compatibility.

Test: Tools/TestWebKitAPI/Tests/WebKit/WKWebView/CustomUserAgent.mm

* Source/WebCore/loader/FrameLoader.cpp:
(WebCore::FrameLoader::userAgent const):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/CustomUserAgent.mm:
(TestWebKitAPI::(CustomUserAgent, SiteSpecificQuirkOverridesWebViewCustomUserAgent)):
(TestWebKitAPI::(CustomUserAgent, ChromeCompatibilityQuirkAppliesToWebViewCustomUserAgent)):

Canonical link: https://commits.webkit.org/325277@main
https://bugs.webkit.org/show_bug.cgi?id=329349
WebKit#78709

Reviewed by Kimmo Kinnunen.

Add disabled API tests in ConnectionTests.cpp to benchmark IPC::Connection send throughput, latency,
and CPU usage across several scenarios. The purpose of this is to make sure that we don't regress
IPC sending perf as we make changes to this codepath in the near future.

To run in a release build: `TestIPC --force --filter '*ConnectionSendBenchmark*'`.

* Tools/TestWebKitAPI/Tests/IPC/ConnectionTests.cpp:
(TestWebKitAPI::MockTestMessageWithDataAndAttachments::encode): Added.
(TestWebKitAPI::testDataOfSize): Added.
(TestWebKitAPI::TEST_P(ConnectionSendBenchmark, DISABLED_SmallMessages)): Added.
(TestWebKitAPI::TEST_P(ConnectionSendBenchmark, DISABLED_SmallMessagesOneAtATime)): Added.
(TestWebKitAPI::TEST_P(ConnectionSendBenchmark, DISABLED_MessagesWithAttachment)): Added.
(TestWebKitAPI::TEST_P(ConnectionSendBenchmark, DISABLED_LargeMessages)): Added.
(TestWebKitAPI::TEST_P(ConnectionSendBenchmark, DISABLED_SlowReceiver)): Added.
(TestWebKitAPI::TEST_P(ConnectionSendBenchmark, DISABLED_SendersOnFourThreads)): Added.
(TestWebKitAPI::TEST_P(ConnectionSendBenchmark, DISABLED_MainThreadWhileBackgroundThreadSends)): Added.
(TestWebKitAPI::TEST_P(ConnectionSendBenchmark, DISABLED_SyncRoundTrips)): Added.
(TestWebKitAPI::MockTestMessageWithDataAndAttachments::name):
(TestWebKitAPI::ConnectionSendBenchmark::readCounters):
(TestWebKitAPI::ConnectionSendBenchmark::openForBenchmark):
(TestWebKitAPI::ConnectionSendBenchmark::expectMessages):
(TestWebKitAPI::ConnectionSendBenchmark::expectMessagesOneAtATime):
(TestWebKitAPI::ConnectionSendBenchmark::waitForMessage):
(TestWebKitAPI::ConnectionSendBenchmark::waitForMessages):
(TestWebKitAPI::ConnectionSendBenchmark::sendMessages):
(TestWebKitAPI::ConnectionSendBenchmark::report):
(TestWebKitAPI::ConnectionSendBenchmark::smallMessage):
(TestWebKitAPI::ConnectionSendBenchmark::percentile):
(TestWebKitAPI::ConnectionSendBenchmark::didReceiveMessage):
(TestWebKitAPI::TEST_P):

Canonical link: https://commits.webkit.org/325278@main
… ::first-line sets a larger font size

https://bugs.webkit.org/show_bug.cgi?id=329495
<rdar://problem/191352930>

Reviewed by Antti Koivisto.

    <style>
    div::first-line { font-size: 32px; }
    </style>
    <div style="width: 120px; font: 16px/1 Ahem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis">XXXXXXXXXX</div>

The line should show "XXX" followed by the 16px ellipsis. Instead it showed "XX".

On the first line, the root inline box's display box style is the ::first-line style, and the ellipsis width was measured
with it. So the content was cut to make room for a 32px ellipsis, while EllipsisBoxPainter paints a 16px one with the
root's own style.

Measure the ellipsis with the root's own style, like the block ellipsis and the painter do.

* LayoutTests/imported/w3c/web-platform-tests/css/css-overflow/text-overflow-ellipsis-first-line-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-overflow/text-overflow-ellipsis-first-line-ref.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-overflow/text-overflow-ellipsis-first-line.html: Added.
* Source/WebCore/layout/formattingContexts/inline/display/InlineDisplayLineBuilder.cpp:
(WebCore::Layout::trailingEllipsisVisualRectAfterTruncation):

Canonical link: https://commits.webkit.org/325279@main
https://bugs.webkit.org/show_bug.cgi?id=321704
rdar://182794086

Reviewed by Dan Glastonbury.

To avoid UB, promote signed integer types to unsigned.

Test: sar3/fast/webgpu/nocrash/fuzz-182794086.html

* LayoutTests/sar3/fast/webgpu/nocrash/fuzz-182794086-expected.txt: Added.
* LayoutTests/sar3/fast/webgpu/nocrash/fuzz-182794086.html: Added.
* Source/WebGPU/WGSL/Metal/MetalFunctionWriter.cpp:
(WGSL::Metal::FunctionDefinitionWriter::emitNecessaryHelpers):

Originally-landed-as: 316606.392@safari-7625-branch (ab8d814). rdar://191053073
Canonical link: https://commits.webkit.org/325280@main
…ax index as a validated ceiling, causing GPU OOB

https://bugs.webkit.org/show_bug.cgi?id=323148
rdar://183840202

Reviewed by Gerald Squelart.

Test: LayoutTests/sar3/fast/webgpu/regression/draw-indexed-validated-payload-max-pending-encoder.html

Use the smallest maximum count from all the vertex buffers instead of the largest count from the index
buffer which is generally a larger range, hence no performance regression.

* LayoutTests/sar3/fast/webgpu/regression/draw-indexed-validated-payload-max-pending-encoder-expected.txt: Added.
* LayoutTests/sar3/fast/webgpu/regression/draw-indexed-validated-payload-max-pending-encoder.html: Added.
* Source/WebGPU/WebGPU/Buffer.h:
* Source/WebGPU/WebGPU/Buffer.mm:
(WebGPU::Buffer::unmap):
(WebGPU::Buffer::drawIndexedValidated):
(WebGPU::Buffer::indirectBufferInvalidated):
(WebGPU::Buffer::needsIndexValidation):

Originally-landed-as: 316606.617@safari-7625-branch (5413228). rdar://191048575
Canonical link: https://commits.webkit.org/325281@main
…a Vector freed while noCopy blit source is in-flight

https://bugs.webkit.org/show_bug.cgi?id=323043
rdar://182126685

Reviewed by Dan Glastonbury.

Mirror what 320118@main did but in Buffer.mm - retain the Vector in an addCompletedHandler on
the staging command buffer.

Test: sar3/fast/webgpu/regression/slow-index-validation-prior-data-uaf.html

* LayoutTests/sar3/fast/webgpu/regression/slow-index-validation-prior-data-uaf-expected.txt: Added.
* LayoutTests/sar3/fast/webgpu/regression/slow-index-validation-prior-data-uaf.html: Added.
* Source/WebGPU/WebGPU/Buffer.mm:
(WebGPU::Buffer::takeSlowIndexValidationPath):
* Source/WebGPU/WebGPU/Queue.h:
* Source/WebGPU/WebGPU/Queue.mm:
(WebGPU::Queue::writeBuffer):
(WebGPU::Queue::finalizeStagedCopy):
* Source/WebGPU/WebGPU/Queue.swift:
(WebGPU.writeBuffer(_:bufferOffset:data:)):

Originally-landed-as: 316606.614@safari-7625-branch (97c5e65). rdar://191052372
Canonical link: https://commits.webkit.org/325282@main
…IONS)

Since the merge of upstream 1d4bed4 a job takes a fourth argument in
every configuration, and the dispatcher has it only with
USE(BUN_JSC_ADDITIONS). Without it the dispatcher named an argument that it
does not have.

There it passes an empty value, and calls the job without a tail call: the
two signatures differ. With USE(BUN_JSC_ADDITIONS) nothing changes. No lane
builds the other configuration.

@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.

Code review completed

Nothing new to post: everything this review found is already covered by existing comments on this pull request or didn't merit a separate one.

robobun added a commit to oven-sh/bun that referenced this pull request Nov 3, 2026
The release autobuild-bcef3ec0b60be8b146bbd23a43fa38abd2359214 is the engine
of main (4d45755fed4a) with upstream WebKit 1d4bed41aca8 merged in. It is a
build of the pull request's branch: the pin moves to the merge commit when
oven-sh/WebKit#992 lands.
main has eight commits since 4d45755, the commit this branch started
at: #967, #971, #972, #974, #978, #979, #982 and #983.

Two files conflict, each in one place. Both sides changed a line that calls
one of WTF's atomic functions: this branch gave it the MemoryOrder template
argument (WebKit/WebKit@6ab0aebc81), main changed the code beside it.

- aot/analysis/AOTCallGraph.cpp: main's new loop over
  body.expectedFunctionTypes, with atomicLoad<MemoryOrder::Relaxed>() and
  atomicStore<MemoryOrder::Relaxed>().
- aot/runtime/AOTInstance.cpp: main's `if constexpr (hasFaultingLoopPolls)`
  in setPollsEnabled(), behind atomicStore<MemoryOrder::Relaxed>().

No conflict, and the same change: aot/valueflow/AOTFlowApply.cpp has three
calls in the old form that main added. They take the template argument.

The other 21 files that both sides changed merge as they are.

@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.

Code review completed

Nothing new to post: everything this review found is already covered by existing comments on this pull request or didn't merit a separate one.

@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Preview build of 09e949d: autobuild-preview-pr-992-09e949d3

… hands the value to the setter

Since upstream 23777f3 (324876@main) a store through a proxy that has no
defineProperty and no getOwnPropertyDescriptor trap is a definition of the
value on the target, and a definition puts the value in the place of a
custom value. Bun has custom values whose setters keep state elsewhere:
onmessage and onerror of the global object, Error.prepareStackTrace,
Module.prototype.require, the exports of a compiled module. After

    new Proxy(globalThis, {}).onmessage = f

no handler was installed, the property was plain data, and a later direct
store installed nothing either.

validateAndApplyPropertyDescriptor(): where a definition gives a value and
changes no attribute, and the property is a custom value with a setter that
is not read-only, the setter gets the value, with the holder and in the
holder's realm, and the property stays what it is. V8 has the same rule for
its native data properties: Object.defineProperty(Error, "prepareStackTrace",
{ value }) takes effect there, and now here.

A definition that changes an attribute, a definition of an accessor and
delete replace the property as before. A row of a static table that is not
reified keeps upstream's result.

The extra properties of a compiled object are an ordinary object and nobody's
holder, so Object::defineOwnProperty() hands the value to such a setter
itself, with the object (tryHandValueToSetterOfExtraProperty()).
operationAOTTryPutProperties() defines one by one only on an object that has
no getter and no setter.

Tests: JSTests/stress/bun-definition-of-a-value-reaches-the-setter-of-a-custom-value.js
       JSTests/stress/reflect-set-proxy-receiver-custom-value.js (one
       expectation, JSTests/BUN-TEST-DIFFERENCES.md A11)
       testaot native slot-exit/definitions-by-native-code

@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.

Nothing blocking. The comments below are optional suggestions. There is no need to push a fix for them before merging.

Comment on lines +2529 to +2531
#if ENABLE(AOT) && OS(WINDOWS) && COMPILER(CLANG)
// As LEAVE_FOR_COMPILED_JOB: MUST_TAIL_CALL is empty on Windows, and the frame has to end here there too.
#define JSC_LEAVE_FOR_INTERNAL_MICROTASK_JOB [[clang::musttail]] return

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 nit (optional): a Windows clang build of JavaScriptCore with USE_BUN_JSC_ADDITIONS off still fails to compile JSMicrotask.cpp, the sibling case the fix for the earlier :2551 comment did not reach. The branch at JSMicrotask.cpp:2529-2531 picks [[clang::musttail]] return whenever ENABLE(AOT) && OS(WINDOWS) && COMPILER(CLANG), before the USE(BUN_JSC_ADDITIONS) test, yet in that configuration the dispatcher at :2542 has eight parameters and every run() has nine. Fix: make the musttail choice depend on the two signatures matching, e.g. gate the Windows clang branch on USE(BUN_JSC_ADDITIONS) as well (or give the non-Bun dispatcher the fourth JSValue parameter), so every configuration either tail-calls with identical signatures or returns normally.

Why this was flagged

Trigger: configuring JavaScriptCore on Windows with clang and USE_BUN_JSC_ADDITIONS=OFF (Source/cmake/OptionsJSCOnly.cmake defaults it OFF); ENABLE(AOT) is 1 there because Source/WTF/wtf/PlatformEnable.h:807 enables it for OS(WINDOWS) with FTL_JIT on x86_64. JSMicrotask.cpp:2529 then defines JSC_LEAVE_FOR_INTERNAL_MICROTASK_JOB as [[clang::musttail]] return, and the dispatch macro at :2549-2551 expands it for every job as a call to run() with nine arguments. The non-Bun dispatcher signature at :2542 has eight parameters. Clang requires a musttail caller and callee to have the same number and types of parameters, so each expansion is rejected and the translation unit does not build; on the base branch the switch-based dispatcher had no tail call in this configuration. The earlier fix (commit 2edbf27) only added the plain return branch at :2535 under #else, which the Windows clang branch takes precedence over.

Verification: nit — triggers when JavaScriptCore is built on Windows with clang, FTL_JIT on (ENABLE(AOT)=1) and USE_BUN_JSC_ADDITIONS=OFF. Source/JavaScriptCore/runtime/JSMicrotask.cpp:2529-2531 selects [[clang::musttail]] return before the #else plain return at :2534-2536. The dispatcher at :2542 has 8 parameters, every run() has 9, so the translation unit fails to compile; the base built in this configuration.

robobun added a commit to oven-sh/bun that referenced this pull request Nov 3, 2026
…a custom value

The engine of bcef3ec0b60b with one more commit of oven-sh/WebKit#992. A store through a
proxy without a set trap ends in [[DefineOwnProperty]] on the target since upstream
23777f3b79. That definition put a plain value in the place of onmessage, onerror,
Error.prepareStackTrace and Module.prototype.require, so the native side never saw the
value and every later store was lost too. The definition now hands the value to the
native setter when it changes no attribute.
Upstream starts the marking helpers when a collection begins. In a compiled image they
start with the first work that is donated, and a collection that
Heap::collectForExhaustedCage() asks for starts none: helper threads allocate memory of
their own, and the cage is full.

Collector::runConcurrentPhase() lets the collector thread wait for the helpers where the
mutator has heap access and does not wait (SlotVisitor::drainInParallelPassively()). The
wait has no time limit under the stochastic scheduler. Without a helper nobody marked
and nobody woke that thread. The collection never ended, and the next synchronous
collection of the mutator never began: both threads slept.

The mutator gets there when it stops waiting for a collection while the next one is in
its concurrent phase already. Heap::waitForCollector() then hands the conn over with the
waiting bit clear, since the mutator is about to run.

drainInParallelPassively() now drains actively where no helper has started.

Test: testaot native collector/helpers/collector-thread-marks-beside-a-running-mutator-without-them.
Without the change its process sleeps in both threads in 3 of 3 runs.

@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.

Still open from earlier reviews (1):

  • Unresolved: 1 minor or pre-existing.

Comment on lines +4683 to +4688
if (descriptor.value() && attributes == current.attributes() && object->structure()->hasAnyKindOfGetterSetterProperties()) {
unsigned storedAttributes;
PropertyOffset offset = object->getDirectOffset(vm, propertyName, storedAttributes);
if (isValidOffset(offset) && (storedAttributes & PropertyAttribute::CustomValue) && !(storedAttributes & PropertyAttribute::ReadOnly)) {
if (PutValueFunc setter = uncheckedDowncast<CustomGetterSetter>(object->getDirect(offset))->setter())
RELEASE_AND_RETURN(scope, setter(object->realm(), JSValue::encode(object), JSValue::encode(descriptor.value()), propertyName));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔴 Callers of Object.defineProperty on a property whose custom setter refuses the value now get a silent no-op instead of the TypeError the spec requires. The new hook at JSObject.cpp:4688 returns the setter's bool straight through and never looks at throwException, so a false return (without an exception) from a CustomValue setter is reported as a plain false. Fix: after calling the setter, if it returned false and set no exception and throwException is true, throw a TypeError as the other refusals in validateAndApplyPropertyDescriptor do via typeError(); the AOT copy of the hook needs the same (AOTObjectMethodTable.cpp:295 and :322 return *handedToSetter and ignore shouldThrow). Same pattern at 3 sites (JSObject.cpp:4688, AOTObjectMethodTable.cpp:295, AOTObjectMethodTable.cpp:322).

Why this was flagged

Trigger: Object.defineProperty(o, k, { value }) or Object.defineProperties, or a strict-mode store through a forwarding Proxy (JSObject.cpp:872 passes shouldThrow), where o has k as a CustomValue with a setter that returns false without throwing. validateAndApplyPropertyDescriptor reaches the USE(BUN_JSC_ADDITIONS) block at JSObject.cpp:4683-4690 and RELEASE_AND_RETURN(scope, setter(...)) at :4688 returns that false with throwException unused. objectConstructorDefineProperty (ObjectConstructor.cpp:934) ignores the bool and returns the object, so the caller sees success while nothing changed; the spec's DefinePropertyOrThrow requires a TypeError here. Every other refusal in this function goes through typeError(globalObject, scope, throwException, ...) and does throw. On the base branch the definition replaced the custom value with a plain data property and succeeded, so no silent failure existed. The AOT copies at Source/JavaScriptCore/aot/object/AOTObjectMethodTable.cpp:295 and :322 return *handedToSetter and likewise ignore shouldThrow.

Verification: The new Bun hook at /home/claude/webkit/Source/JavaScriptCore/runtime/JSObject.cpp:4687-4688 returns the setter's bool without consulting throwException, unlike every other refusal in this function. Object.defineProperty ignores the bool and relies solely on an exception (ObjectConstructor.cpp:934-935). On the base branch the definition fell through to putDirect (line 4693) and succeeded.

robobun added a commit to oven-sh/bun that referenced this pull request Nov 3, 2026
…r started

One more commit of oven-sh/WebKit#992 on the engine of 62d643e3feb4. Compiled programs
that fill their heap stopped on aarch64 in CI, with the main thread and the collector
thread both asleep: the collector thread waited for the marking helpers, and a collection
for a full heap starts none.
…r of a custom value

A definition that gives a value to a custom value with a setter, and changes
no attribute, hands the value to the setter (validateAndApplyPropertyDescriptor(),
JSTests/BUN-TEST-DIFFERENCES.md A11). One definition did not get there: a class
field on an object that the constructor of the base class returned.

    class Hooked extends Returns { require = hook }

putDirectWithReify() asks canPutDirectFast(), which refused only a property
that is not configurable, and then called putDirect(). That put the value in
the place of the custom value: Bun's Module.prototype.require kept its old
function, and no later store reached the setter. Object.defineProperty() with
the same descriptor called the setter, and so did compiled code.

canPutDirectFast() refuses a custom value too. The slow path then defines the
property, and the rule above applies. The test is on attributes that the
function has loaded already. A custom value without a setter is replaced as
before.

A11 now says which places have the rule, what Object.preventExtensions(),
Object.seal() and Object.freeze() do to such a property, and when the rule can
go. The test has those cases. CLAUDE.md: the fork changes 130 upstream tests,
as BUN-TEST-DIFFERENCES.md says.

Test: JSTests/stress/bun-definition-of-a-value-reaches-the-setter-of-a-custom-value.js
…code optimizer

BytecodeOptimizer.cpp has its switches over opcodes written by hand, and an
opcode without a case is taken to read and write only the registers that it
names. Upstream's op_call_varargs_with_spread (325231@main) compiled without a
case. It builds a callee frame, so the optimizer kept live values in registers
that the call overwrites (e17271f), and it moved the opcode numbers that a
cache of bytecode stores (531a5a5). No build and no test failed for either.

A static_assert on a fingerprint of FOR_EACH_BYTECODE_ID (the names and the
lengths, in order) stops the build when the list changes, and its comment says
what to do then. A count of the opcodes is not enough: one opcode more and one
less leaves it as it was.

@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.

Code review found no new issues

No new issues were found in this update; 2 findings from earlier reviews are still open above.

Still open from earlier reviews (2):

If you have decided not to act on one of these findings, resolve its thread (a reply alone leaves it open) and the next review stops counting it. To review this commit again now, use Re-run on its "Claude Code Review" check.

robobun added a commit to oven-sh/bun that referenced this pull request Nov 3, 2026
… opcode list is checked at build time

The build of the fork's branch robobun/0ce9862d/upgrade-to-1d4bed41aca8-bun-main-engine
at da82a279b916 is the engine of fef6892630b2 with two commits of
oven-sh/WebKit#992 on top:

- canPutDirectFast() refuses a custom value, so a class field on a returned
  object is a definition that hands its value to the native setter.
- A static_assert stops the build when upstream changes the list of opcodes
  under the fork's bytecode optimizer.
@robobun

robobun commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator Author

@sosukesuzuki Two decisions about code of this pull request are open. oven-sh/bun#47811 (comment) has both, with the numbers: may a value definition install onmessage (the rule of dcaba855fc and fec01eb589), and does the fork keep upstream's atomic weak handles (WebKit/WebKit@5edecbf3e9).

Please do not merge this before they have an answer, and not before oven-sh/bun#47605 or oven-sh/bun#47811 is on Bun's main. WeakHandleOwner::finalize() returns void on main and FinalizeResult here, so neither side compiles against the other.

This pull request is a draft until then.

@robobun
robobun marked this pull request as draft November 3, 2026 22:59
@robobun

robobun commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator Author

#993 changes the arm of definePropertyOnReceiverSlow that this merge rewrites. The two pull requests conflict on JSObject.cpp:863-867.

After this merge a Proxy receiver does not reach the arm. One other receiver still does. The global object of a node:vm context in Bun answers [[GetOwnProperty]] with the slot of its contextified object, and the arm calls the native setter with that global object and its realm. With contextGlobal over Error, Reflect.set({}, "prepareStackTrace", fn, contextGlobal) makes the setter of Error.prepareStackTrace write out of bounds on Bun's main.

JSTests/stress/custom-value-put-through-proxy.js of #993 has blocks with a receiver that is no Proxy ($vm.createImpureGetter(holder)). The jsc of this branch at 09e949d fails in the first of them: the flag on the holder: expected true but got undefined.

There are two ways to resolve the conflict:

  • Keep the originalReceiver->type() != ProxyObjectType test, and pass slot.slotBase() and its realm to the setter.
  • Require slot.slotBase() == receiver for the arm. The store then ends in [[DefineOwnProperty]] on the receiver, and the node:vm global hands that to its contextified object, where the new block in validateAndApplyPropertyDescriptor calls the setter. The blocks with $vm.createImpureGetter need other expectations for this choice, because that receiver takes the property itself.

robobun added a commit that referenced this pull request Nov 6, 2026
…0cbda1-bun-main-engine

476 upstream commits since 1d4bed4 (the previous upgrade, #992), 85 of them in
Source/JavaScriptCore, Source/WTF or Source/bmalloc.

This records upstream/main as a parent, so the next upgrade finds its base by itself as
long as this lands as a merge commit and not as a squash.

67 files conflicted, in 154 hunks. JSType.h, BytecodeList.rb, .github/workflows,
.github/scripts and the Dockerfiles are untouched. OptionsList.h changes as upstream
changes it: the option useSharedArrayBuffer has the name alwaysUseSharedArrayBuffer
(9e3f762), isInRange() has NODELETE, and ftlThresholdScaleForFewCores is new
(7e32508). By default it multiplies the FTL thresholds by 4 on Linux on ARM64 with
four cores or fewer, and the fork's count of cores follows the CPU limit of a container.
The lists of sources of JavaScriptCore and WTF gain upstream's new files and nothing
else: JSWebAssemblySuspendingWrapper.cpp in Sources.txt, its header in JavaScriptCore's
CMakeLists.txt, NonEscapableBorrow.h and ScopedLeakSanitizerDisabler.h in
wtf/CMakeLists.txt, and four tests in Tools/TestWebKitAPI/CMakeLists.txt.

This commit does not build. The commits on top of it repair what is left:

  - wtf/HashTable.h: the fork's tryAllocateTable(), tryExpand(), prefetchForHash() and
    offsetOfTableSizeMask() use internals that 53bedf6 removes. HashSet.h,
    SparseArrayValueMap.h and the stub emitFindSparseElement() in
    aot/stubs/AOTStubsArrayReads.cpp go with them. The stub is a copy of the old
    inlineLookup() in machine code.
  - assembler/CPUFeatureSet.h has no F16C, which MacroAssemblerX86_64.h and
    MacroAssemblerX86_64.cpp use now (60af4b3).
  - aot/stubs/AOTStubAssembler.cpp calls test32() without a condition. 40aa4a4
    removes that form on x86-64.
  - Five files under aot/tests call Options::useSharedArrayBuffer(), which 9e3f762
    renames.
  - aot/tests/AOTLockedRealmTests.cpp expects the old result for a typed array as a
    prototype (890b90d).

LEGACY_NODELETE becomes NODELETE, in front of the declaration (1aa812d)

  97 hunks in 48 files. 45 files conflicted for this change only. A declaration that
  upstream has takes upstream's form, with what the fork changes in it. A declaration
  that only the fork has stays as the fork wrote it. Where it has LEGACY_NODELETE it
  keeps it, and wtf/Compiler.h still defines that. A declaration that the fork removed
  stays removed. In 25 of the 45 files a change of the fork is next to a declaration
  that upstream changes, and both stand. The rest:

  - B3Common.h, B3Effects.h, B3Procedure.h, AirStackSlot.h, MarkingConstraint.h,
    JSCell.h: NODELETE JS_EXPORT_PRIVATE, in upstream's order, on the 13 declarations
    that the fork exports.
  - CodeBlock.h: NODELETE on tryGetValueProfileForBytecodeIndex() and
    valueProfileForBytecodeIndex(), which return the fork's ValueProfileRef.
    SlotVisitor.h: on didStartMarking() with the fork's fourth parameter.
    YarrPattern.cpp: on restore() with the fork's insideLookbehind parameter.
  - AirFixObviousSpills.cpp: struct State stands below the fork's new SlotAliases, so
    seven of its declarations are outside the hunks, and git leaves them in the old
    form. They have NODELETE now, with the fork's bodies.
  - ExpressionInfo.h, HeapSnapshotBuilder.h, JSBigInt.h: the fork has
    decodeEntryForInstPC() and getNextObjectIdentifier() in the public section, and
    inplaceAddAndPropagate() and inplaceSubAndPropagate() further up. These four lines
    are outside the hunks. They have NODELETE now.
  - AirAllocateRegistersByGreedy.cpp: NODELETE on six declarations with the fork's
    signatures. buildIndices() has no annotation, as in the fork: its version there
    grows Vectors. lowestSoFar() stays removed.
  - CachedTypes.cpp: NODELETE on span8() and span16() with the fork's bodies. The fork
    reads a varint tail in place of 50 getters, which stay removed.
  - YarrInterpreter.cpp: the fork's interpreter has no MatchDirection parameters.
    Nine declarations have NODELETE with the fork's signature. Five others are not in
    the fork and stay out.
  - YarrSyntaxChecker.cpp: NODELETE on the 24 callbacks that both sides have, with the
    fork's bodies, which fill a SyntaxSummary. assertionBOI() and assertionEOI() stay
    removed.
  - AirCode.h: findFirstBlockIndex() is inline in the header in the fork and keeps the
    fork's text. CodeBlock.cpp: timeToLive() is a member of CodeBlock in the fork and
    has no annotation. HeapProfiler.h: setActiveHeapAnalyzer() has none either, as the
    fork's body can delete. Heap.cpp: growthMode() and maxEdenSizeForRateLimiting()
    stay removed.
  - B3ReduceStrength.cpp: class IntRange is in B3IntRange.h in the fork, so the fork's
    empty side stands. See the last section.

Vectors reserve through the reserve-capacity constructor (09aafa4)

  - Dominators.h: upstream's constructor line under the fork's "} else {". The fork
    has braces and ensureKids() on the other branch.
  - URLParser.cpp: percentDecodeImpl() has upstream's constructor line, then the
    fork's grow() and outputLength. The constructor makes the room, grow() sets the
    size, and the fork stores by index.
  - YarrPattern.cpp: copyTerms() has upstream's constructor on the fork's type,
    PatternTermList, then the fork's loop by index.
  - B3Procedure.cpp: blocksInPreOrder() and blocksInPostOrder() keep the fork's two
    lines, without a reservation. The fork's appendBlocksInOrder() reserves by itself.

Thread-safety capabilities for the roles of the GC protocol (9207c83)

  Upstream annotates the GC functions with the role that the caller holds, asserts the
  roles in builds with assertions, and deletes Heap::hasHeapAccess(). Only
  -Wthread-safety reads the annotations, and the JSCOnly port does not turn it on.

  - Collector.h: upstream's annotations and GCConductor parameters. The fork's
    isNotRunning(), canSkipMarking(), startsHelpersLazily() and startHelpers() stand
    between them without a capability: marking threads that do not conduct call
    startHelpers(). m_hasQueuedRequest stands in front of upstream's m_worldIsStopped.
  - Collector.cpp: work() has upstream's assertIsCollectorThread(), then the fork's
    AOT::HeapHooks::willWorkOnThisThread(). endCollectionInEachHeap() has upstream's
    assertIsConductorWithWorldStopped(conn), then the fork's ASSERT, which accepts a
    collection that skips marking.
  - Heap.h: hasHeapAccess() is gone. Bun's BunJSCEventLoop.cpp has to call
    hasAccess() in its place. The fork's five declarations between the lines that
    upstream annotates have no annotation.
  - Heap.cpp: addMarkingConstraint() has the fork's ASSERT(!m_isShuttingDown), then
    upstream's assertIsAccessHolder().
  - Heap.cpp, outside the hunks: reasonNotToEvacuateAuxiliaryBlocksNow() calls
    hasAccess(), which tests the same bit as hasHeapAccess().
  - Heap.cpp, outside the hunks, three new lines: in releaseAccessSlow() the fork's
    branch that collects in the mutator, where no collector thread can start, has
    noteAccessAcquired() in front of collectInMutatorThreadUntilDone() and
    noteAccessReleased() behind it, with a comment. Upstream's releaseAccess() notes
    the release before it calls releaseAccessSlow(), and the conductor asserts that
    it holds access. Both calls are empty without assertions.
  - Heap.cpp: upstream's assertIsAccessHolder() in stopIfNecessarySlow() merges
    without a conflict and stands. The fork lets a caller without heap access into
    stopIfNecessarySlow(unsigned). Such a caller stops at the assert in a build with
    assertions. A search of the fork and of Bun finds no such caller.
  - Heap.cpp, for a build with -Wthread-safety: the fork's
    evacuateSparseAuxiliaryBlocks(), collectInMutatorThreadUntilDone() and
    sweepAndClearCachesInEpilogue() call annotated functions and have no annotation.

JSON.stringify() is faster on arrays of similar objects (aeca1a9)

  - JSONObject.cpp: the declarations and members of both sides stand, the fork's
    first. recentResultsOverflowedStaticBuffer() stands behind the fork's
    tryAppendTo() and stringifyAfterFirstFastCaseFailed().
  - JSONObject.cpp, append(): the object case is upstream's. It calls upstream's new
    appendPreparedObject() or appendUnpreparedObject().
  - JSONObject.cpp, outside the hunks, at seven places in these two functions: the
    fork's enterHolder() and leaveHolder() replace upstream's ++m_depth and --m_depth.
    Without them an object with a prepared Structure is no level for the fork's limit
    of depth. appendPreparedObject() enters first, so it refuses an empty object at
    the limit.
  - JSONObject.cpp, result(): upstream's record of the length, then the one
    shrinkToFit(), under the fork's condition. That condition also frees a presized
    buffer under a short result, so upstream's condition line is not in the file.
  - JSONObject.cpp, arrays: upstream's lookup of a prepared Structure, then the fork's
    append, which writes null for undefined.
  - JSONObject.cpp, stringify(): FastStringifier::stringify() is NEVER_INLINE and has
    the fork's levelsAround. The caller has upstream's first attempt with the dynamic
    Latin-1 buffer, then the fork's lines. The later attempts are in the fork's
    stringifyAfterFirstFastCaseFailed(). It has a new last parameter,
    triedLatin1DynamicBuffer, and upstream's condition on its BufferFull branch.

JSON.parse() parses the objects of an array without a recursive call each, and scans a
double once (c8e6298, d24e80e)

  - LiteralParser.cpp: upstream moves the object parser into a parseObject lambda, and
    git puts the lambda outside the markers, without the fork's changes. The old
    copies of the object code in the hunks are gone. The element loop is upstream's.
  - LiteralParser.cpp, outside the hunks: the fork's seven changes are in the lambda
    now. They are mayHaveCachedString(), the spans of CachedCharType, the test that a
    cached name is ASCII where the text is UTF-8, tryMakeJSString() with its
    out-of-memory path, and the three mayHaveUncacheableTransitions() guards.
  - LiteralParser.cpp, outside the hunks, two new lines: parseObject begins with the
    fork's throwOutOfMemoryErrorIfOwed() check. The fork has it at the top of
    parseRecursively(), which every object passed before. Upstream parses the objects
    of an array in the frame of the array, so that check runs once for the array.
  - LiteralParser.cpp: both includes stand, SIMDHelpers.h and SIMDUTF.h. The fork's
    char8_t isSafeStringCharacter() keeps LEGACY_NODELETE. Git carries the fork's
    bit_cast on the parseJSONDouble() call into upstream's new lexDouble().

Float16 on x86-64 through F16C (60af4b3)

  - MacroAssemblerX86_64.cpp: the fork's collectCPUFeatures() returns a CPUFeatureSet
    and has no s_*CheckState. It takes upstream's changes, partly outside the
    markers: isTranslated, which it reads once from sysctl.proc_translated,
    add(CPUFeature::F16C, hasAVX && hasF16C), AVX2 under Rosetta inside
    collectLeaf7Features, and the Darwin block in upstream's new shape. hasAVX has the
    fork's test of OSXSAVE and XCR0. There is no s_f16cCheckState.
  - MacroAssemblerX86_64.h: supportsFloat16(CPUFeatureSet) answers
    features.contains(CPUFeature::F16C). The form without arguments is a member that
    reads policy().features, as the fork's other feature queries are.
  - testmasm.cpp, outside the hunk: upstream's four Float16 tests ask
    supportsFloat16(CPUFeatureSet::host()).
  - FTLLowerDFGToB3.cpp: compilePutByVal() and compileEnumeratorPutByVal() have the
    fork's clobber of macroClobberedFPRs() for every CPU, then upstream's same clobber
    under isX86_64(). Upstream's pair adds nothing behind the fork's line. It stands
    so that upstream's lines are in the file.
  - FTLLowerDFGToB3.cpp: in compileGetByValWithThis() and compileGetByValImpl()
    c57b5ce adds the line that the fork has. It is there once.

Fixes for the operands of some ARM64 and x86-64 integer operations (40aa4a4)

  - MacroAssemblerARM64.h: both sides fix the sign extension of the TrustedImm32 of a
    64-bit operation, on the same lines. The fork's lines stand:
    moveSignExtendedToCachedReg() in moveConditionally64(), moveDoubleConditionally64()
    and branch64(), and imm.m_value < 0 ? signExtend32ToPtr : move in branchAdd64()
    and branchSub64(). Upstream's lines move a TrustedImm64 for every immediate. The
    fork records a TrustedImm64 as a wide immediate (recordImmediate) for code that
    must hold no process address.
  - MacroAssemblerX86_64.h: test32() takes upstream's condition and has upstream's new
    body, with the fork's test of the register, reg < X86Registers::esp ||
    policy().shortensEncodings. Upstream's comment about esp does not stay. The fork
    deletes it, as it is wrong for the short encodings.
  - testmasm.cpp, outside the hunk: the three test32() calls of the fork's
    checkEncodingsFollowPolicy() pass NonZero.

Fixes for ARM64 MacroAssembler memory accesses (d4e7125)

  - MacroAssemblerARM64.h: the two register forms of branchTest64() with a mask that
    needs a register have upstream's three lines: ASSERT(reg != dataTempRegister), and
    the mask in dataTempRegister. The fork's choice of memoryTempRegister for reg ==
    dataTempRegister is gone, with its comment. Upstream fixes the same bug: the
    memory forms load the word into memoryTempRegister. No caller passes
    dataTempRegister with such a mask.
  - MacroAssemblerARM64.h, merged by git: a search finds no fork code that keeps a
    value in memoryTempRegister across a memory form of branchTest64() or or32().
  - MacroAssemblerARM64.h: storeVector(FPRegisterID, BaseIndex) has upstream's test
    for TimesOne and no ASSERT(Options::useWasmSIMD()), which the fork removes.

Fixes for ARM64 branch ranges and the relinking of conditional branches (081b436)

  - ARM64Assembler.h: relinkJumpOrCall() no longer inverts the condition of a branch
    whose target is 32 bytes ahead, as in upstream. Its three cases keep the fork's
    return of the link function: relinkJumpOrCall() returns a BranchEncoding there.
  - testmasm.cpp, outside the hunk: the 16 KB row of the fork's testLinkedSites()
    expects TestBitJump as its first kind. computeJumpType() compacts a test-bit
    branch within 32 KB now. The kind for late linking is unchanged.

WTF::HashTable stores one status byte per bucket (53bedf6)

  - AtomStringImpl.cpp: SubstringTranslator has the fork's text() and upstream's
    translate(), which takes a pointer and constructs the entry in place. The other
    four translators merge the same way without a conflict. No translator of the fork
    is left in the old form.
  - HashTable.h: it merges without a conflict and does not compile. See the list
    above.

Typed arrays are MayHaveIndexedAccessors (890b90d)

  - StructureCache.cpp: emptyStructureForPrototypeFromBaseStructure() has upstream's
    indexingModeIncludingHistory() line, then the fork's
    prototype->didBecomePrototype(), then the test of the prototype chain. In the fork
    that test also asks a question that is false before didBecomePrototype().
  - StructureCache.cpp, for Bun: Bun makes the Structure of Buffer from that of
    Uint8Array through this function, so Buffer has the bit now too. The fork's realm
    flag for a typed array in a prototype chain adds nothing for these objects now.

B3 resetReachability() looks for Phis in dead blocks only (72e8b46)

  - B3Procedure.cpp: the fork has the same change, with a second loop. The function is
    upstream's single loop now, with the fork's four other lines for the cached block
    orders and the MovedLoadLog.
  - B3ReduceStrength.cpp, outside the hunk: upstream's new unconditional
    m_proc.resetValueOwners() in front of the walk is not in the file. The fork resets
    the owners lazily in front of each reader (m_valueOwnersAreCurrent), Phi folding
    included. It has done so since it made the same change to resetReachability().

The JSToWasm IC assumes no tag registers (600fe6f, c983da4)

  - AssemblyHelpers.cpp: jitAssertIsJSDouble() has upstream's two lines, which compare
    against TrustedImm64(JSValue::NumberTag). The fork's calls of branchIfInt32() and
    branchIfNumber() are gone from it. They read the tag register where the tags are
    not in memory, and the IC entry no longer sets that register up.

JSPI: the host call path clears the ReturnPC slot (a2bc1ad)

  - LowLevelInterpreter64.asm: both sides add the same store in makeHostFunctionCall.
    It is there once, under upstream's comment and the fork's.

A Wasm tail call to a JS import of the same instance uses a restore frame (be384ac)

  - WasmCallee.h: upstream's declaration of g_wasmToJSCalleeBoxed stands outside the
    guard of JSToWasmICCallee, which is ENABLE(CODE_GENERATION) in the fork.

A cache for Intl.Locale (b46acf4)

  - IntlLocale.cpp: both includes stand, AOTRemovableFeature.h and IntlCache.h.

Probe::Page::set() dirties every chunk that a straddling write touches (eeb3fa9)

  - testmasm.cpp: run() has the fork's two blocks of RUN lines, then upstream's
    RUN(testProbeStackSetFlushesStraddlingWrite()).

Merged without a conflict and changed for the fork

  - wasm/js/JSToWasm.cpp: the fork's call of materializeTagRegistersIfNeeded() in the
    I64 case is gone. c983da4 removes that lambda, and upstream's case tests with
    branchIfNotCell(scratchGPR, DoNotHaveTagRegisters).
  - b3/B3IntRange.h: a file of the fork. It holds class IntRange, which the fork moved
    out of B3ReduceStrength.cpp. The 26 declarations that 1aa812d changes there
    have NODELETE in front here too.
  - Nothing else: every other file that only one side changes is that side's, and the
    other 326 files that both sides change without a conflict are the plain three-way
    merge.
robobun added a commit that referenced this pull request Nov 7, 2026
…grade-to-fd64f10cbda1

This branch is main with the upgrade to upstream 1d4bed4 (#992). The
branch that is merged in is the same upgrade on the engine of Bun's main, and on top of
it the merge of upstream fd64f10 (1b14e09) and what the fork needed behind it.
The two branches part at 2edbf27.

Three files conflict, all of them tests:

- b3/testb3_bun_placement.cpp and b3/testb3_bun_vectorize_loops.cpp: main and the merged
  branch repaired the same two tests (an argument that is made where it is used, and a
  disassembly that reads past the code). Main's text stays.
- aot/tests/AOTListedFieldsTests.cpp: each side adds tests at the same place. Both stay.

aot/tests/AOTPropertyLookupTests.cpp merges without a conflict: the merged branch took
main's change of #971 word for word.
@robobun

robobun commented Nov 10, 2026

Copy link
Copy Markdown
Collaborator Author

Closing: #1015 covers this.

@robobun robobun closed this Nov 10, 2026
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.