Asmjit - JIT asm compiler (for C++)

Robert Fraser fraserofthenight at gmail.com
Tue Feb 3 01:25:25 PST 2009


Bill Baxter wrote:
> On Tue, Feb 3, 2009 at 5:24 PM, Robert Fraser
> <fraserofthenight at gmail.com> wrote:
>> Bill Baxter wrote:
>>> Don't know if this is of interest to anyone here, but I've seen this
>>> on another mailing list recently:
>>> http://code.google.com/p/asmjit/
>>>
>>> C++ library to jit-compile assembly functions.
>>> It uses function syntax to do it's think like "a.push(ebp);"
>>> That's pretty cool already, but I was thinking with D you could just
>>> write the assembly function directly as a string mixin.  Or really
>>> (even in C++ ) you could just parse the darn assembly function at
>>> runtime.   But then you don't find out about your coding errors till
>>> runtime.  With compile time parsing you get to keep the compile time
>>> check to make sure the asm instructions are at least typo-free.
>>>
>>> Also kind of relevant to the other thread here about compiling
>>> different versions of the same function for different target
>>> processors.
>>>
>>> --bb
>> Semi on-topic, does anyone know of a a JIT assembler for D (or a good one
>> for C it wouldn't take too long to make a header for?.... Of course,
>> DMD+Windows has linking issues)
> 
> Maybe TCC fits the bill for the C?  http://bellard.org/tcc/
> """
> With libtcc, you can use TCC as a backend for dynamic code generation.
> """
> 
> --bb

Cool, thanks for the link. That looks good, but it is a complete 
compiler, so might be sort of slow. Is there anything more 
lightweight/designed for JITs that works on x86+Windows? There's libjit, 
but that's Unix only AFAICT. Thanks.



More information about the Digitalmars-d mailing list