[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Dotgnu-libjit] Re: x86_64 alloca
From: |
Peter Lobsinger |
Subject: |
[Dotgnu-libjit] Re: x86_64 alloca |
Date: |
Sat, 3 Oct 2009 14:35:50 -0400 |
Thanks for pointing out the errors in my initial attempt.
I have made changes to my patch, which now takes into account the
parameter area size.
Regards,
Peter
On Thu, Oct 1, 2009 at 1:54 AM, <address@hidden> wrote:
> 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
>
>