Try using reportAbandonedObjectGraph a lot

This commit is contained in:
Jarred Sumner
2025-04-13 11:29:49 -07:00
parent 9db14f5db5
commit 284048648b
3 changed files with 14 additions and 2 deletions

View File

@@ -36,6 +36,12 @@ pub const VM = opaque {
JSC__VM__holdAPILock(this, ctx, callback);
}
pub fn reportAbandonedObjectGraph(vm: *VM) void {
JSC__VM__reportAbandonedObjectGraph(vm);
}
extern fn JSC__VM__reportAbandonedObjectGraph(vm: *VM) void;
extern fn JSC__VM__getAPILock(vm: *VM) void;
extern fn JSC__VM__releaseAPILock(vm: *VM) void;

View File

@@ -6187,6 +6187,11 @@ CPP_DECL void JSC__VM__setControlFlowProfiler(JSC__VM* vm, bool isEnabled)
}
}
extern "C" void JSC__VM__reportAbandonedObjectGraph(JSC__VM* vm)
{
vm->heap.reportAbandonedObjectGraph();
}
CPP_DECL void JSC__VM__performOpportunisticallyScheduledTasks(JSC__VM* vm, double until)
{
vm->performOpportunisticallyScheduledTasks(MonotonicTime::now() + Seconds(until), {});

View File

@@ -1348,7 +1348,6 @@ pub const EventLoop = struct {
}
}
this.processGCTimer();
this.processGCTimer();
loop.tick();
@@ -1393,7 +1392,9 @@ pub const EventLoop = struct {
ctx.onAfterEventLoop();
}
pub fn processGCTimer(_: *EventLoop) void {}
pub fn processGCTimer(this: *EventLoop) void {
this.virtual_machine.jsc.reportAbandonedObjectGraph();
}
pub fn tick(this: *EventLoop) void {
JSC.markBinding(@src());