[DGD] llvm/jit

Kris Van Hees aedil at alchar.org
Thu Feb 21 05:30:13 CET 2013


You may want to look at Kaffe, a clean-room JVM implementation with JIT
support.  It has been a few years since I looked at the source code, but
back then it had a fairly nice and cleanly written JIT implementation
that could serve as a good example of how it can be done.

Bear in mind though that the most useful (and also most complex) part of
a JIT implementation is not in the actual code generation and code calling
mechanism, but rather in the decision making process on what code fragments
are worth compiling into machine code vs what is best left interpreted.

	Cheers,
	Kris

On Wed, Feb 20, 2013 at 08:21:07PM -0800, Raymond Jennings wrote:
> On Wed, Feb 20, 2013 at 7:30 PM, Jared Maddox <absinthdraco at gmail.com> wrote:
> >> Date: Wed, 20 Feb 2013 01:31:19 -0800
> >> From: Raymond Jennings <shentino at gmail.com>
> >> To: All about DGD and Hydra <dgd at dworkin.nl>
> >> Subject: Re: [DGD] llvm/jit
> >> Message-ID:
> >>       <CAGDaZ_qRibrd0FjfFAmH7=6iPdqWZGTq7AeLmYBr2qgcGz+1GQ at mail.gmail.com>
> >> Content-Type: text/plain; charset=UTF-8
> >>
> >> So basically you take the address where you've stored the machine
> >> code, stuff it in a function pointer, and call it that way?
> >>
> > Yes. Have you tried the TCC compiler? It has a library version that
> > does something similar to what you might be looking for.
> 
> I've never even heard of it.
> 
> > Speaking of which, what exactly are you trying to do? Add LPC to LLVM,
> > or allow LLVM to target DGD's VM? I vaguely remember a topic ;like
> > this coming up before, but it was a while ago, so...
> 
> The first thing I'm trying to do is learn and successfully implement
> JIT period, because I am a complete and total n00b at it.
> 
> Th second thing is to add JIT to DGD.
> 
> The second thing depends on the first.
> 
> As far as LLVM, I think it may have been related to jit, but I
> probably just got the terninology completely hashed.
> 
> Bear in mind I am a n00b in this area.

-- 
dr. Kris Van Hees
<aedil at alchar.org>



More information about the DGD mailing list