changeset 11244:3bc0b35218e7

Merge.
author Doug Simon <doug.simon@oracle.com>
date Wed, 07 Aug 2013 02:10:59 +0200
parents 5a9d68c3a7d7 (current diff) 0a40e1032037 (diff)
children d89a5dbaaaf6
files graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotGraalRuntime.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/jdk/CRC32_update.java graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/jdk/CRC32_updateBytes.java
diffstat 18 files changed, 268 insertions(+), 103 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotGraalRuntime.java	Mon Aug 05 22:23:00 2013 -0700
+++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotGraalRuntime.java	Wed Aug 07 02:10:59 2013 +0200
@@ -22,8 +22,11 @@
  */
 package com.oracle.graal.hotspot.amd64;
 
+import static com.oracle.graal.amd64.AMD64.*;
+
 import com.oracle.graal.amd64.*;
 import com.oracle.graal.api.code.*;
+import com.oracle.graal.api.meta.*;
 import com.oracle.graal.hotspot.*;
 import com.oracle.graal.hotspot.meta.*;
 
@@ -71,4 +74,9 @@
     protected HotSpotRuntime createRuntime() {
         return new AMD64HotSpotRuntime(config, this);
     }
+
+    @Override
+    protected Value[] getRuntimeCallVolatileRegisters() {
+        return new Value[]{r10.asValue(), r11.asValue()};
+    }
 }
--- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotRuntime.java	Mon Aug 05 22:23:00 2013 -0700
+++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotRuntime.java	Wed Aug 07 02:10:59 2013 +0200
@@ -31,6 +31,7 @@
 import static com.oracle.graal.hotspot.HotSpotForeignCallLinkage.RegisterEffect.*;
 import static com.oracle.graal.hotspot.HotSpotForeignCallLinkage.Transition.*;
 import static com.oracle.graal.hotspot.replacements.AESCryptSubstitutions.*;
+import static com.oracle.graal.hotspot.replacements.CRC32Substitutions.*;
 import static com.oracle.graal.hotspot.replacements.CipherBlockChainingSubstitutions.*;
 
 import com.oracle.graal.api.code.*;
@@ -69,6 +70,7 @@
         registerForeignCall(DECRYPT_BLOCK, config.aescryptDecryptBlockStub, NativeCall, PRESERVES_REGISTERS, LEAF, NOT_REEXECUTABLE, ANY_LOCATION);
         registerForeignCall(ENCRYPT, config.cipherBlockChainingEncryptAESCryptStub, NativeCall, PRESERVES_REGISTERS, LEAF, NOT_REEXECUTABLE, ANY_LOCATION);
         registerForeignCall(DECRYPT, config.cipherBlockChainingDecryptAESCryptStub, NativeCall, PRESERVES_REGISTERS, LEAF, NOT_REEXECUTABLE, ANY_LOCATION);
+        registerForeignCall(UPDATE_BYTES_CRC32, config.updateBytesCRC32Stub, NativeCall, PRESERVES_REGISTERS, LEAF, NOT_REEXECUTABLE, ANY_LOCATION);
 
         convertSnippets = new AMD64ConvertSnippets.Templates(this, replacements, graalRuntime.getTarget());
         super.registerReplacements(replacements);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.hotspot.jdk8.test/src/com/oracle/graal/hotspot/jdk8/test/CRC32UpdateByteBufferSubstitutionTest.java	Wed Aug 07 02:10:59 2013 +0200
