changeset 5271:ad547adc14ab

Merge
author asaha
date Thu, 24 Apr 2014 22:05:07 -0700
parents 81c8c56eecf6 3dc6ae1972a4
children 737fcf362870
files .hgtags
diffstat 7 files changed, 90 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Fri Apr 18 17:05:33 2014 -1000
+++ b/.hgtags	Thu Apr 24 22:05:07 2014 -0700
@@ -630,6 +630,9 @@
 d27b468d5f3be3329ff1ff342f3347e6b2e0303b jdk7u55-b30
 dff9147a781672f20bb0577a94233264ea4a95d1 jdk7u55-b14
 8175599864880938d68d0a515fa561043d7d5fd0 jdk7u55-b31
+ba9270b8fb1f4852ff1d9dab15571eb9e0714495 jdk7u55-b32
+0901a8cf66a0494b55bf104c9666d4e3c6ff93f0 jdk7u55-b33
+278d7e230b297a4632b94ddc07d591e74736e039 jdk7u55-b34
 ae4adc1492d1c90a70bd2d139a939fc0c8329be9 jdk7u60-b00
 af1fc2868a2b919727bfbb0858449bd991bbee4a jdk7u40-b60
 cc83359f5e5eb46dd9176b0a272390b1a0a51fdc hs24.60-b01
@@ -655,6 +658,7 @@
 5853131ba4b448c5d89a3f0aa501fdf07f3b473c jdk7u60-b13
 b226be2040f971855626f5b88cb41a7d5299fea0 jdk7u60-b14
 2871f345b7e5585e20dc7aa91035967fe774cfba jdk7u60-b15
+ec76bacbb5b90efc7988dee5345c656126b97561 jdk7u60-b16
 4a9635c98a917cfcef506ca5d034c733a33c53f3 jdk7u65-b01
 eb797fab50d3b440b17b3e7c5d83f42bfa73655e jdk7u65-b02
 bb00df28ecdbd0da89ab4ed81f6f2b732fa512da jdk7u65-b03
@@ -663,6 +667,8 @@
 6f1dddf9c632bfb14121c9521d17b64bd0be0cd2 jdk7u65-b06
 a053d3d805355ffcd85c17e653182e17d4456bd5 jdk7u65-b07
 6f03dfb50363d26599fcf726586ea3f6d0e0347d jdk7u65-b08
+b4930eb1ea7630b4d8609e2efe6f000d3dc83235 jdk7u65-b09
 6b37a189944aaa09e81d97d394496464d16bee42 jdk7u66-b00
 121dc94194d9234e2b13c867d875e23e1bdd6abd jdk7u66-b01
+f28ea516eb0b9e99f1e342954ab4642456af4da1 jdk7u66-b09
 4ceb9c03fe8ee6b93d22854780ef8c737edd14b2 jdk7u71-b00
--- a/make/hotspot_version	Fri Apr 18 17:05:33 2014 -1000
+++ b/make/hotspot_version	Thu Apr 24 22:05:07 2014 -0700
@@ -35,7 +35,7 @@
 
 HS_MAJOR_VER=24
 HS_MINOR_VER=66
-HS_BUILD_NUMBER=01
+HS_BUILD_NUMBER=02
 
 JDK_MAJOR_VER=1
 JDK_MINOR_VER=7
--- a/src/share/vm/opto/graphKit.cpp	Fri Apr 18 17:05:33 2014 -1000
+++ b/src/share/vm/opto/graphKit.cpp	Thu Apr 24 22:05:07 2014 -0700
@@ -1120,6 +1120,17 @@
   }
   return _gvn.transform( new (C) ConvI2LNode(offset));
 }
