aboutsummaryrefslogtreecommitdiff
path: root/libffi/src/powerpc
AgeCommit message (Collapse)AuthorFilesLines
2023-05-06libffi: fix handling of homogeneous float128 structs (#689)Dan Horák1-1/+1
If there is a homogeneous struct with float128 members, they should be copied to vector register save area. The current code incorrectly copies only the value of the first member, not increasing the pointer with each iteration. Fix this. Merged from upstream libffi commit: 464b4b66e3cf3b5489e730c1466ee1bf825560e0 2023-05-03 Dan Horák <dan@danny.cz> libffi/ PR libffi/109447 * src/powerpc/ffi_linux64.c (ffi_prep_args64): Update arg.f128 pointer.
2021-10-25rs6000: Fix bootstrap (libffi)Segher Boessenkool2-0/+4
This fixes bootstrap for the current problems building libffi. 2021-10-25 Segher Boessenkool <segher@kernel.crashing.org> libffi/ * src/powerpc/linux64.S: Enable AltiVec insns. * src/powerpc/linux64_closure.S: Ditto.
2021-10-20libffi: Sync with libffi 3.4.2H.J. Lu10-110/+437
Merged commit: f9ea41683444ebe11cfa45b05223899764df28fb
2020-09-24Re: [RS6000] Power10 libffi fixesAlan Modra1-1/+3
Adding a nop broke ffi_closure_LINUX64! * src/powerpc/linux64_closure.S (ffi_closure_LINUX64): Correct location of .Lret.
2020-09-24[RS6000] Power10 libffi fixesAlan Modra2-1/+19
Power10 pc-relative code doesn't use or preserve r2 as a TOC pointer. That means calling between pc-relative and TOC using code can't be done without intervening linker stubs, and a call from TOC code to pc-relative code must have a nop after the bl in order to restore r2. Now the PowerPC libffi assembly code doesn't use r2 except for the implicit use when making calls back to C, ffi_closure_helper_LINUX64 and ffi_prep_args64. So changing the assembly to interoperate with pc-relative code without stubs is easily done. * src/powerpc/linux64.S (ffi_call_LINUX64): Don't emit global entry when __PCREL__. Call using @notoc. Add nops. * src/powerpc/linux64_closure.S (ffi_closure_LINUX64): Likewise. (ffi_go_closure_linux64): Likewise.
2018-05-04libffi PowerPC64 ELFv1 fp arg fixesAlan Modra1-16/+45
The ELFv1 ABI says: "Single precision floating point values are mapped to the second word in a single doubleword" and also "Floating point registers f1 through f13 are used consecutively to pass up to 13 floating point values, one member aggregates passed by value containing a floating point value, and to pass complex floating point values". libffi wasn't expecting float args in the second word, and wasn't passing one member aggregates in fp registers. This patch fixes those problems, making use of the existing ELFv2 homogeneous aggregate support since a one element fp struct is a special case of an homogeneous aggregate. I've also set a flag when returning pointers that might be used one day. This is just a tidy since the ppc64 assembly support code currently doesn't test FLAG_RETURNS_64BITS for integer types.. * src/powerpc/ffi_linux64.c (discover_homogeneous_aggregate): Compile for ELFv1 too, handling single element aggregates. (ffi_prep_cif_linux64_core): Call discover_homogeneous_aggregate for ELFv1. Set FLAG_RETURNS_64BITS for FFI_TYPE_POINTER return. (ffi_prep_args64): Call discover_homogeneous_aggregate for ELFv1, and handle single element structs containing float or double as if the element wasn't wrapped in a struct. Store floats in second word of doubleword slot when big-endian. (ffi_closure_helper_LINUX64): Similarly. From-SVN: r259934
2017-10-03Import from libffi master repository.Tony Reix4-9/+578
2017-08-31 Tony Reix <tony.reix@atos.net> * src/powerpc/aix.S (ffi_call_AIX): Add debugging pseudo-op and labels for EH. (ffi_call_go_AIX): New function. (_GLOBAL__F_libffi_src_powerpc_aix): New EH frame. * src/powerpc/aix_closure.S (ffi_closure_ASM): Add debugging pseudo-op and labels for EH. (ffi_go_closure_ASM): New function. (_GLOBAL__F_libffi_src_powerpc_aix_closure): New EH frame. * src/powrpc/ffi_darwin.c (ffi_call_go): New function. (ffi_prep_go_closure): New function. (ffi_closure_helper_common): Rename from ffi_closure_helper_DARWIN. (ffi_closure_helper_DARWIN): Call ffi_closure_helper_common. (ffi_go_closure_helper_DARWIN): Call ffi_closure_helper_common. * src/powerpc/ffitarget.h (FFI_GO_CLOSURES): Define. From-SVN: r253386
2015-10-01[RS6000] Correct powerpc sysv stack argument accountingAlan Modra1-109/+98
ppc32 starts using the stack for integer arg passing when we run out of integer arg passing registers. Similarly, we start using the stack for floating point args when we run out of floating point registers. The decision on where an integer arg goes does not depend on number of floating point args, nor does the decision on where a floating point arg goes depend on number of integer args. Alignment of stack args also simply depends on number of stack args. This patch untangles the horrible mess we had, with intarg_count being wrongly used to count both integer args and stack words. * src/powerpc/ffi_sysv.c (ffi_prep_cif_sysv_core): Count fprs, gprs, and stack words separately. (ffi_prep_args_SYSV): Similarly. From-SVN: r228307
2015-01-12Merge libffi to upstream commit c82cc159426d8d4402375fa1ae3f045b9cf82e16Richard Henderson13-358/+450
From-SVN: r219477
2014-09-11linux64.S: Emit .note.GNU-stack even when POWERPC64 is not defined.Jakub Jelinek2-4/+6
* src/powerpc/linux64.S: Emit .note.GNU-stack even when POWERPC64 is not defined. * src/powerpc/linux64_closure.S: Likewise. Also test _CALL_ELF == 2. From-SVN: r215155
2013-12-10ffitarget.h: Import from upstream.Alan Modra9-1762/+2074
* src/powerpc/ffitarget.h: Import from upstream. * src/powerpc/ffi_powerpc.h: Likewise. * src/powerpc/ffi.c: Likewise. * src/powerpc/ffi_sysv.c: Likewise. * src/powerpc/ffi_linux64.c: Likewise. * src/powerpc/sysv.S: Likewise. * src/powerpc/ppc_closure.S: Likewise. * src/powerpc/linux64.S: Likewise. * src/powerpc/linux64_closure.S: Likewise. * src/types.c: Likewise. * Makefile.am (EXTRA_DIST): Add new src/powerpc files. (nodist_libffi_la_SOURCES <POWERPC, POWERPC_FREEBSD>): Likewise. * configure.ac (HAVE_LONG_DOUBLE_VARIANT): Define for powerpc. * include/ffi.h.in (ffi_prep_types): Declare. * src/prep_cif.c (ffi_prep_cif_core): Call ffi_prep_types. * configure: Regenerate. * fficonfig.h.in: Regenerate. * Makefile.in: Regenerate. * man/Makefile.in: Regenerate. * include/Makefile.in: Regenerate. * testsuite/Makefile.in: Regenerate. From-SVN: r205844
2013-11-18ppc_closure.S: Don't bl .Luint128.Alan Modra1-1/+1
* src/powerpc/ppc_closure.S: Don't bl .Luint128. From-SVN: r204918
2013-11-18PowerPC64 ELFv2 supportAlan Modra4-216/+718
PowerPC64 ELFv2 support * src/powerpc/ffitarget.h: Import from upstream. * src/powerpc/ffi.c: Likewise. * src/powerpc/linux64.S: Likewise. * src/powerpc/linux64_closure.S: Likewise. * doc/libffi.texi: Likewise. * testsuite/libffi.call/cls_double_va.c: Likewise. * testsuite/libffi.call/cls_longdouble_va.c: Likewise. From-SVN: r204917
2013-06-25ffi.c (ffi_prep_args_SYSV): Move var declaration before statements.Alan Modra3-7/+84
* src/powerpc/ffi.c (ffi_prep_args_SYSV): Move var declaration before statements. (ffi_prep_args64): Support little-endian. (ffi_closure_helper_SYSV, ffi_closure_helper_LINUX64): Likewise. * src/powerpc/linux64_closure.S (ffi_closure_LINUX64): Likewise. * src/powerpc/ppc_closure.S (ffi_closure_SYSV): Likewise. From-SVN: r200383
2013-02-06ffi.c (ffi_prep_cif_machdep): Fix case where DOUBLE equal LONGDOUBLE.Andreas Tobler1-0/+2
2013-02-06 Andreas Tobler <andreast@fgznet.ch> * src/powerpc/ffi.c (ffi_prep_cif_machdep): Fix case where DOUBLE equal LONGDOUBLE. From-SVN: r195812
2012-12-26libffi mergeAnthony Green1-3/+3
From-SVN: r194722
2012-10-31linux64_closure.S: Add new ABI support.Alan Modra2-4/+37
* src/powerpc/linux64_closure.S: Add new ABI support. * src/powerpc/linux64.S: Likewise. From-SVN: r193015
2012-04-02ffi.c (ffi_prep_args_SYSV): Declare double_tmp.Peter Bergner1-7/+6
* src/powerpc/ffi.c (ffi_prep_args_SYSV): Declare double_tmp. Silence casting pointer to integer of different size warning. Delete goto to previously deleted label. (ffi_call): Silence possibly undefined warning. (ffi_closure_helper_SYSV): Declare variable type. From-SVN: r186091
2012-03-09aix_closure.S (ffi_closure_ASM): Adjust for Darwin64 change to return value ↵David Edelsohn1-1/+3
of ffi_closure_helper_DARWIN and... * src/powerpc/aix_closure.S (ffi_closure_ASM): Adjust for Darwin64 change to return value of ffi_closure_helper_DARWIN and load type from return type. From-SVN: r185152
2012-03-04Merge upstream libffiAnthony Green9-329/+385
From-SVN: r184897
2011-09-04re PR libffi/49594 (bootstrap failure in libffi:darwin_closure for ↵Iain Sandoe1-3/+4
powerpc-darwin8) PR libffi/49594 * src/powerpc/darwin_closure.S (stubs): Make the stub binding helper reference track the architecture pointer size. From-SVN: r178512
2010-12-18re PR libffi/29152 (64-bit darwin ppc port needed for libffi)Iain Sandoe4-347/+1181
libffi: PR libffi/29152 PR libffi/42378 * src/powerpc/darwin_closure.S: Provide Darwin64 implementation, update comments. * src/powerpc/ffitarget.h (POWERPC_DARWIN64): New, (FFI_TRAMPOLINE_SIZE): Update for Darwin64. * src/powerpc/darwin.S: Provide Darwin64 implementation, update comments. * src/powerpc/ffi_darwin.c: Likewise. From-SVN: r168016
2010-08-06Remove warningsDan Witte1-7/+7
From-SVN: r162959
2010-08-06Define libffi macros carefullyDan Horák1-0/+6
From-SVN: r162945
2009-12-28ffi_darwin.c (ffi_prep_args): Copy abi and nargs to local variables.David Edelsohn1-13/+62
* src/powerpc/ffi_darwin.c (ffi_prep_args): Copy abi and nargs to local variables. (aix_adjust_aggregate_sizes): New function. (ffi_prep_cif_machdep): Call it. From-SVN: r155492
2009-12-26ffi.c (ffi_prep_args_SYSV): Advance intarg_count when a float arguments is ↵Andreas Schwab1-0/+3
passed in memory. * src/powerpc/ffi.c (ffi_prep_args_SYSV): Advance intarg_count when a float arguments is passed in memory. (ffi_closure_helper_SYSV): Mark general registers as used up when a 64bit or soft-float long double argument is passed in memory. From-SVN: r155473
2009-12-07aix_closure.S (libffi_closure_ASM): Fix tablejump typo.David Edelsohn1-1/+1
* src/powerpc/aix_closure.S (libffi_closure_ASM): Fix tablejump typo. From-SVN: r155070
2009-12-05aix.S: Update AIX32 code to be consistent with AIX64 code.David Edelsohn2-174/+185
* src/powerpc/aix.S: Update AIX32 code to be consistent with AIX64 code. * src/powerpc/aix_closure.s: Same. From-SVN: r155016
2009-12-04aix_closure.S: Reorganize 64-bit code to match linux64_closure.S.David Edelsohn1-86/+105
* src/powerpc/aix_closure.S: Reorganize 64-bit code to match linux64_closure.S. From-SVN: r155001
2009-12-04ffi_darwin.c (ffi_closure_helper_DARWIN): Increment pfr for long double ↵David Edelsohn1-1/+2
split between fpr13 and stack. * src/powerpc/ffi_darwin.c (ffi_closure_helper_DARWIN): Increment pfr for long double split between fpr13 and stack. From-SVN: r154983
2009-12-03ffi_darwin.c (ffi_prep_args): Increment next_arg and fparg_count twice for ↵David Edelsohn1-0/+2
long double. * src/powerpc/ffi_darwin.c (ffi_prep_args): Increment next_arg and fparg_count twice for long double. From-SVN: r154967
2009-12-03re PR libffi/42243 (powerpc-apple-darwin9 libffi failures)David Edelsohn1-14/+12
PR libffi/42243 * src/powerpc/ffi_darwin.c (ffi_prep_args): Remove extra parentheses. From-SVN: r154956
2009-12-02ffi_darwin.c (ffi_prep_args): Fix typo in INT64 case.David Edelsohn1-1/+1
* src/powerpc/ffi_darwin.c (ffi_prep_args): Fix typo in INT64 case. From-SVN: r154932
2009-12-01aix.S (ffi_call_AIX): Convert to more standard register usage.David Edelsohn3-115/+85
* src/powerpc/aix.S (ffi_call_AIX): Convert to more standard register usage. Call ffi_prep_args directly. Add long double return value support. * src/powerpc/ffi_darwin.c (ffi_prep_args): Double arg increment applies to FFI_TYPE_DOUBLE. Correct fpr_base increment typo. Separate FFI_TYPE_SINT32 and FFI_TYPE_UINT32 cases. (ffi_prep_cif_machdep): Only 16 byte stack alignment in 64 bit mode. (ffi_closure_helper_DARWIN): Remove nf and ng counters. Move temp into case. * src/powerpc/aix_closure.S: Maintain 16 byte stack alignment. Allocate result area between params and FPRs. From-SVN: r154892
2009-11-30re PR libffi/35484 (libffi doesn't support AIX 64bit)David Edelsohn4-77/+454
2009-11-30 David Edelsohn <edelsohn@gnu.org> PR target/35484 * src/powerpc/ffitarget.h (POWERPC64): Define for PPC64 Linux and AIX64. * src/powerpc/aix.S: Implement AIX64 version. * src/powerpc/aix_closure.S: Implement AIX64 version. (ffi_closure_ASM): Use extsb, lha and displament addresses. * src/powerpc/ffi_darwin.c (ffi_prep_args): Implement AIX64 support. (ffi_prep_cif_machdep): Same. (ffi_call): Same. (ffi_closure_helper_DARWIN): Same. From-SVN: r154855
2009-06-16ffi.c: Avoid clobbering cr3 and cr4, which are supposed to be callee-saved.Wim Lewis2-29/+19
2009-06-16 Wim Lewis <wiml@hhhh.org> * src/powerpc/ffi.c: Avoid clobbering cr3 and cr4, which are supposed to be callee-saved. * src/powerpc/sysv.S (small_struct_return_value): Fix overrun of return buffer for odd-size structs. From-SVN: r148543
2009-06-04[multiple changes]Andrew Haley5-6/+68
2009-06-04 Andrew Haley <aph@redhat.com> * src/powerpc/ppc_closure.S: Insert licence header. * src/powerpc/linux64_closure.S: Likewise. * src/m68k/sysv.S: Likewise. * src/sh64/ffi.c: Change void (*)() to void (*)(void). * src/powerpc/ffi.c: Likewise. * src/powerpc/ffi_darwin.c: Likewise. * src/m32r/ffi.c: Likewise. * src/sh64/ffi.c: Likewise. * src/x86/ffi64.c: Likewise. * src/alpha/ffi.c: Likewise. * src/alpha/osf.S: Likewise. * src/frv/ffi.c: Likewise. * src/s390/ffi.c: Likewise. * src/pa/ffi.c: Likewise. * src/pa/hpux32.S: Likewise. * src/ia64/unix.S: Likewise. * src/ia64/ffi.c: Likewise. * src/sparc/ffi.c: Likewise. * src/mips/ffi.c: Likewise. * src/sh/ffi.c: Likewise. 2008-02-15 David Daney <ddaney@avtrex.com> * src/mips/ffi.c (USE__BUILTIN___CLEAR_CACHE): Define (conditionally), and use it to include cachectl.h. (ffi_prep_closure_loc): Fix cache flushing. * src/mips/ffitarget.h (_ABIN32, _ABI64, _ABIO32): Define. From-SVN: r148172
2009-06-042009-06-04 Andrew Haley <aph@redhat.com>Andrew Haley3-21/+24
include/ffi.h.in, src/arm/ffitarget.h, src/arm/ffi.c, src/arm/sysv.S, src/powerpc/ffitarget.h, src/closures.c, src/sh64/ffitarget.h, src/sh64/ffi.c, src/sh64/sysv.S, src/types.c, src/x86/ffi64.c, src/x86/ffitarget.h, src/x86/win32.S, src/x86/darwin.S, src/x86/ffi.c, src/x86/sysv.S, src/x86/unix64.S, src/alpha/ffitarget.h, src/alpha/ffi.c, src/alpha/osf.S, src/m68k/ffitarget.h, src/frv/ffitarget.h, src/frv/ffi.c, src/s390/ffitarget.h, src/s390/sysv.S, src/cris/ffitarget.h, src/pa/linux.S, src/pa/ffitarget.h, src/pa/ffi.c, src/raw_api.c, src/ia64/ffitarget.h, src/ia64/unix.S, src/ia64/ffi.c, src/ia64/ia64_flags.h, src/java_raw_api.c, src/debug.c, src/sparc/v9.S, src/sparc/ffitarget.h, src/sparc/ffi.c, src/sparc/v8.S, src/mips/ffitarget.h, src/mips/n32.S, src/mips/o32.S, src/mips/ffi.c, src/prep_cif.c, src/sh/ffitarget.h, src/sh/ffi.c, src/sh/sysv.S: Update license text. From-SVN: r148171
2008-08-25ffitarget.h (ffi_abi): Add FFI_LINUX and FFI_LINUX_SOFT_FLOAT to the ↵Andreas Tobler2-7/+20
POWERPC_FREEBSD enum. 2008-08-25 Andreas Tobler <a.tobler@schweiz.org> * src/powerpc/ffitarget.h (ffi_abi): Add FFI_LINUX and FFI_LINUX_SOFT_FLOAT to the POWERPC_FREEBSD enum. Add note about flag bits used for FFI_SYSV_TYPE_SMALL_STRUCT. Adjust copyright notice. * src/powerpc/ffi.c: Add two new flags to indicate if we have one register or two register to use for FFI_SYSV structs. (ffi_prep_cif_machdep): Pass the right register flag introduced above. (ffi_closure_helper_SYSV): Fix the return type for FFI_SYSV_TYPE_SMALL_STRUCT. Comment. Adjust copyright notice. From-SVN: r139567
2008-03-26[multiple changes]Matthias Klose2-0/+8
2008-03-26 Daniel Jacobowitz <dan@debian.org> * src/arm/sysv.S: Fix ARM comment marker. 2008-03-26 Jakub Jelinek <jakub@redhat.com> * src/alpha/osf.S: Add .note.GNU-stack on Linux. * src/s390/sysv.S: Likewise. * src/powerpc/ppc_closure.S: Likewise. * src/powerpc/sysv.S: Likewise. * src/x86/unix64.S: Likewise. * src/x86/sysv.S: Likewise. * src/sparc/v8.S: Likewise. * src/sparc/v9.S: Likewise. * src/m68k/sysv.S: Likewise. * src/arm/sysv.S: Likewise. From-SVN: r133594
2007-12-01re PR libffi/31937 (libffi doesn't support ppc without FPU)Andreas Tobler4-40/+202
2007-12-01 Andreas Tobler <a.tobler@schweiz.org> PR libffi/31937 * src/powerpc/ffitarget.h: Introduce new ABI FFI_LINUX_SOFT_FLOAT. Add local FFI_TYPE_UINT128 to handle soft-float long-double-128. * src/powerpc/ffi.c: Distinguish between __NO_FPRS__ and not and set the NUM_FPR_ARG_REGISTERS according to. Add support for potential soft-float support under hard-float architecture. (ffi_prep_args_SYSV): Set NUM_FPR_ARG_REGISTERS to 0 in case of FFI_LINUX_SOFT_FLOAT, handle float, doubles and long-doubles according to the FFI_LINUX_SOFT_FLOAT ABI. (ffi_prep_cif_machdep): Likewise. (ffi_closure_helper_SYSV): Likewise. * src/powerpc/ppc_closure.S: Make sure not to store float/double on archs where __NO_FPRS__ is true. Add FFI_TYPE_UINT128 support. * src/powerpc/sysv.S: Add support for soft-float long-double-128. Adjust copyright notice. From-SVN: r130559
2007-11-17sysv.S: Load correct cr to compare if we have long double.Andreas Tobler3-1/+4
2007-11-17 Andreas Tobler <a.tobler@schweiz.org> * src/powerpc/sysv.S: Load correct cr to compare if we have long double. * src/powerpc/linux64.S: Likewise. * src/powerpc/ffi.c: Add a comment to show which part goes into cr6. * testsuite/libffi.call/return_ldl.c: New test. From-SVN: r130247
2007-03-08ffi.c (flush_icache): Fix left-over from previous patch.Alexandre Oliva1-8/+5
* src/powerpc/ffi.c (flush_icache): Fix left-over from previous patch. (ffi_prep_closure_loc): Remove unneeded casts. Add needed ones. From-SVN: r122692
2007-03-07ffi.h.in (ffi_closure_alloc, [...]): New.Alexandre Oliva2-22/+24
libffi/ChangeLog: * include/ffi.h.in (ffi_closure_alloc, ffi_closure_free): New. (ffi_prep_closure_loc): New. (ffi_prep_raw_closure_loc): New. (ffi_prep_java_raw_closure_loc): New. * src/closures.c: New file. * src/dlmalloc.c [FFI_MMAP_EXEC_WRIT] (struct malloc_segment): Replace sflags with exec_offset. [FFI_MMAP_EXEC_WRIT] (mmap_exec_offset, add_segment_exec_offset, sub_segment_exec_offset): New macros. (get_segment_flags, set_segment_flags, check_segment_merge): New macros. (is_mmapped_segment, is_extern_segment): Use get_segment_flags. (add_segment, sys_alloc, create_mspace, create_mspace_with_base, destroy_mspace): Use new macros. (sys_alloc): Silence warning. * Makefile.am (libffi_la_SOURCES): Add src/closures.c. * Makefile.in: Rebuilt. * src/prep_cif [FFI_CLOSURES] (ffi_prep_closure): Implement in terms of ffi_prep_closure_loc. * src/raw_api.c (ffi_prep_raw_closure_loc): Renamed and adjusted from... (ffi_prep_raw_closure): ... this. Re-implement in terms of the renamed version. * src/java_raw_api (ffi_prep_java_raw_closure_loc): Renamed and adjusted from... (ffi_prep_java_raw_closure): ... this. Re-implement in terms of the renamed version. * src/alpha/ffi.c (ffi_prep_closure_loc): Renamed from (ffi_prep_closure): ... this. * src/pa/ffi.c: Likewise. * src/cris/ffi.c: Likewise. Adjust. * src/frv/ffi.c: Likewise. * src/ia64/ffi.c: Likewise. * src/mips/ffi.c: Likewise. * src/powerpc/ffi_darwin.c: Likewise. * src/s390/ffi.c: Likewise. * src/sh/ffi.c: Likewise. * src/sh64/ffi.c: Likewise. * src/sparc/ffi.c: Likewise. * src/x86/ffi64.c: Likewise. * src/x86/ffi.c: Likewise. (FFI_INIT_TRAMPOLINE): Adjust. (ffi_prep_raw_closure_loc): Renamed and adjusted from... (ffi_prep_raw_closure): ... this. * src/powerpc/ffi.c (ffi_prep_closure_loc): Renamed from (ffi_prep_closure): ... this. (flush_icache): Adjust. boehm-gc/ChangeLog: * include/gc.h (GC_REGISTER_FINALIZER_UNREACHABLE): New. (GC_register_finalizer_unreachable): Declare. (GC_debug_register_finalizer_unreachable): Declare. * finalize.c (GC_unreachable_finalize_mark_proc): New. (GC_register_finalizer_unreachable): New. (GC_finalize): Handle it. * dbg_mlc.c (GC_debug_register_finalizer_unreachable): New. (GC_debug_register_finalizer_no_order): Fix whitespace. libjava/ChangeLog: * include/jvm.h (_Jv_ClosureListFinalizer): New. (_Jv_Linker::create_error_method): Adjust. * boehm.cc (_Jv_ClosureListFinalizer): New. * nogc.cc (_Jv_ClosureListFinalizer): New. * java/lang/Class.h (class _Jv_ClosureList): New. (class java::lang::Class): Declare it as friend. * java/lang/natClass.cc (_Jv_ClosureList::releaseClosures): New. (_Jv_ClosureList::registerClousure): New. * include/execution.h (_Jv_ExecutionEngine): Add get_closure_list. (_Jv_CompiledEngine::do_get_closure_list): New. (_Jv_CompiledEngine::_Jv_CompiledEngine): Use it. (_Jv_IndirectCompiledClass): Add closures. (_Jv_IndirectCompiledEngine::get_aux_info): New. (_Jv_IndirectCompiledEngine::do_allocate_field_initializers): Use it. (_Jv_IndirectCompiledEngine::do_get_closure_list): New. (_Jv_IndirectCompiledEngine::_Jv_IndirectCompiledEngine): Use it. (_Jv_InterpreterEngine::do_get_closure_list): Declare. (_Jv_InterpreterEngine::_Jv_InterpreterEngine): Use it. * interpret.cc (FFI_PREP_RAW_CLOSURE): Use _loc variants. (node_closure): Add closure list. (_Jv_InterpMethod::ncode): Add jclass argument. Use ffi_closure_alloc and the separate code pointer. Register the closure for finalization. (_Jv_JNIMethod::ncode): Likewise. (_Jv_InterpreterEngine::do_create_ncode): Pass klass to ncode. (_Jv_InterpreterEngine::do_get_closure_list): New. * include/java-interp.h (_Jv_InterpMethod::ncode): Adjust. (_Jv_InterpClass): Add closures field. (_Jv_JNIMethod::ncode): Adjust. * defineclass.cc (_Jv_ClassReader::handleCodeAttribute): Adjust. (_Jv_ClassReader::handleMethodsEnd): Likewise. * link.cc (struct method_closure): Add closure list. (_Jv_Linker::create_error_method): Add jclass argument. Use ffi_closure_alloc and the separate code pointer. Register the closure for finalization. (_Jv_Linker::link_symbol_table): Remove outdated comment about sharing of otable and atable. Adjust. * java/lang/reflect/natVMProxy.cc (ncode_closure): Add closure list. (ncode): Add jclass argument. Use ffi_closure_alloc and the separate code pointer. Register the closure for finalization. (java::lang::reflect::VMProxy::generateProxyClass): Adjust. * testsuite/libjava.jar/TestClosureGC.java: New. * testsuite/libjava.jar/TestClosureGC.out: New. * testsuite/libjava.jar/TestClosureGC.xfail: New. * testsuite/libjava.jar/TestClosureGC.jar: New. From-SVN: r122652
2007-02-02linux64.S (ffi_call_LINUX64): Move restore of r2 immediately after bctrl ↵Jakub Jelinek1-2/+5
instruction. * src/powerpc/linux64.S (ffi_call_LINUX64): Move restore of r2 immediately after bctrl instruction. From-SVN: r121498
2006-11-01In gcc/: PR 23067Geoffrey Keating1-5/+56
In gcc/: PR 23067 * c-decl.c (start_struct): Don't create self-containing structures. * config/rs6000/rs6000.c (darwin_rs6000_special_round_type_align): New. * config/rs6000/rs6000-protos.h (darwin_rs6000_special_round_type_align): New. * config/rs6000/darwin.h (ADJUST_FIELD_ALIGN): Rewrite. (ROUND_TYPE_ALIGN): Use darwin_rs6000_special_round_type_align. In gcc/testsuite/: PR 23067 * gcc.target/powerpc/darwin-abi-3.c: Remove XFAIL. * gcc.target/powerpc/darwin-abi-6.c: Remove XFAIL. * gcc.target/powerpc/darwin-abi-7.c: Remove XFAIL. * gcc.target/powerpc/darwin-abi-8.c: Remove XFAIL. * gcc.target/powerpc/darwin-abi-9.c: Remove XFAIL. * gcc.target/powerpc/darwin-abi-10.c: Remove XFAIL. * gcc.target/powerpc/darwin-abi-11.c: Remove XFAIL. In libobjc/: * encoding.c (darwin_rs6000_special_round_type_align): New. In libffi/: * src/powerpc/ffi_darwin.c (darwin_adjust_aggregate_sizes): New. (ffi_prep_cif_machdep): Call darwin_adjust_aggregate_sizes for Darwin. * testsuite/libffi.call/nested_struct4.c: Remove Darwin XFAIL. * testsuite/libffi.call/nested_struct6.c: Remove Darwin XFAIL. From-SVN: r118365
2006-04-22README: Remove notice about 'Crazy Comments'.Andreas Tobler2-55/+14
2006-04-22 Andreas Tobler <a.tobler@schweiz.ch> * README: Remove notice about 'Crazy Comments'. * src/debug.c: Remove lint directives. Cleanup white spaces. * src/java_raw_api.c: Likewise. * src/prep_cif.c: Likewise. * src/raw_api.c: Likewise. * src/ffitest.c: Delete. No longer needed, all test cases migrated to the testsuite. * src/arm/ffi.c: Remove lint directives. * src/m32r/ffi.c: Likewise. * src/pa/ffi.c: Likewise. * src/powerpc/ffi.c: Likewise. * src/powerpc/ffi_darwin.c: Likewise. * src/sh/ffi.c: Likewise. * src/sh64/ffi.c: Likewise. * src/x86/ffi.c: Likewise. * testsuite/libffi.call/float2.c: Likewise. * testsuite/libffi.call/promotion.c: Likewise. * testsuite/libffi.call/struct1.c: Likewise. From-SVN: r113181
2006-03-24ffitarget.h (enum ffi_abi): Add FFI_LINUX.Alan Modra5-163/+196
* src/powerpc/ffitarget.h (enum ffi_abi): Add FFI_LINUX. Default for 32-bit using IBM extended double format. Fix FFI_LAST_ABI. * src/powerpc/ffi.c (ffi_prep_args_SYSV): Handle linux variant of FFI_TYPE_LONGDOUBLE. (ffi_prep_args64): Assert using IBM extended double. (ffi_prep_cif_machdep): Don't munge FFI_TYPE_LONGDOUBLE type. Handle FFI_LINUX FFI_TYPE_LONGDOUBLE return and args. (ffi_call): Handle FFI_LINUX. (ffi_closure_helper_SYSV): Non FFI_LINUX long double return needs gpr3 return pointer as for struct return. Handle FFI_LINUX FFI_TYPE_LONGDOUBLE return and args. Don't increment "nf" unnecessarily. * src/powerpc/ppc_closure.S (ffi_closure_SYSV): Load both f1 and f2 for FFI_TYPE_LONGDOUBLE. Move epilogue insns into case table. Don't use r6 as pointer to results, instead use sp offset. Don't make a special call to load lr with case table address, instead use offset from previous call. * src/powerpc/sysv.S (ffi_call_SYSV): Save long double return. * src/powerpc/linux64.S (ffi_call_LINUX64): Simplify long double return. From-SVN: r112340
2006-01-18sysv.S (smst_two_register): Don't call __ashldi3, instead do the shifting ↵Jakub Jelinek2-36/+37
inline. * src/powerpc/sysv.S (smst_two_register): Don't call __ashldi3, instead do the shifting inline. * src/powerpc/ppc_closure.S (ffi_closure_SYSV): Don't compute %r5 shift count unconditionally. Simplify load sequences for 1, 2, 3, 4 and 8 byte structs, for the remaining struct sizes don't call __lshrdi3, instead do the shifting inline. From-SVN: r109879
2005-12-03ffi.c: Formatting.Alan Modra1-257/+339
* src/powerpc/ffi.c: Formatting. (ffi_prep_args_SYSV): Avoid possible aliasing problems by using unions. (ffi_prep_args64): Likewise. From-SVN: r107963