After reaching initial stages of the x86-64 JIT, work on a long overdue enhancement of the DWScript engine has started: refactoring how dynamic arrays are implemented.
One of the goals when the 32bit JIT was introduced was to edge out the Delphi 32bits compiler, which was not too complicated as Delphi was using the FPU, so merely using SSE2 at the time was enough. But the Delphi 64bits compiler makes good use of SSE2, so the only way to edge it out would be to leverage AVX2 and vectorisation.
With the new year, work finally started on getting a Windows 64bit Just-In-Time compiler up and running for DWScript.
The repository on Bitbucket and the mirror on GitHub both already hold first working elements. At the moment unit tests are passing, though with effective JIT for only a smaller subset of features than for the 32 bit JIT.
Here is a summary of DWScript changes since the last update.
Language enhancement are centered around several additions for enumeration elements and sets, as well as a standard Map() method for arrays. The JIT compiler also got more capable, and there were various improvements to the support libraries and compatibility with older (D2009) and newer (DXE3) Delphi versions.
For a couple months now, a JIT compiler has been available in the DWScript SVN for 32bits code. The JIT is meant to be transparent, that is, execution, debugging facilities and memory layouts are similar under JIT and interpretation, the only difference is the performance.
The JIT also uses a hybrid architecture, which was designed to allow developing the JIT incrementally, which directly derives from my only working on it a few hours at a time, every once in a while.
Very experimental support for LLVM in DWScript is now in the googlecode repository, thanks to the efforts of Christian-W Budde.
This is the beginning of the opening of new realms of possibilities for DWS!
LLVM support is currently centered around jit compilation, and at the moment doesn’t extend much beyond the needs of the Mandelbrot demo (see below for what is supported right now).
For a few weeks now, an experimental JIT compiler has been available in the DWScript SVN for 32bits code. A more detailed article into the hows and whats and WTFs will come later.
Consider this article as an extended teaser, and a sort of call for test cases, benchmarks and eyeballs on the source code.
This is a belated news update, with only the highlights: