lightning
[Top][All Lists]
Advanced

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

[Lightning] Support for an "automatic area" on stack


From: Ludovic Courtès
Subject: [Lightning] Support for an "automatic area" on stack
Date: Mon, 30 Oct 2006 23:23:04 +0100
User-agent: Mutt/1.5.4i [Guile enabled]

Hi,

Due to the way the area for "automatic variables" is managed on SPARC,
Lightning must provide a specific abstraction for that: something like
`jit_subi_p (JIT_SP, JIT_SP, 8)' may work on PPC and IA32 to allocate 8
octets on the stack, at any time during a procedure's execution, but
that won't work on SPARC (see my previous message).

Therefore, I suggest that we provide a new variant of `prolog' (and
`leaf') so that one can specify the amount of memory that should be
reserved on the stack for "automatic variables" (if we can call it this
way):

  /* Prolog of a 3-arg function, with 8 octets reserved on the stack.  */
  jit_prolog_with_stack_area (3, 8);

Since the exact location of this "automatic area" may vary from one
architecture to another, we can't just let the user assume that this
area is located right above %sp (and we should discourage referring to
`JIT_SP').  Thus we may need additional load and store instructions:

  /* Load into REGD from OFFSET octets after the beginning of the
     "automatic" area.  */
  jit_ldxi_automatic_p (regd, offset);

  /* Store the contents of REGS at OFFSET octets after the beginning of
     the "automatic" area.  */
  jit_stxi_automatic_p (offset, regs);

Finally, we should also clearly state that dynamic allocation of space
on a stack frame (à la `alloca ()') is not possible.

Opinions?

Thanks,
Ludovic.




reply via email to

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