Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#25 JIT via lightning

closed-accepted
Sam Steingold
None
5
2013-11-28
2008-01-27
Yann N. Dauphin
No

Still incomplete JIT compiler for CLISP.

The jit compilation occurs at every function call(no reuse), so it runs slower for now.

Lightning is used because:
- It's portable. Can reportedly be ported under a day.
- It's simple. If the GNU lightning project was to stop, it wouldn't be a problem. Maintaining it is easy. Not so for LLVM.
- It's lean and mean. Code generation is straightforward, so very fast.

Tested on x86 with:

- Linux
- Mac OS X: Must 'export DYLD_BIND_AT_LAUNCH=' for now because the dynamic linker messes with jit function calls

The patch is too big for SF so:
http://www.step.polymtl.ca/~polyrad/polyrad/jit-clisp-2.43.patch

Discussion

1 2 3 .. 5 > >> (Page 1 of 5)
  • Sam Steingold
    Sam Steingold
    2008-01-28

    Logged In: YES
    user_id=5735
    Originator: NO

    the patch is too big because it includes some binary files (.DS_Store) and the full sources for lightning.
    please assume that lightning is installed on the developer's machine.
    please include only the eval.d and jit.h, NOT lightning sources
    please do NOT use "//" comments

     
  • Sam Steingold
    Sam Steingold
    2008-01-28

    Logged In: YES
    user_id=5735
    Originator: NO

    it would be nice if you could elaborate on advantages of lightning over libjit http://freshmeat.net/projects/libjit/

     
  • Logged In: YES
    user_id=1993164
    Originator: YES

    jit-clisp-cvs-20080131.patch.gz:

    This new patch includes the clean ups from Reini and will work against a clean checkout from CVS.
    Please install the latest version of GNU lightning(at least 1.2b):
    http://git.savannah.gnu.org/gitweb/?p=lightning.git;a=snapshot;h=master

    It includes:
    - Modifying make file to add jit.d with jit.h as one of it's depedencies
    - Assuming GNU Lightning is installed
    - lispbibl sets USE_JIT if I80386 is set and registers are saved if !USE_JIT
    - Replacing all // comments with /**/ and tabs with spaces
    - Removed vestigial c source and jit_begin/end
    - Random cleanups

    News tests have been added to 'make check'. CLISP runs out of memory on one of the last ones, 'ctak'.
    This is because using longjmp can cause the memory of codeBuffer to leak. This is of course resolved by reusing the jit function.

    libjit vs lightning coming up.
    File Added: jit-clisp-cvs-20080131.patch.gz

     
  • Adds JIT Compiler to a clean CLISP dist from CVS

     
  • Sam Steingold
    Sam Steingold
    2008-02-04

    Logged In: YES
    user_id=5735
    Originator: NO

    thanks - I committed your patch.
    do codeBuffer & bcIndex have to be in constant memory (as in malloc) as opposed to lisp heap (movable by GC)?

     
  • Logged In: YES
    user_id=1993164
    Originator: YES

    codeBuffer and bcIndex have to be kept in constant memory because the operands of jump instructions in the JITed code are absolute positions.
    As a side-note, I do plan to remove the need to permanently store bcIndex. But that's not high priority.

    Thanks

     
  • Sam Steingold
    Sam Steingold
    2008-02-04

    • assigned_to: nobody --> haible
     
1 2 3 .. 5 > >> (Page 1 of 5)