src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/TrichotomyTest.java
changeset 58877 aec7bf35d6f5
parent 52910 583fd71c47d6
equal deleted inserted replaced
58876:1a8d65e71a66 58877:aec7bf35d6f5
     1 /*
     1 /*
     2  * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2018, 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.
  2525         Assert.assertEquals(result.returnValue, (op == Operation.GREATER || op == Operation.GREATER_EQUAL) ? true : false);
  2525         Assert.assertEquals(result.returnValue, (op == Operation.GREATER || op == Operation.GREATER_EQUAL) ? true : false);
  2526 
  2526 
  2527         // test folding
  2527         // test folding
  2528         StructuredGraph graph = self.parseForCompile(self.getResolvedJavaMethod(name));
  2528         StructuredGraph graph = self.parseForCompile(self.getResolvedJavaMethod(name));
  2529         HighTierContext context = self.getDefaultHighTierContext();
  2529         HighTierContext context = self.getDefaultHighTierContext();
  2530         CanonicalizerPhase canonicalizer = new CanonicalizerPhase();
  2530         CanonicalizerPhase canonicalizer = self.createCanonicalizerPhase();
  2531         canonicalizer.apply(graph, context);
  2531         canonicalizer.apply(graph, context);
  2532         Assert.assertTrue("Too many ConditionalNodes after canonicalization", graph.getNodes().filter(ConditionalNode.class).count() <= 1);
  2532         Assert.assertTrue("Too many ConditionalNodes after canonicalization", graph.getNodes().filter(ConditionalNode.class).count() <= 1);
  2533         Assert.assertTrue("Unexpected IfNodes after canonicalization", graph.getNodes().filter(IfNode.class).isEmpty());
  2533         Assert.assertTrue("Unexpected IfNodes after canonicalization", graph.getNodes().filter(IfNode.class).isEmpty());
  2534     }
  2534     }
  2535 
  2535