aboutsummaryrefslogtreecommitdiff
path: root/libjava
diff options
context:
space:
mode:
authorKai Tietz <ktietz@redhat.com>2012-02-01 11:46:36 +0100
committerKai Tietz <ktietz@gcc.gnu.org>2012-02-01 11:46:36 +0100
commit76a3962fe967dfde16d1b16460149d42680651b0 (patch)
tree97d7fe8daa62f82f0826e2248f98c24d3f5d02a4 /libjava
parent337c6e076cb4b9a2ad374859ca2248067d64e514 (diff)
downloadgcc-76a3962fe967dfde16d1b16460149d42680651b0.zip
gcc-76a3962fe967dfde16d1b16460149d42680651b0.tar.gz
gcc-76a3962fe967dfde16d1b16460149d42680651b0.tar.bz2
re PR libgcj/51500 (106 unexpected libjava testsuite failures with mingw32)
PR target/51500 * interpret.cc (_Jv_init_cif): Handle thiscall convention for 32-bit Windows. * java/lang/reflect/natMethod.cc (_Jv_CallAnyMethodA): Likewise. * java/lang/reflect/natVMProxy.cc (invoke_t): Add thiscall-attribute for 32-bit Windows. From-SVN: r183794
Diffstat (limited to 'libjava')
-rw-r--r--libjava/ChangeLog10
-rw-r--r--libjava/interpret.cc7
-rw-r--r--libjava/java/lang/reflect/natMethod.cc7
-rw-r--r--libjava/java/lang/reflect/natVMProxy.cc6
4 files changed, 27 insertions, 3 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index 7ac0a66..5f78e05 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,3 +1,13 @@
+2012-02-01 Kai Tietz <ktietz@redhat.com>
+
+ PR target/51500
+ * interpret.cc (_Jv_init_cif): Handle thiscall
+ convention for 32-bit Windows.
+ * java/lang/reflect/natMethod.cc (_Jv_CallAnyMethodA):
+ Likewise.
+ * java/lang/reflect/natVMProxy.cc (invoke_t): Add
+ thiscall-attribute for 32-bit Windows.
+
2012-01-01 Jakub Jelinek <jakub@redhat.com>
* gnu/gcj/convert/Convert.java (version): Update copyright notice
diff --git a/libjava/interpret.cc b/libjava/interpret.cc
index ab28836..78686fd 100644
--- a/libjava/interpret.cc
+++ b/libjava/interpret.cc
@@ -1303,7 +1303,12 @@ _Jv_init_cif (_Jv_Utf8Const* signature,
if (ptr != (unsigned char*)signature->chars() + signature->len())
throw_internal_error ("did not find end of signature");
- if (ffi_prep_cif (cif, FFI_DEFAULT_ABI,
+ ffi_abi cabi = FFI_DEFAULT_ABI;
+#if defined (X86_WIN32) && !defined (__CYGWIN__)
+ if (!staticp)
+ cabi = FFI_THISCALL;
+#endif
+ if (ffi_prep_cif (cif, cabi,
arg_count, rtype, arg_types) != FFI_OK)
throw_internal_error ("ffi_prep_cif failed");
diff --git a/libjava/java/lang/reflect/natMethod.cc b/libjava/java/lang/reflect/natMethod.cc
index d95c92f..8ac87fc 100644
--- a/libjava/java/lang/reflect/natMethod.cc
+++ b/libjava/java/lang/reflect/natMethod.cc
@@ -436,7 +436,12 @@ _Jv_CallAnyMethodA (jobject obj,
p += size_per_arg;
}
- if (ffi_prep_cif (&cif, FFI_DEFAULT_ABI, param_count,
+ ffi_abi cabi = FFI_DEFAULT_ABI;
+#if defined (X86_WIN32) && !defined (__CYGWIN__)
+ if (needs_this)
+ cabi = FFI_THISCALL;
+#endif
+ if (ffi_prep_cif (&cif, cabi, param_count,
rtype, argtypes) != FFI_OK)
throw new java::lang::VirtualMachineError(JvNewStringLatin1("internal error: ffi_prep_cif failed"));
diff --git a/libjava/java/lang/reflect/natVMProxy.cc b/libjava/java/lang/reflect/natVMProxy.cc
index 4c3fd74..e46263d 100644
--- a/libjava/java/lang/reflect/natVMProxy.cc
+++ b/libjava/java/lang/reflect/natVMProxy.cc
@@ -79,7 +79,11 @@ typedef void (*closure_fun) (ffi_cif*, void*, void**, void*);
static void *ncode (int method_index, jclass klass, _Jv_Method *self, closure_fun fun);
static void run_proxy (ffi_cif*, void*, void**, void*);
-typedef jobject invoke_t (jobject, Proxy *, Method *, JArray< jobject > *);
+typedef jobject
+#if defined (X86_WIN32) && !defined (__CYGWIN__)
+ __attribute__ ((thiscall))
+#endif
+ invoke_t (jobject, Proxy *, Method *, JArray< jobject > *);
// True if pc points to a proxy frame.