[DGD] llvm/jit

Kris Van Hees aedil at alchar.org
Tue Feb 19 15:22:59 CET 2013


On Tue, Feb 19, 2013 at 06:10:22AM -0800, Raymond Jennings wrote:
> Anyone out there making more progress on this than I am?
> 
> My efforts at JIT so far amount to splicing together snippets of raw
> machine code and using computed gotos to run things.  It usually ends
> up with a segfault.

JIT usually involves a little bit more, to ensure that the snippets of code
actually work together well...  A good first step is often to provide an
implementation for some common used instruction sequences and replace those
with the machine code equivalents.  So in essence, you end up doing a partial
evaluation of the interpreted code.  The main thing to keep in mind is that
is it easiest to implement the machine code fragments as callable functions,
so you can ensure that you can depend on calling conventions from C to
machien code.

> What's the basic way to have JIT in a C environment?

I am not sure what you mean by this?  Obviously, C is (almost always) a
compiled language and thus JIT isn't relevant.

	Cheers,
	Kris

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



More information about the DGD mailing list