@@ -0,0 +1,60 @@
+/*
+ * 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.hotspot.jdk8.test;
+
+import java.io.*;
+import java.nio.*;
+import java.util.zip.*;
+
+import org.junit.*;
+
+import com.oracle.graal.compiler.test.*;
+
+/**
+ * Tests compiled call to {@link CRC32#updateByteBuffer(int, long, int, int)}.
+ */
+@SuppressWarnings("javadoc")
+public class CRC32UpdateByteBufferSubstitutionTest extends GraalCompilerTest {
+
+    public static long updateByteBuffer(ByteBuffer buffer) {
+        CRC32 crc = new CRC32();
+        buffer.rewind();
+        crc.update(buffer);
+        return crc.getValue();
+    }
+
+    @Test
+    public void test1() throws Throwable {
+        String classfileName = CRC32UpdateByteBufferSubstitutionTest.class.getSimpleName().replace('.', '/') + ".class";
+        InputStream s = CRC32UpdateByteBufferSubstitutionTest.class.getResourceAsStream(classfileName);
+        byte[] buf = new byte[s.available()];
+        new DataInputStream(s).readFully(buf);
+
+        ByteBuffer directBuf = ByteBuffer.allocateDirect(buf.length);
+        directBuf.put(buf);
+        ByteBuffer heapBuf = ByteBuffer.wrap(buf);
+
+        test("updateByteBuffer", directBuf);
+        test("updateByteBuffer", heapBuf);
+    }
+}
--- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotGraalRuntime.java	Mon Aug 05 22:23:00 2013 -0700
+++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotGraalRuntime.java	Wed Aug 07 02:10:59 2013 +0200
@@ -23,6 +23,7 @@
 package com.oracle.graal.hotspot.sparc;
 
 import com.oracle.graal.api.code.*;
+import com.oracle.graal.api.meta.*;
 import com.oracle.graal.hotspot.*;
 import com.oracle.graal.hotspot.meta.*;
 import com.oracle.graal.sparc.*;
@@ -66,4 +67,10 @@
     protected HotSpotRuntime createRuntime() {
         return new SPARCHotSpotRuntime(config, this);
     }
+
+    @Override
+    protected Value[] getRuntimeCallVolatileRegisters() {
+        // TODO: is this correct?
+        return new Value[0];
+    }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/CRC32SubstitutionsTest.java	Wed Aug 07 02:10:59 2013 +0200
@@ -0,0 +1,71 @@
+/*
+ * 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.hotspot.test;
+
+import java.io.*;
+import java.util.zip.*;
+
+import org.junit.*;
+
+import com.oracle.graal.compiler.test.*;
+
+/**
+ * Tests compiled call to {@link CRC32#update(int, int)}.
+ */
+@SuppressWarnings("javadoc")
+public class CRC32SubstitutionsTest extends GraalCompilerTest {
+
+    public static long update(byte[] input) {
+        CRC32 crc = new CRC32();
+        for (byte b : input) {
+            crc.update(b);
+        }
+        return crc.getValue();
+    }
+
+    @Test
+    public void test1() {
+        test("update", "some string".getBytes());
+    }
+
+    public static long updateBytes(byte[] input) {
+        CRC32 crc = new CRC32();
+        crc.update(input, 0, input.length);
+        return crc.getValue();
+    }
+
+    @Test
+    public void test2() {
+        test("updateBytes", "some string".getBytes());
+    }
+
+    @Test
+    public void test3() throws Throwable {
+        String classfileName = CRC32SubstitutionsTest.class.getSimpleName().replace('.', '/') + ".class";
+        InputStream s = CRC32SubstitutionsTest.class.getResourceAsStream(classfileName);
+        byte[] buf = new byte[s.available()];
+        new DataInputStream(s).readFully(buf);
+        test("updateBytes", buf);
+    }
+
+}
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotForeignCallLinkage.java	Mon Aug 05 22:23:00 2013 -0700
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotForeignCallLinkage.java	Wed Aug 07 02:10:59 2013 +0200
@@ -124,7 +124,11 @@
                     boolean reexecutable, LocationIdentity... killedLocations) {
         CallingConvention outgoingCc = createCallingConvention(descriptor, outgoingCcType);
         CallingConvention incomingCc = incomingCcType == null ? null : createCallingConvention(descriptor, incomingCcType);
-        return new HotSpotForeignCallLinkage(descriptor, address, effect, transition, outgoingCc, incomingCc, reexecutable, killedLocations);
+        HotSpotForeignCallLinkage linkage = new HotSpotForeignCallLinkage(descriptor, address, effect, transition, outgoingCc, incomingCc, reexecutable, killedLocations);
+        if (outgoingCcType == Type.NativeCall) {
+            linkage.temporaries = graalRuntime().getRuntimeCallVolatileRegisters();
+        }
+        return linkage;
     }
 
     /**
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalRuntime.java	Mon Aug 05 22:23:00 2013 -0700
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalRuntime.java	Wed Aug 07 02:10:59 2013 +0200
@@ -32,6 +32,7 @@
 import com.oracle.graal.api.runtime.*;
 import com.oracle.graal.compiler.target.*;
 import com.oracle.graal.graph.*;
+import com.oracle.graal.hotspot.HotSpotForeignCallLinkage.RegisterEffect;
 import com.oracle.graal.hotspot.bridge.*;
 import com.oracle.graal.hotspot.logging.*;
 import com.oracle.graal.hotspot.meta.*;
@@ -253,6 +254,13 @@
 
     protected abstract HotSpotRuntime createRuntime();
 
+    /**
+     * Gets the registers that are treated volatile by foreign calls into the runtime. These
+     * registers must be spilled across all native foreign runtime calls, even for calls that are
+     * declared as {@link RegisterEffect#PRESERVES_REGISTERS register preserving}.
+     */
+    protected abstract Value[] getRuntimeCallVolatileRegisters();
+
     public HotSpotVMConfig getConfig() {
         return config;
     }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotReplacementsImpl.java	Mon Aug 05 22:23:00 2013 -0700
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotReplacementsImpl.java	Wed Aug 07 02:10:59 2013 +0200
@@ -60,6 +60,10 @@
             assert config.aescryptDecryptBlockStub != 0L;
             assert config.cipherBlockChainingEncryptAESCryptStub != 0L;
             assert config.cipherBlockChainingDecryptAESCryptStub != 0L;
