Hi, after playing around with [LuaJIT's v module](https://github.com/LuaJIT/LuaJIT/blob/master/src/jit/v.lua) without success, I found this thread to be the closest to what I need.
What I'm seeking is a code static analyzing process that tells me where I've coded *too fancily* to hinder JIT compilation, which serves something like a linter. Reading through this thread I also realized that I lack quite a bit of knowledge in JIT process. I sincerely seek your kind advice in the following questions:
1. Apart from taking flame chart in load test, can my Openresty lua code be statically analyzed of JIT compilation failures;
2. If one portion of my code doesn't JIT compile, esp. if I use some closure constructs result in FNEW or UCLO, would JIT compilation fail for all the following functions (with lua_code_cache opened);
3. Given limited resources online regarding LuaJIT details, is there any systematic documentation other than the source code itself that I can refer to, for deeper understanding of the JIT compilation process of LuaJIT
Thanks in advanced :)
On Saturday, 13 August 2016 16:08:43 UTC+8, Aapo Talvensaari wrote:
On Friday, 12 August 2016 21:31:53 UTC+3, Victor wrote:
You're right. I was just curious how those "class" meta methods work :-)
Yes, metamethods is a great concept. For new comers it might be a bit difficult to understand at first. The key thing to understanding it, is that metamethods does not have any meaning _unless_ they are used in metatables (aka setmetatable(({}, { ... table containing metatamethods ... }). And for __index metamethod you can either use a a table (aka fallback table) or a user defined function.
Great to have new people in OpenResty scene! Happy hacking! :-)