[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Dotgnu-libjit] Re: x86_64 alloca
From: |
ktreichel |
Subject: |
[Dotgnu-libjit] Re: x86_64 alloca |
Date: |
Thu, 01 Oct 2009 07:54:00 +0200 |
Hi Peter,
thanks for your patch.
> Hi,
>
> I have implented a small change to libjit to implement alloca on x86_64.
> It can be found at http://github.com/plobsing/libjit
Implementing alloca it's not that easy if the whole call frame is allocated in
the prolog as it is done for x86_64.
The memory at *%rsp will be overwritten as soon as functions are called that
require arguments passed on the stack.
The returned location pointer has to be adjusted after allocating the memory so
that there is still enough space between the
return value and the stack pointer that the largest block of arguments passed
on the stack for a function call fits inbetween.
>
> Basis:
> It is a direct translation of the implementation on x86. I considered
> doubling the smallest unit of allocation, but gcc -S outputs code that
> rounds to 16 for x86_64, so I figured it would be fine.
Yes, the stack has to be aligned on a 16byte boundary on x86_64 SysV ABI.
>
> Testing:
> It seems to be working. I built an nci frame builder for the Parrot VM
> (http://github.com/plobsing/parrot-libjit) that depends on this, and
> it behaves nicely.
>
> Regards,
>
> Peter Lobsinger
>
Cheers,
Klaus
______________________________________________________
GRATIS für alle WEB.DE-Nutzer: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://movieflat.web.de
- [Dotgnu-libjit] Re: x86_64 alloca,
ktreichel <=