# HG changeset patch # User Roland Schatz # Date 1364900278 -7200 # Node ID db2b8fbbf8fc43c34c8239b66517e465bedf5ea2 # Parent 4d75c3833c54221041d493c3d61421cbed850e90# Parent 5a40a5509bac72b65a98e018f50a70a7a0df556f Merge. diff -r 4d75c3833c54 -r db2b8fbbf8fc graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/GraalCompilerTest.java --- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/GraalCompilerTest.java Tue Apr 02 11:48:46 2013 +0200 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/GraalCompilerTest.java Tue Apr 02 12:57:58 2013 +0200 @@ -71,11 +71,15 @@ protected final Backend backend; public GraalCompilerTest() { - DebugEnvironment.initialize(System.out); this.runtime = Graal.getRequiredCapability(GraalCodeCacheProvider.class); this.backend = Graal.getRequiredCapability(Backend.class); } + @BeforeClass + public static void initializeDebgging() { + DebugEnvironment.initialize(System.out); + } + protected void assertEquals(StructuredGraph expected, StructuredGraph graph) { String expectedString = getCanonicalGraphString(expected); String actualString = getCanonicalGraphString(graph); diff -r 4d75c3833c54 -r db2b8fbbf8fc graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/NewObjectSnippets.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/NewObjectSnippets.java Tue Apr 02 11:48:46 2013 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/NewObjectSnippets.java Tue Apr 02 12:57:58 2013 +0200 @@ -91,7 +91,11 @@ } result = memory.toObject(); } - return unsafeCast(verifyOop(result), StampFactory.forNodeIntrinsic()); + /** + * make sure that the unsafeCast is anchored after initialization, + * cf. {@link ReadAfterCheckCast} and {@link CheckCastSnippets} */ + BeginNode anchorNode = BeginNode.anchor(StampFactory.forNodeIntrinsic()); + return unsafeCast(verifyOop(result), StampFactory.forNodeIntrinsic(), anchorNode); } @Snippet diff -r 4d75c3833c54 -r db2b8fbbf8fc graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeCastNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeCastNode.java Tue Apr 02 11:48:46 2013 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeCastNode.java Tue Apr 02 12:57:58 2013 +0200 @@ -112,9 +112,6 @@ } @NodeIntrinsic - public static native T unsafeCast(Object object, @ConstantNodeParameter Stamp stamp); - - @NodeIntrinsic public static native T unsafeCast(Object object, @ConstantNodeParameter Stamp stamp, ValueNode anchor); @SuppressWarnings("unused")