[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: LuaJIT FFI callbacks for functions using only built-in operators and locals
- From: Adam Strzelecki <ono@...>
- Date: Thu, 15 Dec 2011 19:35:42 +0100
Just asking whether it would be technically possible, to generate code for simple functions without all marshaling (VM barriers) that happens on caller code and Lua callback code?
I.e. "function (x) x+1 end" that is mapped into "int (*addone)(int v)", this function is using only built addition in operator.
Having that such function use only built-in operators, locals and single types across whole body, could it be optimized straight ahead into machine code? This could be some benefit to some math packages that can take callback function as argument, calling it a lot.
Probably if it is possible, anyway that wouldn't be trivial task.