From 1375f27ea5f15a30cd9403fa93371ef0b99becc3 Mon Sep 17 00:00:00 2001 From: Ben Grant Date: Tue, 6 May 2025 15:44:05 -0700 Subject: [PATCH] wip --- build.zig | 57 +- src/bun.js/api/FFIObject.zig | 133 --- src/bun.js/api/crypto.classes.ts | 17 - src/bun.js/api/server.classes.ts | 26 - src/bun.js/api/server/ServerWebSocket.zig | 141 --- src/bun.js/bindings/JSBuffer.cpp | 24 - src/bun.js/bindings/JSObject.zig | 18 +- src/bun.js/bindings/ZigGeneratedCode.cpp | 325 ------- .../bindings/ZigLazyStaticFunctions-inlines.h | 33 - src/bun.js/bindings/bindings.cpp | 4 +- src/bun.js/bindings/c-typedefs.h | 54 ++ src/bun.js/bindings/headers-handwritten.h | 129 ++- src/bun.js/bindings/headers.h | 862 ++++++++---------- src/bun.js/jsc/host_fn.zig | 4 - src/bun.js/webcore/Crypto.zig | 42 - src/bun.js/webcore/TextDecoder.zig | 4 - .../webcore/TextEncoderStreamEncoder.zig | 14 - src/bun.js/webcore/encoding.classes.ts | 15 - src/c-headers-for-zig.h | 2 + src/codegen/generate-classes.ts | 209 +---- ...ranslate_c.zig => process_translate_c.zig} | 29 +- 21 files changed, 558 insertions(+), 1584 deletions(-) delete mode 100644 src/bun.js/bindings/ZigLazyStaticFunctions-inlines.h create mode 100644 src/bun.js/bindings/c-typedefs.h rename src/codegen/{process_windows_translate_c.zig => process_translate_c.zig} (68%) diff --git a/build.zig b/build.zig index 04afe96fe8..312a9bedab 100644 --- a/build.zig +++ b/build.zig @@ -508,34 +508,35 @@ fn getTranslateC(b: *Build, initial_target: std.Build.ResolvedTarget, optimize: translate_c.defineCMacroRaw(b.fmt("{s}={d}", .{ str, @intFromBool(value) })); } - if (target.result.os.tag == .windows) { - // translate-c is unable to translate the unsuffixed windows functions - // like `SetCurrentDirectory` since they are defined with an odd macro - // that translate-c doesn't handle. - // - // #define SetCurrentDirectory __MINGW_NAME_AW(SetCurrentDirectory) - // - // In these cases, it's better to just reference the underlying function - // directly: SetCurrentDirectoryW. To make the error better, a post - // processing step is applied to the translate-c file. - // - // Additionally, this step makes it so that decls like NTSTATUS and - // HANDLE point to the standard library structures. - const helper_exe = b.addExecutable(.{ - .name = "process_windows_translate_c", - .root_module = b.createModule(.{ - .root_source_file = b.path("src/codegen/process_windows_translate_c.zig"), - .target = b.graph.host, - .optimize = .Debug, - }), - }); - const in = translate_c.getOutput(); - const run = b.addRunArtifact(helper_exe); - run.addFileArg(in); - const out = run.addOutputFileArg("c-headers-for-zig.zig"); - return out; - } - return translate_c.getOutput(); + // translate-c is unable to translate the unsuffixed windows functions + // like `SetCurrentDirectory` since they are defined with an odd macro + // that translate-c doesn't handle. + // + // #define SetCurrentDirectory __MINGW_NAME_AW(SetCurrentDirectory) + // + // In these cases, it's better to just reference the underlying function + // directly: SetCurrentDirectoryW. To make the error better, a post + // processing step is applied to the translate-c file. + // + // Additionally, this step makes it so that decls like NTSTATUS and + // HANDLE point to the standard library structures. + // + // We also use this to replace some `opaque` declarations generated by + // translate-c with their equivalents defined in our own Zig code, + // since our definitions have useful declarations on them. + const helper_exe = b.addExecutable(.{ + .name = "process_translate_c", + .root_module = b.createModule(.{ + .root_source_file = b.path("src/codegen/process_translate_c.zig"), + .target = b.graph.host, + .optimize = .Debug, + }), + }); + const in = translate_c.getOutput(); + const run = b.addRunArtifact(helper_exe); + run.addFileArg(in); + const out = run.addOutputFileArg("c-headers-for-zig.zig"); + return out; } pub fn addBunObject(b: *Build, opts: *BunBuildOptions) *Compile { diff --git a/src/bun.js/api/FFIObject.zig b/src/bun.js/api/FFIObject.zig index 54e2e1aa32..52ba9a2390 100644 --- a/src/bun.js/api/FFIObject.zig +++ b/src/bun.js/api/FFIObject.zig @@ -201,131 +201,6 @@ pub const Reader = struct { const value = @as(*align(1) u64, @ptrFromInt(addr)).*; return JSValue.fromUInt64NoTruncate(globalObject, value); } - - pub fn u8WithoutTypeChecks( - _: *JSGlobalObject, - _: *anyopaque, - raw_addr: i64, - offset: i32, - ) callconv(JSC.conv) JSValue { - const addr = @as(usize, @intCast(raw_addr)) + @as(usize, @intCast(offset)); - const value = @as(*align(1) u8, @ptrFromInt(addr)).*; - return JSValue.jsNumber(value); - } - pub fn u16WithoutTypeChecks( - _: *JSGlobalObject, - _: *anyopaque, - raw_addr: i64, - offset: i32, - ) callconv(JSC.conv) JSValue { - const addr = @as(usize, @intCast(raw_addr)) + @as(usize, @intCast(offset)); - const value = @as(*align(1) u16, @ptrFromInt(addr)).*; - return JSValue.jsNumber(value); - } - pub fn u32WithoutTypeChecks( - _: *JSGlobalObject, - _: *anyopaque, - raw_addr: i64, - offset: i32, - ) callconv(JSC.conv) JSValue { - const addr = @as(usize, @intCast(raw_addr)) + @as(usize, @intCast(offset)); - const value = @as(*align(1) u32, @ptrFromInt(addr)).*; - return JSValue.jsNumber(value); - } - pub fn ptrWithoutTypeChecks( - _: *JSGlobalObject, - _: *anyopaque, - raw_addr: i64, - offset: i32, - ) callconv(JSC.conv) JSValue { - const addr = @as(usize, @intCast(raw_addr)) + @as(usize, @intCast(offset)); - const value = @as(*align(1) u64, @ptrFromInt(addr)).*; - return JSValue.jsNumber(value); - } - pub fn i8WithoutTypeChecks( - _: *JSGlobalObject, - _: *anyopaque, - raw_addr: i64, - offset: i32, - ) callconv(JSC.conv) JSValue { - const addr = @as(usize, @intCast(raw_addr)) + @as(usize, @intCast(offset)); - const value = @as(*align(1) i8, @ptrFromInt(addr)).*; - return JSValue.jsNumber(value); - } - pub fn i16WithoutTypeChecks( - _: *JSGlobalObject, - _: *anyopaque, - raw_addr: i64, - offset: i32, - ) callconv(JSC.conv) JSValue { - const addr = @as(usize, @intCast(raw_addr)) + @as(usize, @intCast(offset)); - const value = @as(*align(1) i16, @ptrFromInt(addr)).*; - return JSValue.jsNumber(value); - } - pub fn i32WithoutTypeChecks( - _: *JSGlobalObject, - _: *anyopaque, - raw_addr: i64, - offset: i32, - ) callconv(JSC.conv) JSValue { - const addr = @as(usize, @intCast(raw_addr)) + @as(usize, @intCast(offset)); - const value = @as(*align(1) i32, @ptrFromInt(addr)).*; - return JSValue.jsNumber(value); - } - pub fn intptrWithoutTypeChecks( - _: *JSGlobalObject, - _: *anyopaque, - raw_addr: i64, - offset: i32, - ) callconv(JSC.conv) JSValue { - const addr = @as(usize, @intCast(raw_addr)) + @as(usize, @intCast(offset)); - const value = @as(*align(1) i64, @ptrFromInt(addr)).*; - return JSValue.jsNumber(value); - } - - pub fn f32WithoutTypeChecks( - _: *JSGlobalObject, - _: *anyopaque, - raw_addr: i64, - offset: i32, - ) callconv(JSC.conv) JSValue { - const addr = @as(usize, @intCast(raw_addr)) + @as(usize, @intCast(offset)); - const value = @as(*align(1) f32, @ptrFromInt(addr)).*; - return JSValue.jsNumber(value); - } - - pub fn f64WithoutTypeChecks( - _: *JSGlobalObject, - _: *anyopaque, - raw_addr: i64, - offset: i32, - ) callconv(JSC.conv) JSValue { - const addr = @as(usize, @intCast(raw_addr)) + @as(usize, @intCast(offset)); - const value = @as(*align(1) f64, @ptrFromInt(addr)).*; - return JSValue.jsNumber(value); - } - - pub fn u64WithoutTypeChecks( - global: *JSGlobalObject, - _: *anyopaque, - raw_addr: i64, - offset: i32, - ) callconv(JSC.conv) JSValue { - const addr = @as(usize, @intCast(raw_addr)) + @as(usize, @intCast(offset)); - const value = @as(*align(1) u64, @ptrFromInt(addr)).*; - return JSValue.fromUInt64NoTruncate(global, value); - } - - pub fn i64WithoutTypeChecks( - global: *JSGlobalObject, - _: *anyopaque, - raw_addr: i64, - offset: i32, - ) callconv(JSC.conv) JSValue { - const addr = @as(usize, @intCast(raw_addr)) + @as(usize, @intCast(offset)); - const value = @as(*align(1) i64, @ptrFromInt(addr)).*; - return JSValue.fromInt64NoTruncate(global, value); - } }; pub fn ptr( @@ -340,14 +215,6 @@ pub fn ptr( }; } -pub fn ptrWithoutTypeChecks( - _: *JSGlobalObject, - _: *anyopaque, - array: *JSC.JSUint8Array, -) callconv(JSC.conv) JSValue { - return JSValue.fromPtrAddress(@intFromPtr(array.ptr())); -} - fn ptr_( globalThis: *JSGlobalObject, value: JSValue, diff --git a/src/bun.js/api/crypto.classes.ts b/src/bun.js/api/crypto.classes.ts index 9f64ec1f0e..e3192e09d7 100644 --- a/src/bun.js/api/crypto.classes.ts +++ b/src/bun.js/api/crypto.classes.ts @@ -42,30 +42,13 @@ export default [ proto: { getRandomValues: { fn: "getRandomValues", - // https://discord.com/channels/876711213126520882/1276103693665828894/1276133319033229363 - // https://discord.com/channels/876711213126520882/1276103693665828894/1276127092047609919 - // DOMJIT: { - // returns: "JSValue", - // "pure": false, - // args: ["JSUint8Array"], - // }, }, randomUUID: { fn: "randomUUID", length: 1, - DOMJIT: { - returns: "JSString", - "pure": false, - args: [], - }, }, timingSafeEqual: { fn: "timingSafeEqual", - DOMJIT: { - returns: "JSValue", - "pure": false, - args: ["JSUint8Array", "JSUint8Array"], - }, length: 2, }, }, diff --git a/src/bun.js/api/server.classes.ts b/src/bun.js/api/server.classes.ts index 44cb521d86..c6b52fbf3d 100644 --- a/src/bun.js/api/server.classes.ts +++ b/src/bun.js/api/server.classes.ts @@ -214,44 +214,18 @@ export default [ sendText: { fn: "sendText", length: 2, - // ASSERTION FAILED: m_data[index].lockCount - // /Users/jarred/actions-runner/_work/WebKit/WebKit/Source/JavaScriptCore/dfg/DFGRegisterBank.h(204) : void JSC::DFG::RegisterBank::unlock(RegID) [BankInfo = JSC::GPRInfo] - // 1 0x102740124 WTFCrash - // 3 0x103076bac JSC::MacroAssemblerARM64::add64(JSC::AbstractMacroAssembler::TrustedImm64, JSC::ARM64Registers::RegisterID, JSC::ARM64Registers::RegisterID) - // 4 0x10309a2d0 JSC::DFG::SpeculativeJIT::compileCallDOM(JSC::DFG::Node*)::$_0::operator()(JSC::DFG::Edge) const - // DOMJIT: { - // returns: "int", - // args: ["JSString", "bool"], - // }, }, sendBinary: { fn: "sendBinary", length: 2, - // ASSERTION FAILED: m_data[index].lockCount - // /Users/jarred/actions-runner/_work/WebKit/WebKit/Source/JavaScriptCore/dfg/DFGRegisterBank.h(204) : void JSC::DFG::RegisterBank::unlock(RegID) [BankInfo = JSC::GPRInfo] - // 1 0x102740124 WTFCrash - // 3 0x103076bac JSC::MacroAssemblerARM64::add64(JSC::AbstractMacroAssembler::TrustedImm64, JSC::ARM64Registers::RegisterID, JSC::ARM64Registers::RegisterID) - // 4 0x10309a2d0 JSC::DFG::SpeculativeJIT::compileCallDOM(JSC::DFG::Node*)::$_0::operator()(JSC::DFG::Edge) const - // DOMJIT: { - // returns: "int", - // args: ["JSUint8Array", "bool"], - // }, }, publishText: { fn: "publishText", length: 2, - DOMJIT: { - returns: "int", - args: ["JSString", "JSString"], - }, }, publishBinary: { fn: "publishBinary", length: 2, - DOMJIT: { - returns: "int", - args: ["JSString", "JSUint8Array"], - }, }, ping: { fn: "ping", diff --git a/src/bun.js/api/server/ServerWebSocket.zig b/src/bun.js/api/server/ServerWebSocket.zig index b5fc2b1ac4..2847a196a5 100644 --- a/src/bun.js/api/server/ServerWebSocket.zig +++ b/src/bun.js/api/server/ServerWebSocket.zig @@ -572,87 +572,6 @@ pub fn publishBinary( ); } -pub fn publishBinaryWithoutTypeChecks( - this: *ServerWebSocket, - globalThis: *JSC.JSGlobalObject, - topic_str: *JSC.JSString, - array: *JSC.JSUint8Array, -) bun.JSError!JSC.JSValue { - const app = this.handler.app orelse { - log("publish() closed", .{}); - return JSValue.jsNumber(0); - }; - const flags = this.handler.flags; - const ssl = flags.ssl; - const publish_to_self = flags.publish_to_self; - - var topic_slice = topic_str.toSlice(globalThis, bun.default_allocator); - defer topic_slice.deinit(); - if (topic_slice.len == 0) { - return globalThis.throw("publishBinary requires a non-empty topic", .{}); - } - - const compress = true; - - const buffer = array.slice(); - if (buffer.len == 0) { - return JSC.JSValue.jsNumber(0); - } - - const result = if (!publish_to_self and !this.isClosed()) - this.websocket().publish(topic_slice.slice(), buffer, .binary, compress) - else - uws.AnyWebSocket.publishWithOptions(ssl, app, topic_slice.slice(), buffer, .binary, compress); - - return JSValue.jsNumber( - // if 0, return 0 - // else return number of bytes sent - if (result) @as(i32, @intCast(@as(u31, @truncate(buffer.len)))) else @as(i32, 0), - ); -} - -pub fn publishTextWithoutTypeChecks( - this: *ServerWebSocket, - globalThis: *JSC.JSGlobalObject, - topic_str: *JSC.JSString, - str: *JSC.JSString, -) bun.JSError!JSC.JSValue { - const app = this.handler.app orelse { - log("publish() closed", .{}); - return JSValue.jsNumber(0); - }; - const flags = this.handler.flags; - const ssl = flags.ssl; - const publish_to_self = flags.publish_to_self; - - var topic_slice = topic_str.toSlice(globalThis, bun.default_allocator); - defer topic_slice.deinit(); - if (topic_slice.len == 0) { - return globalThis.throw("publishBinary requires a non-empty topic", .{}); - } - - const compress = true; - - const slice = str.toSlice(globalThis, bun.default_allocator); - defer slice.deinit(); - const buffer = slice.slice(); - - if (buffer.len == 0) { - return JSC.JSValue.jsNumber(0); - } - - const result = if (!publish_to_self and !this.isClosed()) - this.websocket().publish(topic_slice.slice(), buffer, .text, compress) - else - uws.AnyWebSocket.publishWithOptions(ssl, app, topic_slice.slice(), buffer, .text, compress); - - return JSValue.jsNumber( - // if 0, return 0 - // else return number of bytes sent - if (result) @as(i32, @intCast(@as(u31, @truncate(buffer.len)))) else @as(i32, 0), - ); -} - pub fn cork( this: *ServerWebSocket, globalThis: *JSC.JSGlobalObject, @@ -826,37 +745,6 @@ pub fn sendText( } } -pub fn sendTextWithoutTypeChecks( - this: *ServerWebSocket, - globalThis: *JSC.JSGlobalObject, - message_str: *JSC.JSString, - compress: bool, -) JSValue { - if (this.isClosed()) { - log("sendText() closed", .{}); - return JSValue.jsNumber(0); - } - - var string_slice = message_str.toSlice(globalThis, bun.default_allocator); - defer string_slice.deinit(); - - const buffer = string_slice.slice(); - switch (this.websocket().send(buffer, .text, compress, true)) { - .backpressure => { - log("sendText() backpressure ({d} bytes string)", .{buffer.len}); - return JSValue.jsNumber(-1); - }, - .success => { - log("sendText() success ({d} bytes string)", .{buffer.len}); - return JSValue.jsNumber(buffer.len); - }, - .dropped => { - log("sendText() dropped ({d} bytes string)", .{buffer.len}); - return JSValue.jsNumber(0); - }, - } -} - pub fn sendBinary( this: *ServerWebSocket, globalThis: *JSC.JSGlobalObject, @@ -903,35 +791,6 @@ pub fn sendBinary( } } -pub fn sendBinaryWithoutTypeChecks( - this: *ServerWebSocket, - _: *JSC.JSGlobalObject, - array_buffer: *JSC.JSUint8Array, - compress: bool, -) JSValue { - if (this.isClosed()) { - log("sendBinary() closed", .{}); - return JSValue.jsNumber(0); - } - - const buffer = array_buffer.slice(); - - switch (this.websocket().send(buffer, .binary, compress, true)) { - .backpressure => { - log("sendBinary() backpressure ({d} bytes)", .{buffer.len}); - return JSValue.jsNumber(-1); - }, - .success => { - log("sendBinary() success ({d} bytes)", .{buffer.len}); - return JSValue.jsNumber(buffer.len); - }, - .dropped => { - log("sendBinary() dropped ({d} bytes)", .{buffer.len}); - return JSValue.jsNumber(0); - }, - } -} - pub fn ping( this: *ServerWebSocket, globalThis: *JSC.JSGlobalObject, diff --git a/src/bun.js/bindings/JSBuffer.cpp b/src/bun.js/bindings/JSBuffer.cpp index 2e6479a4f7..da51337e3a 100644 --- a/src/bun.js/bindings/JSBuffer.cpp +++ b/src/bun.js/bindings/JSBuffer.cpp @@ -1960,30 +1960,6 @@ static JSC::EncodedJSValue jsBufferPrototypeFunction_SliceWithEncoding(JSC::JSGl return jsBufferToString(lexicalGlobalObject, scope, castedThis, start, end - start, encoding); } -// DOMJIT makes it slower! TODO: investigate why -// JSC_DECLARE_JIT_OPERATION_WITHOUT_WTF_INTERNAL(jsBufferPrototypeToStringWithoutTypeChecks, JSValue, (JSC::JSGlobalObject * lexicalGlobalObject, JSC::JSUint8Array* thisValue, JSC::JSString* encodingValue)); - -// JSC_DEFINE_JIT_OPERATION(jsBufferPrototypeToStringWithoutTypeChecks, JSValue, (JSC::JSGlobalObject * lexicalGlobalObject, JSUint8Array* thisValue, JSString* encodingValue)) -// { -// auto& vm = JSC::getVM(lexicalGlobalObject); -// IGNORE_WARNINGS_BEGIN("frame-address") -// CallFrame* callFrame = DECLARE_CALL_FRAME(vm); -// IGNORE_WARNINGS_END -// JSC::JITOperationPrologueCallFrameTracer tracer(vm, callFrame); - -// std::optional encoded = parseEnumeration(*lexicalGlobalObject, encodingValue); -// if (!encoded) { -// auto scope = DECLARE_THROW_SCOPE(vm); - -// throwTypeError(lexicalGlobalObject, scope, "Invalid encoding"_s); -// return {}; -// } - -// auto encoding = encoded.value(); - -// return JSValue::decode(jsBufferToString(vm, lexicalGlobalObject, thisValue, 0, thisValue->byteLength(), encoding)); -// } - // https://github.com/nodejs/node/blob/2eff28fb7a93d3f672f80b582f664a7c701569fb/src/node_buffer.cc#L711 template static JSC::EncodedJSValue jsBufferPrototypeFunction_writeEncodingBody(JSC::VM& vm, JSC::JSGlobalObject* lexicalGlobalObject, JSArrayBufferView* castedThis, JSString* str, JSValue offsetValue, JSValue lengthValue) diff --git a/src/bun.js/bindings/JSObject.zig b/src/bun.js/bindings/JSObject.zig index 62688560fa..cd68d00cd1 100644 --- a/src/bun.js/bindings/JSObject.zig +++ b/src/bun.js/bindings/JSObject.zig @@ -13,12 +13,6 @@ pub const JSObject = opaque { return JSC__JSObject__maxInlineCapacity; } - extern fn JSC__JSObject__getIndex(this: JSValue, globalThis: *JSGlobalObject, i: u32) JSValue; - extern fn JSC__JSObject__putRecord(this: *JSObject, global: *JSGlobalObject, key: *ZigString, values: [*]ZigString, len: usize) void; - extern fn Bun__JSObject__getCodePropertyVMInquiry(global: *JSGlobalObject, obj: *JSObject) JSValue; - extern fn JSC__createStructure(global: *JSC.JSGlobalObject, owner: *JSC.JSCell, length: u32, names: [*]ExternColumnIdentifier) JSC.JSValue; - extern fn JSC__JSObject__create(global_object: *JSGlobalObject, length: usize, ctx: *anyopaque, initializer: InitializeCallback) JSValue; - pub fn toJS(obj: *JSObject) JSValue { return JSValue.fromCell(obj); } @@ -133,28 +127,28 @@ pub const JSObject = opaque { pub fn Initializer(comptime Ctx: type, comptime func: fn (*Ctx, obj: *JSObject, global: *JSGlobalObject) void) type { return struct { - pub fn call(this: *anyopaque, obj: *JSObject, global: *JSGlobalObject) callconv(.C) void { - @call(bun.callmod_inline, func, .{ @as(*Ctx, @ptrCast(@alignCast(this))), obj, global }); + pub fn call(this: ?*anyopaque, obj: *JSObject, global: *JSGlobalObject) callconv(.C) void { + @call(bun.callmod_inline, func, .{ @as(*Ctx, @ptrCast(@alignCast(this.?))), obj, global }); } }; } pub fn createWithInitializer(comptime Ctx: type, creator: *Ctx, global: *JSGlobalObject, length: usize) JSValue { const Type = Initializer(Ctx, Ctx.create); - return JSC__JSObject__create(global, length, creator, Type.call); + return bun.c.JSC__JSObject__create(global, length, creator, Type.call); } pub fn getIndex(this: JSValue, globalThis: *JSGlobalObject, i: u32) JSValue { - return JSC__JSObject__getIndex(this, globalThis, i); + return bun.c.JSC__JSObject__getIndex(this, globalThis, i); } pub fn putRecord(this: *JSObject, global: *JSGlobalObject, key: *ZigString, values: []ZigString) void { - return JSC__JSObject__putRecord(this, global, key, values.ptr, values.len); + return bun.c.JSC__JSObject__putRecord(this, global, key, values.ptr, values.len); } /// This will not call getters or be observable from JavaScript. pub fn getCodePropertyVMInquiry(obj: *JSObject, global: *JSGlobalObject) ?JSValue { - const v = Bun__JSObject__getCodePropertyVMInquiry(global, obj); + const v = bun.c.Bun__JSObject__getCodePropertyVMInquiry(global, obj); if (v == .zero) return null; return v; } diff --git a/src/bun.js/bindings/ZigGeneratedCode.cpp b/src/bun.js/bindings/ZigGeneratedCode.cpp index d420e3824c..d60ef961b4 100644 --- a/src/bun.js/bindings/ZigGeneratedCode.cpp +++ b/src/bun.js/bindings/ZigGeneratedCode.cpp @@ -15,18 +15,6 @@ using namespace WebCore; /* -- BEGIN DOMCall DEFINITIONS -- */ -// BUN_DECLARE_HOST_FUNCTION(FFI__ptr__slowpathWrapper); -// extern "C" JSC_DECLARE_JIT_OPERATION_WITHOUT_WTF_INTERNAL(FFI__ptr__fastpathWrapper, EncodedJSValue, (JSC::JSGlobalObject * lexicalGlobalObject, void* thisValue, JSC::JSUint8Array*)); - -// JSC_DEFINE_JIT_OPERATION(FFI__ptr__fastpathWrapper, EncodedJSValue, (JSC::JSGlobalObject * lexicalGlobalObject, void* thisValue, JSC::JSUint8Array* arg1)) -// { -// auto& vm = JSC::getVM(lexicalGlobalObject); -// IGNORE_WARNINGS_BEGIN("frame-address") -// CallFrame* callFrame = DECLARE_CALL_FRAME(vm); -// IGNORE_WARNINGS_END -// JSC::JITOperationPrologueCallFrameTracer tracer(vm, callFrame); -// return { FFI__ptr__fastpath(lexicalGlobalObject, thisValue, arg1) }; -// } JSC_DEFINE_HOST_FUNCTION(FFI__ptr__slowpathWrapper, (JSC::JSGlobalObject * globalObject, JSC::CallFrame* frame)) { return FFI__ptr__slowpath(globalObject, JSValue::encode(frame->thisValue()), reinterpret_cast(frame->addressOfArgumentsStart()), frame->argumentCount()); @@ -35,19 +23,6 @@ JSC_DEFINE_HOST_FUNCTION(FFI__ptr__slowpathWrapper, (JSC::JSGlobalObject * globa extern "C" void FFI__ptr__put(JSC::JSGlobalObject* globalObject, JSC::EncodedJSValue value) { JSC::JSObject* thisObject = JSC::jsCast(JSC::JSValue::decode(value)); - // static const JSC::DOMJIT::Signature DOMJIT_ptr_signature( - // FFI__ptr__fastpathWrapper, - // thisObject->classInfo(), - // JSC::DOMJIT::Effect::forReadWrite(JSC::DOMJIT::HeapRange::top(), JSC::DOMJIT::HeapRange::top()), - // JSC::SpecDoubleReal, - // JSC::SpecUint8Array); - // JSFunction* function = JSFunction::create( - // globalObject->vm(), - // globalObject, - // 1, - // String("ptr"_s), - // FFI__ptr__slowpathWrapper, ImplementationVisibility::Public, NoIntrinsic, FFI__ptr__slowpathWrapper, - // &DOMJIT_ptr_signature); JSFunction* function = JSFunction::create( globalObject->vm(), globalObject, @@ -63,17 +38,7 @@ extern "C" void FFI__ptr__put(JSC::JSGlobalObject* globalObject, JSC::EncodedJSV } BUN_DECLARE_HOST_FUNCTION(Reader__u8__slowpathWrapper); -extern "C" JSC_DECLARE_JIT_OPERATION_WITHOUT_WTF_INTERNAL(Reader__u8__fastpathWrapper, EncodedJSValue, (JSC::JSGlobalObject * lexicalGlobalObject, void* thisValue, int64_t, int32_t)); -// JSC_DEFINE_JIT_OPERATION(Reader__u8__fastpathWrapper, EncodedJSValue, (JSC::JSGlobalObject * lexicalGlobalObject, void* thisValue, int64_t arg1, int32_t arg2)) -// { -// auto& vm = JSC::getVM(lexicalGlobalObject); -// IGNORE_WARNINGS_BEGIN("frame-address") -// CallFrame* callFrame = DECLARE_CALL_FRAME(vm); -// IGNORE_WARNINGS_END -// JSC::JITOperationPrologueCallFrameTracer tracer(vm, callFrame); -// return { Reader__u8__fastpath(lexicalGlobalObject, thisValue, arg1, arg2) }; -// } JSC_DEFINE_HOST_FUNCTION(Reader__u8__slowpathWrapper, (JSC::JSGlobalObject * globalObject, JSC::CallFrame* frame)) { return Reader__u8__slowpath(globalObject, JSValue::encode(frame->thisValue()), reinterpret_cast(frame->addressOfArgumentsStart()), frame->argumentCount()); @@ -82,21 +47,6 @@ JSC_DEFINE_HOST_FUNCTION(Reader__u8__slowpathWrapper, (JSC::JSGlobalObject * glo extern "C" void Reader__u8__put(JSC::JSGlobalObject* globalObject, JSC::EncodedJSValue value) { JSC::JSObject* thisObject = JSC::jsCast(JSC::JSValue::decode(value)); - // static const JSC::DOMJIT::Signature DOMJIT_u8_signature( - // Reader__u8__fastpathWrapper, - // thisObject->classInfo(), - // JSC::DOMJIT::Effect::forReadWrite(JSC::DOMJIT::HeapRange::top(), JSC::DOMJIT::HeapRange::top()), - // JSC::SpecInt32Only, - // JSC::SpecInt52Any, - // JSC::SpecInt32Only); - // JSFunction* function = JSFunction::create( - // globalObject->vm(), - // globalObject, - // 2, - // String("u8"_s), - // Reader__u8__slowpathWrapper, ImplementationVisibility::Public, NoIntrinsic, Reader__u8__slowpathWrapper, - // &DOMJIT_u8_signature); - JSFunction* function = JSFunction::create( globalObject->vm(), globalObject, @@ -112,17 +62,6 @@ extern "C" void Reader__u8__put(JSC::JSGlobalObject* globalObject, JSC::EncodedJ } BUN_DECLARE_HOST_FUNCTION(Reader__u16__slowpathWrapper); -extern "C" JSC_DECLARE_JIT_OPERATION_WITHOUT_WTF_INTERNAL(Reader__u16__fastpathWrapper, EncodedJSValue, (JSC::JSGlobalObject * lexicalGlobalObject, void* thisValue, int64_t, int32_t)); - -// JSC_DEFINE_JIT_OPERATION(Reader__u16__fastpathWrapper, EncodedJSValue, (JSC::JSGlobalObject * lexicalGlobalObject, void* thisValue, int64_t arg1, int32_t arg2)) -// { -// auto& vm = JSC::getVM(lexicalGlobalObject); -// IGNORE_WARNINGS_BEGIN("frame-address") -// CallFrame* callFrame = DECLARE_CALL_FRAME(vm); -// IGNORE_WARNINGS_END -// JSC::JITOperationPrologueCallFrameTracer tracer(vm, callFrame); -// return { Reader__u16__fastpath(lexicalGlobalObject, thisValue, arg1, arg2) }; -// } JSC_DEFINE_HOST_FUNCTION(Reader__u16__slowpathWrapper, (JSC::JSGlobalObject * globalObject, JSC::CallFrame* frame)) { return Reader__u16__slowpath(globalObject, JSValue::encode(frame->thisValue()), reinterpret_cast(frame->addressOfArgumentsStart()), frame->argumentCount()); @@ -131,20 +70,6 @@ JSC_DEFINE_HOST_FUNCTION(Reader__u16__slowpathWrapper, (JSC::JSGlobalObject * gl extern "C" void Reader__u16__put(JSC::JSGlobalObject* globalObject, JSC::EncodedJSValue value) { JSC::JSObject* thisObject = JSC::jsCast(JSC::JSValue::decode(value)); - // static const JSC::DOMJIT::Signature DOMJIT_u16_signature( - // Reader__u16__fastpathWrapper, - // thisObject->classInfo(), - // JSC::DOMJIT::Effect::forReadWrite(JSC::DOMJIT::HeapRange::top(), JSC::DOMJIT::HeapRange::top()), - // JSC::SpecInt32Only, - // JSC::SpecInt52Any, - // JSC::SpecInt32Only); - // JSFunction* function = JSFunction::create( - // globalObject->vm(), - // globalObject, - // 2, - // String("u16"_s), - // Reader__u16__slowpathWrapper, ImplementationVisibility::Public, NoIntrinsic, Reader__u16__slowpathWrapper, - // &DOMJIT_u16_signature); JSFunction* function = JSFunction::create( globalObject->vm(), globalObject, @@ -158,17 +83,6 @@ extern "C" void Reader__u16__put(JSC::JSGlobalObject* globalObject, JSC::Encoded } BUN_DECLARE_HOST_FUNCTION(Reader__u32__slowpathWrapper); -extern "C" JSC_DECLARE_JIT_OPERATION_WITHOUT_WTF_INTERNAL(Reader__u32__fastpathWrapper, EncodedJSValue, (JSC::JSGlobalObject * lexicalGlobalObject, void* thisValue, int64_t, int32_t)); - -// JSC_DEFINE_JIT_OPERATION(Reader__u32__fastpathWrapper, EncodedJSValue, (JSC::JSGlobalObject * lexicalGlobalObject, void* thisValue, int64_t arg1, int32_t arg2)) -// { -// auto& vm = JSC::getVM(lexicalGlobalObject); -// IGNORE_WARNINGS_BEGIN("frame-address") -// CallFrame* callFrame = DECLARE_CALL_FRAME(vm); -// IGNORE_WARNINGS_END -// JSC::JITOperationPrologueCallFrameTracer tracer(vm, callFrame); -// return { Reader__u32__fastpath(lexicalGlobalObject, thisValue, arg1, arg2) }; -// } JSC_DEFINE_HOST_FUNCTION(Reader__u32__slowpathWrapper, (JSC::JSGlobalObject * globalObject, JSC::CallFrame* frame)) { return Reader__u32__slowpath(globalObject, JSValue::encode(frame->thisValue()), reinterpret_cast(frame->addressOfArgumentsStart()), frame->argumentCount()); @@ -177,20 +91,6 @@ JSC_DEFINE_HOST_FUNCTION(Reader__u32__slowpathWrapper, (JSC::JSGlobalObject * gl extern "C" void Reader__u32__put(JSC::JSGlobalObject* globalObject, JSC::EncodedJSValue value) { JSC::JSObject* thisObject = JSC::jsCast(JSC::JSValue::decode(value)); - // static const JSC::DOMJIT::Signature DOMJIT_u32_signature( - // Reader__u32__fastpathWrapper, - // thisObject->classInfo(), - // JSC::DOMJIT::Effect::forReadWrite(JSC::DOMJIT::HeapRange::top(), JSC::DOMJIT::HeapRange::top()), - // JSC::SpecInt32Only, - // JSC::SpecInt52Any, - // JSC::SpecInt32Only); - // JSFunction* function = JSFunction::create( - // globalObject->vm(), - // globalObject, - // 2, - // String("u32"_s), - // Reader__u32__slowpathWrapper, ImplementationVisibility::Public, NoIntrinsic, Reader__u32__slowpathWrapper, - // &DOMJIT_u32_signature); JSFunction* function = JSFunction::create( globalObject->vm(), globalObject, @@ -204,17 +104,6 @@ extern "C" void Reader__u32__put(JSC::JSGlobalObject* globalObject, JSC::Encoded } BUN_DECLARE_HOST_FUNCTION(Reader__ptr__slowpathWrapper); -extern "C" JSC_DECLARE_JIT_OPERATION_WITHOUT_WTF_INTERNAL(Reader__ptr__fastpathWrapper, EncodedJSValue, (JSC::JSGlobalObject * lexicalGlobalObject, void* thisValue, int64_t, int32_t)); - -// JSC_DEFINE_JIT_OPERATION(Reader__ptr__fastpathWrapper, EncodedJSValue, (JSC::JSGlobalObject * lexicalGlobalObject, void* thisValue, int64_t arg1, int32_t arg2)) -// { -// auto& vm = JSC::getVM(lexicalGlobalObject); -// IGNORE_WARNINGS_BEGIN("frame-address") -// CallFrame* callFrame = DECLARE_CALL_FRAME(vm); -// IGNORE_WARNINGS_END -// JSC::JITOperationPrologueCallFrameTracer tracer(vm, callFrame); -// return { Reader__ptr__fastpath(lexicalGlobalObject, thisValue, arg1, arg2) }; -// } JSC_DEFINE_HOST_FUNCTION(Reader__ptr__slowpathWrapper, (JSC::JSGlobalObject * globalObject, JSC::CallFrame* frame)) { return Reader__ptr__slowpath(globalObject, JSValue::encode(frame->thisValue()), reinterpret_cast(frame->addressOfArgumentsStart()), frame->argumentCount()); @@ -223,20 +112,6 @@ JSC_DEFINE_HOST_FUNCTION(Reader__ptr__slowpathWrapper, (JSC::JSGlobalObject * gl extern "C" void Reader__ptr__put(JSC::JSGlobalObject* globalObject, JSC::EncodedJSValue value) { JSC::JSObject* thisObject = JSC::jsCast(JSC::JSValue::decode(value)); - // static const JSC::DOMJIT::Signature DOMJIT_ptr_signature( - // Reader__ptr__fastpathWrapper, - // thisObject->classInfo(), - // JSC::DOMJIT::Effect::forReadWrite(JSC::DOMJIT::HeapRange::top(), JSC::DOMJIT::HeapRange::top()), - // JSC::SpecInt52Any, - // JSC::SpecInt52Any, - // JSC::SpecInt32Only); - // JSFunction* function = JSFunction::create( - // globalObject->vm(), - // globalObject, - // 2, - // String("ptr"_s), - // Reader__ptr__slowpathWrapper, ImplementationVisibility::Public, NoIntrinsic, Reader__ptr__slowpathWrapper, - // &DOMJIT_ptr_signature); JSFunction* function = JSFunction::create( globalObject->vm(), globalObject, @@ -250,17 +125,6 @@ extern "C" void Reader__ptr__put(JSC::JSGlobalObject* globalObject, JSC::Encoded } BUN_DECLARE_HOST_FUNCTION(Reader__i8__slowpathWrapper); -extern "C" JSC_DECLARE_JIT_OPERATION_WITHOUT_WTF_INTERNAL(Reader__i8__fastpathWrapper, EncodedJSValue, (JSC::JSGlobalObject * lexicalGlobalObject, void* thisValue, int64_t, int32_t)); - -// JSC_DEFINE_JIT_OPERATION(Reader__i8__fastpathWrapper, EncodedJSValue, (JSC::JSGlobalObject * lexicalGlobalObject, void* thisValue, int64_t arg1, int32_t arg2)) -// { -// auto& vm = JSC::getVM(lexicalGlobalObject); -// IGNORE_WARNINGS_BEGIN("frame-address") -// CallFrame* callFrame = DECLARE_CALL_FRAME(vm); -// IGNORE_WARNINGS_END -// JSC::JITOperationPrologueCallFrameTracer tracer(vm, callFrame); -// return { Reader__i8__fastpath(lexicalGlobalObject, thisValue, arg1, arg2) }; -// } JSC_DEFINE_HOST_FUNCTION(Reader__i8__slowpathWrapper, (JSC::JSGlobalObject * globalObject, JSC::CallFrame* frame)) { return Reader__i8__slowpath(globalObject, JSValue::encode(frame->thisValue()), reinterpret_cast(frame->addressOfArgumentsStart()), frame->argumentCount()); @@ -269,20 +133,6 @@ JSC_DEFINE_HOST_FUNCTION(Reader__i8__slowpathWrapper, (JSC::JSGlobalObject * glo extern "C" void Reader__i8__put(JSC::JSGlobalObject* globalObject, JSC::EncodedJSValue value) { JSC::JSObject* thisObject = JSC::jsCast(JSC::JSValue::decode(value)); - // static const JSC::DOMJIT::Signature DOMJIT_i8_signature( - // Reader__i8__fastpathWrapper, - // thisObject->classInfo(), - // JSC::DOMJIT::Effect::forReadWrite(JSC::DOMJIT::HeapRange::top(), JSC::DOMJIT::HeapRange::top()), - // JSC::SpecInt32Only, - // JSC::SpecInt52Any, - // JSC::SpecInt32Only); - // JSFunction* function = JSFunction::create( - // globalObject->vm(), - // globalObject, - // 2, - // String("i8"_s), - // Reader__i8__slowpathWrapper, ImplementationVisibility::Public, NoIntrinsic, Reader__i8__slowpathWrapper, - // &DOMJIT_i8_signature); JSFunction* function = JSFunction::create( globalObject->vm(), globalObject, @@ -296,17 +146,6 @@ extern "C" void Reader__i8__put(JSC::JSGlobalObject* globalObject, JSC::EncodedJ } BUN_DECLARE_HOST_FUNCTION(Reader__i16__slowpathWrapper); -extern "C" JSC_DECLARE_JIT_OPERATION_WITHOUT_WTF_INTERNAL(Reader__i16__fastpathWrapper, EncodedJSValue, (JSC::JSGlobalObject * lexicalGlobalObject, void* thisValue, int64_t, int32_t)); - -// JSC_DEFINE_JIT_OPERATION(Reader__i16__fastpathWrapper, EncodedJSValue, (JSC::JSGlobalObject * lexicalGlobalObject, void* thisValue, int64_t arg1, int32_t arg2)) -// { -// auto& vm = JSC::getVM(lexicalGlobalObject); -// IGNORE_WARNINGS_BEGIN("frame-address") -// CallFrame* callFrame = DECLARE_CALL_FRAME(vm); -// IGNORE_WARNINGS_END -// JSC::JITOperationPrologueCallFrameTracer tracer(vm, callFrame); -// return { Reader__i16__fastpath(lexicalGlobalObject, thisValue, arg1, arg2) }; -// } JSC_DEFINE_HOST_FUNCTION(Reader__i16__slowpathWrapper, (JSC::JSGlobalObject * globalObject, JSC::CallFrame* frame)) { return Reader__i16__slowpath(globalObject, JSValue::encode(frame->thisValue()), reinterpret_cast(frame->addressOfArgumentsStart()), frame->argumentCount()); @@ -315,20 +154,6 @@ JSC_DEFINE_HOST_FUNCTION(Reader__i16__slowpathWrapper, (JSC::JSGlobalObject * gl extern "C" void Reader__i16__put(JSC::JSGlobalObject* globalObject, JSC::EncodedJSValue value) { JSC::JSObject* thisObject = JSC::jsCast(JSC::JSValue::decode(value)); - // static const JSC::DOMJIT::Signature DOMJIT_i16_signature( - // Reader__i16__fastpathWrapper, - // thisObject->classInfo(), - // JSC::DOMJIT::Effect::forReadWrite(JSC::DOMJIT::HeapRange::top(), JSC::DOMJIT::HeapRange::top()), - // JSC::SpecInt32Only, - // JSC::SpecInt52Any, - // JSC::SpecInt32Only); - // JSFunction* function = JSFunction::create( - // globalObject->vm(), - // globalObject, - // 2, - // String("i16"_s), - // Reader__i16__slowpathWrapper, ImplementationVisibility::Public, NoIntrinsic, Reader__i16__slowpathWrapper, - // &DOMJIT_i16_signature); JSFunction* function = JSFunction::create( globalObject->vm(), globalObject, @@ -342,17 +167,6 @@ extern "C" void Reader__i16__put(JSC::JSGlobalObject* globalObject, JSC::Encoded } BUN_DECLARE_HOST_FUNCTION(Reader__i32__slowpathWrapper); -extern "C" JSC_DECLARE_JIT_OPERATION_WITHOUT_WTF_INTERNAL(Reader__i32__fastpathWrapper, EncodedJSValue, (JSC::JSGlobalObject * lexicalGlobalObject, void* thisValue, int64_t, int32_t)); - -// JSC_DEFINE_JIT_OPERATION(Reader__i32__fastpathWrapper, EncodedJSValue, (JSC::JSGlobalObject * lexicalGlobalObject, void* thisValue, int64_t arg1, int32_t arg2)) -// { -// auto& vm = JSC::getVM(lexicalGlobalObject); -// IGNORE_WARNINGS_BEGIN("frame-address") -// CallFrame* callFrame = DECLARE_CALL_FRAME(vm); -// IGNORE_WARNINGS_END -// JSC::JITOperationPrologueCallFrameTracer tracer(vm, callFrame); -// return { Reader__i32__fastpath(lexicalGlobalObject, thisValue, arg1, arg2) }; -// } JSC_DEFINE_HOST_FUNCTION(Reader__i32__slowpathWrapper, (JSC::JSGlobalObject * globalObject, JSC::CallFrame* frame)) { return Reader__i32__slowpath(globalObject, JSValue::encode(frame->thisValue()), reinterpret_cast(frame->addressOfArgumentsStart()), frame->argumentCount()); @@ -361,20 +175,6 @@ JSC_DEFINE_HOST_FUNCTION(Reader__i32__slowpathWrapper, (JSC::JSGlobalObject * gl extern "C" void Reader__i32__put(JSC::JSGlobalObject* globalObject, JSC::EncodedJSValue value) { JSC::JSObject* thisObject = JSC::jsCast(JSC::JSValue::decode(value)); - // static const JSC::DOMJIT::Signature DOMJIT_i32_signature( - // Reader__i32__fastpathWrapper, - // thisObject->classInfo(), - // JSC::DOMJIT::Effect::forReadWrite(JSC::DOMJIT::HeapRange::top(), JSC::DOMJIT::HeapRange::top()), - // JSC::SpecInt32Only, - // JSC::SpecInt52Any, - // JSC::SpecInt32Only); - // JSFunction* function = JSFunction::create( - // globalObject->vm(), - // globalObject, - // 2, - // String("i32"_s), - // Reader__i32__slowpathWrapper, ImplementationVisibility::Public, NoIntrinsic, Reader__i32__slowpathWrapper, - // &DOMJIT_i32_signature); JSFunction* function = JSFunction::create( globalObject->vm(), globalObject, @@ -388,17 +188,6 @@ extern "C" void Reader__i32__put(JSC::JSGlobalObject* globalObject, JSC::Encoded } BUN_DECLARE_HOST_FUNCTION(Reader__i64__slowpathWrapper); -extern "C" JSC_DECLARE_JIT_OPERATION_WITHOUT_WTF_INTERNAL(Reader__i64__fastpathWrapper, EncodedJSValue, (JSC::JSGlobalObject * lexicalGlobalObject, void* thisValue, int64_t, int32_t)); - -// JSC_DEFINE_JIT_OPERATION(Reader__i64__fastpathWrapper, EncodedJSValue, (JSC::JSGlobalObject * lexicalGlobalObject, void* thisValue, int64_t arg1, int32_t arg2)) -// { -// auto& vm = JSC::getVM(lexicalGlobalObject); -// IGNORE_WARNINGS_BEGIN("frame-address") -// CallFrame* callFrame = DECLARE_CALL_FRAME(vm); -// IGNORE_WARNINGS_END -// JSC::JITOperationPrologueCallFrameTracer tracer(vm, callFrame); -// return { Reader__i64__fastpath(lexicalGlobalObject, thisValue, arg1, arg2) }; -// } JSC_DEFINE_HOST_FUNCTION(Reader__i64__slowpathWrapper, (JSC::JSGlobalObject * globalObject, JSC::CallFrame* frame)) { return Reader__i64__slowpath(globalObject, JSValue::encode(frame->thisValue()), reinterpret_cast(frame->addressOfArgumentsStart()), frame->argumentCount()); @@ -407,20 +196,6 @@ JSC_DEFINE_HOST_FUNCTION(Reader__i64__slowpathWrapper, (JSC::JSGlobalObject * gl extern "C" void Reader__i64__put(JSC::JSGlobalObject* globalObject, JSC::EncodedJSValue value) { JSC::JSObject* thisObject = JSC::jsCast(JSC::JSValue::decode(value)); - // static const JSC::DOMJIT::Signature DOMJIT_i64_signature( - // Reader__i64__fastpathWrapper, - // thisObject->classInfo(), - // JSC::DOMJIT::Effect::forReadWrite(JSC::DOMJIT::HeapRange::top(), JSC::DOMJIT::HeapRange::top()), - // JSC::SpecHeapTop, - // JSC::SpecInt52Any, - // JSC::SpecInt32Only); - // JSFunction* function = JSFunction::create( - // globalObject->vm(), - // globalObject, - // 2, - // String("i64"_s), - // Reader__i64__slowpathWrapper, ImplementationVisibility::Public, NoIntrinsic, Reader__i64__slowpathWrapper, - // &DOMJIT_i64_signature); JSFunction* function = JSFunction::create( globalObject->vm(), globalObject, @@ -434,17 +209,6 @@ extern "C" void Reader__i64__put(JSC::JSGlobalObject* globalObject, JSC::Encoded } BUN_DECLARE_HOST_FUNCTION(Reader__u64__slowpathWrapper); -// extern "C" JSC_DECLARE_JIT_OPERATION_WITHOUT_WTF_INTERNAL(Reader__u64__fastpathWrapper, EncodedJSValue, (JSC::JSGlobalObject * lexicalGlobalObject, void* thisValue, int64_t, int32_t)); - -// JSC_DEFINE_JIT_OPERATION(Reader__u64__fastpathWrapper, EncodedJSValue, (JSC::JSGlobalObject * lexicalGlobalObject, void* thisValue, int64_t arg1, int32_t arg2)) -// { -// auto& vm = JSC::getVM(lexicalGlobalObject); -// IGNORE_WARNINGS_BEGIN("frame-address") -// CallFrame* callFrame = DECLARE_CALL_FRAME(vm); -// IGNORE_WARNINGS_END -// JSC::JITOperationPrologueCallFrameTracer tracer(vm, callFrame); -// return { Reader__u64__fastpath(lexicalGlobalObject, thisValue, arg1, arg2) }; -// } JSC_DEFINE_HOST_FUNCTION(Reader__u64__slowpathWrapper, (JSC::JSGlobalObject * globalObject, JSC::CallFrame* frame)) { return Reader__u64__slowpath(globalObject, JSValue::encode(frame->thisValue()), reinterpret_cast(frame->addressOfArgumentsStart()), frame->argumentCount()); @@ -453,20 +217,6 @@ JSC_DEFINE_HOST_FUNCTION(Reader__u64__slowpathWrapper, (JSC::JSGlobalObject * gl extern "C" void Reader__u64__put(JSC::JSGlobalObject* globalObject, JSC::EncodedJSValue value) { JSC::JSObject* thisObject = JSC::jsCast(JSC::JSValue::decode(value)); - // static const JSC::DOMJIT::Signature DOMJIT_u64_signature( - // Reader__u64__fastpathWrapper, - // thisObject->classInfo(), - // JSC::DOMJIT::Effect::forReadWrite(JSC::DOMJIT::HeapRange::top(), JSC::DOMJIT::HeapRange::top()), - // JSC::SpecHeapTop, - // JSC::SpecInt52Any, - // JSC::SpecInt32Only); - // JSFunction* function = JSFunction::create( - // globalObject->vm(), - // globalObject, - // 2, - // String("u64"_s), - // Reader__u64__slowpathWrapper, ImplementationVisibility::Public, NoIntrinsic, Reader__u64__slowpathWrapper, - // &DOMJIT_u64_signature); JSFunction* function = JSFunction::create( globalObject->vm(), globalObject, @@ -480,17 +230,6 @@ extern "C" void Reader__u64__put(JSC::JSGlobalObject* globalObject, JSC::Encoded } BUN_DECLARE_HOST_FUNCTION(Reader__intptr__slowpathWrapper); -// extern "C" JSC_DECLARE_JIT_OPERATION_WITHOUT_WTF_INTERNAL(Reader__intptr__fastpathWrapper, EncodedJSValue, (JSC::JSGlobalObject * lexicalGlobalObject, void* thisValue, int64_t, int32_t)); - -// JSC_DEFINE_JIT_OPERATION(Reader__intptr__fastpathWrapper, EncodedJSValue, (JSC::JSGlobalObject * lexicalGlobalObject, void* thisValue, int64_t arg1, int32_t arg2)) -// { -// auto& vm = JSC::getVM(lexicalGlobalObject); -// IGNORE_WARNINGS_BEGIN("frame-address") -// CallFrame* callFrame = DECLARE_CALL_FRAME(vm); -// IGNORE_WARNINGS_END -// JSC::JITOperationPrologueCallFrameTracer tracer(vm, callFrame); -// return { Reader__intptr__fastpath(lexicalGlobalObject, thisValue, arg1, arg2) }; -// } JSC_DEFINE_HOST_FUNCTION(Reader__intptr__slowpathWrapper, (JSC::JSGlobalObject * globalObject, JSC::CallFrame* frame)) { return Reader__intptr__slowpath(globalObject, JSValue::encode(frame->thisValue()), reinterpret_cast(frame->addressOfArgumentsStart()), frame->argumentCount()); @@ -499,20 +238,6 @@ JSC_DEFINE_HOST_FUNCTION(Reader__intptr__slowpathWrapper, (JSC::JSGlobalObject * extern "C" void Reader__intptr__put(JSC::JSGlobalObject* globalObject, JSC::EncodedJSValue value) { JSC::JSObject* thisObject = JSC::jsCast(JSC::JSValue::decode(value)); - // static const JSC::DOMJIT::Signature DOMJIT_intptr_signature( - // Reader__intptr__fastpathWrapper, - // thisObject->classInfo(), - // JSC::DOMJIT::Effect::forReadWrite(JSC::DOMJIT::HeapRange::top(), JSC::DOMJIT::HeapRange::top()), - // JSC::SpecInt52Any, - // JSC::SpecInt52Any, - // JSC::SpecInt32Only); - // JSFunction* function = JSFunction::create( - // globalObject->vm(), - // globalObject, - // 2, - // String("intptr"_s), - // Reader__intptr__slowpathWrapper, ImplementationVisibility::Public, NoIntrinsic, Reader__intptr__slowpathWrapper, - // &DOMJIT_intptr_signature); JSFunction* function = JSFunction::create( globalObject->vm(), globalObject, @@ -526,17 +251,6 @@ extern "C" void Reader__intptr__put(JSC::JSGlobalObject* globalObject, JSC::Enco } BUN_DECLARE_HOST_FUNCTION(Reader__f32__slowpathWrapper); -// extern "C" JSC_DECLARE_JIT_OPERATION_WITHOUT_WTF_INTERNAL(Reader__f32__fastpathWrapper, EncodedJSValue, (JSC::JSGlobalObject * lexicalGlobalObject, void* thisValue, int64_t, int32_t)); - -// JSC_DEFINE_JIT_OPERATION(Reader__f32__fastpathWrapper, EncodedJSValue, (JSC::JSGlobalObject * lexicalGlobalObject, void* thisValue, int64_t arg1, int32_t arg2)) -// { -// auto& vm = JSC::getVM(lexicalGlobalObject); -// IGNORE_WARNINGS_BEGIN("frame-address") -// CallFrame* callFrame = DECLARE_CALL_FRAME(vm); -// IGNORE_WARNINGS_END -// JSC::JITOperationPrologueCallFrameTracer tracer(vm, callFrame); -// return { Reader__f32__fastpath(lexicalGlobalObject, thisValue, arg1, arg2) }; -// } JSC_DEFINE_HOST_FUNCTION(Reader__f32__slowpathWrapper, (JSC::JSGlobalObject * globalObject, JSC::CallFrame* frame)) { return Reader__f32__slowpath(globalObject, JSValue::encode(frame->thisValue()), reinterpret_cast(frame->addressOfArgumentsStart()), frame->argumentCount()); @@ -545,20 +259,6 @@ JSC_DEFINE_HOST_FUNCTION(Reader__f32__slowpathWrapper, (JSC::JSGlobalObject * gl extern "C" void Reader__f32__put(JSC::JSGlobalObject* globalObject, JSC::EncodedJSValue value) { JSC::JSObject* thisObject = JSC::jsCast(JSC::JSValue::decode(value)); - // static const JSC::DOMJIT::Signature DOMJIT_f32_signature( - // Reader__f32__fastpathWrapper, - // thisObject->classInfo(), - // JSC::DOMJIT::Effect::forReadWrite(JSC::DOMJIT::HeapRange::top(), JSC::DOMJIT::HeapRange::top()), - // JSC::SpecDoubleReal, - // JSC::SpecInt52Any, - // JSC::SpecInt32Only); - // JSFunction* function = JSFunction::create( - // globalObject->vm(), - // globalObject, - // 2, - // String("f32"_s), - // Reader__f32__slowpathWrapper, ImplementationVisibility::Public, NoIntrinsic, Reader__f32__slowpathWrapper, - // &DOMJIT_f32_signature); JSFunction* function = JSFunction::create( globalObject->vm(), globalObject, @@ -572,17 +272,6 @@ extern "C" void Reader__f32__put(JSC::JSGlobalObject* globalObject, JSC::Encoded } BUN_DECLARE_HOST_FUNCTION(Reader__f64__slowpathWrapper); -// extern "C" JSC_DECLARE_JIT_OPERATION_WITHOUT_WTF_INTERNAL(Reader__f64__fastpathWrapper, EncodedJSValue, (JSC::JSGlobalObject * lexicalGlobalObject, void* thisValue, int64_t, int32_t)); - -// JSC_DEFINE_JIT_OPERATION(Reader__f64__fastpathWrapper, EncodedJSValue, (JSC::JSGlobalObject * lexicalGlobalObject, void* thisValue, int64_t arg1, int32_t arg2)) -// { -// auto& vm = JSC::getVM(lexicalGlobalObject); -// IGNORE_WARNINGS_BEGIN("frame-address") -// CallFrame* callFrame = DECLARE_CALL_FRAME(vm); -// IGNORE_WARNINGS_END -// JSC::JITOperationPrologueCallFrameTracer tracer(vm, callFrame); -// return { Reader__f64__fastpath(lexicalGlobalObject, thisValue, arg1, arg2) }; -// } JSC_DEFINE_HOST_FUNCTION(Reader__f64__slowpathWrapper, (JSC::JSGlobalObject * globalObject, JSC::CallFrame* frame)) { return Reader__f64__slowpath(globalObject, JSValue::encode(frame->thisValue()), reinterpret_cast(frame->addressOfArgumentsStart()), frame->argumentCount()); @@ -591,20 +280,6 @@ JSC_DEFINE_HOST_FUNCTION(Reader__f64__slowpathWrapper, (JSC::JSGlobalObject * gl extern "C" void Reader__f64__put(JSC::JSGlobalObject* globalObject, JSC::EncodedJSValue value) { JSC::JSObject* thisObject = JSC::jsCast(JSC::JSValue::decode(value)); - // static const JSC::DOMJIT::Signature DOMJIT_f64_signature( - // Reader__f64__fastpathWrapper, - // thisObject->classInfo(), - // JSC::DOMJIT::Effect::forReadWrite(JSC::DOMJIT::HeapRange::top(), JSC::DOMJIT::HeapRange::top()), - // JSC::SpecDoubleReal, - // JSC::SpecInt52Any, - // JSC::SpecInt32Only); - // JSFunction* function = JSFunction::create( - // globalObject->vm(), - // globalObject, - // 2, - // String("f64"_s), - // Reader__f64__slowpathWrapper, ImplementationVisibility::Public, NoIntrinsic, Reader__f64__slowpathWrapper, - // &DOMJIT_f64_signature); JSFunction* function = JSFunction::create( globalObject->vm(), globalObject, diff --git a/src/bun.js/bindings/ZigLazyStaticFunctions-inlines.h b/src/bun.js/bindings/ZigLazyStaticFunctions-inlines.h deleted file mode 100644 index 0c13ecd588..0000000000 --- a/src/bun.js/bindings/ZigLazyStaticFunctions-inlines.h +++ /dev/null @@ -1,33 +0,0 @@ -// GENERATED FILE -#pragma once - -namespace Zig { - -/* -- BEGIN DOMCall DEFINITIONS -- */ - -static void DOMCall__FFI__ptr__put(JSC::JSGlobalObject* globalObject, JSC::EncodedJSValue value) -{ - JSC::JSObject* thisObject = JSC::jsCast(JSC::JSValue::decode(value)); - static const JSC::DOMJIT::Signature DOMJIT_ptr_signature( - FFI__ptr__fastpath, - thisObject->classInfo(), - JSC::DOMJIT::Effect::forPure(), - JSC::SpecHeapTop, - JSC::SpecUint8Array); - JSFunction* function = JSFunction::create( - globalObject->vm(), - globalObject, - 1, - String("ptr"_s), - FFI__ptr__slowpath, ImplementationVisibility::Public, NoIntrinsic, FFI__ptr__slowpath, - &DOMJIT_ptr_signature); - thisObject->putDirect( - globalObject->vm(), - Identifier::fromString(globalObject->vm(), "ptr"_s), - function, - 0); -} - -/* -- END DOMCall DEFINITIONS-- */ - -} // namespace Zig diff --git a/src/bun.js/bindings/bindings.cpp b/src/bun.js/bindings/bindings.cpp index fbce5027e1..2b6f215fd6 100644 --- a/src/bun.js/bindings/bindings.cpp +++ b/src/bun.js/bindings/bindings.cpp @@ -3025,7 +3025,7 @@ CPP_DECL void JSC__JSValue__push(JSC::EncodedJSValue JSValue0, JSC::JSGlobalObje } JSC::EncodedJSValue JSC__JSGlobalObject__createAggregateError(JSC::JSGlobalObject* globalObject, - const JSValue* errors, size_t errors_count, + const EncodedJSValue* errors, size_t errors_count, const ZigString* arg3) { auto& vm = JSC::getVM(globalObject); @@ -3042,7 +3042,7 @@ JSC::EncodedJSValue JSC__JSGlobalObject__createAggregateError(JSC::JSGlobalObjec errors_count))) { for (size_t i = 0; i < errors_count; ++i) { - array->initializeIndexWithoutBarrier(initializationScope, i, errors[i]); + array->initializeIndexWithoutBarrier(initializationScope, i, JSValue::decode(errors[i])); } } } diff --git a/src/bun.js/bindings/c-typedefs.h b/src/bun.js/bindings/c-typedefs.h new file mode 100644 index 0000000000..ddb504cbcc --- /dev/null +++ b/src/bun.js/bindings/c-typedefs.h @@ -0,0 +1,54 @@ +#pragma once + +#ifdef __cplusplus +#include "root.h" +#define DECLARE_TYPE_FOR_C_AND_CPP(ns, T) \ + namespace ns { \ + class T; \ + } \ + using ns##__##T = ns::T + +using JSC__EncodedJSValue = JSC::EncodedJSValue; +// We can't handle JSUint8Array with DECLARE_TYPE_FOR_C_AND_CPP because the C++ definition is a +// template instantiation, not a regular class +using JSC__JSUint8Array = JSC::JSUint8Array; +using WTF__OrdinalNumber = WTF::OrdinalNumber; +#define AUTO_EXTERN_C extern "C" +#else +#ifdef _WIN32 +#define SYSV_ABI __attribute__((sysv_abi)) +#else +#define SYSV_ABI +#endif + +#define DECLARE_TYPE_FOR_C_AND_CPP(ns, T) typedef struct ns##__##T ns##__##T +typedef int64_t JSC__EncodedJSValue; +typedef struct JSC__JSUint8Array JSC__JSUint8Array; +typedef int WTF__OrdinalNumber; +#define AUTO_EXTERN_C +#endif + +DECLARE_TYPE_FOR_C_AND_CPP(JSC, JSGlobalObject); +DECLARE_TYPE_FOR_C_AND_CPP(JSC, Exception); +DECLARE_TYPE_FOR_C_AND_CPP(JSC, JSObject); +DECLARE_TYPE_FOR_C_AND_CPP(JSC, JSInternalPromise); +DECLARE_TYPE_FOR_C_AND_CPP(JSC, JSString); +DECLARE_TYPE_FOR_C_AND_CPP(JSC, JSCell); +DECLARE_TYPE_FOR_C_AND_CPP(JSC, JSMap); +DECLARE_TYPE_FOR_C_AND_CPP(JSC, JSPromise); +DECLARE_TYPE_FOR_C_AND_CPP(JSC, CatchScope); +DECLARE_TYPE_FOR_C_AND_CPP(JSC, VM); +DECLARE_TYPE_FOR_C_AND_CPP(JSC, ThrowScope); +DECLARE_TYPE_FOR_C_AND_CPP(JSC, CallFrame); +DECLARE_TYPE_FOR_C_AND_CPP(JSC, GetterSetter); +DECLARE_TYPE_FOR_C_AND_CPP(JSC, CustomGetterSetter); +DECLARE_TYPE_FOR_C_AND_CPP(JSC, SourceProvider); +DECLARE_TYPE_FOR_C_AND_CPP(JSC, Structure); + +DECLARE_TYPE_FOR_C_AND_CPP(WebCore, FetchHeaders); +DECLARE_TYPE_FOR_C_AND_CPP(WebCore, DOMFormData); +DECLARE_TYPE_FOR_C_AND_CPP(WebCore, AbortSignal); +DECLARE_TYPE_FOR_C_AND_CPP(WebCore, DOMURL); + +DECLARE_TYPE_FOR_C_AND_CPP(WTF, StringImpl); +DECLARE_TYPE_FOR_C_AND_CPP(WTF, String); diff --git a/src/bun.js/bindings/headers-handwritten.h b/src/bun.js/bindings/headers-handwritten.h index d4b56c87fc..7184697061 100644 --- a/src/bun.js/bindings/headers-handwritten.h +++ b/src/bun.js/bindings/headers-handwritten.h @@ -1,9 +1,14 @@ #pragma once + +#ifdef __cplusplus #include "wtf/Compiler.h" #include "wtf/text/OrdinalNumber.h" #include "JavaScriptCore/JSCJSValue.h" #include "JavaScriptCore/ArgList.h" #include +#endif + +#include "c-typedefs.h" #ifndef HEADERS_HANDWRITTEN #define HEADERS_HANDWRITTEN @@ -12,10 +17,6 @@ typedef struct VirtualMachine VirtualMachine; // exists to make headers.h happy typedef struct CppWebSocket CppWebSocket; -namespace WTF { -class String; -} - typedef struct ZigString { const unsigned char* ptr; size_t len; @@ -23,22 +24,7 @@ typedef struct ZigString { #ifndef __cplusplus typedef uint8_t BunStringTag; -typedef union BunStringImpl { - ZigString zig; - void* wtf; -} BunStringImpl; - #else -namespace WTF { -class StringImpl; -class String; -} - -typedef union BunStringImpl { - ZigString zig; - WTF::StringImpl* wtf; -} BunStringImpl; - enum class BunStringTag : uint8_t { Dead = 0, WTFStringImpl = 1, @@ -48,10 +34,16 @@ enum class BunStringTag : uint8_t { }; #endif +typedef union BunStringImpl { + ZigString zig; + WTF__StringImpl* wtf; +} BunStringImpl; + typedef struct BunString { BunStringTag tag; BunStringImpl impl; +#ifdef __cplusplus enum ZeroCopyTag { ZeroCopy }; enum NonNullTag { NonNull }; @@ -80,7 +72,7 @@ typedef struct BunString { WTF::String toWTFString() const; bool isEmpty() const; - +#endif } BunString; typedef struct ZigErrorType { @@ -108,9 +100,9 @@ typedef struct ResolvedSource { BunString source_code; BunString source_url; bool isCommonJSModule; - JSC::EncodedJSValue cjsCustomExtension; + JSC__EncodedJSValue cjsCustomExtension; void* allocator; - JSC::EncodedJSValue jsvalue_for_export; + JSC__EncodedJSValue jsvalue_for_export; uint32_t tag; bool needsDeref; bool already_bundled; @@ -156,7 +148,7 @@ const ZigStackFrameCode ZigStackFrameCodeGlobal = 4; const ZigStackFrameCode ZigStackFrameCodeWasm = 5; const ZigStackFrameCode ZigStackFrameCodeConstructor = 6; -extern "C" void __attribute((__noreturn__)) Bun__panic(const char* message, size_t length); +AUTO_EXTERN_C void __attribute((__noreturn__)) Bun__panic(const char* message, size_t length); #define BUN_PANIC(message) Bun__panic(message, sizeof(message) - 1) typedef struct ZigStackFramePosition { @@ -164,6 +156,7 @@ typedef struct ZigStackFramePosition { int32_t column_zero_based; int32_t byte_position; +#ifdef __cplusplus ALWAYS_INLINE WTF::OrdinalNumber column() { return OrdinalNumber::fromZeroBasedInt(this->column_zero_based); @@ -172,6 +165,7 @@ typedef struct ZigStackFramePosition { { return OrdinalNumber::fromZeroBasedInt(this->line_zero_based); } +#endif } ZigStackFramePosition; typedef struct ZigStackFrame { @@ -184,12 +178,12 @@ typedef struct ZigStackFrame { typedef struct ZigStackTrace { BunString* source_lines_ptr; - OrdinalNumber* source_lines_numbers; + WTF__OrdinalNumber* source_lines_numbers; uint8_t source_lines_len; uint8_t source_lines_to_collect; ZigStackFrame* frames_ptr; uint8_t frames_len; - JSC::SourceProvider* referenced_source_provider; + JSC__SourceProvider* referenced_source_provider; } ZigStackTrace; typedef struct ZigException { @@ -283,16 +277,15 @@ typedef void WebSocketClientTLS; #ifndef __cplusplus typedef struct Bun__ArrayBuffer Bun__ArrayBuffer; -typedef struct JSC::JSUint8Array JSC::JSUint8Array; #endif #ifdef __cplusplus -extern "C" void Bun__WTFStringImpl__deref(WTF::StringImpl* impl); -extern "C" void Bun__WTFStringImpl__ref(WTF::StringImpl* impl); -extern "C" bool BunString__fromJS(JSC::JSGlobalObject*, JSC::EncodedJSValue, BunString*); -extern "C" JSC::EncodedJSValue BunString__toJS(JSC::JSGlobalObject*, const BunString*); -extern "C" void BunString__toWTFString(BunString*); +AUTO_EXTERN_C void Bun__WTFStringImpl__deref(WTF::StringImpl* impl); +AUTO_EXTERN_C void Bun__WTFStringImpl__ref(WTF::StringImpl* impl); +AUTO_EXTERN_C bool BunString__fromJS(JSC::JSGlobalObject*, JSC::EncodedJSValue, BunString*); +AUTO_EXTERN_C JSC::EncodedJSValue BunString__toJS(JSC::JSGlobalObject*, const BunString*); +AUTO_EXTERN_C void BunString__toWTFString(BunString*); namespace Bun { JSC::JSString* toJS(JSC::JSGlobalObject*, BunString); @@ -324,13 +317,13 @@ typedef struct { #include "SyntheticModuleType.h" -extern "C" const char* Bun__userAgent; +AUTO_EXTERN_C const char* Bun__userAgent; -extern "C" ZigErrorCode Zig_ErrorCodeParserError; +AUTO_EXTERN_C ZigErrorCode Zig_ErrorCodeParserError; -extern "C" void ZigString__free(const unsigned char* ptr, size_t len, void* allocator); +AUTO_EXTERN_C void ZigString__free(const unsigned char* ptr, size_t len, void* allocator); -extern "C" bool Bun__transpileVirtualModule( +AUTO_EXTERN_C bool Bun__transpileVirtualModule( JSC::JSGlobalObject* global, const BunString* specifier, const BunString* referrer, @@ -338,11 +331,11 @@ extern "C" bool Bun__transpileVirtualModule( BunLoaderType loader, ErrorableResolvedSource* result); -extern "C" JSC::EncodedJSValue Bun__runVirtualModule( +AUTO_EXTERN_C JSC::EncodedJSValue Bun__runVirtualModule( JSC::JSGlobalObject* global, const BunString* specifier); -extern "C" JSC::JSInternalPromise* Bun__transpileFile( +AUTO_EXTERN_C JSC::JSInternalPromise* Bun__transpileFile( void* bunVM, JSC::JSGlobalObject* global, BunString* specifier, @@ -353,54 +346,54 @@ extern "C" JSC::JSInternalPromise* Bun__transpileFile( bool isCommonJSRequire, BunLoaderType forceLoaderType); -extern "C" bool Bun__fetchBuiltinModule( +AUTO_EXTERN_C bool Bun__fetchBuiltinModule( void* bunVM, JSC::JSGlobalObject* global, const BunString* specifier, const BunString* referrer, ErrorableResolvedSource* result); -extern "C" bool Bun__resolveAndFetchBuiltinModule( +AUTO_EXTERN_C bool Bun__resolveAndFetchBuiltinModule( void* bunVM, const BunString* specifier, ErrorableResolvedSource* result); // Used in process.version -extern "C" const char* Bun__version; -extern "C" const char* Bun__version_with_sha; +AUTO_EXTERN_C const char* Bun__version; +AUTO_EXTERN_C const char* Bun__version_with_sha; // Used in process.versions -extern "C" const char* Bun__versions_boringssl; -extern "C" const char* Bun__versions_libarchive; -extern "C" const char* Bun__versions_mimalloc; -extern "C" const char* Bun__versions_picohttpparser; -extern "C" const char* Bun__versions_uws; -extern "C" const char* Bun__versions_webkit; -extern "C" const char* Bun__versions_libdeflate; -extern "C" const char* Bun__versions_zig; -extern "C" const char* Bun__versions_zlib; -extern "C" const char* Bun__versions_tinycc; -extern "C" const char* Bun__versions_lolhtml; -extern "C" const char* Bun__versions_c_ares; -extern "C" const char* Bun__versions_lshpack; -extern "C" const char* Bun__versions_zstd; -extern "C" const char* Bun__versions_usockets; +AUTO_EXTERN_C const char* Bun__versions_boringssl; +AUTO_EXTERN_C const char* Bun__versions_libarchive; +AUTO_EXTERN_C const char* Bun__versions_mimalloc; +AUTO_EXTERN_C const char* Bun__versions_picohttpparser; +AUTO_EXTERN_C const char* Bun__versions_uws; +AUTO_EXTERN_C const char* Bun__versions_webkit; +AUTO_EXTERN_C const char* Bun__versions_libdeflate; +AUTO_EXTERN_C const char* Bun__versions_zig; +AUTO_EXTERN_C const char* Bun__versions_zlib; +AUTO_EXTERN_C const char* Bun__versions_tinycc; +AUTO_EXTERN_C const char* Bun__versions_lolhtml; +AUTO_EXTERN_C const char* Bun__versions_c_ares; +AUTO_EXTERN_C const char* Bun__versions_lshpack; +AUTO_EXTERN_C const char* Bun__versions_zstd; +AUTO_EXTERN_C const char* Bun__versions_usockets; -extern "C" const char* Bun__version_sha; +AUTO_EXTERN_C const char* Bun__version_sha; -extern "C" void ZigString__freeGlobal(const unsigned char* ptr, size_t len); +AUTO_EXTERN_C void ZigString__freeGlobal(const unsigned char* ptr, size_t len); -extern "C" size_t Bun__encoding__writeLatin1(const unsigned char* ptr, size_t len, unsigned char* to, size_t other_len, Encoding encoding); -extern "C" size_t Bun__encoding__writeUTF16(const UChar* ptr, size_t len, unsigned char* to, size_t other_len, Encoding encoding); +AUTO_EXTERN_C size_t Bun__encoding__writeLatin1(const unsigned char* ptr, size_t len, unsigned char* to, size_t other_len, Encoding encoding); +AUTO_EXTERN_C size_t Bun__encoding__writeUTF16(const UChar* ptr, size_t len, unsigned char* to, size_t other_len, Encoding encoding); -extern "C" size_t Bun__encoding__byteLengthLatin1AsUTF8(const unsigned char* ptr, size_t len); -extern "C" size_t Bun__encoding__byteLengthUTF16AsUTF8(const UChar* ptr, size_t len); +AUTO_EXTERN_C size_t Bun__encoding__byteLengthLatin1AsUTF8(const unsigned char* ptr, size_t len); +AUTO_EXTERN_C size_t Bun__encoding__byteLengthUTF16AsUTF8(const UChar* ptr, size_t len); -extern "C" int64_t Bun__encoding__constructFromLatin1(void*, const unsigned char* ptr, size_t len, Encoding encoding); -extern "C" int64_t Bun__encoding__constructFromUTF16(void*, const UChar* ptr, size_t len, Encoding encoding); +AUTO_EXTERN_C int64_t Bun__encoding__constructFromLatin1(void*, const unsigned char* ptr, size_t len, Encoding encoding); +AUTO_EXTERN_C int64_t Bun__encoding__constructFromUTF16(void*, const UChar* ptr, size_t len, Encoding encoding); -extern "C" void Bun__EventLoop__runCallback1(JSC::JSGlobalObject* global, JSC::EncodedJSValue callback, JSC::EncodedJSValue thisValue, JSC::EncodedJSValue arg1); -extern "C" void Bun__EventLoop__runCallback2(JSC::JSGlobalObject* global, JSC::EncodedJSValue callback, JSC::EncodedJSValue thisValue, JSC::EncodedJSValue arg1, JSC::EncodedJSValue arg2); -extern "C" void Bun__EventLoop__runCallback3(JSC::JSGlobalObject* global, JSC::EncodedJSValue callback, JSC::EncodedJSValue thisValue, JSC::EncodedJSValue arg1, JSC::EncodedJSValue arg2, JSC::EncodedJSValue arg3); +AUTO_EXTERN_C void Bun__EventLoop__runCallback1(JSC::JSGlobalObject* global, JSC::EncodedJSValue callback, JSC::EncodedJSValue thisValue, JSC::EncodedJSValue arg1); +AUTO_EXTERN_C void Bun__EventLoop__runCallback2(JSC::JSGlobalObject* global, JSC::EncodedJSValue callback, JSC::EncodedJSValue thisValue, JSC::EncodedJSValue arg1, JSC::EncodedJSValue arg2); +AUTO_EXTERN_C void Bun__EventLoop__runCallback3(JSC::JSGlobalObject* global, JSC::EncodedJSValue callback, JSC::EncodedJSValue thisValue, JSC::EncodedJSValue arg1, JSC::EncodedJSValue arg2, JSC::EncodedJSValue arg3); /// @note throws a JS exception and returns false if a stack overflow occurs template @@ -450,7 +443,7 @@ bool Bun__deepMatch( bool replacePropsWithAsymmetricMatchers, bool isMatchingObjectContaining); -extern "C" void Bun__remapStackFramePositions(void*, ZigStackFrame*, size_t); +AUTO_EXTERN_C void Bun__remapStackFramePositions(void*, ZigStackFrame*, size_t); namespace Inspector { class ScriptArguments; diff --git a/src/bun.js/bindings/headers.h b/src/bun.js/bindings/headers.h index 093e7b0f70..8a2b0269fd 100644 --- a/src/bun.js/bindings/headers.h +++ b/src/bun.js/bindings/headers.h @@ -6,485 +6,385 @@ #include #include -#define AUTO_EXTERN_C extern "C" -#ifdef WIN32 - #define AUTO_EXTERN_C_ZIG extern "C" -#else - #define AUTO_EXTERN_C_ZIG extern "C" __attribute__((weak)) -#endif - -#define ZIG_DECL AUTO_EXTERN_C_ZIG +#define ZIG_DECL AUTO_EXTERN_C #define CPP_DECL AUTO_EXTERN_C -#define CPP_SIZE AUTO_EXTERN_C -#include "root.h" -#include +#include "c-typedefs.h" #include "headers-handwritten.h" -namespace JSC { -class JSGlobalObject; -class Exception; -class JSObject; -class JSInternalPromise; -class JSString; -class JSCell; -class JSMap; -class JSPromise; -class CatchScope; -class VM; -class ThrowScope; -class CallFrame; -} -namespace WebCore { -class FetchHeaders; -class DOMFormData; -class AbortSignal; -class DOMURL; -} - #pragma mark - JSC::JSObject -CPP_DECL JSC::EncodedJSValue JSC__JSObject__create(JSC::JSGlobalObject* arg0, size_t arg1, void* arg2, void(* ArgFn3)(void* arg0, JSC::JSObject* arg1, JSC::JSGlobalObject* arg2)); -CPP_DECL size_t JSC__JSObject__getArrayLength(JSC::JSObject* arg0); -CPP_DECL JSC::EncodedJSValue JSC__JSObject__getDirect(JSC::JSObject* arg0, JSC::JSGlobalObject* arg1, const ZigString* arg2); -CPP_DECL JSC::EncodedJSValue JSC__JSObject__getIndex(JSC::EncodedJSValue JSValue0, JSC::JSGlobalObject* arg1, uint32_t arg2); -CPP_DECL void JSC__JSObject__putRecord(JSC::JSObject* arg0, JSC::JSGlobalObject* arg1, ZigString* arg2, ZigString* arg3, size_t arg4); -CPP_DECL JSC::EncodedJSValue ZigString__external(const ZigString* arg0, JSC::JSGlobalObject* arg1, void* arg2, void(* ArgFn3)(void* arg0, void* arg1, size_t arg2)); -CPP_DECL JSC::EncodedJSValue ZigString__to16BitValue(const ZigString* arg0, JSC::JSGlobalObject* arg1); -CPP_DECL JSC::EncodedJSValue ZigString__toAtomicValue(const ZigString* arg0, JSC::JSGlobalObject* arg1); -CPP_DECL JSC::EncodedJSValue ZigString__toErrorInstance(const ZigString* arg0, JSC::JSGlobalObject* arg1); -CPP_DECL JSC::EncodedJSValue ZigString__toExternalU16(const uint16_t* arg0, size_t arg1, JSC::JSGlobalObject* arg2); -CPP_DECL JSC::EncodedJSValue ZigString__toExternalValue(const ZigString* arg0, JSC::JSGlobalObject* arg1); -CPP_DECL JSC::EncodedJSValue ZigString__toExternalValueWithCallback(const ZigString* arg0, JSC::JSGlobalObject* arg1, void(* ArgFn2)(void* arg0, void* arg1, size_t arg2)); -CPP_DECL JSC::EncodedJSValue ZigString__toRangeErrorInstance(const ZigString* arg0, JSC::JSGlobalObject* arg1); -CPP_DECL JSC::EncodedJSValue ZigString__toSyntaxErrorInstance(const ZigString* arg0, JSC::JSGlobalObject* arg1); -CPP_DECL JSC::EncodedJSValue ZigString__toTypeErrorInstance(const ZigString* arg0, JSC::JSGlobalObject* arg1); -CPP_DECL JSC::EncodedJSValue ZigString__toValueGC(const ZigString* arg0, JSC::JSGlobalObject* arg1); -CPP_DECL WebCore::DOMURL* WebCore__DOMURL__cast_(JSC::EncodedJSValue JSValue0, JSC::VM* arg1); -CPP_DECL BunString WebCore__DOMURL__fileSystemPath(WebCore::DOMURL* arg0, int* errorCode); -CPP_DECL void WebCore__DOMURL__href_(WebCore::DOMURL* arg0, ZigString* arg1); -CPP_DECL void WebCore__DOMURL__pathname_(WebCore::DOMURL* arg0, ZigString* arg1); +CPP_DECL JSC__EncodedJSValue JSC__JSObject__create(JSC__JSGlobalObject* arg0, size_t arg1, void* arg2, void(* ArgFn3)(void* arg0, JSC__JSObject* arg1, JSC__JSGlobalObject* arg2)); +CPP_DECL size_t JSC__JSObject__getArrayLength(JSC__JSObject* arg0); +CPP_DECL JSC__EncodedJSValue JSC__JSObject__getDirect(JSC__JSObject* arg0, JSC__JSGlobalObject* arg1, const ZigString* arg2); +CPP_DECL JSC__EncodedJSValue JSC__JSObject__getIndex(JSC__EncodedJSValue JSValue0, JSC__JSGlobalObject* arg1, uint32_t arg2); +CPP_DECL JSC__EncodedJSValue Bun__JSObject__getCodePropertyVMInquiry(JSC__JSGlobalObject* global, JSC__JSObject* object); +CPP_DECL void JSC__JSObject__putRecord(JSC__JSObject* arg0, JSC__JSGlobalObject* arg1, ZigString* arg2, ZigString* arg3, size_t arg4); +CPP_DECL JSC__EncodedJSValue ZigString__external(const ZigString* arg0, JSC__JSGlobalObject* arg1, void* arg2, void(* ArgFn3)(void* arg0, void* arg1, size_t arg2)); +CPP_DECL JSC__EncodedJSValue ZigString__to16BitValue(const ZigString* arg0, JSC__JSGlobalObject* arg1); +CPP_DECL JSC__EncodedJSValue ZigString__toAtomicValue(const ZigString* arg0, JSC__JSGlobalObject* arg1); +CPP_DECL JSC__EncodedJSValue ZigString__toErrorInstance(const ZigString* arg0, JSC__JSGlobalObject* arg1); +CPP_DECL JSC__EncodedJSValue ZigString__toExternalU16(const uint16_t* arg0, size_t arg1, JSC__JSGlobalObject* arg2); +CPP_DECL JSC__EncodedJSValue ZigString__toExternalValue(const ZigString* arg0, JSC__JSGlobalObject* arg1); +CPP_DECL JSC__EncodedJSValue ZigString__toExternalValueWithCallback(const ZigString* arg0, JSC__JSGlobalObject* arg1, void(* ArgFn2)(void* arg0, void* arg1, size_t arg2)); +CPP_DECL JSC__EncodedJSValue ZigString__toRangeErrorInstance(const ZigString* arg0, JSC__JSGlobalObject* arg1); +CPP_DECL JSC__EncodedJSValue ZigString__toSyntaxErrorInstance(const ZigString* arg0, JSC__JSGlobalObject* arg1); +CPP_DECL JSC__EncodedJSValue ZigString__toTypeErrorInstance(const ZigString* arg0, JSC__JSGlobalObject* arg1); +CPP_DECL JSC__EncodedJSValue ZigString__toValueGC(const ZigString* arg0, JSC__JSGlobalObject* arg1); +CPP_DECL WebCore__DOMURL* WebCore__DOMURL__cast_(JSC__EncodedJSValue JSValue0, JSC__VM* arg1); +CPP_DECL BunString WebCore__DOMURL__fileSystemPath(WebCore__DOMURL* arg0, int* errorCode); +CPP_DECL void WebCore__DOMURL__href_(WebCore__DOMURL* arg0, ZigString* arg1); +CPP_DECL void WebCore__DOMURL__pathname_(WebCore__DOMURL* arg0, ZigString* arg1); #pragma mark - WebCore::DOMFormData -CPP_DECL void WebCore__DOMFormData__append(WebCore::DOMFormData* arg0, ZigString* arg1, ZigString* arg2); -CPP_DECL void WebCore__DOMFormData__appendBlob(WebCore::DOMFormData* arg0, JSC::JSGlobalObject* arg1, ZigString* arg2, void* arg3, ZigString* arg4); -CPP_DECL size_t WebCore__DOMFormData__count(WebCore::DOMFormData* arg0); -CPP_DECL JSC::EncodedJSValue WebCore__DOMFormData__create(JSC::JSGlobalObject* arg0); -CPP_DECL JSC::EncodedJSValue WebCore__DOMFormData__createFromURLQuery(JSC::JSGlobalObject* arg0, ZigString* arg1); -CPP_DECL WebCore::DOMFormData* _fromJS(JSC::EncodedJSValue JSValue0); +CPP_DECL void WebCore__DOMFormData__append(WebCore__DOMFormData* arg0, ZigString* arg1, ZigString* arg2); +CPP_DECL void WebCore__DOMFormData__appendBlob(WebCore__DOMFormData* arg0, JSC__JSGlobalObject* arg1, ZigString* arg2, void* arg3, ZigString* arg4); +CPP_DECL size_t WebCore__DOMFormData__count(WebCore__DOMFormData* arg0); +CPP_DECL JSC__EncodedJSValue WebCore__DOMFormData__create(JSC__JSGlobalObject* arg0); +CPP_DECL JSC__EncodedJSValue WebCore__DOMFormData__createFromURLQuery(JSC__JSGlobalObject* arg0, ZigString* arg1); +CPP_DECL WebCore__DOMFormData* _fromJS(JSC__EncodedJSValue JSValue0); #pragma mark - WebCore::FetchHeaders -CPP_DECL void WebCore__FetchHeaders__append(WebCore::FetchHeaders* arg0, const ZigString* arg1, const ZigString* arg2, JSC::JSGlobalObject* arg3); -CPP_DECL WebCore::FetchHeaders* WebCore__FetchHeaders__cast_(JSC::EncodedJSValue JSValue0, JSC::VM* arg1); -CPP_DECL JSC::EncodedJSValue WebCore__FetchHeaders__clone(WebCore::FetchHeaders* arg0, JSC::JSGlobalObject* arg1); -CPP_DECL WebCore::FetchHeaders* WebCore__FetchHeaders__cloneThis(WebCore::FetchHeaders* arg0, JSC::JSGlobalObject* arg1); -CPP_DECL void WebCore__FetchHeaders__copyTo(WebCore::FetchHeaders* arg0, StringPointer* arg1, StringPointer* arg2, unsigned char* arg3); -CPP_DECL void WebCore__FetchHeaders__count(WebCore::FetchHeaders* arg0, uint32_t* arg1, uint32_t* arg2); -CPP_DECL WebCore::FetchHeaders* WebCore__FetchHeaders__createEmpty(); -CPP_DECL WebCore::FetchHeaders* WebCore__FetchHeaders__createFromJS(JSC::JSGlobalObject* arg0, JSC::EncodedJSValue JSValue1); -CPP_DECL WebCore::FetchHeaders* WebCore__FetchHeaders__createFromPicoHeaders_(const void* arg0); -CPP_DECL WebCore::FetchHeaders* WebCore__FetchHeaders__createFromUWS(void* arg1); -CPP_DECL JSC::EncodedJSValue WebCore__FetchHeaders__createValue(JSC::JSGlobalObject* arg0, StringPointer* arg1, StringPointer* arg2, const ZigString* arg3, uint32_t arg4); -CPP_DECL void WebCore__FetchHeaders__deref(WebCore::FetchHeaders* arg0); -CPP_DECL void WebCore__FetchHeaders__fastGet_(WebCore::FetchHeaders* arg0, unsigned char arg1, ZigString* arg2); -CPP_DECL bool WebCore__FetchHeaders__fastHas_(WebCore::FetchHeaders* arg0, unsigned char arg1); -CPP_DECL void WebCore__FetchHeaders__fastRemove_(WebCore::FetchHeaders* arg0, unsigned char arg1); -CPP_DECL void WebCore__FetchHeaders__get_(WebCore::FetchHeaders* arg0, const ZigString* arg1, ZigString* arg2, JSC::JSGlobalObject* arg3); -CPP_DECL bool WebCore__FetchHeaders__has(WebCore::FetchHeaders* arg0, const ZigString* arg1, JSC::JSGlobalObject* arg2); -CPP_DECL bool WebCore__FetchHeaders__isEmpty(WebCore::FetchHeaders* arg0); -CPP_DECL void WebCore__FetchHeaders__remove(WebCore::FetchHeaders* arg0, const ZigString* arg1, JSC::JSGlobalObject* arg2); -CPP_DECL JSC::EncodedJSValue WebCore__FetchHeaders__toJS(WebCore::FetchHeaders* arg0, JSC::JSGlobalObject* arg1); -CPP_DECL void WebCore__FetchHeaders__toUWSResponse(WebCore::FetchHeaders* arg0, bool arg1, void* arg2); -CPP_DECL JSC::EncodedJSValue SystemError__toErrorInstance(const SystemError* arg0, JSC::JSGlobalObject* arg1); +CPP_DECL void WebCore__FetchHeaders__append(WebCore__FetchHeaders* arg0, const ZigString* arg1, const ZigString* arg2, JSC__JSGlobalObject* arg3); +CPP_DECL WebCore__FetchHeaders* WebCore__FetchHeaders__cast_(JSC__EncodedJSValue JSValue0, JSC__VM* arg1); +CPP_DECL JSC__EncodedJSValue WebCore__FetchHeaders__clone(WebCore__FetchHeaders* arg0, JSC__JSGlobalObject* arg1); +CPP_DECL WebCore__FetchHeaders* WebCore__FetchHeaders__cloneThis(WebCore__FetchHeaders* arg0, JSC__JSGlobalObject* arg1); +CPP_DECL void WebCore__FetchHeaders__copyTo(WebCore__FetchHeaders* arg0, StringPointer* arg1, StringPointer* arg2, unsigned char* arg3); +CPP_DECL void WebCore__FetchHeaders__count(WebCore__FetchHeaders* arg0, uint32_t* arg1, uint32_t* arg2); +CPP_DECL WebCore__FetchHeaders* WebCore__FetchHeaders__createEmpty(); +CPP_DECL WebCore__FetchHeaders* WebCore__FetchHeaders__createFromJS(JSC__JSGlobalObject* arg0, JSC__EncodedJSValue JSValue1); +CPP_DECL WebCore__FetchHeaders* WebCore__FetchHeaders__createFromPicoHeaders_(const void* arg0); +CPP_DECL WebCore__FetchHeaders* WebCore__FetchHeaders__createFromUWS(void* arg1); +CPP_DECL JSC__EncodedJSValue WebCore__FetchHeaders__createValue(JSC__JSGlobalObject* arg0, StringPointer* arg1, StringPointer* arg2, const ZigString* arg3, uint32_t arg4); +CPP_DECL void WebCore__FetchHeaders__deref(WebCore__FetchHeaders* arg0); +CPP_DECL void WebCore__FetchHeaders__fastGet_(WebCore__FetchHeaders* arg0, unsigned char arg1, ZigString* arg2); +CPP_DECL bool WebCore__FetchHeaders__fastHas_(WebCore__FetchHeaders* arg0, unsigned char arg1); +CPP_DECL void WebCore__FetchHeaders__fastRemove_(WebCore__FetchHeaders* arg0, unsigned char arg1); +CPP_DECL void WebCore__FetchHeaders__get_(WebCore__FetchHeaders* arg0, const ZigString* arg1, ZigString* arg2, JSC__JSGlobalObject* arg3); +CPP_DECL bool WebCore__FetchHeaders__has(WebCore__FetchHeaders* arg0, const ZigString* arg1, JSC__JSGlobalObject* arg2); +CPP_DECL bool WebCore__FetchHeaders__isEmpty(WebCore__FetchHeaders* arg0); +CPP_DECL void WebCore__FetchHeaders__remove(WebCore__FetchHeaders* arg0, const ZigString* arg1, JSC__JSGlobalObject* arg2); +CPP_DECL JSC__EncodedJSValue WebCore__FetchHeaders__toJS(WebCore__FetchHeaders* arg0, JSC__JSGlobalObject* arg1); +CPP_DECL void WebCore__FetchHeaders__toUWSResponse(WebCore__FetchHeaders* arg0, bool arg1, void* arg2); +CPP_DECL JSC__EncodedJSValue SystemError__toErrorInstance(const SystemError* arg0, JSC__JSGlobalObject* arg1); #pragma mark - JSC::JSCell -CPP_DECL JSC::JSObject* JSC__JSCell__getObject(JSC::JSCell* arg0); -CPP_DECL unsigned char JSC__JSCell__getType(JSC::JSCell* arg0); -CPP_DECL JSC::JSObject* JSC__JSCell__toObject(JSC::JSCell* cell, JSC::JSGlobalObject* globalObject); +CPP_DECL JSC__JSObject* JSC__JSCell__getObject(JSC__JSCell* arg0); +CPP_DECL unsigned char JSC__JSCell__getType(JSC__JSCell* arg0); +CPP_DECL JSC__JSObject* JSC__JSCell__toObject(JSC__JSCell* cell, JSC__JSGlobalObject* globalObject); #pragma mark - JSC::JSString -CPP_DECL bool JSC__JSString__eql(const JSC::JSString* arg0, JSC::JSGlobalObject* arg1, JSC::JSString* arg2); -CPP_DECL bool JSC__JSString__is8Bit(const JSC::JSString* arg0); -CPP_DECL void JSC__JSString__iterator(JSC::JSString* arg0, JSC::JSGlobalObject* arg1, void* arg2); -CPP_DECL size_t JSC__JSString__length(const JSC::JSString* arg0); -CPP_DECL JSC::JSObject* JSC__JSString__toObject(JSC::JSString* arg0, JSC::JSGlobalObject* arg1); -CPP_DECL void JSC__JSString__toZigString(JSC::JSString* arg0, JSC::JSGlobalObject* arg1, ZigString* arg2); +CPP_DECL bool JSC__JSString__eql(const JSC__JSString* arg0, JSC__JSGlobalObject* arg1, JSC__JSString* arg2); +CPP_DECL bool JSC__JSString__is8Bit(const JSC__JSString* arg0); +CPP_DECL void JSC__JSString__iterator(JSC__JSString* arg0, JSC__JSGlobalObject* arg1, void* arg2); +CPP_DECL size_t JSC__JSString__length(const JSC__JSString* arg0); +CPP_DECL JSC__JSObject* JSC__JSString__toObject(JSC__JSString* arg0, JSC__JSGlobalObject* arg1); +CPP_DECL void JSC__JSString__toZigString(JSC__JSString* arg0, JSC__JSGlobalObject* arg1, ZigString* arg2); #pragma mark - JSC::JSModuleLoader -CPP_DECL JSC::EncodedJSValue JSC__JSModuleLoader__evaluate(JSC::JSGlobalObject* arg0, const unsigned char* arg1, size_t arg2, const unsigned char* arg3, size_t arg4, const unsigned char* arg5, size_t arg6, JSC::EncodedJSValue JSValue7, JSC::EncodedJSValue* arg8); -CPP_DECL JSC::JSInternalPromise* JSC__JSModuleLoader__loadAndEvaluateModule(JSC::JSGlobalObject* arg0, const BunString* arg1); +CPP_DECL JSC__EncodedJSValue JSC__JSModuleLoader__evaluate(JSC__JSGlobalObject* arg0, const unsigned char* arg1, size_t arg2, const unsigned char* arg3, size_t arg4, const unsigned char* arg5, size_t arg6, JSC__EncodedJSValue JSValue7, JSC__EncodedJSValue* arg8); +CPP_DECL JSC__JSInternalPromise* JSC__JSModuleLoader__loadAndEvaluateModule(JSC__JSGlobalObject* arg0, const BunString* arg1); #pragma mark - WebCore::AbortSignal -CPP_DECL bool WebCore__AbortSignal__aborted(WebCore::AbortSignal* arg0); -CPP_DECL JSC::EncodedJSValue WebCore__AbortSignal__abortReason(WebCore::AbortSignal* arg0); -CPP_DECL WebCore::AbortSignal* WebCore__AbortSignal__addListener(WebCore::AbortSignal* arg0, void* arg1, void(* ArgFn2)(void* arg0, JSC::EncodedJSValue JSValue1)); -CPP_DECL void WebCore__AbortSignal__cleanNativeBindings(WebCore::AbortSignal* arg0, void* arg1); -CPP_DECL JSC::EncodedJSValue WebCore__AbortSignal__create(JSC::JSGlobalObject* arg0); -CPP_DECL WebCore::AbortSignal* WebCore__AbortSignal__fromJS(JSC::EncodedJSValue JSValue0); -CPP_DECL WebCore::AbortSignal* WebCore__AbortSignal__ref(WebCore::AbortSignal* arg0); -CPP_DECL WebCore::AbortSignal* WebCore__AbortSignal__signal(WebCore::AbortSignal* arg0, JSC::JSGlobalObject*, uint8_t abortReason); -CPP_DECL JSC::EncodedJSValue WebCore__AbortSignal__toJS(WebCore::AbortSignal* arg0, JSC::JSGlobalObject* arg1); -CPP_DECL void WebCore__AbortSignal__unref(WebCore::AbortSignal* arg0); +CPP_DECL bool WebCore__AbortSignal__aborted(WebCore__AbortSignal* arg0); +CPP_DECL JSC__EncodedJSValue WebCore__AbortSignal__abortReason(WebCore__AbortSignal* arg0); +CPP_DECL WebCore__AbortSignal* WebCore__AbortSignal__addListener(WebCore__AbortSignal* arg0, void* arg1, void(* ArgFn2)(void* arg0, JSC__EncodedJSValue JSValue1)); +CPP_DECL void WebCore__AbortSignal__cleanNativeBindings(WebCore__AbortSignal* arg0, void* arg1); +CPP_DECL JSC__EncodedJSValue WebCore__AbortSignal__create(JSC__JSGlobalObject* arg0); +CPP_DECL WebCore__AbortSignal* WebCore__AbortSignal__fromJS(JSC__EncodedJSValue JSValue0); +CPP_DECL WebCore__AbortSignal* WebCore__AbortSignal__ref(WebCore__AbortSignal* arg0); +CPP_DECL WebCore__AbortSignal* WebCore__AbortSignal__signal(WebCore__AbortSignal* arg0, JSC__JSGlobalObject*, uint8_t abortReason); +CPP_DECL JSC__EncodedJSValue WebCore__AbortSignal__toJS(WebCore__AbortSignal* arg0, JSC__JSGlobalObject* arg1); +CPP_DECL void WebCore__AbortSignal__unref(WebCore__AbortSignal* arg0); #pragma mark - JSC::JSPromise -CPP_DECL JSC::EncodedJSValue JSC__JSPromise__asValue(JSC::JSPromise* arg0, JSC::JSGlobalObject* arg1); -CPP_DECL JSC::JSPromise* JSC__JSPromise__create(JSC::JSGlobalObject* arg0); -CPP_DECL bool JSC__JSPromise__isHandled(const JSC::JSPromise* arg0, JSC::VM* arg1); -CPP_DECL void JSC__JSPromise__reject(JSC::JSPromise* arg0, JSC::JSGlobalObject* arg1, JSC::EncodedJSValue JSValue2); -CPP_DECL void JSC__JSPromise__rejectAsHandled(JSC::JSPromise* arg0, JSC::JSGlobalObject* arg1, JSC::EncodedJSValue JSValue2); -CPP_DECL JSC::JSPromise* JSC__JSPromise__rejectedPromise(JSC::JSGlobalObject* arg0, JSC::EncodedJSValue JSValue1); -CPP_DECL JSC::EncodedJSValue JSC__JSPromise__rejectedPromiseValue(JSC::JSGlobalObject* arg0, JSC::EncodedJSValue JSValue1); -CPP_DECL void JSC__JSPromise__rejectOnNextTickWithHandled(JSC::JSPromise* arg0, JSC::JSGlobalObject* arg1, JSC::EncodedJSValue JSValue2, bool arg3); -CPP_DECL void JSC__JSPromise__resolve(JSC::JSPromise* arg0, JSC::JSGlobalObject* arg1, JSC::EncodedJSValue JSValue2); -CPP_DECL JSC::JSPromise* JSC__JSPromise__resolvedPromise(JSC::JSGlobalObject* arg0, JSC::EncodedJSValue JSValue1); -CPP_DECL JSC::EncodedJSValue JSC__JSPromise__resolvedPromiseValue(JSC::JSGlobalObject* arg0, JSC::EncodedJSValue JSValue1); -CPP_DECL JSC::EncodedJSValue JSC__JSPromise__result(JSC::JSPromise* arg0, JSC::VM* arg1); -CPP_DECL void JSC__JSPromise__setHandled(JSC::JSPromise* arg0, JSC::VM* arg1); -CPP_DECL uint32_t JSC__JSPromise__status(const JSC::JSPromise* arg0, JSC::VM* arg1); +CPP_DECL JSC__EncodedJSValue JSC__JSPromise__asValue(JSC__JSPromise* arg0, JSC__JSGlobalObject* arg1); +CPP_DECL JSC__JSPromise* JSC__JSPromise__create(JSC__JSGlobalObject* arg0); +CPP_DECL bool JSC__JSPromise__isHandled(const JSC__JSPromise* arg0, JSC__VM* arg1); +CPP_DECL void JSC__JSPromise__reject(JSC__JSPromise* arg0, JSC__JSGlobalObject* arg1, JSC__EncodedJSValue JSValue2); +CPP_DECL void JSC__JSPromise__rejectAsHandled(JSC__JSPromise* arg0, JSC__JSGlobalObject* arg1, JSC__EncodedJSValue JSValue2); +CPP_DECL JSC__JSPromise* JSC__JSPromise__rejectedPromise(JSC__JSGlobalObject* arg0, JSC__EncodedJSValue JSValue1); +CPP_DECL JSC__EncodedJSValue JSC__JSPromise__rejectedPromiseValue(JSC__JSGlobalObject* arg0, JSC__EncodedJSValue JSValue1); +CPP_DECL void JSC__JSPromise__rejectOnNextTickWithHandled(JSC__JSPromise* arg0, JSC__JSGlobalObject* arg1, JSC__EncodedJSValue JSValue2, bool arg3); +CPP_DECL void JSC__JSPromise__resolve(JSC__JSPromise* arg0, JSC__JSGlobalObject* arg1, JSC__EncodedJSValue JSValue2); +CPP_DECL JSC__JSPromise* JSC__JSPromise__resolvedPromise(JSC__JSGlobalObject* arg0, JSC__EncodedJSValue JSValue1); +CPP_DECL JSC__EncodedJSValue JSC__JSPromise__resolvedPromiseValue(JSC__JSGlobalObject* arg0, JSC__EncodedJSValue JSValue1); +CPP_DECL JSC__EncodedJSValue JSC__JSPromise__result(JSC__JSPromise* arg0, JSC__VM* arg1); +CPP_DECL void JSC__JSPromise__setHandled(JSC__JSPromise* arg0, JSC__VM* arg1); +CPP_DECL uint32_t JSC__JSPromise__status(const JSC__JSPromise* arg0, JSC__VM* arg1); #pragma mark - JSC::JSInternalPromise -CPP_DECL JSC::JSInternalPromise* JSC__JSInternalPromise__create(JSC::JSGlobalObject* arg0); -CPP_DECL bool JSC__JSInternalPromise__isHandled(const JSC::JSInternalPromise* arg0, JSC::VM* arg1); -CPP_DECL void JSC__JSInternalPromise__reject(JSC::JSInternalPromise* arg0, JSC::JSGlobalObject* arg1, JSC::EncodedJSValue JSValue2); -CPP_DECL void JSC__JSInternalPromise__rejectAsHandled(JSC::JSInternalPromise* arg0, JSC::JSGlobalObject* arg1, JSC::EncodedJSValue JSValue2); -CPP_DECL void JSC__JSInternalPromise__rejectAsHandledException(JSC::JSInternalPromise* arg0, JSC::JSGlobalObject* arg1, JSC::Exception* arg2); -CPP_DECL JSC::JSInternalPromise* JSC__JSInternalPromise__rejectedPromise(JSC::JSGlobalObject* arg0, JSC::EncodedJSValue JSValue1); -CPP_DECL void JSC__JSInternalPromise__resolve(JSC::JSInternalPromise* arg0, JSC::JSGlobalObject* arg1, JSC::EncodedJSValue JSValue2); -CPP_DECL JSC::JSInternalPromise* JSC__JSInternalPromise__resolvedPromise(JSC::JSGlobalObject* arg0, JSC::EncodedJSValue JSValue1); -CPP_DECL JSC::EncodedJSValue JSC__JSInternalPromise__result(const JSC::JSInternalPromise* arg0, JSC::VM* arg1); -CPP_DECL void JSC__JSInternalPromise__setHandled(JSC::JSInternalPromise* arg0, JSC::VM* arg1); -CPP_DECL uint32_t JSC__JSInternalPromise__status(const JSC::JSInternalPromise* arg0, JSC::VM* arg1); +CPP_DECL JSC__JSInternalPromise* JSC__JSInternalPromise__create(JSC__JSGlobalObject* arg0); +CPP_DECL bool JSC__JSInternalPromise__isHandled(const JSC__JSInternalPromise* arg0, JSC__VM* arg1); +CPP_DECL void JSC__JSInternalPromise__reject(JSC__JSInternalPromise* arg0, JSC__JSGlobalObject* arg1, JSC__EncodedJSValue JSValue2); +CPP_DECL void JSC__JSInternalPromise__rejectAsHandled(JSC__JSInternalPromise* arg0, JSC__JSGlobalObject* arg1, JSC__EncodedJSValue JSValue2); +CPP_DECL void JSC__JSInternalPromise__rejectAsHandledException(JSC__JSInternalPromise* arg0, JSC__JSGlobalObject* arg1, JSC__Exception* arg2); +CPP_DECL JSC__JSInternalPromise* JSC__JSInternalPromise__rejectedPromise(JSC__JSGlobalObject* arg0, JSC__EncodedJSValue JSValue1); +CPP_DECL void JSC__JSInternalPromise__resolve(JSC__JSInternalPromise* arg0, JSC__JSGlobalObject* arg1, JSC__EncodedJSValue JSValue2); +CPP_DECL JSC__JSInternalPromise* JSC__JSInternalPromise__resolvedPromise(JSC__JSGlobalObject* arg0, JSC__EncodedJSValue JSValue1); +CPP_DECL JSC__EncodedJSValue JSC__JSInternalPromise__result(const JSC__JSInternalPromise* arg0, JSC__VM* arg1); +CPP_DECL void JSC__JSInternalPromise__setHandled(JSC__JSInternalPromise* arg0, JSC__VM* arg1); +CPP_DECL uint32_t JSC__JSInternalPromise__status(const JSC__JSInternalPromise* arg0, JSC__VM* arg1); #pragma mark - JSC::JSFunction -CPP_DECL void JSC__JSFunction__optimizeSoon(JSC::EncodedJSValue JSValue0); +CPP_DECL void JSC__JSFunction__optimizeSoon(JSC__EncodedJSValue JSValue0); #pragma mark - JSC::JSGlobalObject -CPP_DECL VirtualMachine* JSC__JSGlobalObject__bunVM(JSC::JSGlobalObject* arg0); -CPP_DECL JSC::EncodedJSValue JSC__JSGlobalObject__createAggregateError(JSC::JSGlobalObject* arg0, const JSC::JSValue* arg1, size_t arg2, const ZigString* arg3); -CPP_DECL void JSC__JSGlobalObject__createSyntheticModule_(JSC::JSGlobalObject* arg0, ZigString* arg1, size_t arg2, JSC::EncodedJSValue* arg3, size_t arg4); -CPP_DECL void JSC__JSGlobalObject__deleteModuleRegistryEntry(JSC::JSGlobalObject* arg0, ZigString* arg1); -CPP_DECL JSC::EncodedJSValue JSC__JSGlobalObject__generateHeapSnapshot(JSC::JSGlobalObject* arg0); -CPP_DECL JSC::EncodedJSValue JSC__JSGlobalObject__getCachedObject(JSC::JSGlobalObject* arg0, const ZigString* arg1); -CPP_DECL void JSC__JSGlobalObject__handleRejectedPromises(JSC::JSGlobalObject* arg0); -CPP_DECL JSC::EncodedJSValue JSC__JSGlobalObject__putCachedObject(JSC::JSGlobalObject* arg0, const ZigString* arg1, JSC::EncodedJSValue JSValue2); -CPP_DECL void JSC__JSGlobalObject__addGc(JSC::JSGlobalObject* globalObject); -CPP_DECL void JSC__JSGlobalObject__queueMicrotaskJob(JSC::JSGlobalObject* arg0, JSC::EncodedJSValue JSValue1, JSC::EncodedJSValue JSValue2, JSC::EncodedJSValue JSValue3); -CPP_DECL void JSC__JSGlobalObject__reload(JSC::JSGlobalObject* arg0); -CPP_DECL JSC::VM* JSC__JSGlobalObject__vm(JSC::JSGlobalObject* arg0); +CPP_DECL VirtualMachine* JSC__JSGlobalObject__bunVM(JSC__JSGlobalObject* arg0); +CPP_DECL JSC__EncodedJSValue JSC__JSGlobalObject__createAggregateError(JSC__JSGlobalObject* arg0, const JSC__EncodedJSValue* arg1, size_t arg2, const ZigString* arg3); +CPP_DECL void JSC__JSGlobalObject__createSyntheticModule_(JSC__JSGlobalObject* arg0, ZigString* arg1, size_t arg2, JSC__EncodedJSValue* arg3, size_t arg4); +CPP_DECL void JSC__JSGlobalObject__deleteModuleRegistryEntry(JSC__JSGlobalObject* arg0, ZigString* arg1); +CPP_DECL JSC__EncodedJSValue JSC__JSGlobalObject__generateHeapSnapshot(JSC__JSGlobalObject* arg0); +CPP_DECL JSC__EncodedJSValue JSC__JSGlobalObject__getCachedObject(JSC__JSGlobalObject* arg0, const ZigString* arg1); +CPP_DECL void JSC__JSGlobalObject__handleRejectedPromises(JSC__JSGlobalObject* arg0); +CPP_DECL JSC__EncodedJSValue JSC__JSGlobalObject__putCachedObject(JSC__JSGlobalObject* arg0, const ZigString* arg1, JSC__EncodedJSValue JSValue2); +CPP_DECL void JSC__JSGlobalObject__addGc(JSC__JSGlobalObject* globalObject); +CPP_DECL void JSC__JSGlobalObject__queueMicrotaskJob(JSC__JSGlobalObject* arg0, JSC__EncodedJSValue JSValue1, JSC__EncodedJSValue JSValue2, JSC__EncodedJSValue JSValue3); +CPP_DECL void JSC__JSGlobalObject__reload(JSC__JSGlobalObject* arg0); +CPP_DECL JSC__VM* JSC__JSGlobalObject__vm(JSC__JSGlobalObject* arg0); #pragma mark - JSC::JSMap -CPP_DECL JSC::EncodedJSValue JSC__JSMap__create(JSC::JSGlobalObject* arg0); -CPP_DECL JSC::EncodedJSValue JSC__JSMap__get_(JSC::JSMap* arg0, JSC::JSGlobalObject* arg1, JSC::EncodedJSValue JSValue2); -CPP_DECL bool JSC__JSMap__has(JSC::JSMap* arg0, JSC::JSGlobalObject* arg1, JSC::EncodedJSValue JSValue2); -CPP_DECL bool JSC__JSMap__remove(JSC::JSMap* arg0, JSC::JSGlobalObject* arg1, JSC::EncodedJSValue JSValue2); -CPP_DECL void JSC__JSMap__set(JSC::JSMap* arg0, JSC::JSGlobalObject* arg1, JSC::EncodedJSValue JSValue2, JSC::EncodedJSValue JSValue3); +CPP_DECL JSC__EncodedJSValue JSC__JSMap__create(JSC__JSGlobalObject* arg0); +CPP_DECL JSC__EncodedJSValue JSC__JSMap__get_(JSC__JSMap* arg0, JSC__JSGlobalObject* arg1, JSC__EncodedJSValue JSValue2); +CPP_DECL bool JSC__JSMap__has(JSC__JSMap* arg0, JSC__JSGlobalObject* arg1, JSC__EncodedJSValue JSValue2); +CPP_DECL bool JSC__JSMap__remove(JSC__JSMap* arg0, JSC__JSGlobalObject* arg1, JSC__EncodedJSValue JSValue2); +CPP_DECL void JSC__JSMap__set(JSC__JSMap* arg0, JSC__JSGlobalObject* arg1, JSC__EncodedJSValue JSValue2, JSC__EncodedJSValue JSValue3); #pragma mark - JSC::JSValue -CPP_DECL void JSC__JSValue__then(JSC::EncodedJSValue JSValue0, JSC::JSGlobalObject* arg1, JSC::EncodedJSValue JSValue2, SYSV_ABI JSC::EncodedJSValue(* ArgFn3)(JSC::JSGlobalObject* arg0, JSC::CallFrame* arg1), SYSV_ABI JSC::EncodedJSValue(* ArgFn4)(JSC::JSGlobalObject* arg0, JSC::CallFrame* arg1)); -CPP_DECL bool JSC__JSValue__asArrayBuffer_(JSC::EncodedJSValue JSValue0, JSC::JSGlobalObject* arg1, Bun__ArrayBuffer* arg2); -CPP_DECL unsigned char JSC__JSValue__asBigIntCompare(JSC::EncodedJSValue JSValue0, JSC::JSGlobalObject* arg1, JSC::EncodedJSValue JSValue2); -CPP_DECL JSC::JSCell* JSC__JSValue__asCell(JSC::EncodedJSValue JSValue0); -CPP_DECL JSC::JSInternalPromise* JSC__JSValue__asInternalPromise(JSC::EncodedJSValue JSValue0); -CPP_DECL double JSC__JSValue__asNumber(JSC::EncodedJSValue JSValue0); -CPP_DECL JSC::JSPromise* JSC__JSValue__asPromise(JSC::EncodedJSValue JSValue0); -CPP_DECL JSC::JSString* JSC__JSValue__asString(JSC::EncodedJSValue JSValue0); -CPP_DECL double JSC__JSValue__coerceToDouble(JSC::EncodedJSValue JSValue0, JSC::JSGlobalObject* arg1); -CPP_DECL int32_t JSC__JSValue__coerceToInt32(JSC::EncodedJSValue JSValue0, JSC::JSGlobalObject* arg1); -CPP_DECL int64_t JSC__JSValue__coerceToInt64(JSC::EncodedJSValue JSValue0, JSC::JSGlobalObject* arg1); -CPP_DECL JSC::EncodedJSValue JSC__JSValue__createEmptyArray(JSC::JSGlobalObject* arg0, size_t arg1); -CPP_DECL JSC::EncodedJSValue JSC__JSValue__createEmptyObject(JSC::JSGlobalObject* arg0, size_t arg1); -CPP_DECL JSC::EncodedJSValue JSC__JSValue__createInternalPromise(JSC::JSGlobalObject* arg0); -CPP_DECL JSC::EncodedJSValue JSC__JSValue__createObject2(JSC::JSGlobalObject* arg0, const ZigString* arg1, const ZigString* arg2, JSC::EncodedJSValue JSValue3, JSC::EncodedJSValue JSValue4); -CPP_DECL JSC::EncodedJSValue JSC__JSValue__createRangeError(const ZigString* arg0, const ZigString* arg1, JSC::JSGlobalObject* arg2); -CPP_DECL JSC::EncodedJSValue JSC__JSValue__createRopeString(JSC::EncodedJSValue JSValue0, JSC::EncodedJSValue JSValue1, JSC::JSGlobalObject* arg2); -CPP_DECL JSC::EncodedJSValue JSC__JSValue__createStringArray(JSC::JSGlobalObject* arg0, const ZigString* arg1, size_t arg2, bool arg3); -CPP_DECL JSC::EncodedJSValue JSC__JSValue__createTypeError(const ZigString* arg0, const ZigString* arg1, JSC::JSGlobalObject* arg2); -CPP_DECL JSC::EncodedJSValue JSC__JSValue__createUninitializedUint8Array(JSC::JSGlobalObject* arg0, size_t arg1); -CPP_DECL bool JSC__JSValue__deepEquals(JSC::EncodedJSValue JSValue0, JSC::EncodedJSValue JSValue1, JSC::JSGlobalObject* arg2); -CPP_DECL bool JSC__JSValue__deepMatch(JSC::EncodedJSValue JSValue0, JSC::EncodedJSValue JSValue1, JSC::JSGlobalObject* arg2, bool arg3); -CPP_DECL bool JSC__JSValue__eqlCell(JSC::EncodedJSValue JSValue0, JSC::JSCell* arg1); -CPP_DECL bool JSC__JSValue__eqlValue(JSC::EncodedJSValue JSValue0, JSC::EncodedJSValue JSValue1); -CPP_DECL JSC::EncodedJSValue JSC__JSValue__fastGet(JSC::EncodedJSValue JSValue0, JSC::JSGlobalObject* arg1, unsigned char arg2); -CPP_DECL JSC::EncodedJSValue JSC__JSValue__fastGetDirect_(JSC::EncodedJSValue JSValue0, JSC::JSGlobalObject* arg1, unsigned char arg2); -CPP_DECL void JSC__JSValue__forEach(JSC::EncodedJSValue JSValue0, JSC::JSGlobalObject* arg1, void* arg2, void(* ArgFn3)(JSC::VM* arg0, JSC::JSGlobalObject* arg1, void* arg2, JSC::EncodedJSValue JSValue3)); -CPP_DECL void JSC__JSValue__forEachProperty(JSC::EncodedJSValue JSValue0, JSC::JSGlobalObject* arg1, void* arg2, void(* ArgFn3)(JSC::JSGlobalObject* arg0, void* arg1, ZigString* arg2, JSC::EncodedJSValue JSValue3, bool arg4, bool arg5)); -CPP_DECL void JSC__JSValue__forEachPropertyOrdered(JSC::EncodedJSValue JSValue0, JSC::JSGlobalObject* arg1, void* arg2, void(* ArgFn3)(JSC::JSGlobalObject* arg0, void* arg1, ZigString* arg2, JSC::EncodedJSValue JSValue3, bool arg4, bool arg5)); -CPP_DECL JSC::EncodedJSValue JSC__JSValue__fromEntries(JSC::JSGlobalObject* arg0, ZigString* arg1, ZigString* arg2, size_t arg3, bool arg4); -CPP_DECL JSC::EncodedJSValue JSC__JSValue__fromInt64NoTruncate(JSC::JSGlobalObject* arg0, int64_t arg1); -CPP_DECL JSC::EncodedJSValue JSC__JSValue__fromUInt64NoTruncate(JSC::JSGlobalObject* arg0, uint64_t arg1); -CPP_DECL JSC::EncodedJSValue JSC__JSValue__fromTimevalNoTruncate(JSC::JSGlobalObject* arg0, int64_t nsec, int64_t sec); -CPP_DECL JSC::EncodedJSValue JSC__JSValue__bigIntSum(JSC::JSGlobalObject* arg0, JSC::EncodedJSValue JSValue0, JSC::EncodedJSValue JSValue1); -CPP_DECL void JSC__JSValue__getClassName(JSC::EncodedJSValue JSValue0, JSC::JSGlobalObject* arg1, ZigString* arg2); -CPP_DECL JSC::EncodedJSValue JSC__JSValue__getErrorsProperty(JSC::EncodedJSValue JSValue0, JSC::JSGlobalObject* arg1); -CPP_DECL JSC::EncodedJSValue JSC__JSValue__getIfPropertyExistsFromPath(JSC::EncodedJSValue JSValue0, JSC::JSGlobalObject* arg1, JSC::EncodedJSValue JSValue2); -CPP_DECL JSC::EncodedJSValue JSC__JSValue__getIfPropertyExistsImpl(JSC::EncodedJSValue JSValue0, JSC::JSGlobalObject* arg1, const unsigned char* arg2, uint32_t arg3); -CPP_DECL double JSC__JSValue__getLengthIfPropertyExistsInternal(JSC::EncodedJSValue JSValue0, JSC::JSGlobalObject* arg1); -CPP_DECL void JSC__JSValue__getNameProperty(JSC::EncodedJSValue JSValue0, JSC::JSGlobalObject* arg1, ZigString* arg2); -CPP_DECL JSC::EncodedJSValue JSC__JSValue__getPrototype(JSC::EncodedJSValue JSValue0, JSC::JSGlobalObject* arg1); -CPP_DECL void JSC__JSValue__getSymbolDescription(JSC::EncodedJSValue JSValue0, JSC::JSGlobalObject* arg1, ZigString* arg2); -CPP_DECL double JSC__JSValue__getUnixTimestamp(JSC::EncodedJSValue JSValue0); -CPP_DECL bool JSC__JSValue__hasOwnProperty(JSC::EncodedJSValue JSValue0, JSC::JSGlobalObject* arg1, ZigString arg2); -CPP_DECL bool JSC__JSValue__isAggregateError(JSC::EncodedJSValue JSValue0, JSC::JSGlobalObject* arg1); -CPP_DECL bool JSC__JSValue__isAnyError(JSC::EncodedJSValue JSValue0); -CPP_DECL bool JSC__JSValue__isAnyInt(JSC::EncodedJSValue JSValue0); -CPP_DECL bool JSC__JSValue__isBigInt(JSC::EncodedJSValue JSValue0); -CPP_DECL bool JSC__JSValue__isBigInt32(JSC::EncodedJSValue JSValue0); -CPP_DECL bool JSC__JSValue__isCallable(JSC::EncodedJSValue JSValue0); -CPP_DECL bool JSC__JSValue__isClass(JSC::EncodedJSValue JSValue0, JSC::JSGlobalObject* arg1); -CPP_DECL bool JSC__JSValue__isConstructor(JSC::EncodedJSValue JSValue0); -CPP_DECL bool JSC__JSValue__isCustomGetterSetter(JSC::EncodedJSValue JSValue0); -CPP_DECL bool JSC__JSValue__isError(JSC::EncodedJSValue JSValue0); -CPP_DECL bool JSC__JSValue__isException(JSC::EncodedJSValue JSValue0, JSC::VM* arg1); -CPP_DECL bool JSC__JSValue__isGetterSetter(JSC::EncodedJSValue JSValue0); -CPP_DECL bool JSC__JSValue__isHeapBigInt(JSC::EncodedJSValue JSValue0); -CPP_DECL bool JSC__JSValue__isInstanceOf(JSC::EncodedJSValue JSValue0, JSC::JSGlobalObject* arg1, JSC::EncodedJSValue JSValue2); -CPP_DECL bool JSC__JSValue__isInt32(JSC::EncodedJSValue JSValue0); -CPP_DECL bool JSC__JSValue__isInt32AsAnyInt(JSC::EncodedJSValue JSValue0); -CPP_DECL bool JSC__JSValue__isIterable(JSC::EncodedJSValue JSValue0, JSC::JSGlobalObject* arg1); -CPP_DECL bool JSC__JSValue__isNumber(JSC::EncodedJSValue JSValue0); -CPP_DECL bool JSC__JSValue__isObject(JSC::EncodedJSValue JSValue0); -CPP_DECL bool JSC__JSValue__isPrimitive(JSC::EncodedJSValue JSValue0); -CPP_DECL bool JSC__JSValue__isSameValue(JSC::EncodedJSValue JSValue0, JSC::EncodedJSValue JSValue1, JSC::JSGlobalObject* arg2); -CPP_DECL bool JSC__JSValue__isSymbol(JSC::EncodedJSValue JSValue0); -CPP_DECL bool JSC__JSValue__isTerminationException(JSC::EncodedJSValue JSValue0, JSC::VM* arg1); -CPP_DECL bool JSC__JSValue__isUInt32AsAnyInt(JSC::EncodedJSValue JSValue0); -CPP_DECL bool JSC__JSValue__jestDeepEquals(JSC::EncodedJSValue JSValue0, JSC::EncodedJSValue JSValue1, JSC::JSGlobalObject* arg2); -CPP_DECL bool JSC__JSValue__jestDeepMatch(JSC::EncodedJSValue JSValue0, JSC::EncodedJSValue JSValue1, JSC::JSGlobalObject* arg2, bool arg3); -CPP_DECL bool JSC__JSValue__jestStrictDeepEquals(JSC::EncodedJSValue JSValue0, JSC::EncodedJSValue JSValue1, JSC::JSGlobalObject* arg2); -CPP_DECL JSC::EncodedJSValue JSC__JSValue__jsBoolean(bool arg0); -CPP_DECL JSC::EncodedJSValue JSC__JSValue__jsDoubleNumber(double arg0); -CPP_DECL JSC::EncodedJSValue JSC__JSValue__jsNull(); -CPP_DECL JSC::EncodedJSValue JSC__JSValue__jsNumberFromChar(unsigned char arg0); -CPP_DECL JSC::EncodedJSValue JSC__JSValue__jsNumberFromDouble(double arg0); -CPP_DECL JSC::EncodedJSValue JSC__JSValue__jsNumberFromInt64(int64_t arg0); -CPP_DECL JSC::EncodedJSValue JSC__JSValue__jsNumberFromU16(uint16_t arg0); -CPP_DECL void JSC__JSValue__jsonStringify(JSC::EncodedJSValue JSValue0, JSC::JSGlobalObject* arg1, uint32_t arg2, BunString* arg3); -CPP_DECL JSC::EncodedJSValue JSC__JSValue__jsTDZValue(); -CPP_DECL unsigned char JSC__JSValue__jsType(JSC::EncodedJSValue JSValue0); -CPP_DECL JSC::EncodedJSValue JSC__JSValue__jsUndefined(); -CPP_DECL JSC::EncodedJSValue JSC__JSValue__keys(JSC::JSGlobalObject* arg0, JSC::EncodedJSValue arg1); -CPP_DECL JSC::EncodedJSValue JSC__JSValue__values(JSC::JSGlobalObject* arg0, JSC::EncodedJSValue arg1); -CPP_DECL JSC::EncodedJSValue JSC__JSValue__parseJSON(JSC::EncodedJSValue JSValue0, JSC::JSGlobalObject* arg1); -CPP_DECL void JSC__JSValue__push(JSC::EncodedJSValue JSValue0, JSC::JSGlobalObject* arg1, JSC::EncodedJSValue JSValue2); -CPP_DECL void JSC__JSValue__put(JSC::EncodedJSValue JSValue0, JSC::JSGlobalObject* arg1, const ZigString* arg2, JSC::EncodedJSValue JSValue3); -CPP_DECL void JSC__JSValue__putIndex(JSC::EncodedJSValue JSValue0, JSC::JSGlobalObject* arg1, uint32_t arg2, JSC::EncodedJSValue JSValue3); -CPP_DECL void JSC__JSValue__putRecord(JSC::EncodedJSValue JSValue0, JSC::JSGlobalObject* arg1, ZigString* arg2, ZigString* arg3, size_t arg4); -CPP_DECL bool JSC__JSValue__strictDeepEquals(JSC::EncodedJSValue JSValue0, JSC::EncodedJSValue JSValue1, JSC::JSGlobalObject* arg2); -CPP_DECL bool JSC__JSValue__stringIncludes(JSC::EncodedJSValue JSValue0, JSC::JSGlobalObject* arg1, JSC::EncodedJSValue JSValue2); -CPP_DECL JSC::EncodedJSValue JSC__JSValue__symbolFor(JSC::JSGlobalObject* arg0, ZigString* arg1); -CPP_DECL bool JSC__JSValue__symbolKeyFor(JSC::EncodedJSValue JSValue0, JSC::JSGlobalObject* arg1, ZigString* arg2); -CPP_DECL bool JSC__JSValue__toBoolean(JSC::EncodedJSValue JSValue0); -CPP_DECL JSC::EncodedJSValue JSC__JSValue__toError_(JSC::EncodedJSValue JSValue0); -CPP_DECL int32_t JSC__JSValue__toInt32(JSC::EncodedJSValue JSValue0); -CPP_DECL int64_t JSC__JSValue__toInt64(JSC::EncodedJSValue JSValue0); -CPP_DECL bool JSC__JSValue__toMatch(JSC::EncodedJSValue JSValue0, JSC::JSGlobalObject* arg1, JSC::EncodedJSValue JSValue2); -CPP_DECL JSC::JSObject* JSC__JSValue__toObject(JSC::EncodedJSValue JSValue0, JSC::JSGlobalObject* arg1); -CPP_DECL JSC::JSString* JSC__JSValue__toString(JSC::EncodedJSValue JSValue0, JSC::JSGlobalObject* arg1); -CPP_DECL JSC::JSString* JSC__JSValue__toStringOrNull(JSC::EncodedJSValue JSValue0, JSC::JSGlobalObject* arg1); -CPP_DECL uint64_t JSC__JSValue__toUInt64NoTruncate(JSC::EncodedJSValue JSValue0); -CPP_DECL void JSC__JSValue__toZigException(JSC::EncodedJSValue JSValue0, JSC::JSGlobalObject* arg1, ZigException* arg2); -CPP_DECL void JSC__JSValue__toZigString(JSC::EncodedJSValue JSValue0, ZigString* arg1, JSC::JSGlobalObject* arg2); +CPP_DECL void JSC__JSValue__then(JSC__EncodedJSValue JSValue0, JSC__JSGlobalObject* arg1, JSC__EncodedJSValue JSValue2, SYSV_ABI JSC__EncodedJSValue(* ArgFn3)(JSC__JSGlobalObject* arg0, JSC__CallFrame* arg1), SYSV_ABI JSC__EncodedJSValue(* ArgFn4)(JSC__JSGlobalObject* arg0, JSC__CallFrame* arg1)); +CPP_DECL bool JSC__JSValue__asArrayBuffer_(JSC__EncodedJSValue JSValue0, JSC__JSGlobalObject* arg1, Bun__ArrayBuffer* arg2); +CPP_DECL unsigned char JSC__JSValue__asBigIntCompare(JSC__EncodedJSValue JSValue0, JSC__JSGlobalObject* arg1, JSC__EncodedJSValue JSValue2); +CPP_DECL JSC__JSCell* JSC__JSValue__asCell(JSC__EncodedJSValue JSValue0); +CPP_DECL JSC__JSInternalPromise* JSC__JSValue__asInternalPromise(JSC__EncodedJSValue JSValue0); +CPP_DECL double JSC__JSValue__asNumber(JSC__EncodedJSValue JSValue0); +CPP_DECL JSC__JSPromise* JSC__JSValue__asPromise(JSC__EncodedJSValue JSValue0); +CPP_DECL JSC__JSString* JSC__JSValue__asString(JSC__EncodedJSValue JSValue0); +CPP_DECL double JSC__JSValue__coerceToDouble(JSC__EncodedJSValue JSValue0, JSC__JSGlobalObject* arg1); +CPP_DECL int32_t JSC__JSValue__coerceToInt32(JSC__EncodedJSValue JSValue0, JSC__JSGlobalObject* arg1); +CPP_DECL int64_t JSC__JSValue__coerceToInt64(JSC__EncodedJSValue JSValue0, JSC__JSGlobalObject* arg1); +CPP_DECL JSC__EncodedJSValue JSC__JSValue__createEmptyArray(JSC__JSGlobalObject* arg0, size_t arg1); +CPP_DECL JSC__EncodedJSValue JSC__JSValue__createEmptyObject(JSC__JSGlobalObject* arg0, size_t arg1); +CPP_DECL JSC__EncodedJSValue JSC__JSValue__createInternalPromise(JSC__JSGlobalObject* arg0); +CPP_DECL JSC__EncodedJSValue JSC__JSValue__createObject2(JSC__JSGlobalObject* arg0, const ZigString* arg1, const ZigString* arg2, JSC__EncodedJSValue JSValue3, JSC__EncodedJSValue JSValue4); +CPP_DECL JSC__EncodedJSValue JSC__JSValue__createRangeError(const ZigString* arg0, const ZigString* arg1, JSC__JSGlobalObject* arg2); +CPP_DECL JSC__EncodedJSValue JSC__JSValue__createRopeString(JSC__EncodedJSValue JSValue0, JSC__EncodedJSValue JSValue1, JSC__JSGlobalObject* arg2); +CPP_DECL JSC__EncodedJSValue JSC__JSValue__createStringArray(JSC__JSGlobalObject* arg0, const ZigString* arg1, size_t arg2, bool arg3); +CPP_DECL JSC__EncodedJSValue JSC__JSValue__createTypeError(const ZigString* arg0, const ZigString* arg1, JSC__JSGlobalObject* arg2); +CPP_DECL JSC__EncodedJSValue JSC__JSValue__createUninitializedUint8Array(JSC__JSGlobalObject* arg0, size_t arg1); +CPP_DECL bool JSC__JSValue__deepEquals(JSC__EncodedJSValue JSValue0, JSC__EncodedJSValue JSValue1, JSC__JSGlobalObject* arg2); +CPP_DECL bool JSC__JSValue__deepMatch(JSC__EncodedJSValue JSValue0, JSC__EncodedJSValue JSValue1, JSC__JSGlobalObject* arg2, bool arg3); +CPP_DECL bool JSC__JSValue__eqlCell(JSC__EncodedJSValue JSValue0, JSC__JSCell* arg1); +CPP_DECL bool JSC__JSValue__eqlValue(JSC__EncodedJSValue JSValue0, JSC__EncodedJSValue JSValue1); +CPP_DECL JSC__EncodedJSValue JSC__JSValue__fastGet(JSC__EncodedJSValue JSValue0, JSC__JSGlobalObject* arg1, unsigned char arg2); +CPP_DECL JSC__EncodedJSValue JSC__JSValue__fastGetDirect_(JSC__EncodedJSValue JSValue0, JSC__JSGlobalObject* arg1, unsigned char arg2); +CPP_DECL void JSC__JSValue__forEach(JSC__EncodedJSValue JSValue0, JSC__JSGlobalObject* arg1, void* arg2, void(* ArgFn3)(JSC__VM* arg0, JSC__JSGlobalObject* arg1, void* arg2, JSC__EncodedJSValue JSValue3)); +CPP_DECL void JSC__JSValue__forEachProperty(JSC__EncodedJSValue JSValue0, JSC__JSGlobalObject* arg1, void* arg2, void(* ArgFn3)(JSC__JSGlobalObject* arg0, void* arg1, ZigString* arg2, JSC__EncodedJSValue JSValue3, bool arg4, bool arg5)); +CPP_DECL void JSC__JSValue__forEachPropertyOrdered(JSC__EncodedJSValue JSValue0, JSC__JSGlobalObject* arg1, void* arg2, void(* ArgFn3)(JSC__JSGlobalObject* arg0, void* arg1, ZigString* arg2, JSC__EncodedJSValue JSValue3, bool arg4, bool arg5)); +CPP_DECL JSC__EncodedJSValue JSC__JSValue__fromEntries(JSC__JSGlobalObject* arg0, ZigString* arg1, ZigString* arg2, size_t arg3, bool arg4); +CPP_DECL JSC__EncodedJSValue JSC__JSValue__fromInt64NoTruncate(JSC__JSGlobalObject* arg0, int64_t arg1); +CPP_DECL JSC__EncodedJSValue JSC__JSValue__fromUInt64NoTruncate(JSC__JSGlobalObject* arg0, uint64_t arg1); +CPP_DECL JSC__EncodedJSValue JSC__JSValue__fromTimevalNoTruncate(JSC__JSGlobalObject* arg0, int64_t nsec, int64_t sec); +CPP_DECL JSC__EncodedJSValue JSC__JSValue__bigIntSum(JSC__JSGlobalObject* arg0, JSC__EncodedJSValue JSValue0, JSC__EncodedJSValue JSValue1); +CPP_DECL void JSC__JSValue__getClassName(JSC__EncodedJSValue JSValue0, JSC__JSGlobalObject* arg1, ZigString* arg2); +CPP_DECL JSC__EncodedJSValue JSC__JSValue__getErrorsProperty(JSC__EncodedJSValue JSValue0, JSC__JSGlobalObject* arg1); +CPP_DECL JSC__EncodedJSValue JSC__JSValue__getIfPropertyExistsFromPath(JSC__EncodedJSValue JSValue0, JSC__JSGlobalObject* arg1, JSC__EncodedJSValue JSValue2); +CPP_DECL JSC__EncodedJSValue JSC__JSValue__getIfPropertyExistsImpl(JSC__EncodedJSValue JSValue0, JSC__JSGlobalObject* arg1, const unsigned char* arg2, uint32_t arg3); +CPP_DECL double JSC__JSValue__getLengthIfPropertyExistsInternal(JSC__EncodedJSValue JSValue0, JSC__JSGlobalObject* arg1); +CPP_DECL void JSC__JSValue__getNameProperty(JSC__EncodedJSValue JSValue0, JSC__JSGlobalObject* arg1, ZigString* arg2); +CPP_DECL JSC__EncodedJSValue JSC__JSValue__getPrototype(JSC__EncodedJSValue JSValue0, JSC__JSGlobalObject* arg1); +CPP_DECL void JSC__JSValue__getSymbolDescription(JSC__EncodedJSValue JSValue0, JSC__JSGlobalObject* arg1, ZigString* arg2); +CPP_DECL double JSC__JSValue__getUnixTimestamp(JSC__EncodedJSValue JSValue0); +CPP_DECL bool JSC__JSValue__hasOwnProperty(JSC__EncodedJSValue JSValue0, JSC__JSGlobalObject* arg1, ZigString arg2); +CPP_DECL bool JSC__JSValue__isAggregateError(JSC__EncodedJSValue JSValue0, JSC__JSGlobalObject* arg1); +CPP_DECL bool JSC__JSValue__isAnyError(JSC__EncodedJSValue JSValue0); +CPP_DECL bool JSC__JSValue__isAnyInt(JSC__EncodedJSValue JSValue0); +CPP_DECL bool JSC__JSValue__isBigInt(JSC__EncodedJSValue JSValue0); +CPP_DECL bool JSC__JSValue__isBigInt32(JSC__EncodedJSValue JSValue0); +CPP_DECL bool JSC__JSValue__isCallable(JSC__EncodedJSValue JSValue0); +CPP_DECL bool JSC__JSValue__isClass(JSC__EncodedJSValue JSValue0, JSC__JSGlobalObject* arg1); +CPP_DECL bool JSC__JSValue__isConstructor(JSC__EncodedJSValue JSValue0); +CPP_DECL bool JSC__JSValue__isCustomGetterSetter(JSC__EncodedJSValue JSValue0); +CPP_DECL bool JSC__JSValue__isError(JSC__EncodedJSValue JSValue0); +CPP_DECL bool JSC__JSValue__isException(JSC__EncodedJSValue JSValue0, JSC__VM* arg1); +CPP_DECL bool JSC__JSValue__isGetterSetter(JSC__EncodedJSValue JSValue0); +CPP_DECL bool JSC__JSValue__isHeapBigInt(JSC__EncodedJSValue JSValue0); +CPP_DECL bool JSC__JSValue__isInstanceOf(JSC__EncodedJSValue JSValue0, JSC__JSGlobalObject* arg1, JSC__EncodedJSValue JSValue2); +CPP_DECL bool JSC__JSValue__isInt32(JSC__EncodedJSValue JSValue0); +CPP_DECL bool JSC__JSValue__isInt32AsAnyInt(JSC__EncodedJSValue JSValue0); +CPP_DECL bool JSC__JSValue__isIterable(JSC__EncodedJSValue JSValue0, JSC__JSGlobalObject* arg1); +CPP_DECL bool JSC__JSValue__isNumber(JSC__EncodedJSValue JSValue0); +CPP_DECL bool JSC__JSValue__isObject(JSC__EncodedJSValue JSValue0); +CPP_DECL bool JSC__JSValue__isPrimitive(JSC__EncodedJSValue JSValue0); +CPP_DECL bool JSC__JSValue__isSameValue(JSC__EncodedJSValue JSValue0, JSC__EncodedJSValue JSValue1, JSC__JSGlobalObject* arg2); +CPP_DECL bool JSC__JSValue__isSymbol(JSC__EncodedJSValue JSValue0); +CPP_DECL bool JSC__JSValue__isTerminationException(JSC__EncodedJSValue JSValue0, JSC__VM* arg1); +CPP_DECL bool JSC__JSValue__isUInt32AsAnyInt(JSC__EncodedJSValue JSValue0); +CPP_DECL bool JSC__JSValue__jestDeepEquals(JSC__EncodedJSValue JSValue0, JSC__EncodedJSValue JSValue1, JSC__JSGlobalObject* arg2); +CPP_DECL bool JSC__JSValue__jestDeepMatch(JSC__EncodedJSValue JSValue0, JSC__EncodedJSValue JSValue1, JSC__JSGlobalObject* arg2, bool arg3); +CPP_DECL bool JSC__JSValue__jestStrictDeepEquals(JSC__EncodedJSValue JSValue0, JSC__EncodedJSValue JSValue1, JSC__JSGlobalObject* arg2); +CPP_DECL JSC__EncodedJSValue JSC__JSValue__jsBoolean(bool arg0); +CPP_DECL JSC__EncodedJSValue JSC__JSValue__jsDoubleNumber(double arg0); +CPP_DECL JSC__EncodedJSValue JSC__JSValue__jsNull(); +CPP_DECL JSC__EncodedJSValue JSC__JSValue__jsNumberFromChar(unsigned char arg0); +CPP_DECL JSC__EncodedJSValue JSC__JSValue__jsNumberFromDouble(double arg0); +CPP_DECL JSC__EncodedJSValue JSC__JSValue__jsNumberFromInt64(int64_t arg0); +CPP_DECL JSC__EncodedJSValue JSC__JSValue__jsNumberFromU16(uint16_t arg0); +CPP_DECL void JSC__JSValue__jsonStringify(JSC__EncodedJSValue JSValue0, JSC__JSGlobalObject* arg1, uint32_t arg2, BunString* arg3); +CPP_DECL JSC__EncodedJSValue JSC__JSValue__jsTDZValue(); +CPP_DECL unsigned char JSC__JSValue__jsType(JSC__EncodedJSValue JSValue0); +CPP_DECL JSC__EncodedJSValue JSC__JSValue__jsUndefined(); +CPP_DECL JSC__EncodedJSValue JSC__JSValue__keys(JSC__JSGlobalObject* arg0, JSC__EncodedJSValue arg1); +CPP_DECL JSC__EncodedJSValue JSC__JSValue__values(JSC__JSGlobalObject* arg0, JSC__EncodedJSValue arg1); +CPP_DECL JSC__EncodedJSValue JSC__JSValue__parseJSON(JSC__EncodedJSValue JSValue0, JSC__JSGlobalObject* arg1); +CPP_DECL void JSC__JSValue__push(JSC__EncodedJSValue JSValue0, JSC__JSGlobalObject* arg1, JSC__EncodedJSValue JSValue2); +CPP_DECL void JSC__JSValue__put(JSC__EncodedJSValue JSValue0, JSC__JSGlobalObject* arg1, const ZigString* arg2, JSC__EncodedJSValue JSValue3); +CPP_DECL void JSC__JSValue__putIndex(JSC__EncodedJSValue JSValue0, JSC__JSGlobalObject* arg1, uint32_t arg2, JSC__EncodedJSValue JSValue3); +CPP_DECL void JSC__JSValue__putRecord(JSC__EncodedJSValue JSValue0, JSC__JSGlobalObject* arg1, ZigString* arg2, ZigString* arg3, size_t arg4); +CPP_DECL bool JSC__JSValue__strictDeepEquals(JSC__EncodedJSValue JSValue0, JSC__EncodedJSValue JSValue1, JSC__JSGlobalObject* arg2); +CPP_DECL bool JSC__JSValue__stringIncludes(JSC__EncodedJSValue JSValue0, JSC__JSGlobalObject* arg1, JSC__EncodedJSValue JSValue2); +CPP_DECL JSC__EncodedJSValue JSC__JSValue__symbolFor(JSC__JSGlobalObject* arg0, ZigString* arg1); +CPP_DECL bool JSC__JSValue__symbolKeyFor(JSC__EncodedJSValue JSValue0, JSC__JSGlobalObject* arg1, ZigString* arg2); +CPP_DECL bool JSC__JSValue__toBoolean(JSC__EncodedJSValue JSValue0); +CPP_DECL JSC__EncodedJSValue JSC__JSValue__toError_(JSC__EncodedJSValue JSValue0); +CPP_DECL int32_t JSC__JSValue__toInt32(JSC__EncodedJSValue JSValue0); +CPP_DECL int64_t JSC__JSValue__toInt64(JSC__EncodedJSValue JSValue0); +CPP_DECL bool JSC__JSValue__toMatch(JSC__EncodedJSValue JSValue0, JSC__JSGlobalObject* arg1, JSC__EncodedJSValue JSValue2); +CPP_DECL JSC__JSObject* JSC__JSValue__toObject(JSC__EncodedJSValue JSValue0, JSC__JSGlobalObject* arg1); +CPP_DECL JSC__JSString* JSC__JSValue__toString(JSC__EncodedJSValue JSValue0, JSC__JSGlobalObject* arg1); +CPP_DECL JSC__JSString* JSC__JSValue__toStringOrNull(JSC__EncodedJSValue JSValue0, JSC__JSGlobalObject* arg1); +CPP_DECL uint64_t JSC__JSValue__toUInt64NoTruncate(JSC__EncodedJSValue JSValue0); +CPP_DECL void JSC__JSValue__toZigException(JSC__EncodedJSValue JSValue0, JSC__JSGlobalObject* arg1, ZigException* arg2); +CPP_DECL void JSC__JSValue__toZigString(JSC__EncodedJSValue JSValue0, ZigString* arg1, JSC__JSGlobalObject* arg2); #pragma mark - JSC::VM -CPP_DECL size_t JSC__VM__blockBytesAllocated(JSC::VM* arg0); -CPP_DECL void JSC__VM__clearExecutionTimeLimit(JSC::VM* arg0); -CPP_DECL void JSC__VM__collectAsync(JSC::VM* arg0); -CPP_DECL JSC::VM* JSC__VM__create(unsigned char HeapType0); -CPP_DECL void JSC__VM__deinit(JSC::VM* arg0, JSC::JSGlobalObject* arg1); -CPP_DECL void JSC__VM__deleteAllCode(JSC::VM* arg0, JSC::JSGlobalObject* arg1); -CPP_DECL void JSC__VM__drainMicrotasks(JSC::VM* arg0); -CPP_DECL bool JSC__VM__executionForbidden(JSC::VM* arg0); -CPP_DECL size_t JSC__VM__externalMemorySize(JSC::VM* arg0); -CPP_DECL size_t JSC__VM__heapSize(JSC::VM* arg0); -CPP_DECL void JSC__VM__holdAPILock(JSC::VM* arg0, void* arg1, void(* ArgFn2)(void* arg0)); -CPP_DECL bool JSC__VM__isEntered(JSC::VM* arg0); +CPP_DECL size_t JSC__VM__blockBytesAllocated(JSC__VM* arg0); +CPP_DECL void JSC__VM__clearExecutionTimeLimit(JSC__VM* arg0); +CPP_DECL void JSC__VM__collectAsync(JSC__VM* arg0); +CPP_DECL JSC__VM* JSC__VM__create(unsigned char HeapType0); +CPP_DECL void JSC__VM__deinit(JSC__VM* arg0, JSC__JSGlobalObject* arg1); +CPP_DECL void JSC__VM__deleteAllCode(JSC__VM* arg0, JSC__JSGlobalObject* arg1); +CPP_DECL void JSC__VM__drainMicrotasks(JSC__VM* arg0); +CPP_DECL bool JSC__VM__executionForbidden(JSC__VM* arg0); +CPP_DECL size_t JSC__VM__externalMemorySize(JSC__VM* arg0); +CPP_DECL size_t JSC__VM__heapSize(JSC__VM* arg0); +CPP_DECL void JSC__VM__holdAPILock(JSC__VM* arg0, void* arg1, void(* ArgFn2)(void* arg0)); +CPP_DECL bool JSC__VM__isEntered(JSC__VM* arg0); CPP_DECL bool JSC__VM__isJITEnabled(); -CPP_DECL void JSC__VM__notifyNeedDebuggerBreak(JSC::VM* arg0); -CPP_DECL void JSC__VM__notifyNeedShellTimeoutCheck(JSC::VM* arg0); -CPP_DECL void JSC__VM__notifyNeedTermination(JSC::VM* arg0); -CPP_DECL void JSC__VM__notifyNeedWatchdogCheck(JSC::VM* arg0); -CPP_DECL void JSC__VM__releaseWeakRefs(JSC::VM* arg0); -CPP_DECL size_t JSC__VM__runGC(JSC::VM* arg0, bool arg1); -CPP_DECL void JSC__VM__setControlFlowProfiler(JSC::VM* arg0, bool arg1); -CPP_DECL void JSC__VM__setExecutionForbidden(JSC::VM* arg0, bool arg1); -CPP_DECL void JSC__VM__setExecutionTimeLimit(JSC::VM* arg0, double arg1); -CPP_DECL void JSC__VM__shrinkFootprint(JSC::VM* arg0); -CPP_DECL void JSC__VM__throwError(JSC::VM* arg0, JSC::JSGlobalObject* arg1, JSC::EncodedJSValue JSValue2); -CPP_DECL void JSC__VM__throwError(JSC::VM* arg0, JSC::JSGlobalObject* arg1, JSC::EncodedJSValue JSValue2); -CPP_DECL void JSC__VM__whenIdle(JSC::VM* arg0, void(* ArgFn1)()); +CPP_DECL void JSC__VM__notifyNeedDebuggerBreak(JSC__VM* arg0); +CPP_DECL void JSC__VM__notifyNeedShellTimeoutCheck(JSC__VM* arg0); +CPP_DECL void JSC__VM__notifyNeedTermination(JSC__VM* arg0); +CPP_DECL void JSC__VM__notifyNeedWatchdogCheck(JSC__VM* arg0); +CPP_DECL void JSC__VM__releaseWeakRefs(JSC__VM* arg0); +CPP_DECL size_t JSC__VM__runGC(JSC__VM* arg0, bool arg1); +CPP_DECL void JSC__VM__setControlFlowProfiler(JSC__VM* arg0, bool arg1); +CPP_DECL void JSC__VM__setExecutionForbidden(JSC__VM* arg0, bool arg1); +CPP_DECL void JSC__VM__setExecutionTimeLimit(JSC__VM* arg0, double arg1); +CPP_DECL void JSC__VM__shrinkFootprint(JSC__VM* arg0); +CPP_DECL void JSC__VM__throwError(JSC__VM* arg0, JSC__JSGlobalObject* arg1, JSC__EncodedJSValue JSValue2); +CPP_DECL void JSC__VM__throwError(JSC__VM* arg0, JSC__JSGlobalObject* arg1, JSC__EncodedJSValue JSValue2); +CPP_DECL void JSC__VM__whenIdle(JSC__VM* arg0, void(* ArgFn1)()); #pragma mark - JSC::ThrowScope -CPP_DECL void JSC__ThrowScope__clearException(JSC::ThrowScope* arg0); -CPP_DECL JSC::Exception* JSC__ThrowScope__exception(JSC::ThrowScope* arg0); -CPP_DECL void JSC__ThrowScope__release(JSC::ThrowScope* arg0); +CPP_DECL void JSC__ThrowScope__clearException(JSC__ThrowScope* arg0); +CPP_DECL JSC__Exception* JSC__ThrowScope__exception(JSC__ThrowScope* arg0); +CPP_DECL void JSC__ThrowScope__release(JSC__ThrowScope* arg0); #pragma mark - JSC::CatchScope -CPP_DECL void JSC__CatchScope__clearException(JSC::CatchScope* arg0); -CPP_DECL JSC::Exception* JSC__CatchScope__exception(JSC::CatchScope* arg0); -CPP_DECL void FFI__ptr__put(JSC::JSGlobalObject* arg0, JSC::EncodedJSValue JSValue1); +CPP_DECL void JSC__CatchScope__clearException(JSC__CatchScope* arg0); +CPP_DECL JSC__Exception* JSC__CatchScope__exception(JSC__CatchScope* arg0); -#ifdef __cplusplus +#pragma mark - JSC::Structure -extern "C" JSC::EncodedJSValue SYSV_ABI FFI__ptr__fastpath(JSC::JSGlobalObject* arg0, void* arg1, JSC::JSUint8Array* arg2); -extern "C" JSC::EncodedJSValue SYSV_ABI FFI__ptr__slowpath(JSC::JSGlobalObject* arg0, JSC::EncodedJSValue JSValue1, JSC::EncodedJSValue* arg2, size_t arg3); +CPP_DECL JSC__EncodedJSValue JSC__createStructure(JSC__JSGlobalObject* globalObject, JSC__JSCell* owner, uint32_t capacity, ExternColumnIdentifier* namesPtr); -#endif -CPP_DECL void Reader__u8__put(JSC::JSGlobalObject* arg0, JSC::EncodedJSValue JSValue1); +#pragma mark - FFI -#ifdef __cplusplus - -extern "C" JSC::EncodedJSValue SYSV_ABI Reader__u8__fastpath(JSC::JSGlobalObject* arg0, void* arg1, int64_t arg2, int32_t arg3); -extern "C" JSC::EncodedJSValue SYSV_ABI Reader__u8__slowpath(JSC::JSGlobalObject* arg0, JSC::EncodedJSValue JSValue1, JSC::EncodedJSValue* arg2, size_t arg3); - -#endif -CPP_DECL void Reader__u16__put(JSC::JSGlobalObject* arg0, JSC::EncodedJSValue JSValue1); - -#ifdef __cplusplus - -extern "C" JSC::EncodedJSValue SYSV_ABI Reader__u16__fastpath(JSC::JSGlobalObject* arg0, void* arg1, int64_t arg2, int32_t arg3); -extern "C" JSC::EncodedJSValue SYSV_ABI Reader__u16__slowpath(JSC::JSGlobalObject* arg0, JSC::EncodedJSValue JSValue1, JSC::EncodedJSValue* arg2, size_t arg3); - -#endif -CPP_DECL void Reader__u32__put(JSC::JSGlobalObject* arg0, JSC::EncodedJSValue JSValue1); - -#ifdef __cplusplus - -extern "C" JSC::EncodedJSValue SYSV_ABI Reader__u32__fastpath(JSC::JSGlobalObject* arg0, void* arg1, int64_t arg2, int32_t arg3); -extern "C" JSC::EncodedJSValue SYSV_ABI Reader__u32__slowpath(JSC::JSGlobalObject* arg0, JSC::EncodedJSValue JSValue1, JSC::EncodedJSValue* arg2, size_t arg3); - -#endif -CPP_DECL void Reader__ptr__put(JSC::JSGlobalObject* arg0, JSC::EncodedJSValue JSValue1); - -#ifdef __cplusplus - -extern "C" JSC::EncodedJSValue SYSV_ABI Reader__ptr__fastpath(JSC::JSGlobalObject* arg0, void* arg1, int64_t arg2, int32_t arg3); -extern "C" JSC::EncodedJSValue SYSV_ABI Reader__ptr__slowpath(JSC::JSGlobalObject* arg0, JSC::EncodedJSValue JSValue1, JSC::EncodedJSValue* arg2, size_t arg3); - -#endif -CPP_DECL void Reader__i8__put(JSC::JSGlobalObject* arg0, JSC::EncodedJSValue JSValue1); - -#ifdef __cplusplus - -extern "C" JSC::EncodedJSValue SYSV_ABI Reader__i8__fastpath(JSC::JSGlobalObject* arg0, void* arg1, int64_t arg2, int32_t arg3); -extern "C" JSC::EncodedJSValue SYSV_ABI Reader__i8__slowpath(JSC::JSGlobalObject* arg0, JSC::EncodedJSValue JSValue1, JSC::EncodedJSValue* arg2, size_t arg3); - -#endif -CPP_DECL void Reader__i16__put(JSC::JSGlobalObject* arg0, JSC::EncodedJSValue JSValue1); - -#ifdef __cplusplus - -extern "C" JSC::EncodedJSValue SYSV_ABI Reader__i16__fastpath(JSC::JSGlobalObject* arg0, void* arg1, int64_t arg2, int32_t arg3); -extern "C" JSC::EncodedJSValue SYSV_ABI Reader__i16__slowpath(JSC::JSGlobalObject* arg0, JSC::EncodedJSValue JSValue1, JSC::EncodedJSValue* arg2, size_t arg3); - -#endif -CPP_DECL void Reader__i32__put(JSC::JSGlobalObject* arg0, JSC::EncodedJSValue JSValue1); - -#ifdef __cplusplus - -extern "C" JSC::EncodedJSValue SYSV_ABI Reader__i32__fastpath(JSC::JSGlobalObject* arg0, void* arg1, int64_t arg2, int32_t arg3); -extern "C" JSC::EncodedJSValue SYSV_ABI Reader__i32__slowpath(JSC::JSGlobalObject* arg0, JSC::EncodedJSValue JSValue1, JSC::EncodedJSValue* arg2, size_t arg3); - -#endif -CPP_DECL void Reader__f32__put(JSC::JSGlobalObject* arg0, JSC::EncodedJSValue JSValue1); - -#ifdef __cplusplus - -extern "C" JSC::EncodedJSValue SYSV_ABI Reader__f32__fastpath(JSC::JSGlobalObject* arg0, void* arg1, int64_t arg2, int32_t arg3); -extern "C" JSC::EncodedJSValue SYSV_ABI Reader__f32__slowpath(JSC::JSGlobalObject* arg0, JSC::EncodedJSValue JSValue1, JSC::EncodedJSValue* arg2, size_t arg3); - -#endif -CPP_DECL void Reader__f64__put(JSC::JSGlobalObject* arg0, JSC::EncodedJSValue JSValue1); - -#ifdef __cplusplus - -extern "C" JSC::EncodedJSValue SYSV_ABI Reader__f64__fastpath(JSC::JSGlobalObject* arg0, void* arg1, int64_t arg2, int32_t arg3); -extern "C" JSC::EncodedJSValue SYSV_ABI Reader__f64__slowpath(JSC::JSGlobalObject* arg0, JSC::EncodedJSValue JSValue1, JSC::EncodedJSValue* arg2, size_t arg3); - -#endif -CPP_DECL void Reader__i64__put(JSC::JSGlobalObject* arg0, JSC::EncodedJSValue JSValue1); - -#ifdef __cplusplus - -extern "C" JSC::EncodedJSValue SYSV_ABI Reader__i64__fastpath(JSC::JSGlobalObject* arg0, void* arg1, int64_t arg2, int32_t arg3); -extern "C" JSC::EncodedJSValue SYSV_ABI Reader__i64__slowpath(JSC::JSGlobalObject* arg0, JSC::EncodedJSValue JSValue1, JSC::EncodedJSValue* arg2, size_t arg3); - -#endif -CPP_DECL void Reader__u64__put(JSC::JSGlobalObject* arg0, JSC::EncodedJSValue JSValue1); - -#ifdef __cplusplus - -extern "C" JSC::EncodedJSValue SYSV_ABI Reader__u64__fastpath(JSC::JSGlobalObject* arg0, void* arg1, int64_t arg2, int32_t arg3); -extern "C" JSC::EncodedJSValue SYSV_ABI Reader__u64__slowpath(JSC::JSGlobalObject* arg0, JSC::EncodedJSValue JSValue1, JSC::EncodedJSValue* arg2, size_t arg3); - -#endif -CPP_DECL void Reader__intptr__put(JSC::JSGlobalObject* arg0, JSC::EncodedJSValue JSValue1); - -#ifdef __cplusplus - -extern "C" JSC::EncodedJSValue SYSV_ABI Reader__intptr__fastpath(JSC::JSGlobalObject* arg0, void* arg1, int64_t arg2, int32_t arg3); -extern "C" JSC::EncodedJSValue SYSV_ABI Reader__intptr__slowpath(JSC::JSGlobalObject* arg0, JSC::EncodedJSValue JSValue1, JSC::EncodedJSValue* arg2, size_t arg3); - -#endif +CPP_DECL void FFI__ptr__put(JSC__JSGlobalObject* arg0, JSC__EncodedJSValue JSValue1); +ZIG_DECL JSC__EncodedJSValue SYSV_ABI FFI__ptr__slowpath(JSC__JSGlobalObject* arg0, JSC__EncodedJSValue JSValue1, JSC__EncodedJSValue* arg2, size_t arg3); +CPP_DECL void Reader__u8__put(JSC__JSGlobalObject* arg0, JSC__EncodedJSValue JSValue1); +ZIG_DECL JSC__EncodedJSValue SYSV_ABI Reader__u8__slowpath(JSC__JSGlobalObject* arg0, JSC__EncodedJSValue JSValue1, JSC__EncodedJSValue* arg2, size_t arg3); +CPP_DECL void Reader__u16__put(JSC__JSGlobalObject* arg0, JSC__EncodedJSValue JSValue1); +ZIG_DECL JSC__EncodedJSValue SYSV_ABI Reader__u16__slowpath(JSC__JSGlobalObject* arg0, JSC__EncodedJSValue JSValue1, JSC__EncodedJSValue* arg2, size_t arg3); +CPP_DECL void Reader__u32__put(JSC__JSGlobalObject* arg0, JSC__EncodedJSValue JSValue1); +ZIG_DECL JSC__EncodedJSValue SYSV_ABI Reader__u32__slowpath(JSC__JSGlobalObject* arg0, JSC__EncodedJSValue JSValue1, JSC__EncodedJSValue* arg2, size_t arg3); +CPP_DECL void Reader__ptr__put(JSC__JSGlobalObject* arg0, JSC__EncodedJSValue JSValue1); +ZIG_DECL JSC__EncodedJSValue SYSV_ABI Reader__ptr__slowpath(JSC__JSGlobalObject* arg0, JSC__EncodedJSValue JSValue1, JSC__EncodedJSValue* arg2, size_t arg3); +CPP_DECL void Reader__i8__put(JSC__JSGlobalObject* arg0, JSC__EncodedJSValue JSValue1); +ZIG_DECL JSC__EncodedJSValue SYSV_ABI Reader__i8__slowpath(JSC__JSGlobalObject* arg0, JSC__EncodedJSValue JSValue1, JSC__EncodedJSValue* arg2, size_t arg3); +CPP_DECL void Reader__i16__put(JSC__JSGlobalObject* arg0, JSC__EncodedJSValue JSValue1); +ZIG_DECL JSC__EncodedJSValue SYSV_ABI Reader__i16__slowpath(JSC__JSGlobalObject* arg0, JSC__EncodedJSValue JSValue1, JSC__EncodedJSValue* arg2, size_t arg3); +CPP_DECL void Reader__i32__put(JSC__JSGlobalObject* arg0, JSC__EncodedJSValue JSValue1); +ZIG_DECL JSC__EncodedJSValue SYSV_ABI Reader__i32__slowpath(JSC__JSGlobalObject* arg0, JSC__EncodedJSValue JSValue1, JSC__EncodedJSValue* arg2, size_t arg3); +CPP_DECL void Reader__f32__put(JSC__JSGlobalObject* arg0, JSC__EncodedJSValue JSValue1); +ZIG_DECL JSC__EncodedJSValue SYSV_ABI Reader__f32__slowpath(JSC__JSGlobalObject* arg0, JSC__EncodedJSValue JSValue1, JSC__EncodedJSValue* arg2, size_t arg3); +CPP_DECL void Reader__f64__put(JSC__JSGlobalObject* arg0, JSC__EncodedJSValue JSValue1); +ZIG_DECL JSC__EncodedJSValue SYSV_ABI Reader__f64__slowpath(JSC__JSGlobalObject* arg0, JSC__EncodedJSValue JSValue1, JSC__EncodedJSValue* arg2, size_t arg3); +CPP_DECL void Reader__i64__put(JSC__JSGlobalObject* arg0, JSC__EncodedJSValue JSValue1); +ZIG_DECL JSC__EncodedJSValue SYSV_ABI Reader__i64__slowpath(JSC__JSGlobalObject* arg0, JSC__EncodedJSValue JSValue1, JSC__EncodedJSValue* arg2, size_t arg3); +CPP_DECL void Reader__u64__put(JSC__JSGlobalObject* arg0, JSC__EncodedJSValue JSValue1); +ZIG_DECL JSC__EncodedJSValue SYSV_ABI Reader__u64__slowpath(JSC__JSGlobalObject* arg0, JSC__EncodedJSValue JSValue1, JSC__EncodedJSValue* arg2, size_t arg3); +CPP_DECL void Reader__intptr__put(JSC__JSGlobalObject* arg0, JSC__EncodedJSValue JSValue1); +ZIG_DECL JSC__EncodedJSValue SYSV_ABI Reader__intptr__slowpath(JSC__JSGlobalObject* arg0, JSC__EncodedJSValue JSValue1, JSC__EncodedJSValue* arg2, size_t arg3); #pragma mark - Zig::GlobalObject -CPP_DECL JSC::JSGlobalObject* Zig__GlobalObject__create(void* arg0, int32_t arg1, bool arg2, bool arg3, void* arg4); -CPP_DECL void* Zig__GlobalObject__getModuleRegistryMap(JSC::JSGlobalObject* arg0); -CPP_DECL bool Zig__GlobalObject__resetModuleRegistryMap(JSC::JSGlobalObject* arg0, void* arg1); +CPP_DECL JSC__JSGlobalObject* Zig__GlobalObject__create(void* arg0, int32_t arg1, bool arg2, bool arg3, void* arg4); +CPP_DECL void* Zig__GlobalObject__getModuleRegistryMap(JSC__JSGlobalObject* arg0); +CPP_DECL bool Zig__GlobalObject__resetModuleRegistryMap(JSC__JSGlobalObject* arg0, void* arg1); #ifdef __cplusplus -ZIG_DECL void Zig__GlobalObject__fetch(ErrorableResolvedSource* arg0, JSC::JSGlobalObject* arg1, BunString* arg2, BunString* arg3); +ZIG_DECL void Zig__GlobalObject__fetch(ErrorableResolvedSource* arg0, JSC__JSGlobalObject* arg1, BunString* arg2, BunString* arg3); ZIG_DECL void Zig__GlobalObject__onCrash(); -ZIG_DECL JSC::EncodedJSValue Zig__GlobalObject__promiseRejectionTracker(JSC::JSGlobalObject* arg0, JSC::JSPromise* arg1, uint32_t JSPromiseRejectionOperation2); -ZIG_DECL JSC::EncodedJSValue Zig__GlobalObject__reportUncaughtException(JSC::JSGlobalObject* arg0, JSC::Exception* arg1); -ZIG_DECL void Zig__GlobalObject__resolve(ErrorableString* arg0, JSC::JSGlobalObject* arg1, BunString* arg2, BunString* arg3, ZigString* arg4); +ZIG_DECL JSC__EncodedJSValue Zig__GlobalObject__promiseRejectionTracker(JSC__JSGlobalObject* arg0, JSC__JSPromise* arg1, uint32_t JSPromiseRejectionOperation2); +ZIG_DECL JSC__EncodedJSValue Zig__GlobalObject__reportUncaughtException(JSC__JSGlobalObject* arg0, JSC__Exception* arg1); +ZIG_DECL void Zig__GlobalObject__resolve(ErrorableString* arg0, JSC__JSGlobalObject* arg1, BunString* arg2, BunString* arg3, ZigString* arg4); #endif #ifdef __cplusplus -extern "C" JSC::EncodedJSValue SYSV_ABI Bun__Path__basename(JSC::JSGlobalObject* arg0, bool arg1, JSC::EncodedJSValue* arg2, uint16_t arg3); -extern "C" JSC::EncodedJSValue SYSV_ABI Bun__Path__dirname(JSC::JSGlobalObject* arg0, bool arg1, JSC::EncodedJSValue* arg2, uint16_t arg3); -extern "C" JSC::EncodedJSValue SYSV_ABI Bun__Path__extname(JSC::JSGlobalObject* arg0, bool arg1, JSC::EncodedJSValue* arg2, uint16_t arg3); -extern "C" JSC::EncodedJSValue SYSV_ABI Bun__Path__format(JSC::JSGlobalObject* arg0, bool arg1, JSC::EncodedJSValue* arg2, uint16_t arg3); -extern "C" JSC::EncodedJSValue SYSV_ABI Bun__Path__isAbsolute(JSC::JSGlobalObject* arg0, bool arg1, JSC::EncodedJSValue* arg2, uint16_t arg3); -extern "C" JSC::EncodedJSValue SYSV_ABI Bun__Path__join(JSC::JSGlobalObject* arg0, bool arg1, JSC::EncodedJSValue* arg2, uint16_t arg3); -extern "C" JSC::EncodedJSValue SYSV_ABI Bun__Path__normalize(JSC::JSGlobalObject* arg0, bool arg1, JSC::EncodedJSValue* arg2, uint16_t arg3); -extern "C" JSC::EncodedJSValue SYSV_ABI Bun__Path__parse(JSC::JSGlobalObject* arg0, bool arg1, JSC::EncodedJSValue* arg2, uint16_t arg3); -extern "C" JSC::EncodedJSValue SYSV_ABI Bun__Path__relative(JSC::JSGlobalObject* arg0, bool arg1, JSC::EncodedJSValue* arg2, uint16_t arg3); -extern "C" JSC::EncodedJSValue SYSV_ABI Bun__Path__resolve(JSC::JSGlobalObject* arg0, bool arg1, JSC::EncodedJSValue* arg2, uint16_t arg3); -extern "C" JSC::EncodedJSValue SYSV_ABI Bun__Path__toNamespacedPath(JSC::JSGlobalObject* arg0, bool arg1, JSC::EncodedJSValue* arg2, uint16_t arg3); +ZIG_DECL JSC__EncodedJSValue SYSV_ABI Bun__Path__basename(JSC__JSGlobalObject* arg0, bool arg1, JSC__EncodedJSValue* arg2, uint16_t arg3); +ZIG_DECL JSC__EncodedJSValue SYSV_ABI Bun__Path__dirname(JSC__JSGlobalObject* arg0, bool arg1, JSC__EncodedJSValue* arg2, uint16_t arg3); +ZIG_DECL JSC__EncodedJSValue SYSV_ABI Bun__Path__extname(JSC__JSGlobalObject* arg0, bool arg1, JSC__EncodedJSValue* arg2, uint16_t arg3); +ZIG_DECL JSC__EncodedJSValue SYSV_ABI Bun__Path__format(JSC__JSGlobalObject* arg0, bool arg1, JSC__EncodedJSValue* arg2, uint16_t arg3); +ZIG_DECL JSC__EncodedJSValue SYSV_ABI Bun__Path__isAbsolute(JSC__JSGlobalObject* arg0, bool arg1, JSC__EncodedJSValue* arg2, uint16_t arg3); +ZIG_DECL JSC__EncodedJSValue SYSV_ABI Bun__Path__join(JSC__JSGlobalObject* arg0, bool arg1, JSC__EncodedJSValue* arg2, uint16_t arg3); +ZIG_DECL JSC__EncodedJSValue SYSV_ABI Bun__Path__normalize(JSC__JSGlobalObject* arg0, bool arg1, JSC__EncodedJSValue* arg2, uint16_t arg3); +ZIG_DECL JSC__EncodedJSValue SYSV_ABI Bun__Path__parse(JSC__JSGlobalObject* arg0, bool arg1, JSC__EncodedJSValue* arg2, uint16_t arg3); +ZIG_DECL JSC__EncodedJSValue SYSV_ABI Bun__Path__relative(JSC__JSGlobalObject* arg0, bool arg1, JSC__EncodedJSValue* arg2, uint16_t arg3); +ZIG_DECL JSC__EncodedJSValue SYSV_ABI Bun__Path__resolve(JSC__JSGlobalObject* arg0, bool arg1, JSC__EncodedJSValue* arg2, uint16_t arg3); +ZIG_DECL JSC__EncodedJSValue SYSV_ABI Bun__Path__toNamespacedPath(JSC__JSGlobalObject* arg0, bool arg1, JSC__EncodedJSValue* arg2, uint16_t arg3); #endif -CPP_DECL JSC::EncodedJSValue ArrayBufferSink__assignToStream(JSC::JSGlobalObject* arg0, JSC::EncodedJSValue JSValue1, void* arg2, void** arg3); -CPP_DECL JSC::EncodedJSValue ArrayBufferSink__createObject(JSC::JSGlobalObject* arg0, void* arg1, uintptr_t destructor); -CPP_DECL void ArrayBufferSink__detachPtr(JSC::EncodedJSValue JSValue0); -CPP_DECL void ArrayBufferSink__onClose(JSC::EncodedJSValue JSValue0, JSC::EncodedJSValue JSValue1); -CPP_DECL void ArrayBufferSink__onReady(JSC::EncodedJSValue JSValue0, JSC::EncodedJSValue JSValue1, JSC::EncodedJSValue JSValue2); +CPP_DECL JSC__EncodedJSValue ArrayBufferSink__assignToStream(JSC__JSGlobalObject* arg0, JSC__EncodedJSValue JSValue1, void* arg2, void** arg3); +CPP_DECL JSC__EncodedJSValue ArrayBufferSink__createObject(JSC__JSGlobalObject* arg0, void* arg1, uintptr_t destructor); +CPP_DECL void ArrayBufferSink__detachPtr(JSC__EncodedJSValue JSValue0); +CPP_DECL void ArrayBufferSink__onClose(JSC__EncodedJSValue JSValue0, JSC__EncodedJSValue JSValue1); +CPP_DECL void ArrayBufferSink__onReady(JSC__EncodedJSValue JSValue0, JSC__EncodedJSValue JSValue1, JSC__EncodedJSValue JSValue2); #ifdef __cplusplus -ZIG_DECL JSC::EncodedJSValue ArrayBufferSink__close(JSC::JSGlobalObject* arg0, void* arg1); +ZIG_DECL JSC__EncodedJSValue ArrayBufferSink__close(JSC__JSGlobalObject* arg0, void* arg1); BUN_DECLARE_HOST_FUNCTION(ArrayBufferSink__construct); BUN_DECLARE_HOST_FUNCTION(ArrayBufferSink__end); -ZIG_DECL JSC::EncodedJSValue SYSV_ABI ArrayBufferSink__endWithSink(void* arg0, JSC::JSGlobalObject* arg1); +ZIG_DECL JSC__EncodedJSValue SYSV_ABI ArrayBufferSink__endWithSink(void* arg0, JSC__JSGlobalObject* arg1); ZIG_DECL void ArrayBufferSink__finalize(void* arg0); BUN_DECLARE_HOST_FUNCTION(ArrayBufferSink__flush); BUN_DECLARE_HOST_FUNCTION(ArrayBufferSink__start); @@ -492,18 +392,18 @@ ZIG_DECL void ArrayBufferSink__updateRef(void* arg0, bool arg1); BUN_DECLARE_HOST_FUNCTION(ArrayBufferSink__write); #endif -CPP_DECL JSC::EncodedJSValue HTTPSResponseSink__assignToStream(JSC::JSGlobalObject* arg0, JSC::EncodedJSValue JSValue1, void* arg2, void** arg3); -CPP_DECL JSC::EncodedJSValue HTTPSResponseSink__createObject(JSC::JSGlobalObject* arg0, void* arg1, uintptr_t destructor); -CPP_DECL void HTTPSResponseSink__detachPtr(JSC::EncodedJSValue JSValue0); -CPP_DECL void HTTPSResponseSink__onClose(JSC::EncodedJSValue JSValue0, JSC::EncodedJSValue JSValue1); -CPP_DECL void HTTPSResponseSink__onReady(JSC::EncodedJSValue JSValue0, JSC::EncodedJSValue JSValue1, JSC::EncodedJSValue JSValue2); +CPP_DECL JSC__EncodedJSValue HTTPSResponseSink__assignToStream(JSC__JSGlobalObject* arg0, JSC__EncodedJSValue JSValue1, void* arg2, void** arg3); +CPP_DECL JSC__EncodedJSValue HTTPSResponseSink__createObject(JSC__JSGlobalObject* arg0, void* arg1, uintptr_t destructor); +CPP_DECL void HTTPSResponseSink__detachPtr(JSC__EncodedJSValue JSValue0); +CPP_DECL void HTTPSResponseSink__onClose(JSC__EncodedJSValue JSValue0, JSC__EncodedJSValue JSValue1); +CPP_DECL void HTTPSResponseSink__onReady(JSC__EncodedJSValue JSValue0, JSC__EncodedJSValue JSValue1, JSC__EncodedJSValue JSValue2); #ifdef __cplusplus -ZIG_DECL JSC::EncodedJSValue HTTPSResponseSink__close(JSC::JSGlobalObject* arg0, void* arg1); +ZIG_DECL JSC__EncodedJSValue HTTPSResponseSink__close(JSC__JSGlobalObject* arg0, void* arg1); BUN_DECLARE_HOST_FUNCTION(HTTPSResponseSink__construct); BUN_DECLARE_HOST_FUNCTION(HTTPSResponseSink__end); -ZIG_DECL JSC::EncodedJSValue SYSV_ABI HTTPSResponseSink__endWithSink(void* arg0, JSC::JSGlobalObject* arg1); +ZIG_DECL JSC__EncodedJSValue SYSV_ABI HTTPSResponseSink__endWithSink(void* arg0, JSC__JSGlobalObject* arg1); ZIG_DECL void HTTPSResponseSink__finalize(void* arg0); BUN_DECLARE_HOST_FUNCTION(HTTPSResponseSink__flush); BUN_DECLARE_HOST_FUNCTION(HTTPSResponseSink__start); @@ -511,18 +411,18 @@ ZIG_DECL void HTTPSResponseSink__updateRef(void* arg0, bool arg1); BUN_DECLARE_HOST_FUNCTION(HTTPSResponseSink__write); #endif -CPP_DECL JSC::EncodedJSValue HTTPResponseSink__assignToStream(JSC::JSGlobalObject* arg0, JSC::EncodedJSValue JSValue1, void* arg2, void** arg3); -CPP_DECL JSC::EncodedJSValue HTTPResponseSink__createObject(JSC::JSGlobalObject* arg0, void* arg1, uintptr_t destructor); -CPP_DECL void HTTPResponseSink__detachPtr(JSC::EncodedJSValue JSValue0); -CPP_DECL void HTTPResponseSink__onClose(JSC::EncodedJSValue JSValue0, JSC::EncodedJSValue JSValue1); -CPP_DECL void HTTPResponseSink__onReady(JSC::EncodedJSValue JSValue0, JSC::EncodedJSValue JSValue1, JSC::EncodedJSValue JSValue2); +CPP_DECL JSC__EncodedJSValue HTTPResponseSink__assignToStream(JSC__JSGlobalObject* arg0, JSC__EncodedJSValue JSValue1, void* arg2, void** arg3); +CPP_DECL JSC__EncodedJSValue HTTPResponseSink__createObject(JSC__JSGlobalObject* arg0, void* arg1, uintptr_t destructor); +CPP_DECL void HTTPResponseSink__detachPtr(JSC__EncodedJSValue JSValue0); +CPP_DECL void HTTPResponseSink__onClose(JSC__EncodedJSValue JSValue0, JSC__EncodedJSValue JSValue1); +CPP_DECL void HTTPResponseSink__onReady(JSC__EncodedJSValue JSValue0, JSC__EncodedJSValue JSValue1, JSC__EncodedJSValue JSValue2); #ifdef __cplusplus -ZIG_DECL JSC::EncodedJSValue HTTPResponseSink__close(JSC::JSGlobalObject* arg0, void* arg1); +ZIG_DECL JSC__EncodedJSValue HTTPResponseSink__close(JSC__JSGlobalObject* arg0, void* arg1); BUN_DECLARE_HOST_FUNCTION(HTTPResponseSink__construct); BUN_DECLARE_HOST_FUNCTION(HTTPResponseSink__end); -ZIG_DECL JSC::EncodedJSValue SYSV_ABI SYSV_ABI HTTPResponseSink__endWithSink(void* arg0, JSC::JSGlobalObject* arg1); +ZIG_DECL JSC__EncodedJSValue SYSV_ABI SYSV_ABI HTTPResponseSink__endWithSink(void* arg0, JSC__JSGlobalObject* arg1); ZIG_DECL void HTTPResponseSink__finalize(void* arg0); BUN_DECLARE_HOST_FUNCTION(HTTPResponseSink__flush); BUN_DECLARE_HOST_FUNCTION(HTTPResponseSink__start); @@ -530,18 +430,18 @@ ZIG_DECL void HTTPResponseSink__updateRef(void* arg0, bool arg1); BUN_DECLARE_HOST_FUNCTION(HTTPResponseSink__write); #endif -CPP_DECL JSC::EncodedJSValue FileSink__assignToStream(JSC::JSGlobalObject* arg0, JSC::EncodedJSValue JSValue1, void* arg2, void** arg3); -CPP_DECL JSC::EncodedJSValue FileSink__createObject(JSC::JSGlobalObject* arg0, void* arg1, uintptr_t destructor); -CPP_DECL void FileSink__detachPtr(JSC::EncodedJSValue JSValue0); -CPP_DECL void FileSink__onClose(JSC::EncodedJSValue JSValue0, JSC::EncodedJSValue JSValue1); -CPP_DECL void FileSink__onReady(JSC::EncodedJSValue JSValue0, JSC::EncodedJSValue JSValue1, JSC::EncodedJSValue JSValue2); +CPP_DECL JSC__EncodedJSValue FileSink__assignToStream(JSC__JSGlobalObject* arg0, JSC__EncodedJSValue JSValue1, void* arg2, void** arg3); +CPP_DECL JSC__EncodedJSValue FileSink__createObject(JSC__JSGlobalObject* arg0, void* arg1, uintptr_t destructor); +CPP_DECL void FileSink__detachPtr(JSC__EncodedJSValue JSValue0); +CPP_DECL void FileSink__onClose(JSC__EncodedJSValue JSValue0, JSC__EncodedJSValue JSValue1); +CPP_DECL void FileSink__onReady(JSC__EncodedJSValue JSValue0, JSC__EncodedJSValue JSValue1, JSC__EncodedJSValue JSValue2); #ifdef __cplusplus -ZIG_DECL JSC::EncodedJSValue FileSink__close(JSC::JSGlobalObject* arg0, void* arg1); +ZIG_DECL JSC__EncodedJSValue FileSink__close(JSC__JSGlobalObject* arg0, void* arg1); BUN_DECLARE_HOST_FUNCTION(FileSink__construct); BUN_DECLARE_HOST_FUNCTION(FileSink__end); -ZIG_DECL JSC::EncodedJSValue SYSV_ABI FileSink__endWithSink(void* arg0, JSC::JSGlobalObject* arg1); +ZIG_DECL JSC__EncodedJSValue SYSV_ABI FileSink__endWithSink(void* arg0, JSC__JSGlobalObject* arg1); ZIG_DECL void FileSink__finalize(void* arg0); BUN_DECLARE_HOST_FUNCTION(FileSink__flush); BUN_DECLARE_HOST_FUNCTION(FileSink__start); @@ -550,18 +450,18 @@ BUN_DECLARE_HOST_FUNCTION(FileSink__write); #endif -CPP_DECL JSC::EncodedJSValue FileSink__assignToStream(JSC::JSGlobalObject* arg0, JSC::EncodedJSValue JSValue1, void* arg2, void** arg3); -CPP_DECL JSC::EncodedJSValue FileSink__createObject(JSC::JSGlobalObject* arg0, void* arg1, uintptr_t destructor); -CPP_DECL void FileSink__detachPtr(JSC::EncodedJSValue JSValue0); -CPP_DECL void FileSink__onClose(JSC::EncodedJSValue JSValue0, JSC::EncodedJSValue JSValue1); -CPP_DECL void FileSink__onReady(JSC::EncodedJSValue JSValue0, JSC::EncodedJSValue JSValue1, JSC::EncodedJSValue JSValue2); +CPP_DECL JSC__EncodedJSValue FileSink__assignToStream(JSC__JSGlobalObject* arg0, JSC__EncodedJSValue JSValue1, void* arg2, void** arg3); +CPP_DECL JSC__EncodedJSValue FileSink__createObject(JSC__JSGlobalObject* arg0, void* arg1, uintptr_t destructor); +CPP_DECL void FileSink__detachPtr(JSC__EncodedJSValue JSValue0); +CPP_DECL void FileSink__onClose(JSC__EncodedJSValue JSValue0, JSC__EncodedJSValue JSValue1); +CPP_DECL void FileSink__onReady(JSC__EncodedJSValue JSValue0, JSC__EncodedJSValue JSValue1, JSC__EncodedJSValue JSValue2); #ifdef __cplusplus -ZIG_DECL JSC::EncodedJSValue FileSink__close(JSC::JSGlobalObject* arg0, void* arg1); +ZIG_DECL JSC__EncodedJSValue FileSink__close(JSC__JSGlobalObject* arg0, void* arg1); BUN_DECLARE_HOST_FUNCTION(FileSink__construct); BUN_DECLARE_HOST_FUNCTION(FileSink__end); -ZIG_DECL JSC::EncodedJSValue SYSV_ABI FileSink__endWithSink(void* arg0, JSC::JSGlobalObject* arg1); +ZIG_DECL JSC__EncodedJSValue SYSV_ABI FileSink__endWithSink(void* arg0, JSC__JSGlobalObject* arg1); ZIG_DECL void FileSink__finalize(void* arg0); BUN_DECLARE_HOST_FUNCTION(FileSink__flush); BUN_DECLARE_HOST_FUNCTION(FileSink__start); @@ -569,19 +469,19 @@ ZIG_DECL void FileSink__updateRef(void* arg0, bool arg1); BUN_DECLARE_HOST_FUNCTION(FileSink__write); #endif -CPP_DECL JSC::EncodedJSValue NetworkSink__assignToStream(JSC::JSGlobalObject* arg0, JSC::EncodedJSValue JSValue1, void* arg2, void** arg3); -CPP_DECL JSC::EncodedJSValue NetworkSink__createObject(JSC::JSGlobalObject* arg0, void* arg1, uintptr_t destructor); -CPP_DECL void NetworkSink__detachPtr(JSC::EncodedJSValue JSValue0); -CPP_DECL void* NetworkSink__fromJS(JSC::EncodedJSValue JSValue1); -CPP_DECL void NetworkSink__onClose(JSC::EncodedJSValue JSValue0, JSC::EncodedJSValue JSValue1); -CPP_DECL void NetworkSink__onReady(JSC::EncodedJSValue JSValue0, JSC::EncodedJSValue JSValue1, JSC::EncodedJSValue JSValue2); +CPP_DECL JSC__EncodedJSValue NetworkSink__assignToStream(JSC__JSGlobalObject* arg0, JSC__EncodedJSValue JSValue1, void* arg2, void** arg3); +CPP_DECL JSC__EncodedJSValue NetworkSink__createObject(JSC__JSGlobalObject* arg0, void* arg1, uintptr_t destructor); +CPP_DECL void NetworkSink__detachPtr(JSC__EncodedJSValue JSValue0); +CPP_DECL void* NetworkSink__fromJS(JSC__EncodedJSValue JSValue1); +CPP_DECL void NetworkSink__onClose(JSC__EncodedJSValue JSValue0, JSC__EncodedJSValue JSValue1); +CPP_DECL void NetworkSink__onReady(JSC__EncodedJSValue JSValue0, JSC__EncodedJSValue JSValue1, JSC__EncodedJSValue JSValue2); #ifdef __cplusplus -ZIG_DECL JSC::EncodedJSValue NetworkSink__close(JSC::JSGlobalObject* arg0, void* arg1); +ZIG_DECL JSC__EncodedJSValue NetworkSink__close(JSC__JSGlobalObject* arg0, void* arg1); BUN_DECLARE_HOST_FUNCTION(NetworkSink__construct); BUN_DECLARE_HOST_FUNCTION(NetworkSink__end); -ZIG_DECL JSC::EncodedJSValue SYSV_ABI SYSV_ABI NetworkSink__endWithSink(void* arg0, JSC::JSGlobalObject* arg1); +ZIG_DECL JSC__EncodedJSValue SYSV_ABI SYSV_ABI NetworkSink__endWithSink(void* arg0, JSC__JSGlobalObject* arg1); ZIG_DECL void NetworkSink__finalize(void* arg0); BUN_DECLARE_HOST_FUNCTION(NetworkSink__flush); BUN_DECLARE_HOST_FUNCTION(NetworkSink__start); @@ -592,16 +492,16 @@ BUN_DECLARE_HOST_FUNCTION(NetworkSink__write); #ifdef __cplusplus ZIG_DECL void Bun__WebSocketHTTPClient__cancel(WebSocketHTTPClient* arg0); -ZIG_DECL WebSocketHTTPClient* Bun__WebSocketHTTPClient__connect(JSC::JSGlobalObject* arg0, void* arg1, CppWebSocket* arg2, const ZigString* arg3, uint16_t arg4, const ZigString* arg5, const ZigString* arg6, ZigString* arg7, ZigString* arg8, size_t arg9); -ZIG_DECL void Bun__WebSocketHTTPClient__register(JSC::JSGlobalObject* arg0, void* arg1, void* arg2); +ZIG_DECL WebSocketHTTPClient* Bun__WebSocketHTTPClient__connect(JSC__JSGlobalObject* arg0, void* arg1, CppWebSocket* arg2, const ZigString* arg3, uint16_t arg4, const ZigString* arg5, const ZigString* arg6, ZigString* arg7, ZigString* arg8, size_t arg9); +ZIG_DECL void Bun__WebSocketHTTPClient__register(JSC__JSGlobalObject* arg0, void* arg1, void* arg2); ZIG_DECL size_t Bun__WebSocketHTTPClient__memoryCost(WebSocketHTTPClient* arg0); #endif #ifdef __cplusplus ZIG_DECL void Bun__WebSocketHTTPSClient__cancel(WebSocketHTTPSClient* arg0); -ZIG_DECL WebSocketHTTPSClient* Bun__WebSocketHTTPSClient__connect(JSC::JSGlobalObject* arg0, void* arg1, CppWebSocket* arg2, const ZigString* arg3, uint16_t arg4, const ZigString* arg5, const ZigString* arg6, ZigString* arg7, ZigString* arg8, size_t arg9); -ZIG_DECL void Bun__WebSocketHTTPSClient__register(JSC::JSGlobalObject* arg0, void* arg1, void* arg2); +ZIG_DECL WebSocketHTTPSClient* Bun__WebSocketHTTPSClient__connect(JSC__JSGlobalObject* arg0, void* arg1, CppWebSocket* arg2, const ZigString* arg3, uint16_t arg4, const ZigString* arg5, const ZigString* arg6, ZigString* arg7, ZigString* arg8, size_t arg9); +ZIG_DECL void Bun__WebSocketHTTPSClient__register(JSC__JSGlobalObject* arg0, void* arg1, void* arg2); ZIG_DECL size_t Bun__WebSocketHTTPSClient__memoryCost(WebSocketHTTPSClient* arg0); #endif @@ -610,8 +510,8 @@ ZIG_DECL size_t Bun__WebSocketHTTPSClient__memoryCost(WebSocketHTTPSClient* arg0 ZIG_DECL void Bun__WebSocketClient__cancel(WebSocketClient* arg0); ZIG_DECL void Bun__WebSocketClient__close(WebSocketClient* arg0, uint16_t arg1, const ZigString* arg2); ZIG_DECL void Bun__WebSocketClient__finalize(WebSocketClient* arg0); -ZIG_DECL void* Bun__WebSocketClient__init(CppWebSocket* arg0, void* arg1, void* arg2, JSC::JSGlobalObject* arg3, unsigned char* arg4, size_t arg5); -ZIG_DECL void Bun__WebSocketClient__register(JSC::JSGlobalObject* arg0, void* arg1, void* arg2); +ZIG_DECL void* Bun__WebSocketClient__init(CppWebSocket* arg0, void* arg1, void* arg2, JSC__JSGlobalObject* arg3, unsigned char* arg4, size_t arg5); +ZIG_DECL void Bun__WebSocketClient__register(JSC__JSGlobalObject* arg0, void* arg1, void* arg2); ZIG_DECL void Bun__WebSocketClient__writeBinaryData(WebSocketClient* arg0, const unsigned char* arg1, size_t arg2, unsigned char arg3); ZIG_DECL void Bun__WebSocketClient__writeString(WebSocketClient* arg0, const ZigString* arg1, unsigned char arg2); ZIG_DECL size_t Bun__WebSocketClient__memoryCost(WebSocketClient* arg0); @@ -623,8 +523,8 @@ ZIG_DECL size_t Bun__WebSocketClient__memoryCost(WebSocketClient* arg0); ZIG_DECL void Bun__WebSocketClientTLS__cancel(WebSocketClientTLS* arg0); ZIG_DECL void Bun__WebSocketClientTLS__close(WebSocketClientTLS* arg0, uint16_t arg1, const ZigString* arg2); ZIG_DECL void Bun__WebSocketClientTLS__finalize(WebSocketClientTLS* arg0); -ZIG_DECL void* Bun__WebSocketClientTLS__init(CppWebSocket* arg0, void* arg1, void* arg2, JSC::JSGlobalObject* arg3, unsigned char* arg4, size_t arg5); -ZIG_DECL void Bun__WebSocketClientTLS__register(JSC::JSGlobalObject* arg0, void* arg1, void* arg2); +ZIG_DECL void* Bun__WebSocketClientTLS__init(CppWebSocket* arg0, void* arg1, void* arg2, JSC__JSGlobalObject* arg3, unsigned char* arg4, size_t arg5); +ZIG_DECL void Bun__WebSocketClientTLS__register(JSC__JSGlobalObject* arg0, void* arg1, void* arg2); ZIG_DECL void Bun__WebSocketClientTLS__writeBinaryData(WebSocketClientTLS* arg0, const unsigned char* arg1, size_t arg2, unsigned char arg3); ZIG_DECL void Bun__WebSocketClientTLS__writeString(WebSocketClientTLS* arg0, const ZigString* arg1, unsigned char arg2); ZIG_DECL size_t Bun__WebSocketClientTLS__memoryCost(WebSocketClientTLS* arg0); @@ -632,37 +532,37 @@ ZIG_DECL size_t Bun__WebSocketClientTLS__memoryCost(WebSocketClientTLS* arg0); #ifdef __cplusplus -ZIG_DECL /*[[noreturn]]*/ void Bun__Process__exit(JSC::JSGlobalObject* arg0, uint8_t arg1); // TODO(@190n) figure out why with a real [[noreturn]] annotation this trips ASan before calling the function -ZIG_DECL JSC::EncodedJSValue Bun__Process__createArgv(JSC::JSGlobalObject* arg0); -ZIG_DECL JSC::EncodedJSValue Bun__Process__createArgv0(JSC::JSGlobalObject* arg0); -ZIG_DECL JSC::EncodedJSValue Bun__Process__getCwd(JSC::JSGlobalObject* arg0); -ZIG_DECL JSC::EncodedJSValue Bun__Process__createExecArgv(JSC::JSGlobalObject* arg0); -ZIG_DECL JSC::EncodedJSValue Bun__Process__getExecPath(JSC::JSGlobalObject* arg0); -ZIG_DECL void Bun__Process__getTitle(JSC::JSGlobalObject* arg0, ZigString* arg1); -ZIG_DECL JSC::EncodedJSValue Bun__Process__setCwd(JSC::JSGlobalObject* arg0, ZigString* arg1); -ZIG_DECL JSC::EncodedJSValue Bun__Process__setTitle(JSC::JSGlobalObject* arg0, ZigString* arg1); +ZIG_DECL /*[[noreturn]]*/ void Bun__Process__exit(JSC__JSGlobalObject* arg0, uint8_t arg1); // TODO(@190n) figure out why with a real [[noreturn]] annotation this trips ASan before calling the function +ZIG_DECL JSC__EncodedJSValue Bun__Process__createArgv(JSC__JSGlobalObject* arg0); +ZIG_DECL JSC__EncodedJSValue Bun__Process__createArgv0(JSC__JSGlobalObject* arg0); +ZIG_DECL JSC__EncodedJSValue Bun__Process__getCwd(JSC__JSGlobalObject* arg0); +ZIG_DECL JSC__EncodedJSValue Bun__Process__createExecArgv(JSC__JSGlobalObject* arg0); +ZIG_DECL JSC__EncodedJSValue Bun__Process__getExecPath(JSC__JSGlobalObject* arg0); +ZIG_DECL void Bun__Process__getTitle(JSC__JSGlobalObject* arg0, ZigString* arg1); +ZIG_DECL JSC__EncodedJSValue Bun__Process__setCwd(JSC__JSGlobalObject* arg0, ZigString* arg1); +ZIG_DECL JSC__EncodedJSValue Bun__Process__setTitle(JSC__JSGlobalObject* arg0, ZigString* arg1); #endif -CPP_DECL ZigException ZigException__fromException(JSC::Exception* arg0); +CPP_DECL ZigException ZigException__fromException(JSC__Exception* arg0); #pragma mark - Bun::ConsoleObject #ifdef __cplusplus -extern "C" SYSV_ABI void Bun__ConsoleObject__count(void* arg0, JSC::JSGlobalObject* arg1, const unsigned char* arg2, size_t arg3); -extern "C" SYSV_ABI void Bun__ConsoleObject__countReset(void* arg0, JSC::JSGlobalObject* arg1, const unsigned char* arg2, size_t arg3); -extern "C" SYSV_ABI void Bun__ConsoleObject__messageWithTypeAndLevel(void* arg0, uint32_t MessageType1, uint32_t MessageLevel2, JSC::JSGlobalObject* arg3, JSC::EncodedJSValue* arg4, size_t arg5); -extern "C" SYSV_ABI void Bun__ConsoleObject__profile(void* arg0, JSC::JSGlobalObject* arg1, const unsigned char* arg2, size_t arg3); -extern "C" SYSV_ABI void Bun__ConsoleObject__profileEnd(void* arg0, JSC::JSGlobalObject* arg1, const unsigned char* arg2, size_t arg3); -extern "C" SYSV_ABI void Bun__ConsoleObject__record(void* arg0, JSC::JSGlobalObject* arg1, ScriptArguments* arg2); -extern "C" SYSV_ABI void Bun__ConsoleObject__recordEnd(void* arg0, JSC::JSGlobalObject* arg1, ScriptArguments* arg2); -extern "C" SYSV_ABI void Bun__ConsoleObject__screenshot(void* arg0, JSC::JSGlobalObject* arg1, ScriptArguments* arg2); -extern "C" SYSV_ABI void Bun__ConsoleObject__takeHeapSnapshot(void* arg0, JSC::JSGlobalObject* arg1, const unsigned char* arg2, size_t arg3); -extern "C" SYSV_ABI void Bun__ConsoleObject__time(void* arg0, JSC::JSGlobalObject* arg1, const unsigned char* arg2, size_t arg3); -extern "C" SYSV_ABI void Bun__ConsoleObject__timeEnd(void* arg0, JSC::JSGlobalObject* arg1, const unsigned char* arg2, size_t arg3); -extern "C" SYSV_ABI void Bun__ConsoleObject__timeLog(void* arg0, JSC::JSGlobalObject* arg1, const unsigned char* arg2, size_t arg3, JSC::EncodedJSValue* arg4, size_t arg5); -extern "C" SYSV_ABI void Bun__ConsoleObject__timeStamp(void* arg0, JSC::JSGlobalObject* arg1, ScriptArguments* arg2); +ZIG_DECL SYSV_ABI void Bun__ConsoleObject__count(void* arg0, JSC__JSGlobalObject* arg1, const unsigned char* arg2, size_t arg3); +ZIG_DECL SYSV_ABI void Bun__ConsoleObject__countReset(void* arg0, JSC__JSGlobalObject* arg1, const unsigned char* arg2, size_t arg3); +ZIG_DECL SYSV_ABI void Bun__ConsoleObject__messageWithTypeAndLevel(void* arg0, uint32_t MessageType1, uint32_t MessageLevel2, JSC__JSGlobalObject* arg3, JSC__EncodedJSValue* arg4, size_t arg5); +ZIG_DECL SYSV_ABI void Bun__ConsoleObject__profile(void* arg0, JSC__JSGlobalObject* arg1, const unsigned char* arg2, size_t arg3); +ZIG_DECL SYSV_ABI void Bun__ConsoleObject__profileEnd(void* arg0, JSC__JSGlobalObject* arg1, const unsigned char* arg2, size_t arg3); +ZIG_DECL SYSV_ABI void Bun__ConsoleObject__record(void* arg0, JSC__JSGlobalObject* arg1, ScriptArguments* arg2); +ZIG_DECL SYSV_ABI void Bun__ConsoleObject__recordEnd(void* arg0, JSC__JSGlobalObject* arg1, ScriptArguments* arg2); +ZIG_DECL SYSV_ABI void Bun__ConsoleObject__screenshot(void* arg0, JSC__JSGlobalObject* arg1, ScriptArguments* arg2); +ZIG_DECL SYSV_ABI void Bun__ConsoleObject__takeHeapSnapshot(void* arg0, JSC__JSGlobalObject* arg1, const unsigned char* arg2, size_t arg3); +ZIG_DECL SYSV_ABI void Bun__ConsoleObject__time(void* arg0, JSC__JSGlobalObject* arg1, const unsigned char* arg2, size_t arg3); +ZIG_DECL SYSV_ABI void Bun__ConsoleObject__timeEnd(void* arg0, JSC__JSGlobalObject* arg1, const unsigned char* arg2, size_t arg3); +ZIG_DECL SYSV_ABI void Bun__ConsoleObject__timeLog(void* arg0, JSC__JSGlobalObject* arg1, const unsigned char* arg2, size_t arg3, JSC__EncodedJSValue* arg4, size_t arg5); +ZIG_DECL SYSV_ABI void Bun__ConsoleObject__timeStamp(void* arg0, JSC__JSGlobalObject* arg1, ScriptArguments* arg2); #endif @@ -671,14 +571,14 @@ extern "C" SYSV_ABI void Bun__ConsoleObject__timeStamp(void* arg0, JSC::JSGlobal #ifdef __cplusplus -ZIG_DECL JSC::EncodedJSValue Bun__Timer__clearImmediate(JSC::JSGlobalObject* arg0, JSC::EncodedJSValue JSValue1); -ZIG_DECL JSC::EncodedJSValue Bun__Timer__clearInterval(JSC::JSGlobalObject* arg0, JSC::EncodedJSValue JSValue1); -ZIG_DECL JSC::EncodedJSValue Bun__Timer__clearTimeout(JSC::JSGlobalObject* arg0, JSC::EncodedJSValue JSValue1); +ZIG_DECL JSC__EncodedJSValue Bun__Timer__clearImmediate(JSC__JSGlobalObject* arg0, JSC__EncodedJSValue JSValue1); +ZIG_DECL JSC__EncodedJSValue Bun__Timer__clearInterval(JSC__JSGlobalObject* arg0, JSC__EncodedJSValue JSValue1); +ZIG_DECL JSC__EncodedJSValue Bun__Timer__clearTimeout(JSC__JSGlobalObject* arg0, JSC__EncodedJSValue JSValue1); ZIG_DECL int32_t Bun__Timer__getNextID(); -ZIG_DECL JSC::EncodedJSValue Bun__Timer__setInterval(JSC::JSGlobalObject* globalThis, JSC::EncodedJSValue callback, JSC::EncodedJSValue arguments, JSC::EncodedJSValue countdown); -ZIG_DECL JSC::EncodedJSValue Bun__Timer__setTimeout(JSC::JSGlobalObject* globalThis, JSC::EncodedJSValue callback, JSC::EncodedJSValue arguments, JSC::EncodedJSValue countdown); -ZIG_DECL JSC::EncodedJSValue Bun__Timer__sleep(JSC::JSGlobalObject* globalThis, JSC::EncodedJSValue promise, JSC::EncodedJSValue countdown); -ZIG_DECL JSC::EncodedJSValue Bun__Timer__setImmediate(JSC::JSGlobalObject* globalThis, JSC::EncodedJSValue callback, JSC::EncodedJSValue arguments); +ZIG_DECL JSC__EncodedJSValue Bun__Timer__setInterval(JSC__JSGlobalObject* globalThis, JSC__EncodedJSValue callback, JSC__EncodedJSValue arguments, JSC__EncodedJSValue countdown); +ZIG_DECL JSC__EncodedJSValue Bun__Timer__setTimeout(JSC__JSGlobalObject* globalThis, JSC__EncodedJSValue callback, JSC__EncodedJSValue arguments, JSC__EncodedJSValue countdown); +ZIG_DECL JSC__EncodedJSValue Bun__Timer__sleep(JSC__JSGlobalObject* globalThis, JSC__EncodedJSValue promise, JSC__EncodedJSValue countdown); +ZIG_DECL JSC__EncodedJSValue Bun__Timer__setImmediate(JSC__JSGlobalObject* globalThis, JSC__EncodedJSValue callback, JSC__EncodedJSValue arguments); #endif @@ -747,11 +647,11 @@ BUN_DECLARE_HOST_FUNCTION(Bun__TestScope__onResolve); #ifdef __cplusplus -CPP_DECL bool JSC__GetterSetter__isGetterNull(JSC::GetterSetter *arg); -CPP_DECL bool JSC__GetterSetter__isSetterNull(JSC::GetterSetter *arg); +CPP_DECL bool JSC__GetterSetter__isGetterNull(JSC__GetterSetter* arg); +CPP_DECL bool JSC__GetterSetter__isSetterNull(JSC__GetterSetter* arg); -CPP_DECL bool JSC__CustomGetterSetter__isGetterNull(JSC::CustomGetterSetter *arg); -CPP_DECL bool JSC__CustomGetterSetter__isSetterNull(JSC::CustomGetterSetter *arg); +CPP_DECL bool JSC__CustomGetterSetter__isGetterNull(JSC__CustomGetterSetter* arg); +CPP_DECL bool JSC__CustomGetterSetter__isSetterNull(JSC__CustomGetterSetter* arg); #endif diff --git a/src/bun.js/jsc/host_fn.zig b/src/bun.js/jsc/host_fn.zig index 2ef4f032e4..fa61f788a0 100644 --- a/src/bun.js/jsc/host_fn.zig +++ b/src/bun.js/jsc/host_fn.zig @@ -469,9 +469,6 @@ pub fn DOMCall( return jsc.toJSHostValue(globalObject, @field(Container, functionName)(globalObject, thisValue, arguments_ptr[0..arguments_len])); } - pub const fastpath = @field(Container, functionName ++ "WithoutTypeChecks"); - pub const Fastpath = @TypeOf(fastpath); - pub const Arguments = std.meta.ArgsTuple(Fastpath); const PutFnType = *const fn (globalObject: *jsc.JSGlobalObject, value: jsc.JSValue) callconv(.c) void; const put_fn = @extern(PutFnType, .{ .name = className ++ "__" ++ functionName ++ "__put" }); @@ -483,7 +480,6 @@ pub fn DOMCall( comptime { @export(&slowpath, .{ .name = className ++ "__" ++ functionName ++ "__slowpath" }); - @export(&fastpath, .{ .name = className ++ "__" ++ functionName ++ "__fastpath" }); } }; } diff --git a/src/bun.js/webcore/Crypto.zig b/src/bun.js/webcore/Crypto.zig index 6c1ecf311e..fb11b905da 100644 --- a/src/bun.js/webcore/Crypto.zig +++ b/src/bun.js/webcore/Crypto.zig @@ -27,23 +27,6 @@ pub fn timingSafeEqual(_: *@This(), global: *JSC.JSGlobalObject, callframe: *JSC return JSC.Node.crypto.timingSafeEqual(global, callframe); } -pub fn timingSafeEqualWithoutTypeChecks( - _: *@This(), - globalThis: *JSC.JSGlobalObject, - array_a: *JSC.JSUint8Array, - array_b: *JSC.JSUint8Array, -) JSC.JSValue { - const a = array_a.slice(); - const b = array_b.slice(); - - const len = a.len; - if (b.len != len) { - return globalThis.ERR(.CRYPTO_TIMING_SAFE_EQUAL_LENGTH, "Input buffers must have the same byte length", .{}).throw(); - } - - return JSC.jsBoolean(bun.BoringSSL.c.CRYPTO_memcmp(a.ptr, b.ptr, len) == 0); -} - pub fn getRandomValues( _: *@This(), globalThis: *JSC.JSGlobalObject, @@ -64,16 +47,6 @@ pub fn getRandomValues( return arguments[0]; } -pub fn getRandomValuesWithoutTypeChecks( - _: *@This(), - globalThis: *JSC.JSGlobalObject, - array: *JSC.JSUint8Array, -) JSC.JSValue { - const slice = array.slice(); - randomData(globalThis, slice.ptr, slice.len); - return @as(JSC.JSValue, @enumFromInt(@as(i64, @bitCast(@intFromPtr(array))))); -} - fn randomData( globalThis: *JSC.JSGlobalObject, ptr: [*]u8, @@ -162,21 +135,6 @@ pub fn Bun__randomUUIDv7_(globalThis: *JSC.JSGlobalObject, callframe: *JSC.CallF return encoding.encodeWithMaxSize(globalThis, 32, &uuid.bytes); } -pub fn randomUUIDWithoutTypeChecks( - _: *Crypto, - globalThis: *JSC.JSGlobalObject, -) JSC.JSValue { - const str, var bytes = bun.String.createUninitialized(.latin1, 36); - defer str.deref(); - - // randomUUID must have been called already many times before this kicks - // in so we can skip the rare_data pointer check. - const uuid = globalThis.bunVM().rare_data.?.nextUUID(); - - uuid.print(bytes[0..36]); - return str.toJS(globalThis); -} - pub fn constructor(globalThis: *JSC.JSGlobalObject, _: *JSC.CallFrame) bun.JSError!*Crypto { return JSC.Error.ILLEGAL_CONSTRUCTOR.throw(globalThis, "Crypto is not constructable", .{}); } diff --git a/src/bun.js/webcore/TextDecoder.zig b/src/bun.js/webcore/TextDecoder.zig index 516a034aa5..f03fe37b08 100644 --- a/src/bun.js/webcore/TextDecoder.zig +++ b/src/bun.js/webcore/TextDecoder.zig @@ -187,10 +187,6 @@ pub fn decode(this: *TextDecoder, globalThis: *JSC.JSGlobalObject, callframe: *J }; } -pub fn decodeWithoutTypeChecks(this: *TextDecoder, globalThis: *JSC.JSGlobalObject, uint8array: *JSC.JSUint8Array) bun.JSError!JSValue { - return this.decodeSlice(globalThis, uint8array.slice(), false); -} - fn decodeSlice(this: *TextDecoder, globalThis: *JSC.JSGlobalObject, buffer_slice: []const u8, comptime flush: bool) bun.JSError!JSValue { switch (this.encoding) { EncodingLabel.latin1 => { diff --git a/src/bun.js/webcore/TextEncoderStreamEncoder.zig b/src/bun.js/webcore/TextEncoderStreamEncoder.zig index 12b7ee79eb..6b2ca65b65 100644 --- a/src/bun.js/webcore/TextEncoderStreamEncoder.zig +++ b/src/bun.js/webcore/TextEncoderStreamEncoder.zig @@ -32,16 +32,6 @@ pub fn encode(this: *TextEncoderStreamEncoder, globalObject: *JSC.JSGlobalObject return this.encodeLatin1(globalObject, str.slice()); } -pub fn encodeWithoutTypeChecks(this: *TextEncoderStreamEncoder, globalObject: *JSC.JSGlobalObject, input: *JSC.JSString) JSValue { - const str = input.getZigString(globalObject); - - if (str.is16Bit()) { - return this.encodeUTF16(globalObject, str.utf16SliceAligned()); - } - - return this.encodeLatin1(globalObject, str.slice()); -} - fn encodeLatin1(this: *TextEncoderStreamEncoder, globalObject: *JSGlobalObject, input: []const u8) JSValue { log("encodeLatin1: \"{s}\"", .{input}); @@ -185,10 +175,6 @@ pub fn flush(this: *TextEncoderStreamEncoder, globalObject: *JSGlobalObject, _: return flushBody(this, globalObject); } -pub fn flushWithoutTypeChecks(this: *TextEncoderStreamEncoder, globalObject: *JSGlobalObject) JSValue { - return flushBody(this, globalObject); -} - fn flushBody(this: *TextEncoderStreamEncoder, globalObject: *JSGlobalObject) JSValue { return if (this.pending_lead_surrogate == null) JSUint8Array.createEmpty(globalObject) diff --git a/src/bun.js/webcore/encoding.classes.ts b/src/bun.js/webcore/encoding.classes.ts index b26078ccc1..155868ee06 100644 --- a/src/bun.js/webcore/encoding.classes.ts +++ b/src/bun.js/webcore/encoding.classes.ts @@ -23,11 +23,6 @@ export default [ decode: { fn: "decode", length: 1, - - DOMJIT: { - returns: "JSString", - args: ["JSUint8Array"], - }, }, }, }), @@ -42,20 +37,10 @@ export default [ encode: { fn: "encode", length: 1, - - DOMJIT: { - returns: "JSUint8Array", - args: ["JSString"], - }, }, flush: { fn: "flush", length: 0, - - DOMJIT: { - returns: "JSUint8Array", - args: [], - }, }, }, }), diff --git a/src/c-headers-for-zig.h b/src/c-headers-for-zig.h index 90e2998161..22b9dddf32 100644 --- a/src/c-headers-for-zig.h +++ b/src/c-headers-for-zig.h @@ -69,3 +69,5 @@ #undef lstat #undef fstat #undef stat + +#include "bun.js/bindings/headers.h" diff --git a/src/codegen/generate-classes.ts b/src/codegen/generate-classes.ts index 5c74f9a981..255fe15e73 100644 --- a/src/codegen/generate-classes.ts +++ b/src/codegen/generate-classes.ts @@ -54,10 +54,6 @@ function constructorName(typeName) { return `JS${typeName}Constructor`; } -function DOMJITName(fnName) { - return `${fnName}WithoutTypeChecks`; -} - function argTypeName(arg) { return { ["bool"]: "bool", @@ -68,116 +64,12 @@ function argTypeName(arg) { }[arg]; } -function DOMJITType(type) { - return { - ["bool"]: "JSC::SpecBoolean", - ["int"]: "JSC::SpecInt32Only", - ["JSUint8Array"]: "JSC::SpecUint8Array", - ["JSString"]: "JSC::SpecString", - ["JSValue"]: "JSC::SpecHeapTop", - }[type]; -} - -function ZigDOMJITArgType(type) { - return { - ["bool"]: "bool", - ["int"]: "i32", - ["JSUint8Array"]: "*jsc.JSUint8Array", - ["JSString"]: "*jsc.JSString", - ["JSValue"]: "jsc.JSValue", - }[type]; -} - -function ZigDOMJITArgTypeDefinition(type, index) { - return `arg${index}: ${ZigDOMJITArgType(type)}`; -} - -function ZigDOMJITFunctionType(thisName, { args, returns }) { - return `fn (*${thisName}, *jsc.JSGlobalObject, ${args - .map(ZigDOMJITArgType) - .join(", ")}) callconv(jsc.conv) ${ZigDOMJITArgType("JSValue")}`; -} - -function DOMJITReturnType(type) { - return { - ["bool"]: "bool", - ["int"]: "int32_t", - ["JSUint8Array"]: "JSC::JSUint8Array*", - ["JSString"]: "JSString*", - ["JSValue"]: "EncodedJSValue", - }[type]; -} - -function DOMJITFunctionDeclaration(jsClassName, fnName, symName, { args, returns, pure = false }) { - const argNames = args.map((arg, i) => `${argTypeName(arg)} arg${i}`); - const formattedArgs = argNames.length > 0 ? `, ${argNames.join(", ")}` : ""; - const domJITArgs = args.length > 0 ? `, ${args.map(DOMJITType).join(", ")}` : ""; - externs += ` -extern JSC_CALLCONV JSC::EncodedJSValue JSC_HOST_CALL_ATTRIBUTES ${DOMJITName(symName)}(void* ptr, JSC::JSGlobalObject * lexicalGlobalObject${formattedArgs}); - `; - - return ( - ` -extern JSC_CALLCONV JSC_DECLARE_JIT_OPERATION_WITHOUT_WTF_INTERNAL(${DOMJITName( - fnName, - )}Wrapper, JSC::EncodedJSValue, (JSC::JSGlobalObject * lexicalGlobalObject, void* thisValue${formattedArgs})); -static const JSC::DOMJIT::Signature DOMJITSignatureFor${fnName}(${DOMJITName(fnName)}Wrapper, - ${jsClassName}::info(), - ${ - pure - ? "JSC::DOMJIT::Effect::forPure()" - : "JSC::DOMJIT::Effect::forReadWrite(JSC::DOMJIT::HeapRange::top(), JSC::DOMJIT::HeapRange::top())" - }, - ${returns === "JSString" ? "JSC::SpecString" : DOMJITType("JSValue")}${domJITArgs}); -`.trim() + "\n" - ); -} - -function DOMJITFunctionDefinition(jsClassName, fnName, symName, { args }, fn) { - const argNames = args.map((arg, i) => `${argTypeName(arg)} arg${i}`); - const formattedArgs = argNames.length > 0 ? `, ${argNames.join(", ")}` : ""; - const retArgs = argNames.length > 0 ? `, ${args.map((b, i) => "arg" + i).join(", ")}` : ""; - - return ` -JSC_DEFINE_JIT_OPERATION(${DOMJITName( - fnName, - )}Wrapper, JSC::EncodedJSValue, (JSC::JSGlobalObject * lexicalGlobalObject, void* thisValue${formattedArgs})) -{ - auto& vm = JSC::getVM(lexicalGlobalObject); - IGNORE_WARNINGS_BEGIN("frame-address") - CallFrame* callFrame = DECLARE_CALL_FRAME(vm); - IGNORE_WARNINGS_END - JSC::JITOperationPrologueCallFrameTracer tracer(vm, callFrame); -#if BUN_DEBUG - ${jsClassName}* wrapper = reinterpret_cast<${jsClassName}*>(thisValue); - JSC::EncodedJSValue result = ${DOMJITName(symName)}(wrapper->wrapped(), lexicalGlobalObject${retArgs}); - JSValue decoded = JSValue::decode(result); - if (wrapper->m_${fn}_expectedResultType) { - if (decoded.isCell() && !decoded.isEmpty()) { - ASSERT_WITH_MESSAGE(wrapper->m_${fn}_expectedResultType.value().has_value(), "DOMJIT function return type changed!"); - ASSERT_WITH_MESSAGE(wrapper->m_${fn}_expectedResultType.value().value() == decoded.asCell()->type(), "DOMJIT function return type changed!"); - } else { - ASSERT_WITH_MESSAGE(!wrapper->m_${fn}_expectedResultType.value().has_value(), "DOMJIT function return type changed!"); - } - } else if (!decoded.isEmpty()) { - wrapper->m_${fn}_expectedResultType = decoded.isCell() - ? std::optional(decoded.asCell()->type()) - : std::optional(std::nullopt); - } - return { result }; -#endif - return {${DOMJITName(symName)}(reinterpret_cast<${jsClassName}*>(thisValue)->wrapped(), lexicalGlobalObject${retArgs})}; -} -`.trim(); -} - function zigExportName(to: Map, symbolName: (name: string) => string, prop) { - var { defaultValue, getter, setter, accessor, fn, DOMJIT, cache } = prop; + var { defaultValue, getter, setter, accessor, fn, cache } = prop; const exportNames = { getter: "", setter: "", fn: "", - DOMJIT: "", }; if (accessor) { @@ -194,9 +86,6 @@ function zigExportName(to: Map, symbolName: (name: string) => st } if (fn && !to.get(fn)) { - if (DOMJIT) { - to.set(DOMJITName(fn), (exportNames.DOMJIT = symbolName(DOMJITName(fn)))); - } to.set(fn, (exportNames.fn = symbolName(fn))); } @@ -220,7 +109,6 @@ function propRow( fn, length = 0, cache, - DOMJIT, enumerable = true, configurable = false, value, @@ -274,12 +162,6 @@ function propRow( } } } `.trim(); } else if (fn !== undefined) { - if (DOMJIT) { - // { "getElementById"_s, static_cast(JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DOMJITFunction), NoIntrinsic, { HashTableValue::DOMJITFunctionType, jsTestDOMJITPrototypeFunction_getElementById, &DOMJITSignatureForTestDOMJITGetElementById } }, - return ` - { "${name}"_s, static_cast(JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DOMJITFunction${extraPropertyAttributes}), NoIntrinsic, { HashTableValue::DOMJITFunctionType, ${fn}, &DOMJITSignatureFor${symbol} } } - `.trim(); - } return ` { "${name}"_s, static_cast(JSC::PropertyAttribute::Function${extraPropertyAttributes}), NoIntrinsic, { HashTableValue::NativeFunctionType, ${fn}, ${ length || 0 @@ -912,24 +794,6 @@ function renderDecls(symbolName, typeName, proto, supportsObjectCreate = false) `.trim(), "\n", ); - - if (proto[name].DOMJIT) { - rows.push( - DOMJITFunctionDeclaration( - className(typeName), - symbolName(typeName, name), - symbolName(typeName, proto[name].fn), - proto[name].DOMJIT, - ), - DOMJITFunctionDefinition( - className(typeName), - symbolName(typeName, name), - symbolName(typeName, proto[name].fn), - proto[name].DOMJIT, - proto[name].fn, - ), - ); - } } } @@ -1201,25 +1065,6 @@ JSC_DEFINE_HOST_FUNCTION(${symbolName(typeName, name)}Callback, (JSGlobalObject ASSERT_WITH_MESSAGE(!JSValue::decode(result).isEmpty() or DECLARE_CATCH_SCOPE(vm).exception() != 0, \"${typeName}.${proto[name].fn} returned an empty value without an exception\"); - ${ - !proto[name].DOMJIT - ? "" - : ` - JSValue decoded = JSValue::decode(result); - if (thisObject->m_${fn}_expectedResultType) { - if (decoded.isCell() && !decoded.isEmpty()) { - ASSERT_WITH_MESSAGE(thisObject->m_${fn}_expectedResultType.value().has_value(), "DOMJIT function return type changed!"); - ASSERT_WITH_MESSAGE(thisObject->m_${fn}_expectedResultType.value().value() == decoded.asCell()->type(), "DOMJIT function return type changed!"); - } else { - ASSERT_WITH_MESSAGE(!thisObject->m_${fn}_expectedResultType.value().has_value(), "DOMJIT function return type changed!"); - } - } else if (!decoded.isEmpty()) { - thisObject->m_${fn}_expectedResultType = decoded.isCell() - ? std::optional(decoded.asCell()->type()) - : std::optional(std::nullopt); - }` - } - return result; #endif @@ -1398,8 +1243,6 @@ function generateClassHeader(typeName, obj: ClassDefinition) { }) .join("\n")} - ${domJITTypeCheckFields(proto, klass)} - ${weakOwner} ${DECLARE_VISIT_CHILDREN} @@ -1411,23 +1254,6 @@ function generateClassHeader(typeName, obj: ClassDefinition) { `.trim(); } -function domJITTypeCheckFields(proto, klass) { - var output = "#if BUN_DEBUG\n"; - for (const name in proto) { - const { DOMJIT, fn } = proto[name]; - if (!DOMJIT) continue; - output += `std::optional> m_${fn}_expectedResultType = std::nullopt;\n`; - } - - for (const name in klass) { - const { DOMJIT, fn } = klass[name]; - if (!DOMJIT) continue; - output += `std::optional> m_${fn}_expectedResultType = std::nullopt;\n`; - } - output += "#endif\n"; - return output; -} - function generateClassImpl(typeName, obj: ClassDefinition) { const { klass: fields, @@ -1945,7 +1771,7 @@ const JavaScriptCoreBindings = struct { { const exportNames = name => zigExportName(exports, name => protoSymbolName(typeName, name), proto[name]); for (const name in proto) { - const { getter, setter, accessor, fn, this: thisValue = false, cache, DOMJIT } = proto[name]; + const { getter, setter, accessor, fn, this: thisValue = false, cache } = proto[name]; const names = exportNames(name); if (names.getter) { output += ` @@ -1983,17 +1809,6 @@ const JavaScriptCoreBindings = struct { } if (names.fn) { - if (names.DOMJIT) { - const { args, returns } = DOMJIT; - output += ` - pub fn ${names.DOMJIT}(thisValue: *${typeName}, globalObject: *jsc.JSGlobalObject, ${args - .map(ZigDOMJITArgTypeDefinition) - .join(", ")}) callconv(jsc.conv) jsc.JSValue { - return @call(bun.callmod_inline, ${typeName}.${DOMJITName(fn)}, .{thisValue, globalObject, ${args.map((_, i) => `arg${i}`).join(", ")}}); - } - `; - } - output += ` pub fn ${names.fn}(thisValue: *${typeName}, globalObject: *jsc.JSGlobalObject, callFrame: *jsc.CallFrame${proto[name].passThis ? ", js_this_value: jsc.JSValue" : ""}) callconv(jsc.conv) jsc.JSValue { if (comptime Environment.enable_logs) log_zig_method("${typeName}", "${name}", callFrame); @@ -2007,7 +1822,7 @@ const JavaScriptCoreBindings = struct { { const exportNames = name => zigExportName(exports, name => classSymbolName(typeName, name), klass[name]); for (const name in klass) { - const { getter, setter, accessor, fn, this: thisValue = true, cache, DOMJIT } = klass[name]; + const { getter, setter, accessor, fn, this: thisValue = true, cache } = klass[name]; const names = exportNames(name); if (names.getter) { output += ` @@ -2035,19 +1850,6 @@ const JavaScriptCoreBindings = struct { } if (names.fn) { - if (DOMJIT) { - const { args, returns } = DOMJIT; - - output += ` - pub fn ${names.DOMJIT}(globalObject: *jsc.JSGlobalObject, thisValue: jsc.JSValue, ${args - .map(ZigDOMJITArgTypeDefinition) - .join(", ")}) callconv(jsc.conv) jsc.JSValue { - if (comptime Environment.enable_logs) log_zig_class_domjit("${typeName}", "${name}"); - return @call(.always_inline, ${typeName}.${DOMJITName(fn)}, .{thisValue, globalObject, ${args.map((_, i) => `arg${i}`).join(", ")}}); - } - `; - } - output += ` pub fn ${names.fn}(globalObject: *jsc.JSGlobalObject, callFrame: *jsc.CallFrame) callconv(jsc.conv) jsc.JSValue { if (comptime Environment.enable_logs) log_zig_class_method("${typeName}", "${name}", callFrame); @@ -2277,11 +2079,6 @@ const GENERATED_CLASSES_IMPL_HEADER_PRE = ` #include #include -#include -#include "DOMJITIDLConvert.h" -#include "DOMJITIDLType.h" -#include "DOMJITIDLTypeFilter.h" -#include "DOMJITHelpers.h" #include #include "JSDOMConvertBufferSource.h" diff --git a/src/codegen/process_windows_translate_c.zig b/src/codegen/process_translate_c.zig similarity index 68% rename from src/codegen/process_windows_translate_c.zig rename to src/codegen/process_translate_c.zig index 8bbfd5cf57..aa5be7cc55 100644 --- a/src/codegen/process_windows_translate_c.zig +++ b/src/codegen/process_translate_c.zig @@ -1,12 +1,19 @@ -// translate-c is unable to translate the unsuffixed windows functions -// like `SetCurrentDirectory` since they are defined with an odd macro -// that translate-c doesn't handle. -// -// #define SetCurrentDirectory __MINGW_NAME_AW(SetCurrentDirectory) -// -// In these cases, it's better to just reference the underlying function -// directly: SetCurrentDirectoryW. To make the error better, a post -// processing step is applied to the translate-c file. +//! translate-c is unable to translate the unsuffixed windows functions +//! like `SetCurrentDirectory` since they are defined with an odd macro +//! that translate-c doesn't handle. +//! +//! #define SetCurrentDirectory __MINGW_NAME_AW(SetCurrentDirectory) +//! +//! In these cases, it's better to just reference the underlying function +//! directly: SetCurrentDirectoryW. To make the error better, a post +//! processing step is applied to the translate-c file. +//! +//! Additionally, this step makes it so that decls like NTSTATUS and +//! HANDLE point to the standard library structures. +//! +//! We also use this to replace some `opaque` declarations generated by +//! translate-c with their equivalents defined in our own Zig code, +//! since our definitions have useful declarations on them. const std = @import("std"); const mem = std.mem; @@ -14,6 +21,10 @@ const symbol_replacements = std.StaticStringMap([]const u8).initComptime(&.{ &.{ "NTSTATUS", "@import(\"std\").os.windows.NTSTATUS" }, &.{ "HANDLE", "@import(\"std\").os.windows.HANDLE" }, &.{ "PHANDLE", "*HANDLE" }, + &.{ "JSC__JSGlobalObject", "@import(\"bun\").jsc.JSGlobalObject" }, + &.{ "JSC__JSObject", "@import(\"bun\").jsc.JSObject" }, + &.{ "JSC__EncodedJSValue", "@import(\"bun\").jsc.JSValue" }, + &.{ "ZigString", "@import(\"bun\").jsc.ZigString" }, }); pub fn main() !void {