+        } else if (substituteMethod.getDeclaringClass() == CRC32Substitutions.class) {
+            if (!config.useCRC32Intrinsics) {
+                return null;
+            }
         }
         return super.registerMethodSubstitution(originalMethod, substituteMethod);
     }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotVMConfig.java	Mon Aug 05 22:23:00 2013 -0700
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotVMConfig.java	Wed Aug 07 02:10:59 2013 +0200
@@ -108,6 +108,7 @@
     public final boolean useBiasedLocking = getVMOption("UseBiasedLocking");
     public final boolean usePopCountInstruction = getVMOption("UsePopCountInstruction");
     public final boolean useAESIntrinsics = getVMOption("UseAESIntrinsics");
+    public final boolean useCRC32Intrinsics = getVMOption("UseCRC32Intrinsics");
     public final boolean useG1GC = getVMOption("UseG1GC");
     public long gcTotalCollectionsAddress;
 
@@ -484,6 +485,7 @@
     public long aescryptDecryptBlockStub;
     public long cipherBlockChainingEncryptAESCryptStub;
     public long cipherBlockChainingDecryptAESCryptStub;
+    public long updateBytesCRC32Stub;
 
     public long newInstanceAddress;
     public long newArrayAddress;
@@ -513,6 +515,7 @@
     public long arithmeticCosAddress;
     public long arithmeticTanAddress;
     public long loadAndClearExceptionAddress;
+    public long crcTableAddress;
 
     public int deoptReasonNone;
     public int deoptReasonNullCheck;
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java	Mon Aug 05 22:23:00 2013 -0700
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java	Wed Aug 07 02:10:59 2013 +0200
@@ -332,6 +332,9 @@
             r.registerSubstitutions(AESCryptSubstitutions.class);
             r.registerSubstitutions(CipherBlockChainingSubstitutions.class);
         }
