Skip to content

Upgrade WebKit to ea1bfb85d259 - #26161

Merged
Jarred-Sumner merged 11 commits into
mainfrom
claude/webkit-upgrade-ea1bfb85d259
Jan 17, 2026
Merged

Jarred-Sumner merged 11 commits into
mainfrom
claude/webkit-upgrade-ea1bfb85d259

Conversation

@robobun

@robobun robobun commented Jan 16, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Upgrades WebKit from c4d4cae03ece to ea1bfb85d259
  • Merges upstream WebKit changes into oven-sh/webkit fork

WebKit Upgrade Summary (JavaScriptCore Changes)

JSType Enum Changes

No breaking changes to JSType enum from upstream. The diff showing InternalFieldTupleType removal is actually showing Bun's custom addition - upstream WebKit does not have this type. The Bun fork maintains InternalFieldTupleType after DerivedStringObjectType, which is preserved during the upgrade.

Notable Performance Improvements

ARM64 Conditional Compare Chain (ccmp/ccmn)

  • Commit: 2cd6a734ed6c
  • Implements ARM64 ccmp/ccmn instruction chaining for compound boolean expressions
  • Converts patterns like if (x0 == 0 && x1 == 1) into efficient conditional compare sequences
  • Reduces branch prediction misses and code size
  • Introduces new Air opcodes: CompareOnFlags, CompareConditionallyOnFlags, BranchOnFlags

Extended Constant Materialization for Float16/Float/Double/V128

  • Commit: 0521cc7f331a
  • Enhanced ARM64 constant materialization using movi, mvni, and vector fmov
  • Avoids memory loads for Float constants (32-bit values can now be materialized directly)
  • Adds FPImm128 and Move128ToVector Air instructions

DFG/FTL Storage Pointer Improvements

  • Commits: 00c0add58ec3, 7051d3ac1f34
  • FTL Phis now properly support storage (butterfly) pointers
  • Introduces KnownStorageUse for all storage operands in DFG/FTL
  • Fixes issues with Array allocation sinking when creating storage Phis
  • Improves GC safety by ensuring butterfly pointers are properly tracked

Bug Fixes

Thread Termination Race Condition

  • Commit: 23922a766f07
  • Fixes race condition in VM::m_hasTerminationRequest between main thread and worker threads
  • Moves setHasTerminationRequest() call into VMTraps::handleTraps() to eliminate race

ThrowScope Exception Clearing

  • Commit: 67abaaa35c4d
  • ThrowScopes can no longer accidentally clear termination exceptions
  • Introduces tryClearException() which fails on termination exceptions
  • Affects iterator operations, promises, and WebCore stream handling

Bytecode Cache JIT Threshold

  • Commit: e0644034f46e
  • Functions loaded from bytecode cache now correctly set JIT threshold
  • Previously, cached functions would JIT immediately on first execution

Wasm Fixes

  • Commit: 8579516f4b61 - Fix JIT-less Wasm-to-JS i31ref marshalling for i31 values in double format
  • Commit: 22b6a610f6ff - Fix nullability for wasm js-string builtins return types (cast, fromCharCode, fromCodePoint, concat, substring)
  • Commit: 5ad2efd177db - Optimize Wasm BlockSignature to avoid lock contention during parsing

32-bit ARM (Armv7) Fix

  • Commit: 9cc23c0e75b7
  • Fixes tail call shuffler register allocation on 32-bit ARM
  • Prevents assertion failures when JSValue can load via FPR but GPRs are exhausted

New Features

Temporal PlainYearMonth Support

  • Commit: d865004780e6
  • Enables all PlainYearMonth test262 tests
  • Fixes several bugs in month code handling and rounding modes

Wasm IPInt Execution Tracing

  • Commit: 634156af4114
  • Adds --traceWasmIPIntExecution option for debugging WebAssembly interpreter execution

