src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MonitorGraphTest.java
changeset 58877 aec7bf35d6f5
parent 52910 583fd71c47d6
equal deleted inserted replaced
58876:1a8d65e71a66 58877:aec7bf35d6f5
     1 /*
     1 /*
     2  * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     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
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    34 import org.graalvm.compiler.nodes.Invoke;
    34 import org.graalvm.compiler.nodes.Invoke;
    35 import org.graalvm.compiler.nodes.ParameterNode;
    35 import org.graalvm.compiler.nodes.ParameterNode;
    36 import org.graalvm.compiler.nodes.StructuredGraph;
    36 import org.graalvm.compiler.nodes.StructuredGraph;
    37 import org.graalvm.compiler.nodes.StructuredGraph.AllowAssumptions;
    37 import org.graalvm.compiler.nodes.StructuredGraph.AllowAssumptions;
    38 import org.graalvm.compiler.nodes.java.MonitorExitNode;
    38 import org.graalvm.compiler.nodes.java.MonitorExitNode;
    39 import org.graalvm.compiler.phases.common.CanonicalizerPhase;
       
    40 import org.graalvm.compiler.phases.common.DeadCodeEliminationPhase;
    39 import org.graalvm.compiler.phases.common.DeadCodeEliminationPhase;
    41 import org.graalvm.compiler.phases.tiers.HighTierContext;
    40 import org.graalvm.compiler.phases.tiers.HighTierContext;
    42 import org.junit.Assert;
    41 import org.junit.Assert;
    43 import org.junit.Test;
    42 import org.junit.Test;
    44 
    43 
   101         Map<Invoke, Double> hints = new HashMap<>();
   100         Map<Invoke, Double> hints = new HashMap<>();
   102         for (Invoke invoke : graph.getInvokes()) {
   101         for (Invoke invoke : graph.getInvokes()) {
   103             hints.put(invoke, 1000d);
   102             hints.put(invoke, 1000d);
   104         }
   103         }
   105         HighTierContext context = getDefaultHighTierContext();
   104         HighTierContext context = getDefaultHighTierContext();
   106         createInliningPhase(hints, new CanonicalizerPhase()).apply(graph, context);
   105         createInliningPhase(hints, createCanonicalizerPhase()).apply(graph, context);
   107         new CanonicalizerPhase().apply(graph, context);
   106         createCanonicalizerPhase().apply(graph, context);
   108         new DeadCodeEliminationPhase().apply(graph);
   107         new DeadCodeEliminationPhase().apply(graph);
   109         return graph;
   108         return graph;
   110     }
   109     }
   111 
   110 
   112     private void test(String snippet) {
   111     private void test(String snippet) {