lightning
[Top][All Lists]
Advanced

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

Re: [Lightning] Re: Copying generated functions


From: Sandro Magi
Subject: Re: [Lightning] Re: Copying generated functions
Date: Sun, 9 Mar 2008 13:06:49 -0400

On Sat, Mar 8, 2008 at 2:15 PM, Alban Bedel <address@hidden> wrote:
> On Tue, 26 Feb 2008 08:33:15 -0500
>  "Sandro Magi" <address@hidden> wrote:
>
>  > For instance, the initial buffer could be stack-allocated, then copied
>  > to a malloc'd buffer. Cheap and easy. The only pitfalls I can think of
>  > here, are absolute jumps within the buffer which are then invalidated
>  > because of the reocation. Does Lightning generate such code?
>
>  My asm knowledge is limited to i386, however I doubt that any sane cpu
>  design would miss relative jump. So I doubt that local jumps will ever
>  be a big problem.

I just wanted to make sure that Lightning only uses relative jumps
within a function.

> However function call might well be a problem.

Generating mutually recursive functions are the only real problem.
Some sort of forward declaration, followed by patching would be
needed.

>  In my compiler I use a malloced buffer that is reallocated when more
>  space is needed.

Not sufficient for code GC unless you are copying all existing code
into a new buffer.

Sandro




reply via email to

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