Code Quality Improvements

  • Commit: 31bc5e6778d4 - JSRegExpStringIterator reduced from 56 to 40 bytes by merging boolean fields into bitfield
  • Commit: cda948675446 - Fix fragile include dependency in JSC::getCallDataInline
  • Commit: bd87f5db107e - Fix unretained local variable warnings in JavaScriptCore/API

Merge Conflicts Resolved

Fixed 4 merge conflicts related to Bun-specific patches:

  1. Source/JavaScriptCore/API/JSVirtualMachine.mm - Removed JSLockHolder as per Bun's patch
  2. Source/JavaScriptCore/runtime/JSBoundFunction.h - Used relative includes instead of framework includes
  3. Source/JavaScriptCore/runtime/JSObjectInlines.h - Used relative includes and updated JSFunction.h to JSFunctionInlines.h
  4. Source/WTF/wtf/text/WTFString.h - Preserved ExternalStringImpl support

Test plan

  • WebKit builds successfully (bun build.ts debug)
  • JSType enum values verified to be compatible
  • CI builds and tests pass

🤖 Generated with Claude Code

Updates WebKit from c4d4cae03ece to ea1bfb85d259.

Notable JSC changes:
- ARM64 ccmp/ccmn instruction chaining for better branch prediction
- Extended constant materialization for Float16/Float/Double/V128
- DFG/FTL storage pointer improvements
- Thread termination race condition fix
- ThrowScope exception clearing changes (tryClearException replaces clearException)
- Various Wasm and Temporal fixes

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@robobun

robobun commented Jan 16, 2026 •

Copy link
Copy Markdown
Collaborator Author
Updated 7:03 PM PT - Jan 16th, 2026

❌ Your commit 0cbfc4ed has 2 failures in Build #35093 (All Failures):


🧪   To try this PR locally:

bunx bun-pr 26161

That installs a local version of the PR into your bun-26161 executable, so you can run:

bun-26161 --bun

@coderabbitai

coderabbitai Bot commented Jan 16, 2026 •

Copy link
Copy Markdown
Contributor

Walkthrough

This PR changes many exception-clearing calls from clearException() to tryClearException() (discarding return values), updates the default WEBKIT_VERSION in the CMake script, fixes UTF‑8 lifetime issues in timer/codegen code, and updates the CLEAR_IF_EXCEPTION macro to use tryClearException().

Changes

Cohort / File(s) Summary
WebKit version update
cmake/tools/SetupWebKit.cmake
Updated default WEBKIT_VERSION from c4d4cae03ecef2791f7ad5dd795f722d8be87d41 to 5ae5f07f29059c183a8db2eef2c9aabd474ec73c
Exception handling macro
src/bun.js/bindings/headers-handwritten.h
CLEAR_IF_EXCEPTION(scope__) changed from scope__.clearException(); to (void)scope__.tryClearException();
Bindings-wide exception migration
src/bun.js/bindings/..., src/bun.js/bindings/bindings.cpp
Replaced many clearException() calls with (void)scope.tryClearException() / (void)catchScope.tryClearException() across numerous binding files (BunObject, BunPlugin, BunProcess, CallSite, ErrorCode, ErrorStackTrace, JSCommonJSModule, ModuleLoader, etc.)
WebCore & helper code
src/bun.js/bindings/helpers.h, src/bun.js/bindings/webcore/...
Switched clearException() → (void)tryClearException() in WebCore integration and helper files (JSCallbackData, JSDOMPromiseDeferred, JSEventListener, SerializedScriptValue, etc.)
Node / module / runtime
src/bun.js/modules/..., src/bun.js/bindings/node/...
Switched exception clears to tryClearException() in module and Node-related files (NodeModuleModule, NodeProcessModule, ObjectModule, NodeTimers, NodeTimerObject, NodeVM*, NodeVMSpecialSandbox change adds proxy revocation check)
Crypto / N-API / WebCrypto / SQLite
src/bun.js/bindings/napi.cpp, src/bun.js/bindings/node/crypto/..., src/bun.js/bindings/sqlite/JSSQLStatement.cpp, src/bun.js/bindings/webcrypto/JSSubtleCrypto.cpp
Replaced clearException() with (void)tryClearException(); sqlite changes also adjust UTF‑8/static storage for paths and entry points
UTF‑8 lifetime & codegen fixes
src/bun.js/bindings/node/NodeTimers.cpp, src/codegen/generate-classes.ts
Preserve UTF‑8 view objects to avoid dangling pointers when extracting const char* from temporary UTF‑8 views
Misc bindings & modules
src/bun.js/modules/*, src/bun.js/bindings/*
Multiple small replacements of scope.clearException() → (void)scope.tryClearException() across additional files (JSMockFunction, JSBundlerPlugin, JSX509Certificate, ZigGlobalObject, etc.)

Possibly related PRs

Suggested reviewers

  • nektro
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Upgrade WebKit to ea1bfb85d259' directly and clearly describes the main change - a WebKit version upgrade with the specific commit hash.
Description check ✅ Passed The PR description provides comprehensive details about the WebKit upgrade, changes, bug fixes, and merge conflicts resolved. While it exceeds the template's simple format, it contains all necessary information about what the PR does and verification steps.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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

Claude Bot and others added 9 commits January 16, 2026 22:11
- Replace clearException() with tryClearException() for ThrowScope/CatchScope
- Fix dangling pointer issues with utf8().data() by keeping CString alive
- Update SetupWebKit.cmake to use release 5ae5f07f29059c183a8db2eef2c9aabd474ec73c

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…ile not found" (#26126)

## Summary

- When running `bun <file>` on a file with an unsupported type (e.g.,
`.css`, `.yaml`, `.toml`), Bun now shows a helpful error message instead
of the misleading "File not found"
- Tracks when a file is resolved but has a loader that can't be run
directly
- Shows the actual file path and file type in the error message

**Before:**
```
error: File not found "test.css"
```

**After:**
```
error: Cannot run "/path/to/test.css"
note: Bun cannot run css files directly
```

## Test plan

- [x] Added regression test in `test/regression/issue/1365.test.ts`
- [x] Test verifies unsupported files show "Cannot run" error
- [x] Test verifies nonexistent files still show "File not found"
- [x] Test fails with `USE_SYSTEM_BUN=1` and passes with debug build

Fixes #1365

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Bot <claude-bot@bun.sh>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
…led (#26175)

The signature size adjustment was being applied unconditionally, but it
should only happen when building for ARM64 and codesigning is enabled.
This prevents incorrect offset calculations on non-ARM64 platforms.

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
…ogs (#26177)

## Summary
- Fetches complete logs from BuildKite's public API (no token required)
- Saves logs to `/tmp/bun-build-{number}-{platform}-{step}.log`
- Shows log file path in output for each failed job
- Displays brief error summary (unique errors, max 5)
- Adds help text with usage examples (`--help`)
- Groups failures by type (build/test/other)
- Shows annotation counts with link to view full annotations
- Documents usage in CLAUDE.md

## Test plan
- [x] Tested with build #35051 (9 failed jobs)
- [x] Verified logs saved to `/tmp/bun-build-35051-*.log`
- [x] Verified error extraction and deduplication works
- [x] Verified `--help` flag shows usage

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Bot <claude-bot@bun.sh>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
The previous code was assigning a pointer to temporary data that would be
destroyed at the end of the expression. Use a static CString to keep the
string alive for the lifetime of the process.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The script wasn't recognizing the 'started' build state, which caused
it to incorrectly report builds as having no failures when they were
still running.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Two fixes for node:vm module after the WebKit upgrade:

1. NodeVMModule.cpp: Use DECLARE_CATCH_SCOPE(vm).clearException() instead
   of scope.tryClearException() when handling termination exceptions.
   The tryClearException() method now returns false without clearing
   termination exceptions, causing assertion failures later.

2. NodeVM.cpp: Add extra safety check for ProxyObject handler value
   to ensure it's an object before casting with jsCast<JSObject*>.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants