本文整理汇总了Java中com.google.javascript.jscomp.PhaseOptimizer.Loop类的典型用法代码示例。如果您正苦于以下问题:Java Loop类的具体用法?Java Loop怎么用?Java Loop使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Loop类属于com.google.javascript.jscomp.PhaseOptimizer包,在下文中一共展示了Loop类的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: testInfiniteLoop
import com.google.javascript.jscomp.PhaseOptimizer.Loop; //导入依赖的package包/类
public void testInfiniteLoop() {
Loop loop = optimizer.addFixedPointLoop();
addLoopedPass(loop, "x", PhaseOptimizer.MAX_LOOPS + 1);
try {
optimizer.process(null, null);
fail("Expected RuntimeException");
} catch (RuntimeException e) {
assertTrue(e.getMessage().contains(PhaseOptimizer.OPTIMIZE_LOOP_ERROR));
}
}
开发者ID:andyjko,项目名称:feedlack,代码行数:11,代码来源:PhaseOptimizerTest.java
示例2: testCombined
import com.google.javascript.jscomp.PhaseOptimizer.Loop; //导入依赖的package包/类
public void testCombined() {
addOneTimePass("a");
Loop loop = optimizer.addFixedPointLoop();
addLoopedPass(loop, "x", 3);
addLoopedPass(loop, "y", 1);
addOneTimePass("z");
assertPasses("a", "x", "y", "x", "y", "x", "y", "x", "y", "z");
}
开发者ID:andyjko,项目名称:feedlack,代码行数:9,代码来源:PhaseOptimizerTest.java
示例3: testSanityCheck
import com.google.javascript.jscomp.PhaseOptimizer.Loop; //导入依赖的package包/类
public void testSanityCheck() {
Loop loop = optimizer.addFixedPointLoop();
addLoopedPass(loop, "x", 1);
addOneTimePass("z");
optimizer.setSanityCheck(
createPassFactory("sanity", createPass("sanity", 0), false));
assertPasses("x", "sanity", "x", "sanity", "z", "sanity");
}
开发者ID:andyjko,项目名称:feedlack,代码行数:9,代码来源:PhaseOptimizerTest.java
示例4: testDuplicateLoop
import com.google.javascript.jscomp.PhaseOptimizer.Loop; //导入依赖的package包/类
public void testDuplicateLoop() {
Loop loop = optimizer.addFixedPointLoop();
addLoopedPass(loop, "x", 1);
try {
addLoopedPass(loop, "x", 1);
fail("Expected exception");
} catch (IllegalArgumentException e) {}
}
开发者ID:andyjko,项目名称:feedlack,代码行数:9,代码来源:PhaseOptimizerTest.java
示例5: testPassOrdering
import com.google.javascript.jscomp.PhaseOptimizer.Loop; //导入依赖的package包/类
public void testPassOrdering() {
Loop loop = optimizer.addFixedPointLoop();
List<String> optimalOrder = Lists.newArrayList(
PhaseOptimizer.OPTIMAL_ORDER);
Random random = new Random();
while (optimalOrder.size() > 0) {
addLoopedPass(
loop, optimalOrder.remove(random.nextInt(optimalOrder.size())), 0);
}
optimizer.process(null, null);
assertEquals(PhaseOptimizer.OPTIMAL_ORDER, passesRun);
}
开发者ID:andyjko,项目名称:feedlack,代码行数:13,代码来源:PhaseOptimizerTest.java
示例6: testCombined
import com.google.javascript.jscomp.PhaseOptimizer.Loop; //导入依赖的package包/类
public void testCombined() {
addOneTimePass("a");
Loop loop = optimizer.addFixedPointLoop();
addLoopedPass(loop, "x", 3);
addLoopedPass(loop, "y", 1);
addOneTimePass("z");
assertPasses("a", "x", "y", "x", "y", "x", "x", "y", "z");
}
开发者ID:SpoonLabs,项目名称:astor,代码行数:9,代码来源:PhaseOptimizerTest.java
示例7: testSchedulingOfLoopablePasses
import com.google.javascript.jscomp.PhaseOptimizer.Loop; //导入依赖的package包/类
public void testSchedulingOfLoopablePasses() {
Loop loop = optimizer.addFixedPointLoop();
addLoopedPass(loop, "x", 3);
addLoopedPass(loop, "y", 1);
// The pass iterations can be grouped as: [x y] [x y] [x] [x] [y]
assertPasses("x", "y", "x", "y", "x", "x", "y");
}
开发者ID:google,项目名称:closure-compiler,代码行数:8,代码来源:PhaseOptimizerTest.java
示例8: testCapLoopIterations
import com.google.javascript.jscomp.PhaseOptimizer.Loop; //导入依赖的package包/类
public void testCapLoopIterations() {
CompilerOptions options = compiler.getOptions();
options.optimizationLoopMaxIterations = 1;
optimizer = new PhaseOptimizer(compiler, tracker);
Loop loop = optimizer.addFixedPointLoop();
addLoopedPass(loop, PassNames.PEEPHOLE_OPTIMIZATIONS, 2);
assertPasses(PassNames.PEEPHOLE_OPTIMIZATIONS);
}
开发者ID:google,项目名称:closure-compiler,代码行数:9,代码来源:PhaseOptimizerTest.java
示例9: testInfiniteLoop
import com.google.javascript.jscomp.PhaseOptimizer.Loop; //导入依赖的package包/类
public void testInfiniteLoop() {
Loop loop = optimizer.addFixedPointLoop();
addLoopedPass(loop, "x", PhaseOptimizer.MAX_LOOPS + 1);
try {
optimizer.process(null, dummyRoot);
fail("Expected RuntimeException");
} catch (RuntimeException e) {
assertTrue(e.getMessage(),
e.getMessage().contains(PhaseOptimizer.OPTIMIZE_LOOP_ERROR));
}
}
开发者ID:google,项目名称:closure-compiler,代码行数:12,代码来源:PhaseOptimizerTest.java
示例10: testSchedulingOfAnyKindOfPasses1
import com.google.javascript.jscomp.PhaseOptimizer.Loop; //导入依赖的package包/类
public void testSchedulingOfAnyKindOfPasses1() {
addOneTimePass("a");
Loop loop = optimizer.addFixedPointLoop();
addLoopedPass(loop, "x", 3);
addLoopedPass(loop, "y", 1);
addOneTimePass("z");
assertPasses("a", "x", "y", "x", "y", "x", "x", "y", "z");
}
开发者ID:google,项目名称:closure-compiler,代码行数:9,代码来源:PhaseOptimizerTest.java
示例11: testDuplicateLoop
import com.google.javascript.jscomp.PhaseOptimizer.Loop; //导入依赖的package包/类
public void testDuplicateLoop() {
Loop loop = optimizer.addFixedPointLoop();
addLoopedPass(loop, "x", 1);
try {
addLoopedPass(loop, "x", 1);
fail("Expected exception");
} catch (IllegalArgumentException e) {
return;
}
}
开发者ID:google,项目名称:closure-compiler,代码行数:11,代码来源:PhaseOptimizerTest.java
示例12: testPassOrdering
import com.google.javascript.jscomp.PhaseOptimizer.Loop; //导入依赖的package包/类
public void testPassOrdering() {
Loop loop = optimizer.addFixedPointLoop();
List<String> optimalOrder = new ArrayList<>(
PhaseOptimizer.OPTIMAL_ORDER);
Random random = new Random();
while (!optimalOrder.isEmpty()) {
addLoopedPass(
loop, optimalOrder.remove(random.nextInt(optimalOrder.size())), 0);
}
optimizer.process(null, dummyRoot);
assertEquals(PhaseOptimizer.OPTIMAL_ORDER, passesRun);
}
开发者ID:google,项目名称:closure-compiler,代码行数:13,代码来源:PhaseOptimizerTest.java
示例13: testPassOrdering
import com.google.javascript.jscomp.PhaseOptimizer.Loop; //导入依赖的package包/类
public void testPassOrdering() {
Loop loop = optimizer.addFixedPointLoop();
List<String> optimalOrder = Lists.newArrayList(
PhaseOptimizer.OPTIMAL_ORDER);
Random random = new Random();
while (optimalOrder.size() > 0) {
addLoopedPass(
loop, optimalOrder.remove(random.nextInt(optimalOrder.size())), 0);
}
optimizer.process(null, dummyRoot);
assertEquals(PhaseOptimizer.OPTIMAL_ORDER, passesRun);
}
开发者ID:nicks,项目名称:closure-compiler-old,代码行数:13,代码来源:PhaseOptimizerTest.java
示例14: testLoop1
import com.google.javascript.jscomp.PhaseOptimizer.Loop; //导入依赖的package包/类
public void testLoop1() {
Loop loop = optimizer.addFixedPointLoop();
addLoopedPass(loop, "x", 0);
assertPasses("x");
}
开发者ID:andyjko,项目名称:feedlack,代码行数:6,代码来源:PhaseOptimizerTest.java
示例15: testLoop2
import com.google.javascript.jscomp.PhaseOptimizer.Loop; //导入依赖的package包/类
public void testLoop2() {
Loop loop = optimizer.addFixedPointLoop();
addLoopedPass(loop, "x", 3);
assertPasses("x", "x", "x", "x");
}
开发者ID:andyjko,项目名称:feedlack,代码行数:6,代码来源:PhaseOptimizerTest.java
示例16: testLoop3
import com.google.javascript.jscomp.PhaseOptimizer.Loop; //导入依赖的package包/类
public void testLoop3() {
Loop loop = optimizer.addFixedPointLoop();
addLoopedPass(loop, "x", 3);
addLoopedPass(loop, "y", 1);
assertPasses("x", "y", "x", "y", "x", "y", "x", "y");
}
开发者ID:andyjko,项目名称:feedlack,代码行数:7,代码来源:PhaseOptimizerTest.java
示例17: testNotInfiniteLoop
import com.google.javascript.jscomp.PhaseOptimizer.Loop; //导入依赖的package包/类
public void testNotInfiniteLoop() {
Loop loop = optimizer.addFixedPointLoop();
addLoopedPass(loop, "x", PhaseOptimizer.MAX_LOOPS);
optimizer.process(null, null);
assertEquals("There should be no errors.", 0, compiler.getErrorCount());
}
开发者ID:andyjko,项目名称:feedlack,代码行数:7,代码来源:PhaseOptimizerTest.java
示例18: addLoopedPass
import com.google.javascript.jscomp.PhaseOptimizer.Loop; //导入依赖的package包/类
private void addLoopedPass(Loop loop, String name, int numChanges) {
loop.addLoopedPass(
createPassFactory(name, numChanges, false));
}
开发者ID:andyjko,项目名称:feedlack,代码行数:5,代码来源:PhaseOptimizerTest.java
注:本文中的com.google.javascript.jscomp.PhaseOptimizer.Loop类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论