< prev index next >

test/testlibrary/jittester/src/jdk/test/lib/jittester/loops/For.java

Print this page

        

*** 24,33 **** --- 24,34 ---- package jdk.test.lib.jittester.loops; import java.util.List; import jdk.test.lib.jittester.Block; import jdk.test.lib.jittester.IRNode; + import jdk.test.lib.jittester.Statement; import jdk.test.lib.jittester.visitors.Visitor; public class For extends IRNode { @Override
*** 43,53 **** STATEMENT1, STATEMENT2, BODY1, BODY2, BODY3, ! }; private final Loop loop; // header; // [subblock] // statement1, statement2; // for (statement; condition; statement) { // body1; // [subblock with breaks] --- 44,54 ---- STATEMENT1, STATEMENT2, BODY1, BODY2, BODY3, ! } private final Loop loop; // header; // [subblock] // statement1, statement2; // for (statement; condition; statement) { // body1; // [subblock with breaks]
*** 55,66 **** // body2; // [subblock with breaks and continues] // body3; // [subblock with breaks] // } private long thisLoopIterLimit = 0; public For(int level, Loop loop, long thisLoopIterLimit, ! IRNode header, IRNode statement1, ! IRNode statement2, IRNode body1, IRNode body2, IRNode body3) { this.level = level; this.loop = loop; this.thisLoopIterLimit = thisLoopIterLimit; resizeUpChildren(ForPart.values().length); getChildren().set(ForPart.HEADER.ordinal(), header); --- 56,68 ---- // body2; // [subblock with breaks and continues] // body3; // [subblock with breaks] // } private long thisLoopIterLimit = 0; public For(int level, Loop loop, long thisLoopIterLimit, ! Block header, Statement statement1, ! Statement statement2, Block body1, Block body2, Block body3) { ! super(body1.getResultType()); this.level = level; this.loop = loop; this.thisLoopIterLimit = thisLoopIterLimit; resizeUpChildren(ForPart.values().length); getChildren().set(ForPart.HEADER.ordinal(), header);
*** 98,112 **** @Override public boolean removeSelf() { IRNode header = getChildren().get(ForPart.HEADER.ordinal()); List<IRNode> siblings = getParent().getChildren(); int index = siblings.indexOf(this); if (header instanceof Block) { - siblings.remove(this); siblings.addAll(index, header.getChildren()); } else { ! siblings.set(index, header); } - siblings.add(index + header.getChildren().size(), loop.initialization); return true; } } --- 100,113 ---- @Override public boolean removeSelf() { IRNode header = getChildren().get(ForPart.HEADER.ordinal()); List<IRNode> siblings = getParent().getChildren(); int index = siblings.indexOf(this); + siblings.set(index++, loop.initialization); if (header instanceof Block) { siblings.addAll(index, header.getChildren()); } else { ! siblings.add(index, header); } return true; } }
< prev index next >