< prev index next >

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

Print this page
rev 52889 : 8214023: Update Graal

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, 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.

@@ -41,10 +41,12 @@
 import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugin;
 import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugins;
 import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugins.Registration;
 import org.graalvm.compiler.nodes.spi.LIRLowerable;
 import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool;
+import org.graalvm.compiler.phases.OptimisticOptimizations;
+import org.graalvm.compiler.phases.tiers.HighTierContext;
 import org.junit.Test;
 
 import jdk.vm.ci.meta.JavaKind;
 import jdk.vm.ci.meta.ResolvedJavaMethod;
 

@@ -409,10 +411,11 @@
         }
 
         public void rewrite(LoopsData loops) {
             InductionVariable inductionVariable = loops.getInductionVariable(iv);
             assert inductionVariable != null;
+            assertTrue(inductionVariable.getLoop().isCounted(), "must be counted");
             ValueNode node = null;
             if (staticCheck != null) {
                 assert staticProperty != null;
                 if (staticCheck.test(inductionVariable)) {
                     node = ConstantNode.forLong(staticProperty.get(inductionVariable), graph());

@@ -488,10 +491,16 @@
         }
         assert graph.getNodes().filter(IVPropertyNode.class).isEmpty();
         return true;
     }
 
+    @Override
+    protected HighTierContext getDefaultHighTierContext() {
+        // Don't convert unreached paths into Guard
+        return new HighTierContext(getProviders(), getDefaultGraphBuilderSuite(), OptimisticOptimizations.NONE);
+    }
+
     private Object[] argsToBind;
 
     @Override
     protected Object[] getArgumentToBind() {
         return argsToBind;
< prev index next >