[PATCH] mark need for struct return ABI in block header

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] mark need for struct return ABI in block header

Blaine Garst
There are runtime clients of blocks that need to introspect and invoke a block "by hand".  On x86 large structures are passed as an address of a stack local as the first parameter.  "Blind" clients of a void* block API, like runtimes, need to know the difference.

This patch gathers the appropriate info and marks the block header for both global and local blocks.  The ABI history of the flags is introduced in a comment.  The new feature is marked with what amounts as a combo of the reintroduced (1<<29) field and the just introduced block signature marker (1<<30).

Unfortunately in my last patch I forgot to rename the macro that marks the signature field, so the macro name changes from the last patch to name its actual use but nothing else.

A unit test is attached which tests both i386 and x86_64.







Blaine
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

clang-1.patch (2K) Download Attachment
blockstret.c (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] mark need for struct return ABI in block header

jahanian
Two comments.

Please remove comments in source referring to SnowLeopard.
Generally, to avoid test failures on some unknown platforms, try to  
avoid dependency on
include files (stdbool.h etc.).
OK with these changes.

- fariborz

On Mar 3, 2010, at 5:44 PM, Blaine Garst wrote:

> There are runtime clients of blocks that need to introspect and  
> invoke a block "by hand".  On x86 large structures are passed as an  
> address of a stack local as the first parameter.  "Blind" clients of  
> a void* block API, like runtimes, need to know the difference.
>
> This patch gathers the appropriate info and marks the block header  
> for both global and local blocks.  The ABI history of the flags is  
> introduced in a comment.  The new feature is marked with what  
> amounts as a combo of the reintroduced (1<<29) field and the just  
> introduced block signature marker (1<<30).
>
> Unfortunately in my last patch I forgot to rename the macro that  
> marks the signature field, so the macro name changes from the last  
> patch to name its actual use but nothing else.
>
> A unit test is attached which tests both i386 and x86_64.
>
> <clang-1.patch>
>
> <blockstret.c>
>
> Blaine_______________________________________________
> cfe-dev mailing list
> [hidden email]
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev