<div dir="ltr"><div>1. Behaviour discrepancy between loops run with interpreter and JIT. See attachment (NewJITtest-0.0.1).</div><div>2. Bug with arrays as arguments. See attachment (NewJITtest-0.0.2).</div><div><br></div><div>I bet you will get a lot more, when the rest of the features are implemented. I have talent for this...</div><div><br></div><div><br></div><div>Jussi<br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jun 13, 2018 at 2:38 AM, Benoît Minisini <span dir="ltr"><<a href="mailto:g4mba5@gmail.com" target="_blank">g4mba5@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I have just merged the 'jit-with-c' branch to 'master'.<br>
<br>
The JIT compiler is not finished, but is advanced enough to run all the fast methods of the IDE, the gb.form.editor and the gb.form.terminal components. The benchmarks run too.<br>
<br>
Many features are still not implemented:<br>
<br>
- Functions with variable number of arguments.<br>
- Structures.<br>
- Static arrays.<br>
- ON GOTO and ON GOSUB.<br>
- Error management.<br>
- BYREF.<br>
- Extern functions.<br>
- WITH ... END WITH.<br>
<br>
And many implemented features are not tested.<br>
<br>
And many optimizations could be done too, especially in properties and methods calls, that are mostly run by the interpreter at the moment.<br>
<br>
The performance gain is about the same as the old JIT compiler. Often a bit slower, sometimes unexpectedly faster. The biggest gains are when dealing with loops, integers and native arrays. On the other side, you won't gain anything with string routines, the 'string' benchmark even being a bit slower!<br>
<br>
Note that the JIT compiler is not a compiler, but a Gambas to C translator, about 3,000 lines of code, whose result is preprocessed, compiled and linked by the gcc compiler at runtime.<br>
<br>
To disable the JIT compiler, set the environment variable GB_NO_JIT to 1. To have some debugging messages, set GB_JIT_DEBUG to 1.<br>
<br>
Otherwise, I fixed the thousand separator management in the Format() function, and optimized the string search routine used by InStr(), RInstr() and Replace(). The "string" benchmark now runs 4 times faster.<br>
<br>
Apart from the previous limitations, you can start to play with it, to help me test the following:<br>
<br>
- Does it work with 32 bits x86?<br>
- Does it work with ARM?<br>
- Does it work with clang?<br>
- ...<br>
<br>
Enjoy it!<span class="HOEnZb"><font color="#888888"><br>
<br>
-- <br>
Benoît Minisini<br>
<br>
----[ Gambas mailing-list is hosted by <a href="https://www.hostsharing.net" rel="noreferrer" target="_blank">https://www.hostsharing.net</a> ]----<br>
</font></span></blockquote></div><br></div>