jdk.nashorn.internal.ir.Symbol Java Examples

The following examples show how to use jdk.nashorn.internal.ir.Symbol. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AssignSymbols.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
@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;
}
 
Example #2
Source File: RangeAnalyzer.java    From nashorn with GNU General Public License v2.0 6 votes vote down vote up
private Symbol setRange(final Expression dest, final Range range) {
    if (range.isUnknown()) {
        return null;
    }

    final Symbol symbol = dest.getSymbol();
    assert symbol != null : dest + " " + dest.getClass() + " has no symbol";
    assert symbol.getRange() != null : symbol + " has no range";
    final Range symRange = RANGE.join(symbol.getRange(), range);

    //anything assigned in the loop, not being the safe loop counter(s) invalidates its entire range
    if (lc.inLoop() && !isLoopCounter(lc.getCurrentLoop(), symbol)) {
        symbol.setRange(Range.createGenericRange());
        return symbol;
    }

    if (!symRange.equals(symbol.getRange())) {
        LOG.fine("Modify range for " + dest + " " + symbol + " from " + symbol.getRange() + " to " + symRange + " (in node = " + dest + ")" );
        symbol.setRange(symRange);
    }

    return null;
}
 
Example #3
Source File: AssignSymbols.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
@Override
public Node leaveIdentNode(final IdentNode identNode) {
    if (identNode.isPropertyName()) {
        return identNode;
    }

    final Symbol symbol = nameIsUsed(identNode.getName(), identNode);

    if (!identNode.isInitializedHere()) {
        symbol.increaseUseCount();
    }

    IdentNode newIdentNode = identNode.setSymbol(symbol);

    // If a block-scoped var is used before its declaration mark it as dead.
    // We can only statically detect this for local vars, cross-function symbols require runtime checks.
    if (symbol.isBlockScoped() && !symbol.hasBeenDeclared() && !identNode.isDeclaredHere() && isLocal(lc.getCurrentFunction(), symbol)) {
        newIdentNode = newIdentNode.markDead();
    }

    return end(newIdentNode);
}
 
Example #4
Source File: Attr.java    From nashorn with GNU General Public License v2.0 6 votes vote down vote up
@Override
public Node leaveReturnNode(final ReturnNode returnNode) {
    final Expression expr = returnNode.getExpression();
    final Type returnType;

    if (expr != null) {
        //we can't do parameter specialization if we return something that hasn't been typed yet
        final Symbol symbol = expr.getSymbol();
        if (expr.getType().isUnknown() && symbol.isParam()) {
            symbol.setType(Type.OBJECT);
        }

        returnType = Type.widest(returnTypes.pop(), symbol.getSymbolType());
    } else {
        returnType = Type.OBJECT; //undefined
    }
    LOG.info("Returntype is now ", returnType);
    returnTypes.push(returnType);

    end(returnNode);

    return returnNode;
}
 
Example #5
Source File: AssignSymbols.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
@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;
}
 
Example #6
Source File: AssignSymbols.java    From jdk8u_nashorn with GNU General Public License v2.0 6 votes vote down vote up
@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;
}
 
Example #7
Source File: OptimisticTypesCalculator.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
@Override
public boolean enterBinaryNode(final BinaryNode binaryNode) {
    if(binaryNode.isAssignment()) {
        final Expression lhs = binaryNode.lhs();
        if(!binaryNode.isSelfModifying()) {
            tagNeverOptimistic(lhs);
        }
        if(lhs instanceof IdentNode) {
            final Symbol symbol = ((IdentNode)lhs).getSymbol();
            // Assignment to internal symbols is never optimistic, except for self-assignment expressions
            if(symbol.isInternal() && !binaryNode.rhs().isSelfModifying()) {
                tagNeverOptimistic(binaryNode.rhs());
            }
        }
    } else if(binaryNode.isTokenType(TokenType.INSTANCEOF)) {
        tagNeverOptimistic(binaryNode.lhs());
        tagNeverOptimistic(binaryNode.rhs());
    }
    return true;
}
 
