# HG changeset patch # User Tom Rodriguez # Date 1429834732 25200 # Node ID 05e3ec9d5aa2de021ab1ca07c0db82e92b7e2a58 # Parent 5d7a2915c96cf9e64a6865d369020cac7d7ca108 Make sure an after state is available when lowering checkcast arraycopy diff -r 5d7a2915c96c -r 05e3ec9d5aa2 graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/ArrayCopyIntrinsificationTest.java --- a/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/ArrayCopyIntrinsificationTest.java Thu Apr 23 17:17:52 2015 -0700 +++ b/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/ArrayCopyIntrinsificationTest.java Thu Apr 23 17:18:52 2015 -0700 @@ -256,7 +256,6 @@ * "https://code.google.com/r/baggiogamp-guava/source/browse/guava/src/com/google/common/collect/ArrayTable.java?r=d2e06112416223cb5437d43c12a989c0adc7345b#181" * > com.google.common.collect.ArrayTable(ArrayTable other). */ - @Ignore @Test public void testCopyRows() { mustIntrinsify = false; diff -r 5d7a2915c96c -r 05e3ec9d5aa2 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/arraycopy/ArrayCopySnippets.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/arraycopy/ArrayCopySnippets.java Thu Apr 23 17:17:52 2015 -0700 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/arraycopy/ArrayCopySnippets.java Thu Apr 23 17:18:52 2015 -0700 @@ -207,6 +207,9 @@ // copied elements (xor'd with -1). copiedElements ^= -1; System.arraycopy(nonNullSrc, srcPos + copiedElements, nonNullDest, destPos + copiedElements, length - copiedElements); + } else { + // Capture an after state for this path. + ArrayCopyStateNode.captureState(); } } diff -r 5d7a2915c96c -r 05e3ec9d5aa2 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/arraycopy/ArrayCopyStateNode.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/arraycopy/ArrayCopyStateNode.java Thu Apr 23 17:18:52 2015 -0700 @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2015, 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. + */ +//JaCoCo Exclude +package com.oracle.graal.hotspot.replacements.arraycopy; + +import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.type.*; +import com.oracle.graal.graph.*; +import com.oracle.graal.nodeinfo.*; +import com.oracle.graal.nodes.*; +import com.oracle.graal.nodes.spi.*; + +/** + * A dummy node whose only purpose is to capture a final {@link FrameState} when lowering complex + * arraycopy snippets. + */ + +@NodeInfo +public final class ArrayCopyStateNode extends AbstractStateSplit implements Lowerable { + + public static final NodeClass TYPE = NodeClass.create(ArrayCopyStateNode.class); + + protected ArrayCopyStateNode() { + super(TYPE, StampFactory.forKind(Kind.Void)); + + } + + @Override + public void lower(LoweringTool tool) { + if (graph().getGuardsStage().areFrameStatesAtDeopts()) { + graph().removeFixed(this); + } + } + + @NodeIntrinsic + public static native void captureState(); +}