diff --git a/src/bun.js/node/node_perf_hooks_histogram_binding.zig b/src/bun.js/node/node_perf_hooks_histogram_binding.zig index fd2e86d9b4..d301c7c9ea 100644 --- a/src/bun.js/node/node_perf_hooks_histogram_binding.zig +++ b/src/bun.js/node/node_perf_hooks_histogram_binding.zig @@ -14,38 +14,38 @@ pub const RecordableHistogram = struct { delta_start: ?bun.timespec = null, const This = @This(); - const PropertyGetter = fn (this: *This, globalThis: *JSC.JSGlobalObject) callconv(.C) JSC.JSValue; + const PropertyGetter = fn (this: *This, globalThis: *JSC.JSGlobalObject) JSC.JSValue; - pub fn min(this: *This, globalThis: *JSC.JSGlobalObject) callconv(.C) JSValue { + pub fn min(this: *This, globalThis: *JSC.JSGlobalObject) JSValue { return globalThis.toJS(this.hdrHist.min, .temporary); } pub const minBigInt = getterAsFn(min); - pub fn max(this: *This, globalThis: *JSC.JSGlobalObject) callconv(.C) JSValue { + pub fn max(this: *This, globalThis: *JSC.JSGlobalObject) JSValue { return globalThis.toJS(this.hdrHist.max, .temporary); } pub const maxBigInt = getterAsFn(max); - pub fn count(this: *This, globalThis: *JSC.JSGlobalObject) callconv(.C) JSValue { + pub fn count(this: *This, globalThis: *JSC.JSGlobalObject) JSValue { return globalThis.toJS(this.hdrHist.total_count, .temporary); } pub const countBigInt = getterAsFn(count); - pub fn mean(this: *This, globalThis: *JSC.JSGlobalObject) callconv(.C) JSValue { + pub fn mean(this: *This, globalThis: *JSC.JSGlobalObject) JSValue { if (this.hdrHist.mean()) |m| { return globalThis.toJS(m, .temporary); } return globalThis.toJS(std.math.nan(f64), .temporary); } - pub fn stddev(this: *This, globalThis: *JSC.JSGlobalObject) callconv(.C) JSValue { + pub fn stddev(this: *This, globalThis: *JSC.JSGlobalObject) JSValue { if (this.hdrHist.stddev()) |sd| { return globalThis.toJS(sd, .temporary); } return globalThis.toJS(std.math.nan(f64), .temporary); } - pub fn percentile(this: *This, globalThis: *JSC.JSGlobalObject, callframe: *JSC.CallFrame) callconv(.C) JSValue { + pub fn percentile(this: *This, globalThis: *JSC.JSGlobalObject, callframe: *JSC.CallFrame) callconv(JSC.conv) JSValue { const args = callframe.arguments(1).slice(); if (args.len < 1) { globalThis.throwInvalidArguments("Expected query percent as argument", .{}); @@ -60,7 +60,7 @@ pub const RecordableHistogram = struct { } pub const percentileBigInt = percentile; - pub fn percentiles(this: *This, globalObject: *JSC.JSGlobalObject) callconv(.C) JSValue { + pub fn percentiles(this: *This, globalObject: *JSC.JSGlobalObject) JSValue { // 2 arrays with percent and value // make a cpp version of this file, extern C function. accepts array, length, creates search JSMap:: (search) @@ -99,7 +99,7 @@ pub const RecordableHistogram = struct { // additional functions // record duration in nanoseconds - pub fn record(this: *This, globalThis: *JSC.JSGlobalObject, callframe: *JSC.CallFrame) callconv(.C) JSValue { + pub fn record(this: *This, globalThis: *JSC.JSGlobalObject, callframe: *JSC.CallFrame) callconv(JSC.conv) JSValue { const args = callframe.arguments(1).slice(); if (args.len < 1) { globalThis.throwInvalidArguments("Expected the value to record as an argument", .{}); @@ -111,7 +111,7 @@ pub const RecordableHistogram = struct { } // record time since last call to recordDelta - pub fn recordDelta(this: *This, _: *JSC.JSGlobalObject, _: *JSC.CallFrame) callconv(.C) JSValue { + pub fn recordDelta(this: *This, _: *JSC.JSGlobalObject, _: *JSC.CallFrame) callconv(JSC.conv) JSValue { if (this.delta_start) |start| { const end = bun.timespec.now(); const diff = end.duration(&start); @@ -126,14 +126,14 @@ pub const RecordableHistogram = struct { return .undefined; } - pub fn reset(this: *This, globalThis: *JSC.JSGlobalObject, callframe: *JSC.CallFrame) callconv(.C) JSValue { + pub fn reset(this: *This, globalThis: *JSC.JSGlobalObject, callframe: *JSC.CallFrame) callconv(JSC.conv) JSValue { _ = globalThis; _ = callframe; this.hdrHist.reset(); return .undefined; } - pub fn add(this: *This, globalThis: *JSC.JSGlobalObject, callframe: *JSC.CallFrame) callconv(.C) JSValue { + pub fn add(this: *This, globalThis: *JSC.JSGlobalObject, callframe: *JSC.CallFrame) callconv(JSC.conv) JSValue { const args = callframe.arguments(1).slice(); if (args.len < 1) { globalThis.throwInvalidArguments("Expected other histogram to add as an argument", .{}); @@ -156,13 +156,13 @@ pub const RecordableHistogram = struct { fn getterAsFn(callback: fn ( this: *This, globalThis: *JSC.JSGlobalObject, - ) callconv(.C) JSValue) fn ( + ) JSValue) fn ( this: *This, globalThis: *JSC.JSGlobalObject, _: *JSC.CallFrame, - ) callconv(.C) JSValue { + ) callconv(JSC.conv) JSValue { const outer = struct { - pub fn inner(this: *This, globalThis: *JSC.JSGlobalObject, _: *JSC.CallFrame) callconv(.C) JSValue { + pub fn inner(this: *This, globalThis: *JSC.JSGlobalObject, _: *JSC.CallFrame) callconv(JSC.conv) JSValue { // we don't need the callframe, so we can just call the callback return callback(this, globalThis); } @@ -172,13 +172,13 @@ pub const RecordableHistogram = struct { // since we create this with bun.new, we need to have it be destroyable // our node.classes.ts has finalize=true to generate the call to finalize - pub fn finalize(this: *This) callconv(.C) void { + pub fn finalize(this: *This) callconv(JSC.conv) void { this.hdrHist.deinit(); bun.destroy(this); } }; -fn createHistogram(globalThis: *JSC.JSGlobalObject, _: *JSC.CallFrame) callconv(.C) JSC.JSValue { +fn createHistogram(globalThis: *JSC.JSGlobalObject, _: *JSC.CallFrame) callconv(JSC.conv) JSC.JSValue { const hdrHist = HDRHistogram.init(bun.default_allocator, .{}) catch |err| { globalThis.throwError(err, "failed to initialize histogram"); return .zero; @@ -187,7 +187,7 @@ fn createHistogram(globalThis: *JSC.JSGlobalObject, _: *JSC.CallFrame) callconv( return histogram.toJS(globalThis); } -pub fn createPerfHooksHistogramBinding(global: *JSC.JSGlobalObject) callconv(.C) JSC.JSValue { +pub fn createPerfHooksHistogramBinding(global: *JSC.JSGlobalObject) callconv(JSC.conv) JSC.JSValue { return JSC.JSFunction.create( global, "createHistogram",