From bc855ff2e0d2365c6c48065ce377f97bc28f8fe1 Mon Sep 17 00:00:00 2001 From: Bertrand Delsart Date: Wed, 14 Sep 2011 16:28:39 +0200 Subject: [PATCH] 7077806: ARM: java.lang.InternalError: bound subword value does not fit into the subword type Shared fix necessary for ARM/PPC Reviewed-by: twisti, roland --- hotspot/src/share/vm/prims/methodHandles.hpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hotspot/src/share/vm/prims/methodHandles.hpp b/hotspot/src/share/vm/prims/methodHandles.hpp index 216a6ede210..f1c44ba7b4d 100644 --- a/hotspot/src/share/vm/prims/methodHandles.hpp +++ b/hotspot/src/share/vm/prims/methodHandles.hpp @@ -515,11 +515,12 @@ class MethodHandles: AllStatic { } // Here is the transformation the i2i adapter must perform: static int truncate_subword_from_vminfo(jint value, int vminfo) { - jint tem = value << vminfo; + int shift = vminfo & ~CONV_VMINFO_SIGN_FLAG; + jint tem = value << shift; if ((vminfo & CONV_VMINFO_SIGN_FLAG) != 0) { - return (jint)tem >> vminfo; + return (jint)tem >> shift; } else { - return (juint)tem >> vminfo; + return (juint)tem >> shift; } }