hotspot/src/share/vm/prims/methodHandles.hpp
changeset 10551 095307d09cb3
parent 10514 e229a19078cf
child 11487 f45d945367d4
--- a/hotspot/src/share/vm/prims/methodHandles.hpp	Wed Sep 14 10:40:13 2011 +0200
+++ b/hotspot/src/share/vm/prims/methodHandles.hpp	Wed Sep 14 16:28:39 2011 +0200
@@ -515,11 +515,12 @@
   }
   // 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;
     }
   }