changeset 11176:0630959b64e8

disabled CRC32 intrinsics until they work with Graal
author Doug Simon <doug.simon@oracle.com>
date Thu, 01 Aug 2013 00:57:27 +0200
parents e636d62005c3
children d0aeaf72c7bd
files graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/jdk/CRC32_update.java src/share/vm/runtime/arguments.cpp
diffstat 2 files changed, 54 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/jdk/CRC32_update.java	Thu Aug 01 00:57:27 2013 +0200
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2007, 2012, 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.
+ */
+package com.oracle.graal.jtt.jdk;
+
+import java.util.zip.*;
+
+import org.junit.*;
+
+import com.oracle.graal.jtt.*;
+
+public class CRC32_update extends JTTTest {
+
+    public static long test(byte[] input) {
+        CRC32 crc = new CRC32();
+        for (byte b : input) {
+            crc.update(b);
+        }
+        return crc.getValue();
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        runTest("test", "some string".getBytes());
+    }
+
+}
--- a/src/share/vm/runtime/arguments.cpp	Thu Aug 01 00:38:28 2013 +0200
+++ b/src/share/vm/runtime/arguments.cpp	Thu Aug 01 00:57:27 2013 +0200
@@ -2219,6 +2219,14 @@
       ScavengeRootsInCode = 1;
   }
 
+  if (UseCRC32Intrinsics) {
+    // For some yet to be determined reason, enabling CRC32 intrinsics causes
+    // a Graal compiled call to 'static java.util.zip.CRC32.update(int crc, int b)'
+    // to crash the VM
+    warning("disabling CRC32 intrinsics because Graal is enabled");
+  }
+  // This prevents the flag being set to true by VM_Version::get_processor_features()
+  FLAG_SET_CMDLINE(bool, UseCRC32Intrinsics, false);
 #endif
 
   // Need to limit the extent of the padding to reasonable size.