当前位置: 首页>>代码示例>>Java>>正文


Java Block.getFinish方法代码示例

本文整理汇总了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;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:27,代码来源:IRTranslator.java

示例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));
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:18,代码来源:Splitter.java

示例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);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:9,代码来源:Lower.java


注:本文中的jdk.nashorn.internal.ir.Block.getFinish方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。