sparc: Re-add abi compliant structure support

The original code, removed in the "rewrite" patch, was incorrect for
large structures, and required dynamic allocation of a trampoline on
every ffi_call.

Instead, allocate a 4k entry table of all possible structure returns.
The table is 80k, but is read-only and dynamically paged, which ought
to be better than allocating the trampoline.

This is difficult to test with gcc.  One can only use -O0 at present.
See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63668.
This commit is contained in:
Richard Henderson
2014-11-12 09:36:11 +01:00
parent 92022496ef
commit 6eec410f15
5 changed files with 39 additions and 17 deletions
+1 -1
View File
@@ -197,7 +197,7 @@ ffi_prep_cif_machdep(ffi_cif *cif)
int all_mask = (1 << word_size) - 1;
int fp_mask = size_mask >> 8;
flags = (size_mask << SPARC_FLTMASK_SHIFT) | SPARC_RET_STRUCT;
flags = (size_mask << SPARC_SIZEMASK_SHIFT) | SPARC_RET_STRUCT;
/* For special cases of all-int or all-fp, we can return
the value directly without popping through a struct copy. */