Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
73618b9
Adapt the C++ bindings to WebKit 7b485a76e9
robobun Sep 24, 2026
c59bd5d
Upgrade WebKit to 7b485a76e9
robobun Sep 24, 2026
253498e
verify-baseline: the IPInt slow paths now follow ipint_op_memory_atom…
robobun Sep 24, 2026
336f019
node:vm: compute the physical line of a parse error from the provider…
robobun Sep 24, 2026
e8f29f9
test: run the WebKit upgrade cases one after another
robobun Sep 24, 2026
6981c0a
test: Error.appendStackTrace with a stackTraceLimit that is not a number
robobun Sep 24, 2026
1783628
Address review: keep the sampling profiler path edit to the type, pin…
robobun Sep 24, 2026
2485e4e
Move the WebKit pin to the preview build of eacf0ea760
robobun Sep 24, 2026
cbc7da0
[autofix.ci] apply automated fixes
autofix-ci[bot] Sep 24, 2026
701805b
ci: retrigger
robobun Sep 24, 2026
f17c171
test: carry over the WebKit upgrade tests that only #42666 had
robobun Sep 24, 2026
07e4a6c
test: drop a "use strict" directive that is illegal next to a rest pa…
robobun Sep 24, 2026
b2c031c
test: an error from a class field initializer is reported where the c…
robobun Sep 24, 2026
05411f8
Move the WebKit pin to the preview build of 3a8b1bc93b
robobun Sep 24, 2026
e795bac
Merge branch 'main' into robobun/d9954162/upgrade-webkit-7b485a76e9
robobun Sep 25, 2026
07e92bb
napi: describe why napi_delete_reference is safe during a sweep
robobun Sep 25, 2026
bb32fe2
Merge remote-tracking branch 'origin/main' into robobun/d9954162/upgr…
robobun Sep 25, 2026
5a659db
napi: remove a sentence about the sweep from a comment
robobun Sep 25, 2026
6786486
Pass UTF-8 bytes with a length as a span
robobun Sep 25, 2026
5599f05
webview: shorten a comment
robobun Sep 25, 2026
efdc463
Merge branch 'main' into robobun/d9954162/upgrade-webkit-7b485a76e9
dylan-conway Sep 25, 2026
c8448eb
compile: an executable brings where the lines of its modules start
dylan-conway Sep 26, 2026
f226244
Move the WebKit pin to the preview build of oven-sh/WebKit#734
dylan-conway Sep 26, 2026
8aee5a0
ci: a connection to Azure that times out does not fail the pipeline step
dylan-conway Sep 26, 2026
62c5767
Merge remote-tracking branch 'origin/main' into robobun/d9954162/upgr…
dylan-conway Sep 26, 2026
c5349a1
The line starts of a source come with its code
dylan-conway Sep 26, 2026
3ad6806
test: a build without the testing hook still runs the other upgrade t…
dylan-conway Sep 26, 2026
83cd52a
Move the WebKit pin to the preview build of oven-sh/WebKit#734 at 7c2…
dylan-conway Sep 26, 2026
412965d
test: a position in a builtin depends on the build, and a chunk that …
robobun Sep 26, 2026
c202477
test: the code of an executable came out of its bytecode, and positio…
robobun Sep 26, 2026
a3aa45f
test: make the padding of the line length case with Buffer.alloc
robobun Sep 26, 2026
f4d56ee
test: the lines of the disk cache log end with CR LF on Windows
robobun Sep 26, 2026
5e20ed2
test: follow oven-sh/WebKit#734 as it landed
dylan-conway Sep 26, 2026
3067a6e
Move the WebKit pin to f20ce77445, the fork's main with oven-sh/WebKi…
dylan-conway Sep 26, 2026
303040f
Merge remote-tracking branch 'origin/main' into robobun/d9954162/upgr…
dylan-conway Sep 26, 2026
6f9fc95
Merge the branch's test commits, with the tests as oven-sh/WebKit#734…
dylan-conway Sep 26, 2026
aeef738
test: a build with assertions has the line starts of an internal modu…
robobun Sep 26, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 14 additions & 9 deletions scripts/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,16 +91,19 @@ interface RequestOptions {
}

