1 /*
2 * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
37 import org.graalvm.compiler.debug.DebugHandlersFactory;
38 import org.graalvm.compiler.debug.DebugContext;
39 import org.graalvm.compiler.graph.NodeClass;
40 import org.graalvm.compiler.java.GraphBuilderPhase;
41 import org.graalvm.compiler.nodeinfo.NodeInfo;
42 import org.graalvm.compiler.nodes.ConstantNode;
43 import org.graalvm.compiler.nodes.StructuredGraph;
44 import org.graalvm.compiler.nodes.ValueNode;
45 import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration;
46 import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration.Plugins;
47 import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugins;
48 import org.graalvm.compiler.nodes.java.ArrayLengthNode;
49 import org.graalvm.compiler.nodes.spi.Virtualizable;
50 import org.graalvm.compiler.nodes.spi.VirtualizerTool;
51 import org.graalvm.compiler.options.OptionValues;
52 import org.graalvm.compiler.phases.OptimisticOptimizations;
53 import org.graalvm.compiler.phases.PhaseSuite;
54 import org.graalvm.compiler.phases.VerifyPhase.VerificationError;
55 import org.graalvm.compiler.phases.tiers.HighTierContext;
56 import org.graalvm.compiler.phases.util.Providers;
57 import org.graalvm.compiler.phases.verify.VerifyVirtualizableUsage;
58 import org.graalvm.compiler.runtime.RuntimeProvider;
59 import org.junit.Test;
60
61 import jdk.vm.ci.meta.MetaAccessProvider;
62 import jdk.vm.ci.meta.ResolvedJavaMethod;
63
64 public class VerifyVirtualizableTest {
65
66 @NodeInfo(cycles = CYCLES_IGNORED, size = SIZE_IGNORED)
67 static class InvalidEffectNodeAdd extends ValueNode implements Virtualizable {
68
69 public static final NodeClass<InvalidEffectNodeAdd> TYPE = NodeClass.create(InvalidEffectNodeAdd.class);
70
71 protected InvalidEffectNodeAdd() {
72 super(TYPE, StampFactory.forVoid());
73 }
74
75 @Override
76 public void virtualize(VirtualizerTool tool) {
77 graph().add(new ArrayLengthNode(null));
|
1 /*
2 * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
37 import org.graalvm.compiler.debug.DebugHandlersFactory;
38 import org.graalvm.compiler.debug.DebugContext;
39 import org.graalvm.compiler.graph.NodeClass;
40 import org.graalvm.compiler.java.GraphBuilderPhase;
41 import org.graalvm.compiler.nodeinfo.NodeInfo;
42 import org.graalvm.compiler.nodes.ConstantNode;
43 import org.graalvm.compiler.nodes.StructuredGraph;
44 import org.graalvm.compiler.nodes.ValueNode;
45 import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration;
46 import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration.Plugins;
47 import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugins;
48 import org.graalvm.compiler.nodes.java.ArrayLengthNode;
49 import org.graalvm.compiler.nodes.spi.Virtualizable;
50 import org.graalvm.compiler.nodes.spi.VirtualizerTool;
51 import org.graalvm.compiler.options.OptionValues;
52 import org.graalvm.compiler.phases.OptimisticOptimizations;
53 import org.graalvm.compiler.phases.PhaseSuite;
54 import org.graalvm.compiler.phases.VerifyPhase.VerificationError;
55 import org.graalvm.compiler.phases.tiers.HighTierContext;
56 import org.graalvm.compiler.phases.util.Providers;
57 import org.graalvm.compiler.runtime.RuntimeProvider;
58 import org.junit.Test;
59
60 import jdk.vm.ci.meta.MetaAccessProvider;
61 import jdk.vm.ci.meta.ResolvedJavaMethod;
62
63 public class VerifyVirtualizableTest {
64
65 @NodeInfo(cycles = CYCLES_IGNORED, size = SIZE_IGNORED)
66 static class InvalidEffectNodeAdd extends ValueNode implements Virtualizable {
67
68 public static final NodeClass<InvalidEffectNodeAdd> TYPE = NodeClass.create(InvalidEffectNodeAdd.class);
69
70 protected InvalidEffectNodeAdd() {
71 super(TYPE, StampFactory.forVoid());
72 }
73
74 @Override
75 public void virtualize(VirtualizerTool tool) {
76 graph().add(new ArrayLengthNode(null));
|