Skip to content
Permalink
Browse files

8239095: Upgrade libFFI to the latest 3.3 version

Reviewed-by: jvos, kcr
  • Loading branch information
Alexander Matveev
Alexander Matveev committed Jun 2, 2020
1 parent 853ac78 commit 6bd0e22d7e33a7e24f17a351914c9ab78a0c3398
Showing with 4,853 additions and 3,522 deletions.
  1. +2 −2 modules/javafx.media/src/main/legal/libffi.md
  2. +1 −1 modules/javafx.media/src/main/native/gstreamer/3rd_party/libffi/LICENSE
  3. +55 −0 modules/javafx.media/src/main/native/gstreamer/3rd_party/libffi/include/ffi_cfi.h
  4. +23 −2 modules/javafx.media/src/main/native/gstreamer/3rd_party/libffi/include/ffi_common.h
  5. +43 −46 modules/javafx.media/src/main/native/gstreamer/3rd_party/libffi/include/ffitarget.h
  6. +515 −0 modules/javafx.media/src/main/native/gstreamer/3rd_party/libffi/include/mac/x64/ffi.h
  7. +24 −24 modules/javafx.media/src/main/native/gstreamer/3rd_party/libffi/include/{ → mac}/x64/fficonfig.h
  8. +110 −82 modules/javafx.media/src/main/native/gstreamer/3rd_party/libffi/include/{ → win}/x64/ffi.h
  9. +215 −0 modules/javafx.media/src/main/native/gstreamer/3rd_party/libffi/include/win/x64/fficonfig.h
  10. +109 −81 modules/javafx.media/src/main/native/gstreamer/3rd_party/libffi/include/{ → win}/x86/ffi.h
  11. +20 −20 modules/javafx.media/src/main/native/gstreamer/3rd_party/libffi/include/{ → win}/x86/fficonfig.h
  12. +360 −50 modules/javafx.media/src/main/native/gstreamer/3rd_party/libffi/src/closures.c
  13. +7 −2 modules/javafx.media/src/main/native/gstreamer/3rd_party/libffi/src/dlmalloc.c
  14. +3 −3 modules/javafx.media/src/main/native/gstreamer/3rd_party/libffi/src/java_raw_api.c
  15. +31 −21 modules/javafx.media/src/main/native/gstreamer/3rd_party/libffi/src/prep_cif.c
  16. +9 −5 modules/javafx.media/src/main/native/gstreamer/3rd_party/libffi/src/raw_api.c
  17. +3 −1 modules/javafx.media/src/main/native/gstreamer/3rd_party/libffi/src/types.c
  18. +30 −0 modules/javafx.media/src/main/native/gstreamer/3rd_party/libffi/src/x86/asmnames.h
  19. +0 −416 modules/javafx.media/src/main/native/gstreamer/3rd_party/libffi/src/x86/darwin64.S
  20. +565 −769 modules/javafx.media/src/main/native/gstreamer/3rd_party/libffi/src/x86/ffi.c
  21. +316 −106 modules/javafx.media/src/main/native/gstreamer/3rd_party/libffi/src/x86/ffi64.c
  22. +311 −0 modules/javafx.media/src/main/native/gstreamer/3rd_party/libffi/src/x86/ffiw64.c
  23. +29 −0 modules/javafx.media/src/main/native/gstreamer/3rd_party/libffi/src/x86/internal.h
  24. +22 −0 modules/javafx.media/src/main/native/gstreamer/3rd_party/libffi/src/x86/internal64.h
  25. +995 −0 modules/javafx.media/src/main/native/gstreamer/3rd_party/libffi/src/x86/sysv_intel.S
  26. +566 −0 modules/javafx.media/src/main/native/gstreamer/3rd_party/libffi/src/x86/unix64.S
  27. +0 −1,351 modules/javafx.media/src/main/native/gstreamer/3rd_party/libffi/src/x86/win32.S
  28. +227 −518 modules/javafx.media/src/main/native/gstreamer/3rd_party/libffi/src/x86/win64.S
  29. +237 −0 modules/javafx.media/src/main/native/gstreamer/3rd_party/libffi/src/x86/win64_intel.S
  30. +1 −1 modules/javafx.media/src/main/native/gstreamer/projects/mac/glib-lite/Makefile
  31. +12 −9 modules/javafx.media/src/main/native/gstreamer/projects/mac/libffi/Makefile
  32. +5 −5 modules/javafx.media/src/main/native/gstreamer/projects/win/glib-lite/Makefile.ffi
  33. +7 −7 modules/javafx.media/src/main/native/gstreamer/projects/win/glib-lite/Makefile.gobject
@@ -1,9 +1,9 @@
## LibFFI v3.2.1
## LibFFI v3.3

### LibFFI License
```
libffi - Copyright (c) 1996-2014 Anthony Green, Red Hat, Inc and others.
libffi - Copyright (c) 1996-2019 Anthony Green, Red Hat, Inc and others.
See source files for details.
Permission is hereby granted, free of charge, to any person obtaining
@@ -1,4 +1,4 @@
libffi - Copyright (c) 1996-2014 Anthony Green, Red Hat, Inc and others.
libffi - Copyright (c) 1996-2019 Anthony Green, Red Hat, Inc and others.
See source files for details.

Permission is hereby granted, free of charge, to any person obtaining
@@ -0,0 +1,55 @@
/* -----------------------------------------------------------------------
ffi_cfi.h - Copyright (c) 2014 Red Hat, Inc.
Conditionally assemble cfi directives. Only necessary for building libffi.
----------------------------------------------------------------------- */

#ifndef FFI_CFI_H
#define FFI_CFI_H

#ifdef HAVE_AS_CFI_PSEUDO_OP

# define cfi_startproc .cfi_startproc
# define cfi_endproc .cfi_endproc
# define cfi_def_cfa(reg, off) .cfi_def_cfa reg, off
# define cfi_def_cfa_register(reg) .cfi_def_cfa_register reg
# define cfi_def_cfa_offset(off) .cfi_def_cfa_offset off
# define cfi_adjust_cfa_offset(off) .cfi_adjust_cfa_offset off
# define cfi_offset(reg, off) .cfi_offset reg, off
# define cfi_rel_offset(reg, off) .cfi_rel_offset reg, off
# define cfi_register(r1, r2) .cfi_register r1, r2
# define cfi_return_column(reg) .cfi_return_column reg
# define cfi_restore(reg) .cfi_restore reg
# define cfi_same_value(reg) .cfi_same_value reg
# define cfi_undefined(reg) .cfi_undefined reg
# define cfi_remember_state .cfi_remember_state
# define cfi_restore_state .cfi_restore_state
# define cfi_window_save .cfi_window_save
# define cfi_personality(enc, exp) .cfi_personality enc, exp
# define cfi_lsda(enc, exp) .cfi_lsda enc, exp
# define cfi_escape(...) .cfi_escape __VA_ARGS__

#else

# define cfi_startproc
# define cfi_endproc
# define cfi_def_cfa(reg, off)
# define cfi_def_cfa_register(reg)
# define cfi_def_cfa_offset(off)
# define cfi_adjust_cfa_offset(off)
# define cfi_offset(reg, off)
# define cfi_rel_offset(reg, off)
# define cfi_register(r1, r2)
# define cfi_return_column(reg)
# define cfi_restore(reg)
# define cfi_same_value(reg)
# define cfi_undefined(reg)
# define cfi_remember_state
# define cfi_restore_state
# define cfi_window_save
# define cfi_personality(enc, exp)
# define cfi_lsda(enc, exp)
# define cfi_escape(...)

#endif /* HAVE_AS_CFI_PSEUDO_OP */
#endif /* FFI_CFI_H */
@@ -74,14 +74,35 @@ void ffi_type_test(ffi_type *a, char *file, int line);
#define FFI_ASSERT_VALID_TYPE(x)
#endif

#define ALIGN(v, a) (((((size_t) (v))-1) | ((a)-1))+1)
#define ALIGN_DOWN(v, a) (((size_t) (v)) & -a)
/* v cast to size_t and aligned up to a multiple of a */
#define FFI_ALIGN(v, a) (((((size_t) (v))-1) | ((a)-1))+1)
/* v cast to size_t and aligned down to a multiple of a */
#define FFI_ALIGN_DOWN(v, a) (((size_t) (v)) & -a)

/* Perform machine dependent cif processing */
ffi_status ffi_prep_cif_machdep(ffi_cif *cif);
ffi_status ffi_prep_cif_machdep_var(ffi_cif *cif,
unsigned int nfixedargs, unsigned int ntotalargs);


#if HAVE_LONG_DOUBLE_VARIANT
/* Used to adjust size/alignment of ffi types. */
void ffi_prep_types (ffi_abi abi);
#endif

/* Used internally, but overridden by some architectures */
ffi_status ffi_prep_cif_core(ffi_cif *cif,
ffi_abi abi,
unsigned int isvariadic,
unsigned int nfixedargs,
unsigned int ntotalargs,
ffi_type *rtype,
ffi_type **atypes);

/* Translate a data pointer to a code pointer. Needed for closures on
some targets. */
void *ffi_data_to_code_pointer (void *data) FFI_HIDDEN;

/* Extended cif, used in callback from assembly routine */
typedef struct
{
@@ -1,5 +1,5 @@
/* -----------------------------------------------------------------*-C-*-
ffitarget.h - Copyright (c) 2012, 2014 Anthony Green
ffitarget.h - Copyright (c) 2012, 2014, 2018 Anthony Green
Copyright (c) 1996-2003, 2010 Red Hat, Inc.
Copyright (C) 2008 Free Software Foundation, Inc.
@@ -50,7 +50,9 @@
#endif

#define FFI_TARGET_SPECIFIC_STACK_SPACE_ALLOCATION
//#define FFI_TARGET_HAS_COMPLEX_TYPE
#ifndef _MSC_VER
#define FFI_TARGET_HAS_COMPLEX_TYPE
#endif

/* ---- Generic type definitions ----------------------------------------- */

@@ -76,74 +78,69 @@ typedef signed long ffi_sarg;
#endif

typedef enum ffi_abi {
#if defined(X86_WIN64)
FFI_FIRST_ABI = 0,

/* ---- Intel x86 Win32 ---------- */
#ifdef X86_WIN32
FFI_SYSV,
FFI_STDCALL,
FFI_THISCALL,
FFI_FASTCALL,
FFI_MS_CDECL,
FFI_PASCAL,
FFI_REGISTER,
FFI_WIN64, /* sizeof(long double) == 8 - microsoft compilers */
FFI_GNUW64, /* sizeof(long double) == 16 - GNU compilers */
FFI_LAST_ABI,
#ifdef _MSC_VER
FFI_DEFAULT_ABI = FFI_MS_CDECL
#ifdef __GNUC__
FFI_DEFAULT_ABI = FFI_GNUW64
#else
FFI_DEFAULT_ABI = FFI_SYSV
FFI_DEFAULT_ABI = FFI_WIN64
#endif

#elif defined(X86_WIN64)
#elif defined(X86_64) || (defined (__x86_64__) && defined (X86_DARWIN))
FFI_FIRST_ABI = 1,
FFI_UNIX64,
FFI_WIN64,
FFI_EFI64 = FFI_WIN64,
FFI_GNUW64,
FFI_LAST_ABI,
FFI_DEFAULT_ABI = FFI_WIN64
FFI_DEFAULT_ABI = FFI_UNIX64

#elif defined(X86_WIN32)
FFI_FIRST_ABI = 0,
FFI_SYSV = 1,
FFI_STDCALL = 2,
FFI_THISCALL = 3,
FFI_FASTCALL = 4,
FFI_MS_CDECL = 5,
FFI_PASCAL = 6,
FFI_REGISTER = 7,
FFI_LAST_ABI,
FFI_DEFAULT_ABI = FFI_MS_CDECL
#else
/* ---- Intel x86 and AMD x86-64 - */
FFI_SYSV,
FFI_UNIX64, /* Unix variants all use the same ABI for x86-64 */
FFI_THISCALL,
FFI_FASTCALL,
FFI_STDCALL,
FFI_PASCAL,
FFI_REGISTER,
FFI_FIRST_ABI = 0,
FFI_SYSV = 1,
FFI_THISCALL = 3,
FFI_FASTCALL = 4,
FFI_STDCALL = 5,
FFI_PASCAL = 6,
FFI_REGISTER = 7,
FFI_MS_CDECL = 8,
FFI_LAST_ABI,
#if defined(__i386__) || defined(__i386)
FFI_DEFAULT_ABI = FFI_SYSV
#else
FFI_DEFAULT_ABI = FFI_UNIX64
#endif
#endif
} ffi_abi;
#endif

/* ---- Definitions for closures ----------------------------------------- */

#define FFI_CLOSURES 1
#define FFI_GO_CLOSURES 1

#define FFI_TYPE_SMALL_STRUCT_1B (FFI_TYPE_LAST + 1)
#define FFI_TYPE_SMALL_STRUCT_2B (FFI_TYPE_LAST + 2)
#define FFI_TYPE_SMALL_STRUCT_4B (FFI_TYPE_LAST + 3)
#define FFI_TYPE_MS_STRUCT (FFI_TYPE_LAST + 4)

#if defined (X86_64) || (defined (__x86_64__) && defined (X86_DARWIN))
#define FFI_TRAMPOLINE_SIZE 24
#define FFI_NATIVE_RAW_API 0
#else
#ifdef X86_WIN32
#define FFI_TRAMPOLINE_SIZE 52
#if defined (X86_64) || defined(X86_WIN64) \
|| (defined (__x86_64__) && defined (X86_DARWIN))
# define FFI_TRAMPOLINE_SIZE 24
# define FFI_NATIVE_RAW_API 0
#else
#ifdef X86_WIN64
#define FFI_TRAMPOLINE_SIZE 29
#define FFI_NATIVE_RAW_API 0
#define FFI_NO_RAW_API 1
#else
#define FFI_TRAMPOLINE_SIZE 10
#endif
#endif
#ifndef X86_WIN64
#define FFI_NATIVE_RAW_API 1 /* x86 has native raw api support */
#endif
# define FFI_TRAMPOLINE_SIZE 12
# define FFI_NATIVE_RAW_API 1 /* x86 has native raw api support */
#endif

#endif

0 comments on commit 6bd0e22

Please sign in to comment.
You can’t perform that action at this time.