Java Code Examples for jdk.nashorn.internal.ir.Symbol#hasSlot()

The following examples show how to use jdk.nashorn.internal.ir.Symbol#hasSlot() . 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: MethodEmitter.java    From hottub 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 2
Source File: CodeGeneratorLexicalContext.java    From jdk8u_nashorn 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 3
Source File: CodeGeneratorLexicalContext.java    From openjdk-8 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 4
Source File: FinalizeTypes.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private static void updateSymbolsLog(final FunctionNode functionNode, final Symbol symbol, final boolean loseSlot) {
    if (LOG.isEnabled()) {
        if (!symbol.isScope()) {
            LOG.finest("updateSymbols: ", symbol, " => scope, because all vars in ", functionNode.getName(), " are in scope");
        }
        if (loseSlot && symbol.hasSlot()) {
            LOG.finest("updateSymbols: ", symbol, " => no slot, because all vars in ", functionNode.getName(), " are in scope");
        }
    }
}
 
Example 5
Source File: MethodEmitter.java    From jdk8u_nashorn 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 6
Source File: CodeGenerator.java    From nashorn 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 7
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 8
Source File: FinalizeTypes.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private static void updateSymbolsLog(final FunctionNode functionNode, final Symbol symbol, final boolean loseSlot) {
    if (LOG.isEnabled()) {
        if (!symbol.isScope()) {
            LOG.finest("updateSymbols: ", symbol, " => scope, because all vars in ", functionNode.getName(), " are in scope");
        }
        if (loseSlot && symbol.hasSlot()) {
            LOG.finest("updateSymbols: ", symbol, " => no slot, because all vars in ", functionNode.getName(), " are in scope");
        }
    }
}
 
Example 9
Source File: MethodEmitter.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Add a local variable. This is a nop if the symbol has no slot
 *
 * @param symbol symbol for the local variable
 * @param start  start of scope
 * @param end    end of scope
 */
void localVariable(final Symbol symbol, final Label start, final Label end) {
    if (!symbol.hasSlot()) {
        return;
    }

    String name = symbol.getName();

    if (name.equals(THIS.symbolName())) {
        name = THIS_DEBUGGER.symbolName();
    }

    method.visitLocalVariable(name, symbol.getSymbolType().getDescriptor(), null, start.getLabel(), end.getLabel(), symbol.getSlot());
}
 
Example 10
Source File: CodeGeneratorLexicalContext.java    From hottub 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 11
Source File: MethodEmitter.java    From TencentKona-8 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 12
Source File: CodeGeneratorLexicalContext.java    From openjdk-jdk9 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 13
Source File: MethodEmitter.java    From openjdk-jdk9 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 14
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 15
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 16
Source File: CodeGeneratorLexicalContext.java    From openjdk-jdk8u 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 17
Source File: MethodEmitter.java    From openjdk-jdk8u 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 18
Source File: CodeGeneratorLexicalContext.java    From jdk8u60 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 19
Source File: CodeGeneratorLexicalContext.java    From nashorn 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 20
Source File: CodeGeneratorLexicalContext.java    From TencentKona-8 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;
}