Example #8
Source File: AssignSymbols.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Marks the current function as one using a scoped symbol. The block defining the symbol will be marked as needing
 * its own scope to hold the variable. If the symbol is defined outside of the current function, it and all
 * functions up to (but not including) the function containing the defining block will be marked as needing parent
 * function scope.
 * @see FunctionNode#needsParentScope()
 */
private void functionUsesScopeSymbol(final Symbol symbol) {
    final String name = symbol.getName();
    for (final Iterator<LexicalContextNode> contextNodeIter = lc.getAllNodes(); contextNodeIter.hasNext(); ) {
        final LexicalContextNode node = contextNodeIter.next();
        if (node instanceof Block) {
            final Block block = (Block)node;
            if (block.getExistingSymbol(name) != null) {
                assert lc.contains(block);
                lc.setBlockNeedsScope(block);
                break;
            }
        } else if (node instanceof FunctionNode) {
            lc.setFlag(node, FunctionNode.USES_ANCESTOR_SCOPE);
        }
    }
}
 
Example #9
Source File: AssignSymbols.java    From jdk8u_nashorn with GNU General Public License v2.0 6 votes vote down vote up
private Symbol nameIsUsed(final String name, final IdentNode origin) {
    final Block block = lc.getCurrentBlock();

    Symbol symbol = findSymbol(block, name);

    //If an existing symbol with the name is found, use that otherwise, declare a new one
    if (symbol != null) {
        log.info("Existing symbol = ", symbol);
        if (symbol.isFunctionSelf()) {
            final FunctionNode functionNode = lc.getDefiningFunction(symbol);
            assert functionNode != null;
            assert lc.getFunctionBody(functionNode).getExistingSymbol(CALLEE.symbolName()) != null;
            lc.setFlag(functionNode, FunctionNode.USES_SELF_SYMBOL);
        }

        // if symbol is non-local or we're in a with block, we need to put symbol in scope (if it isn't already)
        maybeForceScope(symbol);
    } else {
        log.info("No symbol exists. Declare as global: ", name);
        symbol = defineSymbol(block, name, origin, IS_GLOBAL | IS_SCOPE);
    }

    functionUsesSymbol(symbol);
    return symbol;
}
 
Example #10
Source File: CompilationPhase.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
FunctionNode transform(final Compiler compiler, final CompilationPhases phases, final FunctionNode fn) {
    // It's not necessary to guard the marking of symbols as locals with this "if" condition for
    // correctness, it's just an optimization -- runtime type calculation is not used when the compilation
    // is not an on-demand optimistic compilation, so we can skip locals marking then.
    if (compiler.useOptimisticTypes() && compiler.isOnDemandCompilation()) {
        fn.getBody().accept(new SimpleNodeVisitor() {
            @Override
            public boolean enterFunctionNode(final FunctionNode functionNode) {
                // OTOH, we must not declare symbols from nested functions to be locals. As we're doing on-demand
                // compilation, and we're skipping parsing the function bodies for nested functions, this
                // basically only means their parameters. It'd be enough to mistakenly declare to be a local a
                // symbol in the outer function named the same as one of the parameters, though.
                return false;
            };
            @Override
            public boolean enterBlock(final Block block) {
                for (final Symbol symbol: block.getSymbols()) {
                    if (!symbol.isScope()) {
                        compiler.declareLocalSymbol(symbol.getName());
                    }
                }
                return true;
            };
        });
    }
    return fn;
}
 
Example #11
Source File: MethodEmitter.java    From jdk8u_nashorn with GNU General Public License v2.0 5 votes vote down vote up
void closeLocalVariable(final Symbol symbol, final Label label) {
    final LocalVariableDef def = localVariableDefs.get(symbol);
    if(def != null) {
        endLocalValueDef(symbol, def, label.getLabel());
    }
    if(isReachable()) {
        markDeadLocalVariable(symbol);
    }
}
 
