lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Joe Finn wrote:
> A virtual call can NOT be inlined, or at least not completely, because later
> it's possible that some new definitions will make this inlining incorrect.

All calls are virtual in Lua. LuaJIT will happily inline them.
JVM Hotspot is able to inline virtual calls for Java, too. The
techniques for this are widely known since more than 25 years (*).
Maybe the key insight you're missing is that it's rather easy
for JIT compilers to back off from their decisions.

(*) Efficient implementation of the smalltalk-80 system,
    Peter L. Deutsch, Allan M. Schiffman, SIGPLAN, 1984

--Mike