JIT compiler crashes

Started by
6 comments, last by ruphert 11 years ago

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

KAG DEVLOG: http://kagdev.tumblr.com/
Advertisement

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?

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Visual Studio 2010. It compiles fine, just crashes at run-time

KAG DEVLOG: http://kagdev.tumblr.com/

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.

The thing is, it's a heap corruption so it happens at random locations. I'll try to track down the line or function though...

KAG DEVLOG: http://kagdev.tumblr.com/

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?
KAG DEVLOG: http://kagdev.tumblr.com/

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.

Thanks, sent you a PM.

KAG DEVLOG: http://kagdev.tumblr.com/

This topic is closed to new replies.

Advertisement