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


Java Symbol.clearFlag方法代码示例

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


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

示例1: enterCatchNode

import jdk.nashorn.internal.ir.Symbol; //导入方法依赖的package包/类
@Override
public boolean enterCatchNode(final CatchNode catchNode) {
    final IdentNode exception = catchNode.getException();
    final Block     block     = lc.getCurrentBlock();

    start(catchNode);

    // define block-local exception variable
    final String exname = exception.getName();
    // If the name of the exception starts with ":e", this is a synthetic catch block, likely a catch-all. Its
    // symbol is naturally internal, and should be treated as such.
    final boolean isInternal = exname.startsWith(EXCEPTION_PREFIX.symbolName());
    // IS_LET flag is required to make sure symbol is not visible outside catch block. However, we need to
    // clear the IS_LET flag after creation to allow redefinition of symbol inside the catch block.
    final Symbol symbol = defineSymbol(block, exname, catchNode, IS_VAR | IS_LET | (isInternal ? IS_INTERNAL : 0) | HAS_OBJECT_VALUE);
    symbol.clearFlag(IS_LET);

    return true;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:AssignSymbols.java

示例2: removeUnusedSlots

import jdk.nashorn.internal.ir.Symbol; //导入方法依赖的package包/类
/**
 * Checks if various symbols that were provisionally marked as needing a slot ended up unused, and marks them as not
 * needing a slot after all.
 * @param functionNode the function node
 * @return the passed in node, for easy chaining
 */
private static FunctionNode removeUnusedSlots(final FunctionNode functionNode) {
    if (!functionNode.needsCallee()) {
        functionNode.compilerConstant(CALLEE).setNeedsSlot(false);
    }
    if (!(functionNode.hasScopeBlock() || functionNode.needsParentScope())) {
        functionNode.compilerConstant(SCOPE).setNeedsSlot(false);
    }
    // Named function expressions that end up not referencing themselves won't need a local slot for the self symbol.
    if(functionNode.isNamedFunctionExpression() && !functionNode.usesSelfSymbol()) {
        final Symbol selfSymbol = functionNode.getBody().getExistingSymbol(functionNode.getIdent().getName());
        if(selfSymbol != null && selfSymbol.isFunctionSelf()) {
            selfSymbol.setNeedsSlot(false);
            selfSymbol.clearFlag(Symbol.IS_VAR);
        }
    }
    return functionNode;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:24,代码来源:AssignSymbols.java

示例3: enterCatchNode

import jdk.nashorn.internal.ir.Symbol; //导入方法依赖的package包/类
@Override
public boolean enterCatchNode(final CatchNode catchNode) {
    final IdentNode exception = catchNode.getExceptionIdentifier();
    final Block     block     = lc.getCurrentBlock();

    start(catchNode);

    // define block-local exception variable
    final String exname = exception.getName();
    // If the name of the exception starts with ":e", this is a synthetic catch block, likely a catch-all. Its
    // symbol is naturally internal, and should be treated as such.
    final boolean isInternal = exname.startsWith(EXCEPTION_PREFIX.symbolName());
    // IS_LET flag is required to make sure symbol is not visible outside catch block. However, we need to
    // clear the IS_LET flag after creation to allow redefinition of symbol inside the catch block.
    final Symbol symbol = defineSymbol(block, exname, catchNode, IS_VAR | IS_LET | (isInternal ? IS_INTERNAL : 0) | HAS_OBJECT_VALUE);
    symbol.clearFlag(IS_LET);

    return true;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:20,代码来源:AssignSymbols.java


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