[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A Working (but Minimal) JIT

From: Andy Wingo
Subject: Re: A Working (but Minimal) JIT
Date: Mon, 29 Nov 2010 22:25:19 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)

On Sun 28 Nov 2010 21:56, Noah Lavine <address@hidden> writes:

> I've been poking around in the code, and noticed that procs.c has a
> reference to "applicable structs".

They aren't as efficient as they could be. Currently applicable structs
are the only nonuniform case in procedure calls -- I was trying to get
procedure calls to have no conditional branches, and they (and
applicable smobs) are the only odd cases.

I prefer the trampoline approach used by primitives, continuations,
foreign functions, etc -- they are normal procedures, whose code is a
stub that does the type-specific dispatch.

This is also (and even more the case) what you want for native
procedures -- a native procedure call should just be a jmp and arg
shuffle. Objects which don't have native implementations should have a
stub that does the right thing.

> I don't see how to get from C code to JIT code without pushing onto
> the stack without either some assembly code or a trampoline.

Well, that's what a jit library is for, no? :) Presumably it knows the
calling convention for C, so it should know how to do a tail call from C
-- implemented in assembly of course.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]