< prev index next >

src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifyDebugUsageTest.java

Print this page
rev 52889 : 8214023: Update Graal
   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  */


  31 
  32 import org.graalvm.compiler.api.test.Graal;
  33 import org.graalvm.compiler.debug.DebugCloseable;
  34 import org.graalvm.compiler.debug.DebugHandlersFactory;
  35 import org.graalvm.compiler.debug.DebugContext;
  36 import org.graalvm.compiler.debug.GraalError;
  37 import org.graalvm.compiler.debug.Indent;
  38 import org.graalvm.compiler.graph.Node;
  39 import org.graalvm.compiler.java.GraphBuilderPhase;
  40 import org.graalvm.compiler.nodes.StructuredGraph;
  41 import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration;
  42 import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration.Plugins;
  43 import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugins;
  44 import org.graalvm.compiler.options.OptionValues;
  45 import org.graalvm.compiler.phases.OptimisticOptimizations;
  46 import org.graalvm.compiler.phases.Phase;
  47 import org.graalvm.compiler.phases.PhaseSuite;
  48 import org.graalvm.compiler.phases.VerifyPhase.VerificationError;
  49 import org.graalvm.compiler.phases.tiers.HighTierContext;
  50 import org.graalvm.compiler.phases.util.Providers;
  51 import org.graalvm.compiler.phases.verify.VerifyDebugUsage;
  52 import org.graalvm.compiler.runtime.RuntimeProvider;
  53 import org.junit.Test;
  54 
  55 import jdk.vm.ci.meta.MetaAccessProvider;
  56 import jdk.vm.ci.meta.ResolvedJavaMethod;
  57 
  58 public class VerifyDebugUsageTest {
  59 
  60     private static class InvalidLogUsagePhase extends Phase {
  61 
  62         @Override
  63         protected void run(StructuredGraph graph) {
  64             DebugContext debug = graph.getDebug();
  65             for (Node n : graph.getNodes()) {
  66                 debug.log("%s", n.toString());
  67             }
  68         }
  69 
  70     }
  71 


   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  */


  31 
  32 import org.graalvm.compiler.api.test.Graal;
  33 import org.graalvm.compiler.debug.DebugCloseable;
  34 import org.graalvm.compiler.debug.DebugHandlersFactory;
  35 import org.graalvm.compiler.debug.DebugContext;
  36 import org.graalvm.compiler.debug.GraalError;
  37 import org.graalvm.compiler.debug.Indent;
  38 import org.graalvm.compiler.graph.Node;
  39 import org.graalvm.compiler.java.GraphBuilderPhase;
  40 import org.graalvm.compiler.nodes.StructuredGraph;
  41 import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration;
  42 import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration.Plugins;
  43 import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugins;
  44 import org.graalvm.compiler.options.OptionValues;
  45 import org.graalvm.compiler.phases.OptimisticOptimizations;
  46 import org.graalvm.compiler.phases.Phase;
  47 import org.graalvm.compiler.phases.PhaseSuite;
  48 import org.graalvm.compiler.phases.VerifyPhase.VerificationError;
  49 import org.graalvm.compiler.phases.tiers.HighTierContext;
  50 import org.graalvm.compiler.phases.util.Providers;

  51 import org.graalvm.compiler.runtime.RuntimeProvider;
  52 import org.junit.Test;
  53 
  54 import jdk.vm.ci.meta.MetaAccessProvider;
  55 import jdk.vm.ci.meta.ResolvedJavaMethod;
  56 
  57 public class VerifyDebugUsageTest {
  58 
  59     private static class InvalidLogUsagePhase extends Phase {
  60 
  61         @Override
  62         protected void run(StructuredGraph graph) {
  63             DebugContext debug = graph.getDebug();
  64             for (Node n : graph.getNodes()) {
  65                 debug.log("%s", n.toString());
  66             }
  67         }
  68 
  69     }
  70 


< prev index next >