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


Java Block.getSymbols方法代码示例

本文整理汇总了Java中jdk.nashorn.internal.ir.Block.getSymbols方法的典型用法代码示例。如果您正苦于以下问题:Java Block.getSymbols方法的具体用法?Java Block.getSymbols怎么用?Java Block.getSymbols使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在jdk.nashorn.internal.ir.Block的用法示例。


在下文中一共展示了Block.getSymbols方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: enterBlock

import jdk.nashorn.internal.ir.Block; //导入方法依赖的package包/类
@Override
public boolean enterBlock(final Block block) {
    boolean cloned = false;
    for(final Symbol symbol: block.getSymbols()) {
        if(symbol.isBytecodeLocal()) {
            if (getLocalVariableTypeOrNull(symbol) == null) {
                if (!cloned) {
                    cloneOrNewLocalVariableTypes();
                    cloned = true;
                }
                localVariableTypes.put(symbol, LvarType.UNDEFINED);
            }
            // In case we're repeating analysis of a lexical scope (e.g. it's in a loop),
            // make sure all symbols lexically scoped by the block become valid again.
            invalidatedSymbols.remove(symbol);
        }
    }
    return true;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:20,代码来源:LocalVariableTypesCalculator.java

示例2: assignSlots

import jdk.nashorn.internal.ir.Block; //导入方法依赖的package包/类
private int assignSlots(final Block block, final int firstSlot) {
    int fromSlot = firstSlot;
    final MethodEmitter method = methodEmitters.peek();
    for (final Symbol symbol : block.getSymbols()) {
        if (symbol.hasSlot()) {
            symbol.setFirstSlot(fromSlot);
            final int toSlot = fromSlot + symbol.slotCount();
            method.defineBlockLocalVariable(fromSlot, toSlot);
            fromSlot = toSlot;
        }
    }
    return fromSlot;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:14,代码来源:CodeGeneratorLexicalContext.java

示例3: enterBlock

import jdk.nashorn.internal.ir.Block; //导入方法依赖的package包/类
@Override
public boolean enterBlock(final Block block) {
    for(final Symbol symbol: block.getSymbols()) {
        if(symbol.isBytecodeLocal() && getLocalVariableTypeOrNull(symbol) == null) {
            setType(symbol, LvarType.UNDEFINED);
        }
    }
    return true;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:10,代码来源:LocalVariableTypesCalculator.java

示例4: closeBlockVariables

import jdk.nashorn.internal.ir.Block; //导入方法依赖的package包/类
/**
 * Closes any still open entries for this block's local variables in the bytecode local variable table.
 *
 * @param block block containing symbols.
 */
private void closeBlockVariables(final Block block) {
    for (final Symbol symbol : block.getSymbols()) {
        if (symbol.isBytecodeLocal()) {
            method.closeLocalVariable(symbol, block.getBreakLabel());
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:13,代码来源:CodeGenerator.java


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