-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AOT support #228
Comments
All code is PIC except branches / calls.
You can allocate a stack area for local data for every function. You need to manage your variables manually there (hence the sljit name comes). See the last argument of |
So I actually can use the stack (without heap) but have to manage its usage manually? |
Yes. |
This guy seems to have made a stackful version of the project |
It seems the author added alloca support, but still no local management. Btw building a higher level generic compiler based on sljit is possible. It can manage locals. E.g. the WebAssembly compilers based on sljit do this. |
Back to the topic of AOT, I have an idea. A serialize/de-serialize interface could save/restore the internal representation of the compiler. The loaded code could be compiled with generate code. This is not as fast as loading PIC, but the compiler can optimize branches, and still much faster than a full compilation. |
I have added serialization to the code: Since this is a new feature, there might be bugs in the code. With this interface the majority of the compilation can be skipped without giving up performance. |
Is that also backward/forward compatible? I might consider saving the AOT results and cache to local filesystem (similar to GAC) |
It has a version number, so you can detect if your cache is not valid anymore, and can recompile the code: |
I wonder if we can use the emitted code statically, so we can save the JIT code into an object file for caching (for example). This means the codegen should not emit any position-dependent code (I think it should be PIC by default) and do not reference any runtime-dependent address as well. Is it possible for SLJIT to do this?
(Out of context but as a query) Far as I can see the stackless in SLJIT means there aren't any push/pop operation directly on the stack pointer, and you have to maintain an external stack created on a heap right? How does that translate in terms of assembly?
The text was updated successfully, but these errors were encountered: