Пример #1
0
 @Test
 public void testValueProxyInputs() {
   StructuredGraph graph = parseEager("testValueProxyInputsSnippet", AllowAssumptions.YES);
   for (FrameState fs : graph.getNodes().filter(FrameState.class).snapshot()) {
     fs.replaceAtUsages(null);
     GraphUtil.killWithUnusedFloatingInputs(fs);
   }
   SchedulePhase schedulePhase = new SchedulePhase(SchedulingStrategy.LATEST);
   schedulePhase.apply(graph);
   ScheduleResult schedule = graph.getLastSchedule();
   NodeMap<Block> nodeToBlock = schedule.getCFG().getNodeToBlock();
   assertTrue(graph.getNodes().filter(LoopExitNode.class).count() == 1);
   LoopExitNode loopExit = graph.getNodes().filter(LoopExitNode.class).first();
   List<Node> list = schedule.nodesFor(nodeToBlock.get(loopExit));
   for (BinaryArithmeticNode<?> node : graph.getNodes().filter(BinaryArithmeticNode.class)) {
     if (!(node instanceof AddNode)) {
       assertTrue(node.toString(), nodeToBlock.get(node) == nodeToBlock.get(loopExit));
       assertTrue(
           list.indexOf(node) + " < " + list.indexOf(loopExit) + ", " + node + ", " + loopExit,
           list.indexOf(node) < list.indexOf(loopExit));
     }
   }
 }