Example #12
Source File: CompilationPhase.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@Override
FunctionNode transform(final Compiler compiler, final CompilationPhases phases, final FunctionNode fn) {
    // It's not necessary to guard the marking of symbols as locals with this "if" condition for
    // correctness, it's just an optimization -- runtime type calculation is not used when the compilation
    // is not an on-demand optimistic compilation, so we can skip locals marking then.
    if (compiler.useOptimisticTypes() && compiler.isOnDemandCompilation()) {
        fn.getBody().accept(new SimpleNodeVisitor() {
            @Override
            public boolean enterFunctionNode(final FunctionNode functionNode) {
                // OTOH, we must not declare symbols from nested functions to be locals. As we're doing on-demand
                // compilation, and we're skipping parsing the function bodies for nested functions, this
                // basically only means their parameters. It'd be enough to mistakenly declare to be a local a
                // symbol in the outer function named the same as one of the parameters, though.
                return false;
            };
            @Override
            public boolean enterBlock(final Block block) {
                for (final Symbol symbol: block.getSymbols()) {
                    if (!symbol.isScope()) {
                        compiler.declareLocalSymbol(symbol.getName());
                    }
                }
                return true;
            };
        });
    }
    return fn;
}
 
Example #13
Source File: LocalVariableTypesCalculator.java    From jdk8u_nashorn with GNU General Public License v2.0 5 votes vote down vote up
private void symbolIsConverted(final Symbol symbol, final LvarType from, final LvarType to) {
    SymbolConversions conversions = symbolConversions.get(symbol);
    if(conversions == null) {
        conversions = new SymbolConversions();
        symbolConversions.put(symbol, conversions);
    }
    conversions.recordConversion(from, to);
}
 
Example #14
Source File: MethodEmitter.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private void endLocalValueDef(final Symbol symbol, final LocalVariableDef def, final jdk.internal.org.objectweb.asm.Label label) {
    String name = symbol.getName();
    if (name.equals(THIS.symbolName())) {
        name = THIS_DEBUGGER.symbolName();
    }
    method.visitLocalVariable(name, def.type.getDescriptor(), null, def.label, label, symbol.getSlot(def.type));
}
 
Example #15
Source File: SharedScopeCall.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Constructor.
 *
 * @param symbol the symbol
 * @param valueType the type of the value
 * @param returnType the return type
 * @param paramTypes the function parameter types
 * @param flags the callsite flags
 */
SharedScopeCall(final Symbol symbol, final Type valueType, final Type returnType, final Type[] paramTypes, final int flags) {
    this.symbol = symbol;
    this.valueType = valueType;
    this.returnType = returnType;
    this.paramTypes = paramTypes;
    this.flags = flags;
    // If paramTypes is not null this is a call, otherwise it's just a get.
    this.isCall = paramTypes != null;
}
 
Example #16
Source File: MethodEmitter.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
void storeCompilerConstant(final CompilerConstants cc, final Type type) {
    final Symbol symbol = getCompilerConstantSymbol(cc);
    if(!symbol.hasSlot()) {
        return;
    }
    debug("store compiler constant ", symbol);
    store(symbol, type != null ? type : getCompilerConstantType(cc));
}
 
Example #17
Source File: LocalVariableTypesCalculator.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private void enterDoWhileLoop(final WhileNode loopNode) {
    assertTypeStackIsEmpty();
    final JoinPredecessorExpression test = loopNode.getTest();
    final Block body = loopNode.getBody();
    final Label continueLabel = loopNode.getContinueLabel();
    final Label breakLabel = loopNode.getBreakLabel();
    final Map<Symbol, LvarType> beforeLoopTypes = localVariableTypes;
    final Label repeatLabel = new Label("");
    for(;;) {
        jumpToLabel(loopNode, repeatLabel, beforeLoopTypes);
        final Map<Symbol, LvarType> beforeRepeatTypes = localVariableTypes;
        body.accept(this);
        if(reachable) {
            jumpToLabel(body, continueLabel);
        }
        joinOnLabel(continueLabel);
        if(!reachable) {
            break;
        }
        visitExpressionOnEmptyStack(test);
        jumpToLabel(test, breakLabel);
        if(isAlwaysFalse(test)) {
            break;
        }
        jumpToLabel(test, repeatLabel);
        joinOnLabel(repeatLabel);
        if(localVariableTypes.equals(beforeRepeatTypes)) {
            break;
        }
        resetJoinPoint(continueLabel);
        resetJoinPoint(breakLabel);
        resetJoinPoint(repeatLabel);
    }

    if(isAlwaysTrue(test)) {
        doesNotContinueSequentially();
    }

    leaveBreakable(loopNode);
}
 