/**
* A request to the cloud's metadata or secret service. Those are not always up
* yet when the agent starts at boot, so a failed attempt is repeated, a little
* later each time. A 400, 404 or 422 is an answer, not a failure to repeat.
* A request to a cloud's service. The metadata and secret services are not
* always up yet when the agent starts at boot, and a connection to any of them
* can time out, so a failed attempt is repeated, a little later each time. A
* 400, 404, 409 or 422 is an answer, not a failure to repeat. `status` is that
* of the last response, if the last attempt got one.
*/
export async function request(
url: string,
options: RequestOptions,
): Promise<{ error: Error | undefined; body: unknown }> {
): Promise<{ error: Error | undefined; body: unknown; status: number | undefined }> {
const { method = "GET", headers = {}, body: input, json, attempts } = options;
let error: Error | undefined;
let status: number | undefined;
for (let attempt = 0; attempt < attempts; attempt++) {
if (attempt > 0) {
await new Promise(resolve => setTimeout(resolve, 1000 * (attempt + 1)));
Expand All @@ -112,17 +115,19 @@ export async function request(
body = json && response.ok ? await response.json() : await response.text();
} catch (cause) {
error = new Error(`Fetch failed: ${method} ${url}`, { cause });
status = undefined;
continue;
}
status = response.status;
if (response.ok) {
return { error: undefined, body };
return { error: undefined, body, status };
}
error = new Error(`Fetch failed: ${method} ${url}: ${response.status} ${response.statusText}`, { cause: body });
if (response.status === 400 || response.status === 404 || response.status === 422) {
return { error, body };
error = new Error(`Fetch failed: ${method} ${url}: ${status} ${response.statusText}`, { cause: body });
if (status === 400 || status === 404 || status === 409 || status === 422) {
return { error, body, status };
}
}
return { error, body: undefined };
return { error, body: undefined, status };
}

/** The temp directory to use on this machine. */
Expand Down
2 changes: 1 addition & 1 deletion scripts/build/deps/webkit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* for local mode. Override via `--webkit-version=<hash>` to test a branch.
* From https://github.com/oven-sh/WebKit releases.
*/
export const WEBKIT_VERSION = "35e8970dfd926abf6661c9d356f5d60d8f611c9b";
export const WEBKIT_VERSION = "f20ce7744553c910bcf16a33faf976af208de091";

/**
* WebKit (JavaScriptCore) — the JS engine.
Expand Down
47 changes: 32 additions & 15 deletions scripts/ci-image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { tmpdir } from "node:os";
import { join, relative, resolve } from "node:path";
import { fileURLToPath } from "node:url";
import { parseArgs } from "node:util";
import { getArch, requireCommand, run } from "./agent.ts";
import { getArch, request, requireCommand, run } from "./agent.ts";
import {
type WindowsImage,
bakeDirectory,
Expand Down Expand Up @@ -67,6 +67,17 @@ function getLinuxImageState(name: string): ImageState {
return states.size ? "failed" : "missing";
}

const azureAttempts = 5;

/**
* `request()` names the URL in its error, and Azure's name the tenant or the
* subscription. This has the status and what came with it: the body of the
* response, or why there was none.
*/
function azureError(what: string, { error, status }: Awaited<ReturnType<typeof request>>): Error {
return new Error(`${what}: ${status ?? "no response"}`, { cause: error?.cause });
}

type Azure = {
token: string;
subscriptionId: string;
Expand All @@ -77,20 +88,25 @@ type Azure = {

async function getAzure(): Promise<Azure> {
const tenantId = getSecret("AZURE_TENANT_ID");
const response = await fetch(`https://login.microsoftonline.com/${tenantId}/oauth2/v2.0/token`, {
const response = await request(`https://login.microsoftonline.com/${tenantId}/oauth2/v2.0/token`, {
method: "POST",
headers: { "Content-Type": "application/x-www-form-urlencoded" },
body: new URLSearchParams({
grant_type: "client_credentials",
client_id: getSecret("AZURE_CLIENT_ID"),
client_secret: getSecret("AZURE_CLIENT_SECRET"),
scope: "https://management.azure.com/.default",
}),
}).toString(),
json: true,
attempts: azureAttempts,
});

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 nit (optional): an operator running ci-image.ts with a rejected Azure client secret now waits about 14 s through five retries before seeing "Azure auth failed: 401", where the base failed at once. request() at scripts/agent.ts:126 treats only 400, 404, 409 and 422 as final, so the token endpoint's 401 (invalid_client) is retried azureAttempts times with growing sleeps at scripts/agent.ts:109. Fix: treat authentication and authorization answers (401, 403) as final in request(), or pass attempts: 1 for the token request at scripts/ci-image.ts:102, while still retrying network failures and 5xx from the metadata and secret services.

Why this was flagged

An operator runs scripts/ci-image.ts with a wrong AZURE_CLIENT_SECRET. getAzure() at scripts/ci-image.ts:91-102 now calls request() with attempts: azureAttempts (5) instead of a single fetch. login.microsoftonline.com answers 401 with invalid_client, which is not in the final-status list at scripts/agent.ts:126, so the loop at scripts/agent.ts:107-129 repeats the POST four more times with sleeps of 2, 3, 4 and 5 seconds. Only after that does scripts/ci-image.ts:106-109 throw "Azure auth failed: 401". On the base branch the single fetch's !response.ok threw the same message immediately. No safeguard stops the retries because the status list was written for the metadata service, not for an auth endpoint whose 401 is a definitive answer.

Verification: nit. Trigger: an operator runs scripts/ci-image.ts with a wrong AZURE_CLIENT_SECRET (or an expired bearer token on the gallery calls). Mechanism verified: getAzure() at /home/claude/bun/scripts/ci-image.ts:90-101 now calls request() with attempts: azureAttempts (5, defined at line 70) where the base did a single fetch and threw on !response.ok at once. In… | nit. Trigger: an operator/CI run…

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This line is in the maintainer's commit 8aee5a03e8, and he makes the changes outside test/ on this branch, so I leave the decision to him. One fact for that decision: scripts/agent.ts is copied onto every machine image, so a change to request() gives every image a new name, and the next build bakes them all again (about an hour for the Windows ones).

if (!response.ok) {
throw new Error(`Azure auth failed: ${response.status}`);
if (response.error) {
// Without the body of a response, which can name the client.
throw response.status
? new Error(`Azure auth failed: ${response.status}`)
: azureError("Azure auth failed", response);
}
const { access_token: token } = (await response.json()) as { access_token: string };
const { access_token: token } = response.body as { access_token: string };
return {
token,
subscriptionId: getSecret("AZURE_SUBSCRIPTION_ID"),
Expand All @@ -101,12 +117,13 @@ async function getAzure(): Promise<Azure> {
}

/** A request to the gallery image definition `name`, or to a path under it. */
function galleryRequest(azure: Azure, name: string, path: string, init?: RequestInit): Promise<Response> {
function galleryRequest(azure: Azure, name: string, path: string, init?: { method: string; body?: string }) {
const { subscriptionId, resourceGroup, galleryName, token } = azure;
const definition = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroup}/providers/Microsoft.Compute/galleries/${galleryName}/images/${name}`;
return fetch(`https://management.azure.com${definition}${path}?api-version=2024-03-03`, {
return request(`https://management.azure.com${definition}${path}?api-version=2024-03-03`, {
...init,
headers: { "Authorization": `Bearer ${token}`, "Content-Type": "application/json" },
attempts: azureAttempts,
});
}

Expand All @@ -118,10 +135,10 @@ async function getWindowsImageState(azure: Azure, name: string): Promise<ImageSt
if (response.status === 404) {
return "missing";
}
if (!response.ok) {
throw new Error(`Azure gallery lookup of ${name} failed: ${response.status} ${await response.text()}`);
if (response.error) {
throw azureError(`Azure gallery lookup of ${name} failed`, response);
}
const { properties } = (await response.json()) as { properties: { provisioningState: string } };
const { properties } = JSON.parse(response.body as string) as { properties: { provisioningState: string } };
switch (properties.provisioningState) {
case "Succeeded":
return "available";
Expand Down Expand Up @@ -226,16 +243,16 @@ async function bakeWindowsImage(key: string, name: string, timeoutMinutes: numbe
},
}),
});
if (!definition.ok && definition.status !== 409) {
throw new Error(`Failed to create gallery image definition: ${definition.status} ${await definition.text()}`);
if (definition.error && definition.status !== 409) {
throw azureError("Failed to create gallery image definition", definition);
}

if (state === "failed") {
// Packer refuses to publish over a version that exists, and this one never became an image.
console.log(`[packer] Deleting the failed version of ${name}`);
const deleted = await galleryRequest(azure, name, galleryVersion, { method: "DELETE" });
if (!deleted.ok) {
throw new Error(`Failed to delete the failed version of ${name}: ${deleted.status} ${await deleted.text()}`);
if (deleted.error) {
throw azureError(`Failed to delete the failed version of ${name}`, deleted);
}
while ((await getWindowsImageState(azure, name)) !== "missing") {
await new Promise(done => setTimeout(done, 10_000));
Expand Down
12 changes: 8 additions & 4 deletions scripts/verify-baseline-static/allowlist-x64.txt
Original file line number Diff line number Diff line change
Expand Up @@ -442,12 +442,16 @@ ipint_simd_i8x16_relaxed_swizzle [AVX]


# ----------------------------------------------------------------------------
# JSC IPInt atomics. cmpxchg loop reloads the SIMD accumulator with vmovdqu
# after the IPInt metadata removal in upstream ef40cabc28d2; gated behind
# Options::useWasmSIMD().
# JSC IPInt out-of-line slow paths. They have local labels only, so the scanner
# counts them as part of the last global symbol in front of them. Since
# upstream 5ad2bece76 that symbol is the out-of-line memory.atomic.wait64
# handler (it was ipint_i64_atomic_rmw32_cmpxchg_u). The AVX instructions are
# the splats of .simd_v128_load{8,16,32,64}_splat_slow_path, which only SIMD
# opcodes reach. Gate: Options::useWasmSIMD(), which Options.cpp turns off
# when isX86_64_AVX() is false.
# (1 symbols)
# ----------------------------------------------------------------------------
ipint_i64_atomic_rmw32_cmpxchg_u [AVX]
ipint_op_memory_atomic_wait64 [AVX]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 nit (optional): if the Windows x64 profile binary has the same IPInt reorder as Linux, the windows-x64 verify-baseline CI step fails after this merge. The diff renames only the Linux entry at scripts/verify-baseline-static/allowlist-x64.txt:454 to ipint_op_memory_atomic_wait64 for upstream 5ad2bece76, while scripts/verify-baseline-static/allowlist-x64-windows.txt:428 still names ipint_i64_atomic_rmw32_cmpxchg_u_atomic_validate. Fix: rescan the windows-x64 bun-profile.exe built with the new WebKit pin and move that Windows entry to whichever _validate symbol now precedes the v128.load*_splat slow paths, so both x64 allowlists follow the same upstream layout.

Why this was flagged

The Windows allowlist is generated from the same JSC offlineasm as the Linux one (its header says symbol names only differ by MSVC mangling and a _validate suffix), and its IPInt SIMD entries at scripts/verify-baseline-static/allowlist-x64-windows.txt:405-419 mirror the Linux ones one for one. The Linux commit 253498e explains that the AVX splat slow paths have local labels only and are attributed to the last global symbol before them, which upstream 5ad2bece76 changed from ipint_i64_atomic_rmw32_cmpxchg_u to ipint_op_memory_atomic_wait64. The Windows list at :428 still allowlists ipint_i64_atomic_rmw32_cmpxchg_u_atomic_validate and has no wait64 entry. scripts/verify-baseline-static/src/main.rs:1223-1233 returns FAIL for any violation not in the allowlist (stale entries only print), and .buildkite/ci.ts:673 runs verify-baseline for windows x64, so the Windows step reports the splat AVX instructions under the new symbol and fails, where the base branch with the old WebKit pin passed. Condition I could not check from this checkout: that the Windows prebuilt's global label order moved the…

Verification: nit — triggered when CI runs the windows-x64 verify-baseline step on a bun-profile.exe built from the new WebKit pin (which it does on every PR/main build: .buildkite/ci.ts:673 if (os === "windows") return arch === "x64";, step not soft_fail at ci.ts:784-797, and scripts/verify-baseline.ts:214-219 turns a static-scan exit code 1 into instructionFailures++ and process.exit(1) at…



# ----------------------------------------------------------------------------
Expand Down
6 changes: 4 additions & 2 deletions src/codegen/bundle-functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ JSC::FunctionExecutable* ${lowerBasename}${cap(fn.name)}CodeGenerator(JSC::VM& v

const initializeSourceCodeFn = (fn: BundledBuiltin, basename: string) => {
const name = `${low(basename)}${cap(fn.name)}CodeSource`;
return `m_${name}(SourceCode(sourceProvider.copyRef(), ${fn.sourceOffset}, ${fn.source.length + fn.sourceOffset}, 1, 1))`;
return `m_${name}(SourceCode(sourceProvider.copyRef(), ${fn.sourceOffset}, ${fn.source.length + fn.sourceOffset}))`;
};
for (const { basename, internal, functions } of files) {
bundledCPP += `
Expand All @@ -482,8 +482,10 @@ ${basename}BuiltinsWrapper::${basename}BuiltinsWrapper(JSC::VM& vm, RefPtr<JSC::
}

bundledCPP += `
static constexpr unsigned internalCombinedSourceStarts[] = { ${files.flatMap(({ functions }) => functions.map(fn => fn.sourceOffset)).join(", ")} };

RefPtr<JSC::SourceProvider> createBuiltinsSourceProvider() {
return JSC::StringSourceProvider::create(StringImpl::createWithoutCopying(internalCombinedSource), SourceOrigin(), String(), SourceTaintedOrigin());
return JSC::BuiltinsSourceProvider::create(StringImpl::createWithoutCopying(internalCombinedSource), internalCombinedSourceStarts);
}
`;

Expand Down
2 changes: 1 addition & 1 deletion src/codegen/generate-classes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -852,7 +852,7 @@ JSC_DEFINE_HOST_FUNCTION(${symbolName(typeName, name)}Callback, (JSGlobalObject
* from a debugger */
SourceOrigin sourceOrigin = callFrame->callerSourceOrigin(vm);
auto fileNameUTF8 = sourceOrigin.string().utf8();
const char* fileName = fileNameUTF8.data();
const char* fileName = fileNameUTF8.legacyCStringPointer();
static const char* lastFileName = nullptr;
if (lastFileName != fileName) {
lastFileName = fileName;
Expand Down
8 changes: 8 additions & 0 deletions src/js/internal-for-testing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,14 @@ export const internalModulesLoadedFromBytecode: () => number = $newCppFunction(
0,
);

// Whether the source of `fn` knows where its lines start. Before anything asked for a position in it, that means they
// came with its code: from the parse, or out of the bytecode.
Comment on lines +862 to +863

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If you need a paragraph-long comment to justify why the workaround is OK, the code is wrong — fix the code

export const sourceHasLineStarts: (fn: Function) => boolean = $newCppFunction(
"ZigSourceProvider.cpp",
"jsSourceHasLineStarts",
1,
);

// The bytecode `bun build --compile --bytecode` embeds for a builtin module, plus the external string table it embeds
// beside it: internal module number `index` (null past the last), or `source` written in builtin syntax (@-intrinsics,
// a function expression) compiled under `name`.
Expand Down
8 changes: 6 additions & 2 deletions src/jsc/bindings/BunAnalyzeTranspiledModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -276,11 +276,15 @@ static EncodedJSValue fallbackParse(JSGlobalObject* globalObject, JSModuleLoader
auto actual = dumpRecordInfo(resultValue);
auto expected = dumpRecordInfo(moduleRecord);
if (actual != expected) {
dataLog("\n\n\n\n\n\n\x1b[95mBEGIN analyzeTranspiledModule\x1b(B\x1b[m\n --- module key ---\n", moduleKey.utf8().data(), "\n --- code ---\n\n", sourceCode.toUTF8().data(), "\n");
dataLog("\n\n\n\n\n\n\x1b[95mBEGIN analyzeTranspiledModule\x1b(B\x1b[m\n --- module key ---\n", moduleKey.utf8(), "\n --- code ---\n\n", sourceCode.toUTF8(), "\n");
dataLog(" ------", "\n");
dataLog(" BunAnalyzeTranspiledModule:", "\n");

zig__renderDiff(expected.utf8().data(), expected.utf8().length(), actual.utf8().data(), actual.utf8().length());
auto expectedUTF8 = expected.utf8();
auto actualUTF8 = actual.utf8();
auto expectedBytes = byteCast<char>(expectedUTF8.span());
auto actualBytes = byteCast<char>(actualUTF8.span());
zig__renderDiff(expectedBytes.data(), expectedBytes.size(), actualBytes.data(), actualBytes.size());

RELEASE_AND_RETURN(scope, JSValue::encode(rejectWithError(createError(globalObject, WTF::String::fromLatin1("Imports different between parseFromSourceCode and fallbackParse")))));
}
Expand Down
4 changes: 2 additions & 2 deletions src/jsc/bindings/BunClientData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ void JSVMClientData::create(VM* vm, void* bunVM, WorkerMessagingProxy* worker)
// (~VM -> lastChanceToFinalize -> delete clientData), so the capture stays
// valid for every collection.
vm->heap.addMarkingConstraint(makeUnique<JSC::SimpleMarkingConstraint>(
"Srb", "Bun StrongRootBlocks",
"Srb"_s, "Bun StrongRootBlocks"_s,
MAKE_MARKING_CONSTRAINT_EXECUTOR_PAIR(([clientData](auto& visitor) {
JSC::SetRootMarkReasonScope rootScope(visitor, JSC::RootMarkReason::StrongHandles);
visitor.appendUnbarriered(clientData->m_strongRootBlockHead);
Expand All @@ -179,7 +179,7 @@ void JSVMClientData::create(VM* vm, void* bunVM, WorkerMessagingProxy* worker)

// The common string cache: slots filled by the JS thread, read here with the world stopped (as above).
vm->heap.addMarkingConstraint(makeUnique<JSC::SimpleMarkingConstraint>(
"Bcs", "Bun CommonStrings",
"Bcs"_s, "Bun CommonStrings"_s,
MAKE_MARKING_CONSTRAINT_EXECUTOR_PAIR(([clientData](auto& visitor) {
JSC::SetRootMarkReasonScope rootScope(visitor, JSC::RootMarkReason::StrongHandles);
clientData->commonStrings.visit(visitor);
Expand Down
2 changes: 1 addition & 1 deletion src/jsc/bindings/BunGCOutputConstraint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ namespace WebCore {
using namespace JSC;

DOMGCOutputConstraint::DOMGCOutputConstraint(VM& vm, JSHeapData& heapData)
: MarkingConstraint("Domo", "DOM Output", ConstraintVolatility::SeldomGreyed, ConstraintConcurrency::Concurrent, ConstraintParallelism::Parallel)
: MarkingConstraint("Domo"_s, "DOM Output"_s, ConstraintVolatility::SeldomGreyed, ConstraintConcurrency::Concurrent, ConstraintParallelism::Parallel)
, m_vm(vm)
, m_heapData(heapData)
, m_lastExecutionVersion(vm.heap.mutatorExecutionVersion())
Expand Down
6 changes: 3 additions & 3 deletions src/jsc/bindings/BunProcess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ static JSValue constructProcessReleaseObject(VM& vm, JSObject* processObject)
auto* release = JSC::constructEmptyObject(globalObject);

release->putDirect(vm, vm.propertyNames->name, jsOwnedString(vm, String("node"_s)), 0); // maybe this should be 'bun' eventually
putDirectNamed(vm, release, "sourceUrl"_s, jsOwnedString(vm, WTF::String(std::span { Bun__githubURL, strlen(Bun__githubURL) })));
putDirectNamed(vm, release, "sourceUrl"_s, jsOwnedString(vm, String::fromLatin1(Bun__githubURL)));
putDirectNamed(vm, release, "headersUrl"_s, jsOwnedString(vm, String("https://nodejs.org/download/release/v" REPORTED_NODEJS_VERSION "/node-v" REPORTED_NODEJS_VERSION "-headers.tar.gz"_s)));

RETURN_IF_EXCEPTION(scope, {});
Expand Down Expand Up @@ -3373,7 +3373,7 @@ static JSValue maybe_uid_by_name(JSC::ThrowScope& throwScope, JSGlobalObject* gl
auto str = value.getString(globalObject);
RETURN_IF_EXCEPTION(throwScope, {});
auto utf8 = str.utf8();
auto name = utf8.data();
auto name = utf8.legacyCStringPointer();
struct passwd pwd;
struct passwd* pp = nullptr;
char buf[8192];
Expand All @@ -3395,7 +3395,7 @@ static JSValue maybe_gid_by_name(JSC::ThrowScope& throwScope, JSGlobalObject* gl
auto str = value.getString(globalObject);
RETURN_IF_EXCEPTION(throwScope, {});
auto utf8 = str.utf8();
auto name = utf8.data();
auto name = utf8.legacyCStringPointer();
struct group pwd;
struct group* pp = nullptr;
char buf[8192];
Expand Down
2 changes: 1 addition & 1 deletion src/jsc/bindings/BunSecureContextCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class SecureContextCache {
}

JSC::JSObject* get(uint64_t key) { return m_map.get(key); }
void set(uint64_t key, JSC::JSObject* value) { m_map.set(key, JSC::Weak<JSC::JSObject>(value)); }
void set(uint64_t key, JSC::JSObject* value) { m_map.set(key, value); }

private:
JSC::WeakGCMap<uint64_t, JSC::JSObject, WTF::IntHash<uint64_t>, WTF::UnsignedWithZeroKeyHashTraits<uint64_t>> m_map;
Expand Down
2 changes: 1 addition & 1 deletion src/jsc/bindings/CookieMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ static void CookieMap__writeFetchHeadersToUWSResponse(CookieMap* cookie_map, JSC
// Loop over modified cookies and write Set-Cookie headers to the response
for (auto& cookie : cookie_map->getAllChanges()) {
auto utf8 = cookie->toString(global_this->vm()).utf8();
res->writeHeader("Set-Cookie", utf8.data());
res->writeHeader("Set-Cookie", utf8.legacyCStringPointer());
}
}
extern "C" void CookieMap__write(CookieMap* cookie_map, JSC::JSGlobalObject* global_this, UWSResponseKind kind, void* arg2)
Expand Down
6 changes: 4 additions & 2 deletions src/jsc/bindings/ErrorStackFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,12 @@ void adjustPositionBackwards(ZigStackFramePosition& pos, int amount, CodeBlock*
ZigStackFramePosition getAdjustedPositionForBytecode(JSC::CodeBlock* code, JSC::BytecodeIndex bc)
{
auto expr = code->expressionInfoForBytecodeIndex(bc);
// Expression info has offsets only. The provider derives the line and the column from the divot.
auto lineColumn = code->source().provider()->documentLineColumnForOffset(expr.divot);

ZigStackFramePosition pos {
.line_zero_based = OrdinalNumber::fromOneBasedInt(expr.lineColumn.line).zeroBasedInt(),
.column_zero_based = OrdinalNumber::fromOneBasedInt(expr.lineColumn.column).zeroBasedInt(),
.line_zero_based = OrdinalNumber::fromOneBasedInt(lineColumn.line).zeroBasedInt(),
.column_zero_based = OrdinalNumber::fromOneBasedInt(lineColumn.column).zeroBasedInt(),
.byte_position = (int)expr.divot,
};

Expand Down
2 changes: 1 addition & 1 deletion src/jsc/bindings/FuzzilliREPRL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ static JSC::EncodedJSValue JSC_HOST_CALL_ATTRIBUTES functionFuzzilli(JSC::JSGlob
// the fuzzer harness).
static FILE* f = fdopen(REPRL_DWFD, "w");
if (f) {
fprintf(f, "%s\n", output.utf8().data());
fprintf(f, "%s\n", output.utf8().legacyCStringPointer());
fflush(f);
}
}
Expand Down
5 changes: 4 additions & 1 deletion src/jsc/bindings/InspectorBunFrontendDevServerAgent.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,14 @@ class FrontendRouter;
class BackendDispatcher;
class BunFrontendDevServerFrontendDispatcher;

class InspectorBunFrontendDevServerAgent final : public InspectorAgentBase, public Inspector::BunFrontendDevServerBackendDispatcherHandler {
class InspectorBunFrontendDevServerAgent final : public InspectorAgentBase, public Inspector::BunFrontendDevServerBackendDispatcherHandler, public CanMakeThreadSafeCheckedPtr<InspectorBunFrontendDevServerAgent> {
WTF_MAKE_NONCOPYABLE(InspectorBunFrontendDevServerAgent);
WTF_MAKE_TZONE_ALLOCATED(InspectorBunFrontendDevServerAgent);
WTF_OVERRIDE_DELETE_FOR_CHECKED_PTR(InspectorBunFrontendDevServerAgent);

public:
OVERRIDE_ABSTRACT_CAN_MAKE_CHECKEDPTR(CanMakeThreadSafeCheckedPtr);

InspectorBunFrontendDevServerAgent(JSC::JSGlobalObject&);
virtual ~InspectorBunFrontendDevServerAgent() final;

Expand Down
5 changes: 4 additions & 1 deletion src/jsc/bindings/InspectorHTTPServerAgent.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,14 @@ enum class DisconnectReason;

using AnyServerPtr = void*;

class InspectorHTTPServerAgent final : public InspectorAgentBase, public Inspector::HTTPServerBackendDispatcherHandler {
class InspectorHTTPServerAgent final : public InspectorAgentBase, public Inspector::HTTPServerBackendDispatcherHandler, public CanMakeThreadSafeCheckedPtr<InspectorHTTPServerAgent> {
WTF_MAKE_NONCOPYABLE(InspectorHTTPServerAgent);
WTF_MAKE_TZONE_ALLOCATED(InspectorHTTPServerAgent);
WTF_OVERRIDE_DELETE_FOR_CHECKED_PTR(InspectorHTTPServerAgent);

public:
OVERRIDE_ABSTRACT_CAN_MAKE_CHECKEDPTR(CanMakeThreadSafeCheckedPtr);

InspectorHTTPServerAgent(JSC::JSGlobalObject&);
virtual ~InspectorHTTPServerAgent();

Expand Down
Loading
Loading