Skip to content
This repository has been archived by the owner on Dec 23, 2019. It is now read-only.

GM13 LuaJIT support #132

Open
ColonelThirtyTwo opened this issue Oct 14, 2012 · 5 comments
Open

GM13 LuaJIT support #132

ColonelThirtyTwo opened this issue Oct 14, 2012 · 5 comments
Assignees

Comments

@ColonelThirtyTwo
Copy link
Member

GM13 is getting LuaJIT

There are a couple of incompatibilities with the debug features. 1) SF code can't be compiled due to debug hook issues, and 2) we'd have to scrap the coroutine solution because coroutines no longer get their own debug hooks.

@Elemecca
Copy link
Member

Using jit.off() does not fix the coroutine issue; debug hooks are global in the LuaJIT VM regardless of whether JIT compilation is enabled and that is unlikely to change. I'll look into the compilation issues with JIT on now.

@ghost ghost assigned Elemecca Aug 27, 2013
@ColonelThirtyTwo
Copy link
Member Author

That's not why the JIT is being turned off. It's being turned off because the debug hook isn't called at all in JIT-compiled code.

@Elemecca
Copy link
Member

It looks like you're right; see for example this thread. Apparently a debug hook being called will prevent JIT compilation, so it probably wouldn't negatively affect us. At the very least we should disable JIT locally to SF script functions instead of globally. I'll look into what's actually happening in more depth.

@ColonelThirtyTwo
Copy link
Member Author

You would have to turn off JIT for every function that could be called (directly or indirectly) from SF code. jit.off(func) operates on the function itself then recurses to the functions the passed func defined (not the functions called).

(However, with all the people reporting slowdowns with the JIT turned on, it might not be worth it. I mailed Mike Pall about this: http://www.freelists.org/post/luajit/When-to-turn-off-JIT,5 )

@ColonelThirtyTwo
Copy link
Member Author

Also, I'd like to point out that with the massive amounts of C functions being called in gmod, most traces can't be compiled anyway.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants