Alan Wu
Alan Wu
We could give each code page their `frozen_bytes`. By the way, I think there is a problem with global invalidation and `frozen_bytes` and GC compaction. We don't patch after freezing,...
> Why not just mark individual blocks as invalidated with a bit flag though? I think the problem is sometimes we do patching for branches and with blocks and branches...
Yeah I think this make sense. I feel confident relying on `__bp__` since the interpreter checks it in `leave`. https://github.com/ruby/ruby/blob/5534698b84c1ef1567ebb1e2d79fbe1a2a573a77/insns.def#L902 We shouldn't need to change `__bp__` cause it's supposed to...
`BP == SP` on entry to a frame, so no calculation needed there. The interpreter is checking that when leaving, SP is the same as it were on entry to...
At the moment, when a we [invalidate a block][invalidate-block-version], we don't immediately reset the code belonging to the block to `int3`. If we tried to do it, we would run...
> Maybe turn their branch_t pointer to NULL and have the stubs return after they get the lock. I'm not sure what you mean by this. Can you go into...
I think with branches/blocks referencing the code page instead of the iseq, we could throw away most of the code correctly by doing a full GC run. > If this...
There is a public C API `TypedData_Make_Struct()` that lets us make objects with custom mark, free, and compaction callbacks. We use it for our dependency table: https://github.com/Shopify/yjit/blob/cdc3115db07874e16bb4e7dbc75a7320cec23a2f/yjit_iface.c#L1053 https://github.com/Shopify/yjit/blob/cdc3115db07874e16bb4e7dbc75a7320cec23a2f/yjit_iface.c#L319-L323
In discussions this week, we identified two challenges with code GC. 1. Invalidated blocks need special handling to be reachable by the GC. In situations where a method invalidates its...
> is there a GC callback to do that? Also note that this would only work for a full GC run. We couldn't collect code pages in a minor GC....