|
|
|
|
|
by pansa2
2120 days ago
|
|
> How would a trace-based JIT be easier to implement? When compiling at method-granularity, with incomplete information about types, complex features are required e.g. On-Stack Replacement (if the current method becomes "hot", it needs to be replaced by a compiled version), Inline Caches, Hidden Classes and Deoptimization. In a trace-based JIT, all these features can be replaced by "just compile another trace". |
|
LuaJIT does without hidden classes or property caching because on-trace it's able to eliminate table access and allocation. Performance tanks on OO Lua once you fall off trace. You can work around it with "compile another trace" in a sense that works as long as you have infinite cache.