diff options
author | 2023-10-16 21:22:43 -0700 | |
---|---|---|
committer | 2023-10-16 21:22:43 -0700 | |
commit | 98d19fa6244384f7e17998b5420d724481ed3835 (patch) | |
tree | 3061ccab41196daf4194ecc385961b121f2ec06d /src/bun.js/event_loop.zig | |
parent | a3958190e8f106adca7fbf4ba2605056cb22aced (diff) | |
download | bun-98d19fa6244384f7e17998b5420d724481ed3835.tar.gz bun-98d19fa6244384f7e17998b5420d724481ed3835.tar.zst bun-98d19fa6244384f7e17998b5420d724481ed3835.zip |
fix(runtime): make some things more stable (partial jsc debug build) (#5881)
* make our debug assertions work
* install bun-webkit-debug
* more progress
* ok
* progress...
* more debug build stuff
* ok
* a
* asdfghjkl
* fix(runtime): fix bad assertion failure in JSBufferList
* ok
* stuff
* upgrade webkit
* Update src/bun.js/bindings/JSDOMWrapperCache.h
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
* fix message for colin's changes
* okay
* fix cjs prototype
* implement mainModule
* i think this fixes it all
---------
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Diffstat (limited to 'src/bun.js/event_loop.zig')
-rw-r--r-- | src/bun.js/event_loop.zig | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/bun.js/event_loop.zig b/src/bun.js/event_loop.zig index 8bc6a771e..c41b05e15 100644 --- a/src/bun.js/event_loop.zig +++ b/src/bun.js/event_loop.zig @@ -118,6 +118,7 @@ pub fn WorkTask(comptime Context: type, comptime async_io: bool) type { } pub fn runFromThreadPool(task: *TaskType) void { + JSC.markBinding(@src()); var this = @fieldParentPtr(This, "task", task); Context.run(this.ctx, this); } @@ -405,7 +406,7 @@ pub const Task = TaggedPointerUnion(.{ }); const UnboundedQueue = @import("./unbounded_queue.zig").UnboundedQueue; pub const ConcurrentTask = struct { - task: Task = undefined, + task: if (JSC.is_bindgen) void else Task = undefined, next: ?*ConcurrentTask = null, auto_delete: bool = false, @@ -426,14 +427,19 @@ pub const ConcurrentTask = struct { } pub fn createFrom(task: anytype) *ConcurrentTask { + JSC.markBinding(@src()); return create(Task.init(task)); } pub fn fromCallback(ptr: anytype, comptime callback: anytype) *ConcurrentTask { + JSC.markBinding(@src()); + return create(ManagedTask.New(std.meta.Child(@TypeOf(ptr)), callback).init(ptr)); } pub fn from(this: *ConcurrentTask, of: anytype, auto_deinit: AutoDeinit) *ConcurrentTask { + JSC.markBinding(@src()); + this.* = .{ .task = Task.init(of), .next = null, @@ -601,7 +607,7 @@ comptime { pub const DeferredRepeatingTask = *const (fn (*anyopaque) bool); pub const EventLoop = struct { - tasks: Queue = undefined, + tasks: if (JSC.is_bindgen) void else Queue = undefined, concurrent_tasks: ConcurrentTask.Queue = ConcurrentTask.Queue{}, global: *JSGlobalObject = undefined, virtual_machine: *JSC.VirtualMachine = undefined, @@ -925,6 +931,7 @@ pub const EventLoop = struct { } pub fn tickConcurrentWithCount(this: *EventLoop) usize { + JSC.markBinding(@src()); var concurrent = this.concurrent_tasks.popBatch(); const count = concurrent.count; if (count == 0) @@ -1067,6 +1074,8 @@ pub const EventLoop = struct { } pub fn tick(this: *EventLoop) void { + JSC.markBinding(@src()); + var ctx = this.virtual_machine; this.tickConcurrent(); @@ -1136,6 +1145,7 @@ pub const EventLoop = struct { } pub fn enqueueTask(this: *EventLoop, task: Task) void { + JSC.markBinding(@src()); this.tasks.writeItem(task) catch unreachable; } |