Example #18
Source File: SharedScopeCall.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Constructor.
 *
 * @param symbol the symbol
 * @param valueType the type of the value
 * @param returnType the return type
 * @param paramTypes the function parameter types
 * @param flags the callsite flags
 */
SharedScopeCall(final Symbol symbol, final Type valueType, final Type returnType, final Type[] paramTypes, final int flags) {
    this.symbol = symbol;
    this.valueType = valueType;
    this.returnType = returnType;
    this.paramTypes = paramTypes;
    assert (flags & CALLSITE_OPTIMISTIC) == 0;
    this.flags = flags;
    // If paramTypes is not null this is a call, otherwise it's just a get.
    this.isCall = paramTypes != null;
}
 
Example #19
Source File: CodeGeneratorLexicalContext.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
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;
}
 
Example #20
Source File: CodeGenerator.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create symbol debug information.
 *
 * @param block block containing symbols.
 */
private void symbolInfo(final Block block) {
    for (final Symbol symbol : block.getSymbols()) {
        if (symbol.hasSlot()) {
            method.localVariable(symbol, block.getEntryLabel(), block.getBreakLabel());
        }
    }
}
 
Example #21
Source File: LocalVariableTypesCalculator.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public boolean enterTernaryNode(final TernaryNode ternaryNode) {
    final Expression test = ternaryNode.getTest();
    final Expression trueExpr = ternaryNode.getTrueExpression();
    final Expression falseExpr = ternaryNode.getFalseExpression();

    visitExpression(test);

    final Map<Symbol, LvarType> testExitLvarTypes = localVariableTypes;
    final LvarType trueType;
    if(!isAlwaysFalse(test)) {
        trueType = visitExpression(trueExpr);
    } else {
        trueType = null;
    }
    final Map<Symbol, LvarType> trueExitLvarTypes = localVariableTypes;
    localVariableTypes = testExitLvarTypes;
    final LvarType falseType;
    if(!isAlwaysTrue(test)) {
        falseType = visitExpression(falseExpr);
    } else {
        falseType = null;
    }
    final Map<Symbol, LvarType> falseExitLvarTypes = localVariableTypes;
    localVariableTypes = getUnionTypes(trueExitLvarTypes, falseExitLvarTypes);
    setConversion((JoinPredecessor)trueExpr, trueExitLvarTypes, localVariableTypes);
    setConversion((JoinPredecessor)falseExpr, falseExitLvarTypes, localVariableTypes);

    typeStack.push(trueType != null ? falseType != null ? widestLvarType(trueType, falseType) : trueType : assertNotNull(falseType));
    return false;
}
 
Example #22
Source File: MethodEmitter.java    From jdk8u_nashorn with GNU General Public License v2.0 5 votes vote down vote up
private void endLocalValueDef(final Symbol symbol, final LocalVariableDef def, final jdk.internal.org.objectweb.asm.Label label) {
    String name = symbol.getName();
    if (name.equals(THIS.symbolName())) {
        name = THIS_DEBUGGER.symbolName();
    }
    method.visitLocalVariable(name, def.type.getDescriptor(), null, def.label, label, symbol.getSlot(def.type));
}
 
Example #23
Source File: CodeGenerator.java    From nashorn with GNU General Public License v2.0 5 votes vote down vote up
private void enterNumericAdd(final Expression lhs, final Expression rhs, final Type type, final Symbol symbol) {
    assert lhs.getType().equals(rhs.getType()) && lhs.getType().equals(type) : lhs.getType() + " != " + rhs.getType() + " != " + type + " " + new ASTWriter(lhs) + " " + new ASTWriter(rhs);
    load(lhs);
    load(rhs);
    method.add(); //if the symbol is optimistic, it always needs to be written, not on the stack?
    method.store(symbol);
}
 
