Improve heuristics around discarding JIT code
Categories
(Core :: JavaScript: GC, enhancement, P3)
Tracking
()
People
(Reporter: jonco, Assigned: mgaudet)
References
(Depends on 1 open bug, Blocks 2 open bugs)
Details
(Whiteboard: [sp3])
Currently we have a bunch of heuristics about when to throw away JIT code (see GCRuntime::shouldPreserveJITCode) but this ultimately operates at the granularity of a zone. So either all JIT code in a zone is preserved or it's all thrown away. This has the problem that we can both throw away JIT code too eagerly causing performance issues, and we can throw it away too lazily causing increased memory use and GC time.
One approach is to track which JIT code has been executed since some previous point in time. This could be implemented using trampolines to set a flag the next time a piece of JIT code is executed. This could give us much better information about what we can throw away.
Comment 1•6 months ago
|
||
Trampoline are a good idea, but they only report which function is being called directly not which function might be called from any other JIT-ed function.
Similarly, monitoring functions which are calling into the VM would be one way, but they might hide some functions which are not relying on any VM calls, such as tiny functions or function using self-hosted code only.
I think the trampoline idea would be interesting if combined with an approximation of the call graph. In which case we could "protect" the closure of the call-graph when the JIT preserve mode is enabled.
Updated•6 months ago
|
Updated•6 months ago
|
Assignee | ||
Updated•3 hours ago
|
Description
•