+        if (IntrinsifyCRC32Methods.getValue()) {
+            r.registerSubstitutions(CRC32Substitutions.class);
+        }
         if (IntrinsifyReflectionMethods.getValue()) {
             r.registerSubstitutions(ReflectionSubstitutions.class);
         }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/CRC32Substitutions.java	Wed Aug 07 02:10:59 2013 +0200
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 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.hotspot.replacements;
+
+import static com.oracle.graal.hotspot.HotSpotGraalRuntime.*;
+import static com.oracle.graal.hotspot.replacements.HotSpotReplacementsUtil.*;
+
+import java.util.zip.*;
+
+import com.oracle.graal.api.meta.*;
+import com.oracle.graal.api.replacements.*;
+import com.oracle.graal.graph.Node.*;
+import com.oracle.graal.hotspot.nodes.*;
+import com.oracle.graal.nodes.extended.*;
+import com.oracle.graal.replacements.Snippet.Fold;
+import com.oracle.graal.word.*;
+
+/**
+ * Substitutions for {@link CRC32}.
+ */
+@ClassSubstitution(value = CRC32.class)
+public class CRC32Substitutions {
+
+    /**
+     * Gets the address of {@code StubRoutines::x86::_crc_table} in {@code stubRoutines_x86.hpp}.
+     */
+    @Fold
+    private static long crcTableAddress() {
+        return graalRuntime().getConfig().crcTableAddress;
+    }
+
+    @MethodSubstitution(isStatic = true)
+    static int update(int crc, int b) {
+        int c = ~crc;
+        int index = (b ^ c) & 0xFF;
+        int offset = index << 2;
+        int result = Word.unsigned(crcTableAddress()).readInt(offset);
+        result = result ^ (c >>> 8);
+        return ~result;
+    }
+
+    @MethodSubstitution(isStatic = true)
+    static int updateBytes(int crc, byte[] buf, int off, int len) {
+        Word bufAddr = Word.unsigned(GetObjectAddressNode.get(buf) + arrayBaseOffset(Kind.Byte) + off);
+        return updateBytes(UPDATE_BYTES_CRC32, crc, bufAddr, len);
+    }
+
+    @MethodSubstitution(isStatic = true, optional = true)
+    static int updateByteBuffer(int crc, long addr, int off, int len) {
+        Word bufAddr = Word.unsigned(addr).add(off);
+        return updateBytes(UPDATE_BYTES_CRC32, crc, bufAddr, len);
+    }
+
+    public static final ForeignCallDescriptor UPDATE_BYTES_CRC32 = new ForeignCallDescriptor("updateBytesCRC32", int.class, int.class, Word.class, int.class);
+
+    @NodeIntrinsic(ForeignCallNode.class)
+    public static native int updateBytes(@ConstantNodeParameter ForeignCallDescriptor descriptor, int crc, Word buf, int length);
+}
--- a/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/jdk/CRC32_update.java	Mon Aug 05 22:23:00 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
- * 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.*;
-
-/**
- * Tests compiled call to {@link CRC32#update(int, int)}.
- */
-@SuppressWarnings("javadoc")
-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/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/jdk/CRC32_updateBytes.java	Mon Aug 05 22:23:00 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * 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.*;
-
-/**
- * Tests compiled call to {@link CRC32#updateBytes(int, byte[], int, int)}.
- */
-@SuppressWarnings("javadoc")
-public class CRC32_updateBytes extends JTTTest {
-
-    public static long test(byte[] input) {
-        CRC32 crc = new CRC32();
-        crc.update(input, 0, input.length);
-        return crc.getValue();
-    }
-
-    @Test
-    public void run0() throws Throwable {
-        runTest("test", "some string".getBytes());
-    }
-
-}
--- a/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/GraalOptions.java	Mon Aug 05 22:23:00 2013 -0700
+++ b/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/GraalOptions.java	Wed Aug 07 02:10:59 2013 +0200
@@ -308,6 +308,8 @@
     @Option(help = "")
     public static final OptionValue<Boolean> IntrinsifyAESMethods = new OptionValue<>(true);
     @Option(help = "")
+    public static final OptionValue<Boolean> IntrinsifyCRC32Methods = new OptionValue<>(true);
+    @Option(help = "")
     public static final OptionValue<Boolean> IntrinsifyReflectionMethods = new OptionValue<>(true);
     @Option(help = "")
     public static final OptionValue<Boolean> IntrinsifyInstalledCodeMethods = new OptionValue<>(true);
--- a/graal/com.oracle.graal.replacements.verifier/src/com/oracle/graal/replacements/verifier/MethodSubstitutionVerifier.java	Mon Aug 05 22:23:00 2013 -0700
+++ b/graal/com.oracle.graal.replacements.verifier/src/com/oracle/graal/replacements/verifier/MethodSubstitutionVerifier.java	Wed Aug 07 02:10:59 2013 +0200
@@ -170,8 +170,11 @@
             }
         }
         if (originalMethod == null) {
-            env.getMessager().printMessage(Kind.ERROR, String.format("Could not find the original method with name '%s' and parameters '%s'.", originalName, Arrays.toString(signatureParameters)),
-                            substitutionMethod, substitutionAnnotation);
+            boolean optional = resolveAnnotationValue(Boolean.class, findAnnotationValue(substitutionAnnotation, "optional"));
+            if (!optional) {
+                env.getMessager().printMessage(Kind.ERROR, String.format("Could not find the original method with name '%s' and parameters '%s'.", originalName, Arrays.toString(signatureParameters)),
+                                substitutionMethod, substitutionAnnotation);
+            }
             return null;
         }
 
--- a/mx/projects	Mon Aug 05 22:23:00 2013 -0700
+++ b/mx/projects	Wed Aug 07 02:10:59 2013 +0200
@@ -150,6 +150,14 @@
 project@com.oracle.graal.hotspot.test@javaCompliance=1.7
 project@com.oracle.graal.hotspot.test@workingSets=Graal,HotSpot,Test
 
+# graal.hotspot.test
+project@com.oracle.graal.hotspot.jdk8.test@subDir=graal
+project@com.oracle.graal.hotspot.jdk8.test@sourceDirs=src
+project@com.oracle.graal.hotspot.jdk8.test@dependencies=com.oracle.graal.compiler.test
+project@com.oracle.graal.hotspot.jdk8.test@checkstyle=com.oracle.graal.graph
+project@com.oracle.graal.hotspot.jdk8.test@javaCompliance=1.8
+project@com.oracle.graal.hotspot.jdk8.test@workingSets=Graal,HotSpot,Test
+
 # graal.hotspot.amd64.test
 project@com.oracle.graal.hotspot.amd64.test@subDir=graal
 project@com.oracle.graal.hotspot.amd64.test@sourceDirs=src
--- a/src/cpu/x86/vm/templateInterpreter_x86_64.cpp	Mon Aug 05 22:23:00 2013 -0700
+++ b/src/cpu/x86/vm/templateInterpreter_x86_64.cpp	Wed Aug 07 02:10:59 2013 +0200
@@ -1001,13 +1001,13 @@
     // Calculate address of start element
     if (kind == Interpreter::java_util_zip_CRC32_updateByteBuffer) {
       __ movptr(buf, Address(rsp, 3*wordSize)); // long buf
-      __ movl(len,   Address(rsp, 2*wordSize)); // offset
+      __ movslq(len,   Address(rsp, 2*wordSize)); // offset
       __ addq(buf, len); // + offset
       __ movl(crc,   Address(rsp, 5*wordSize)); // Initial CRC
     } else {
       __ movptr(buf, Address(rsp, 3*wordSize)); // byte[] array
       __ addptr(buf, arrayOopDesc::base_offset_in_bytes(T_BYTE)); // + header size
-      __ movl(len,   Address(rsp, 2*wordSize)); // offset
+      __ movslq(len,   Address(rsp, 2*wordSize)); // offset
       __ addq(buf, len); // + offset
       __ movl(crc,   Address(rsp, 4*wordSize)); // Initial CRC
     }
--- a/src/share/vm/graal/graalCompilerToVM.cpp	Mon Aug 05 22:23:00 2013 -0700
+++ b/src/share/vm/graal/graalCompilerToVM.cpp	Wed Aug 07 02:10:59 2013 +0200
@@ -788,6 +788,7 @@
   set_address("aescryptDecryptBlockStub", StubRoutines::aescrypt_decryptBlock());
   set_address("cipherBlockChainingEncryptAESCryptStub", StubRoutines::cipherBlockChaining_encryptAESCrypt());
   set_address("cipherBlockChainingDecryptAESCryptStub", StubRoutines::cipherBlockChaining_decryptAESCrypt());
+  set_address("updateBytesCRC32Stub", StubRoutines::updateBytesCRC32());
 
   set_address("newInstanceAddress", GraalRuntime::new_instance);
   set_address("newArrayAddress", GraalRuntime::new_array);
@@ -815,6 +816,7 @@
   set_address("arithmeticSinAddress", CAST_FROM_FN_PTR(address, SharedRuntime::dsin));
   set_address("arithmeticCosAddress", CAST_FROM_FN_PTR(address, SharedRuntime::dcos));
   set_address("arithmeticTanAddress", CAST_FROM_FN_PTR(address, SharedRuntime::dtan));
+  set_address("crcTableAddress", StubRoutines::crc_table_addr());
 
   set_int("deoptReasonNone", Deoptimization::Reason_none);
   set_int("deoptReasonNullCheck", Deoptimization::Reason_null_check);