+
+Node* GraphKit::ConvI2UL(Node* offset) {
+  juint offset_con = (juint) find_int_con(offset, Type::OffsetBot);
+  if (offset_con != (juint) Type::OffsetBot) {
+    return longcon((julong) offset_con);
+  }
+  Node* conv = _gvn.transform( new (C) ConvI2LNode(offset));
+  Node* mask = _gvn.transform( ConLNode::make(C, (julong) max_juint) );
+  return _gvn.transform( new (C) AndLNode(conv, mask) );
+}
+
 Node* GraphKit::ConvL2I(Node* offset) {
   // short-circuit a common case
   jlong offset_con = find_long_con(offset, (jlong)Type::OffsetBot);
--- a/src/share/vm/opto/graphKit.hpp	Fri Apr 18 17:05:33 2014 -1000
+++ b/src/share/vm/opto/graphKit.hpp	Thu Apr 24 22:05:07 2014 -0700
@@ -338,6 +338,7 @@
   // Convert between int and long, and size_t.
   // (See macros ConvI2X, etc., in type.hpp for ConvI2X, etc.)
   Node* ConvI2L(Node* offset);
+  Node* ConvI2UL(Node* offset);
   Node* ConvL2I(Node* offset);
   // Find out the klass of an object.
   Node* load_object_klass(Node* object);
--- a/src/share/vm/opto/library_call.cpp	Fri Apr 18 17:05:33 2014 -1000
+++ b/src/share/vm/opto/library_call.cpp	Thu Apr 24 22:05:07 2014 -0700
@@ -2432,7 +2432,7 @@
     case T_ADDRESS:
       // Cast to an int type.
       p = _gvn.transform(new (C) CastP2XNode(NULL, p));
-      p = ConvX2L(p);
+      p = ConvX2UL(p);
       break;
     default:
       fatal(err_msg_res("unexpected type %d: %s", type, type2name(type)));
--- a/src/share/vm/opto/type.hpp	Fri Apr 18 17:05:33 2014 -1000
+++ b/src/share/vm/opto/type.hpp	Thu Apr 24 22:05:07 2014 -0700
@@ -1348,6 +1348,7 @@
 #define ConvL2X(x)   (x)
 #define ConvX2I(x)   ConvL2I(x)
 #define ConvX2L(x)   (x)
+#define ConvX2UL(x)  (x)
 
 #else
 
@@ -1392,6 +1393,7 @@
 #define ConvL2X(x)   ConvL2I(x)
 #define ConvX2I(x)   (x)
 #define ConvX2L(x)   ConvI2L(x)
+#define ConvX2UL(x)  ConvI2UL(x)
 
 #endif
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/compiler/6653795/UnsafeGetAddressTest.java	Thu Apr 24 22:05:07 2014 -0700
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 6653795
+ * @summary C2 intrinsic for Unsafe.getAddress performs pointer sign extension on 32-bit systems
+ * @run main UnsafeGetAddressTest
+ *
+ */
+
+import sun.misc.Unsafe;
+import java.lang.reflect.*;
+
+public class UnsafeGetAddressTest {
+    private static Unsafe unsafe;
+
+    public static void main(String[] args) throws Exception {
+        Class c = UnsafeGetAddressTest.class.getClassLoader().loadClass("sun.misc.Unsafe");
+        Field f = c.getDeclaredField("theUnsafe");
+        f.setAccessible(true);
+        unsafe = (Unsafe)f.get(c);
+
+        long address = unsafe.allocateMemory(unsafe.addressSize());
+        unsafe.putAddress(address, 0x0000000080000000L);
+        // from sun.misc.Unsafe.getAddress' documentation:
+        // "If the native pointer is less than 64 bits wide, it is
+        // extended as an unsigned number to a Java long."
+        result = unsafe.getAddress(address);
+        System.out.printf("1: was 0x%x, expected 0x%x\n", result,
+                0x0000000080000000L);
+        for (int i = 0; i < 1000000; i++) {
+            result = unsafe.getAddress(address);
+        }
+
+        // The code has got compiled, check the result now
+        System.out.printf("2: was 0x%x, expected 0x%x\n", result,
+                0x0000000080000000L);
+        if (result != 0x0000000080000000L) {
+            System.out.println("Test Failed");
+            System.exit(97);
+        } else {
+            System.out.println("Test Passed");
+        }
+    }
+    static volatile long result;
+}
+