本文整理汇总了Java中jdk.nashorn.internal.ir.Block.getFinish方法的典型用法代码示例。如果您正苦于以下问题:Java Block.getFinish方法的具体用法?Java Block.getFinish怎么用?Java Block.getFinish使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jdk.nashorn.internal.ir.Block
的用法示例。
在下文中一共展示了Block.getFinish方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handleBlock
import jdk.nashorn.internal.ir.Block; //导入方法依赖的package包/类
private boolean handleBlock(final Block block, final boolean sortStats) {
// FIXME: revisit this!
if (block.isSynthetic()) {
final int statCount = block.getStatementCount();
switch (statCount) {
case 0: {
final EmptyNode emptyNode = new EmptyNode(-1, block.getToken(), block.getFinish());
curStat = new EmptyStatementTreeImpl(emptyNode);
return false;
}
case 1: {
curStat = translateStat(block.getStatements().get(0));
return false;
}
default: {
// fall through
break;
}
}
}
final List<? extends Statement> stats = block.getStatements();
curStat = new BlockTreeImpl(block,
translateStats(sortStats? getOrderedStatements(stats) : stats));
return false;
}
示例2: createBlockSplitNode
import jdk.nashorn.internal.ir.Block; //导入方法依赖的package包/类
/**
* Create a new split node from statements contained in a parent block.
*
* @param parent Parent block.
* @param statements Statements to include.
*
* @return New split node.
*/
private SplitNode createBlockSplitNode(final Block parent, final FunctionNode function, final List<Statement> statements, final long weight) {
final long token = parent.getToken();
final int finish = parent.getFinish();
final String name = function.uniqueName(SPLIT_PREFIX.symbolName());
final Block newBlock = new Block(token, finish, statements);
return new SplitNode(name, newBlock, compiler.findUnit(weight + WeighNodes.FUNCTION_WEIGHT));
}
示例3: createJumpToInlinedFinally
import jdk.nashorn.internal.ir.Block; //导入方法依赖的package包/类
private static JumpToInlinedFinally createJumpToInlinedFinally(final FunctionNode fn, final List<Block> inlinedFinallies, final Block finallyBlock) {
final String labelName = fn.uniqueName(":finally");
final long token = finallyBlock.getToken();
final int finish = finallyBlock.getFinish();
inlinedFinallies.add(new Block(token, finish, new LabelNode(finallyBlock.getFirstStatementLineNumber(),
token, finish, labelName, finallyBlock)));
return new JumpToInlinedFinally(labelName);
}