3 ms·
No, I don't think Lua (or the author) is inlining the external function. What's being JIT'd is the Lua code into machine code, and where Lua would need to call
by deathanatos 5y ago
No, I don't think Lua (or the author) is inlining the external function.
What's being JIT'd is the Lua code into machine code, and where Lua would need to call a C function, it (apparently) is just emitting a `call the_external_fn` into the JIT's resulting assembly. That's a direct function call, so it's about as fast as you're going to get, but somewhat counter-intuitively, it'll be faster than C, as we don't do anything with the PLT or indirection. Just call the function.