Java Code Examples for jdk.nashorn.internal.ir.IdentNode#isPropertyName()

The following examples show how to use jdk.nashorn.internal.ir.IdentNode#isPropertyName() . 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 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 2
Source File: AssignSymbols.java    From jdk8u60 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 3
Source File: AssignSymbols.java    From openjdk-jdk8u 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: AssignSymbols.java    From openjdk-jdk8u-backup 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 5
Source File: AssignSymbols.java    From openjdk-jdk9 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 6
Source File: AssignSymbols.java    From hottub 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 7
Source File: AssignSymbols.java    From jdk8u_nashorn 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 8
Source File: ProgramPoints.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Node leaveIdentNode(final IdentNode identNode) {
    if(identNode.isPropertyName()) {
        return identNode;
    }
    return setProgramPoint(identNode);
}
 
Example 9
Source File: ProgramPoints.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Node leaveIdentNode(final IdentNode identNode) {
    if(identNode.isPropertyName()) {
        return identNode;
    }
    return setProgramPoint(identNode);
}
 
Example 10
Source File: ProgramPoints.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Node leaveIdentNode(final IdentNode identNode) {
    if(identNode.isPropertyName()) {
        return identNode;
    }
    return setProgramPoint(identNode);
}
 
Example 11
Source File: ProgramPoints.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Node leaveIdentNode(final IdentNode identNode) {
    if(identNode.isPropertyName()) {
        return identNode;
    }
    return setProgramPoint(identNode);
}
 
Example 12
Source File: ProgramPoints.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Node leaveIdentNode(final IdentNode identNode) {
    if(identNode.isPropertyName()) {
        return identNode;
    }
    return setProgramPoint(identNode);
}
 
Example 13
Source File: ProgramPoints.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Node leaveIdentNode(final IdentNode identNode) {
    if(identNode.isPropertyName()) {
        return identNode;
    }
    return setProgramPoint(identNode);
}
 
Example 14
Source File: ProgramPoints.java    From jdk8u_nashorn with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Node leaveIdentNode(final IdentNode identNode) {
    if(identNode.isPropertyName()) {
        return identNode;
    }
    return setProgramPoint(identNode);
}