_Jv_CallAnyMehtodA alignment patch
Boehm, Hans
hans_boehm@hp.com
Mon Feb 10 16:46:00 GMT 2003
I don't have a compact test case. I started getting misalignment warnings out of the Linux/IA64 kernel when trying to run my calculator with the gtk awt peers, and I traced the problem to this code. The current code looks clearly wrong to me. The problem went away with this patch. (Unfortunately, it takes a few awt patches to get to this stage. I would like to see those, or corrected versions of them, make it into the tree as well.)
"Make check" in libjava on IA64 with this patch shows no regressions. It also doesn't fix any of the existing test suite failures.
I think this should show up if you try to pass a byte as the first argument and a long as the second argument to a JNI method. It looks like there are no such cases in the test suite. The gtk peers seem to be by far the most demanding JNI test we have?
Hans
> -----Original Message-----
> From: Andrew Haley [mailto:aph@redhat.com]
> Sent: Monday, February 10, 2003 2:19 AM
> To: Boehm, Hans
> Cc: 'java-patches@gcc.gnu.org '
> Subject: _Jv_CallAnyMehtodA alignment patch
>
>
> Boehm, Hans writes:
> >
> > _Jv_CallAnyMethodA allocates an array p to hold arguments
> to the call. Arguments are stored adjacently, which means
> they may end up misaligned. This can fail on non-X86 architectures.
> >
> > I attached a patch which allocates a jvalue for each
> argument instead. This also simplifies the code. My guess
> is it speeds up a little as well, though I didn't check that.
> OK for trunk? This should probably go into 3.3 as well,
> though we may want to try it on the trunk first.
>
> I'm surprised we haven't seen this one before! Did you happen to have
> a test case?
>
> Thanks,
> Andrew.
>
More information about the Java-patches
mailing list