本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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());
}
}
}