Sign in to follow this  
ruphert

JIT compiler crashes

Recommended Posts

I'm having trouble running the JIT compiler -> https://github.com/BlindMindStudios/AngelScript-JIT-Compiler

 

I tried running it with the angelscript version that was last supported by the JIT compiler. I set it up as in the provided example and I finalize pages after script compiles.

 

It gives either a buffer overrun or heap corruption error on the very first script it does. Showing the code is kind of pointless cause its long and convoluted. If anyone is interested in helping me with this I can provide the source code. But I wonder if I am maybe doing something wrong.

 

The crashes happen in random location in the jit files:

like this http://grab.by/kYPw

 

I tried running the JIT with some compatibility stuff like this:

 jit = new asCJITCompiler(JIT_NO_SCRIPT_CALLS | JIT_NO_SUSPEND | JIT_NO_SWITCHES); 

 

but it also crashes in a different place:

http://grab.by/kYPo

Share this post


Link to post
Share on other sites

As far I know there haven't been any changes in AngelScript's VM that would break the JIT since the last update that Blind Mind Studios did to it. 

 

The JIT compiler requires C++0x feature support according to the readme. One would think it would be compatible with C++11 too, but it's difficult to know for sure.

 

What C++ compiler are you using using? 

Share this post


Link to post
Share on other sites

It is important to know the script code that crashes the JIT, as that is the only way to reliably identify the crash. It may be possible to identify the problem on our end with only the line of script that crashes the JIT.

Share this post


Link to post
Share on other sites

I made a smaller case and found the issue. The JIT compiler doesn't work with virtual functions. Whenever there was a virtual function binding in my engine it crashed with a heap corruption after that. ThyReaper did you know about this?

 

 

I made some benchmarks after I made it work and they were quite disheartening. Running with the JIT compiler is actually SLOWER than without it. Did anyone do benchmarks of their own with JIT on/off?

Share this post


Link to post
Share on other sites

Virtual functions are supported, and we have both an existing game and an active project that use virtual functions bound to the JIT. Could you provide an example of the function that is causing the issue, and the way you bound it to AngelScript?

 

As for performance, unless you are regularly calling functions that can't be directly JIT'd (we fallback to AngelScript's calling system), there should be at least a doubling of performance. Again, it would be helpful to have examples to go off of to see why you might be getting poor performance. Without scripts or code, I can only guess at what is wrong.

Edited by ThyReaper

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this