Example #24
Source File: LocalVariableTypesCalculator.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@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;
}
 
Example #25
Source File: CodeGeneratorLexicalContext.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private static int assignSlots(final Block block, final int firstSlot) {
    int nextSlot = firstSlot;
    for (final Symbol symbol : block.getSymbols()) {
        if (symbol.hasSlot()) {
            symbol.setSlot(nextSlot);
            nextSlot += symbol.slotCount();
        }
    }
    return nextSlot;
}
 
Example #26
Source File: AssignSymbols.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Determines if the symbol has to be a scope symbol. In general terms, it has to be a scope symbol if it can only
 * be reached from the current block by traversing a function node, a split node, or a with node.
 * @param symbol the symbol checked for needing to be a scope symbol
 * @return true if the symbol has to be a scope symbol.
 */
private boolean symbolNeedsToBeScope(final Symbol symbol) {
    if (symbol.isThis() || symbol.isInternal()) {
        return false;
    }

    final FunctionNode func = lc.getCurrentFunction();
    if ( func.allVarsInScope() || (!symbol.isBlockScoped() && func.isProgram())) {
        return true;
    }

    boolean previousWasBlock = false;
    for (final Iterator<LexicalContextNode> it = lc.getAllNodes(); it.hasNext();) {
        final LexicalContextNode node = it.next();
        if (node instanceof FunctionNode || isSplitLiteral(node)) {
            // We reached the function boundary or a splitting boundary without seeing a definition for the symbol.
            // It needs to be in scope.
            return true;
        } else if (node instanceof WithNode) {
            if (previousWasBlock) {
                // We reached a WithNode; the symbol must be scoped. Note that if the WithNode was not immediately
                // preceded by a block, this means we're currently processing its expression, not its body,
                // therefore it doesn't count.
                return true;
            }
            previousWasBlock = false;
        } else if (node instanceof Block) {
            if (((Block)node).getExistingSymbol(symbol.getName()) == symbol) {
                // We reached the block that defines the symbol without reaching either the function boundary, or a
                // WithNode. The symbol need not be scoped.
                return false;
            }
            previousWasBlock = true;
        } else {
            previousWasBlock = false;
        }
    }
    throw new AssertionError();
}
 
Example #27
Source File: LocalVariableTypesCalculator.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private void symbolIsConverted(final Symbol symbol, final LvarType from, final LvarType to) {
    SymbolConversions conversions = symbolConversions.get(symbol);
    if(conversions == null) {
        conversions = new SymbolConversions();
        symbolConversions.put(symbol, conversions);
    }
    conversions.recordConversion(from, to);
}
 
Example #28
Source File: SharedScopeCall.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Constructor.
 *
 * @param symbol the symbol
 * @param valueType the type of the value
 * @param returnType the return type
 * @param paramTypes the function parameter types
 * @param flags the callsite flags
 */
SharedScopeCall(final Symbol symbol, final Type valueType, final Type returnType, final Type[] paramTypes, final int flags) {
    this.symbol = symbol;
    this.valueType = valueType;
    this.returnType = returnType;
    this.paramTypes = paramTypes;
    assert (flags & CALLSITE_OPTIMISTIC) == 0;
    this.flags = flags;
    // If paramTypes is not null this is a call, otherwise it's just a get.
    this.isCall = paramTypes != null;
}
 
Example #29
Source File: LocalVariableTypesCalculator.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
@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;
}
 
Example #30
Source File: MethodEmitter.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private void endLocalValueDef(final Symbol symbol, final LocalVariableDef def, final jdk.internal.org.objectweb.asm.Label label) {
    String name = symbol.getName();
    if (name.equals(THIS.symbolName())) {
        name = THIS_DEBUGGER.symbolName();
    }
    method.visitLocalVariable(name, def.type.getDescriptor(), null, def.label, label, symbol.getSlot(def.type));
}