Java Code Examples for jdk.nashorn.internal.ir.FunctionNode#uniqueName()

The following examples show how to use jdk.nashorn.internal.ir.FunctionNode#uniqueName() . 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: Lower.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private static JumpToInlinedFinally createJumpToInlinedFinally(final FunctionNode fn, final List<Block> inlinedFinallies, final Block finallyBlock) {
    final String labelName = fn.uniqueName(":finally");
    final long token = finallyBlock.getToken();
    final int finish = finallyBlock.getFinish();
    inlinedFinallies.add(new Block(token, finish, new LabelNode(finallyBlock.getFirstStatementLineNumber(),
            token, finish, labelName, finallyBlock)));
    return new JumpToInlinedFinally(labelName);
}
 
Example 2
Source File: Splitter.java    From nashorn with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create a new split node from statements contained in a parent block.
 *
 * @param parent     Parent block.
 * @param statements Statements to include.
 *
 * @return New split node.
 */
private SplitNode createBlockSplitNode(final Block parent, final FunctionNode function, final List<Statement> statements, final long weight) {
    final long   token      = parent.getToken();
    final int    finish     = parent.getFinish();
    final String name       = function.uniqueName(SPLIT_PREFIX.symbolName());

    final Block newBlock = new Block(token, finish, statements);

    return new SplitNode(name, newBlock, compiler.findUnit(weight + WeighNodes.FUNCTION_WEIGHT));
}
 
Example 3
Source File: Splitter.java    From jdk8u_nashorn with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create a new split node from statements contained in a parent block.
 *
 * @param parent     Parent block.
 * @param statements Statements to include.
 *
 * @return New split node.
 */
private SplitNode createBlockSplitNode(final Block parent, final FunctionNode function, final List<Statement> statements, final long weight) {
    final long   token      = parent.getToken();
    final int    finish     = parent.getFinish();
    final String name       = function.uniqueName(SPLIT_PREFIX.symbolName());

    final Block newBlock = new Block(token, finish, statements);

    return new SplitNode(name, newBlock, compiler.findUnit(weight + WeighNodes.FUNCTION_WEIGHT));
}
 
Example 4
Source File: Lower.java    From jdk8u_nashorn with GNU General Public License v2.0 5 votes vote down vote up
private static JumpToInlinedFinally createJumpToInlinedFinally(final FunctionNode fn, final List<Block> inlinedFinallies, final Block finallyBlock) {
    final String labelName = fn.uniqueName(":finally");
    final long token = finallyBlock.getToken();
    final int finish = finallyBlock.getFinish();
    inlinedFinallies.add(new Block(token, finish, new LabelNode(finallyBlock.getFirstStatementLineNumber(),
            token, finish, labelName, finallyBlock)));
    return new JumpToInlinedFinally(labelName);
}
 
Example 5
Source File: Splitter.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create a new split node from statements contained in a parent block.
 *
 * @param parent     Parent block.
 * @param statements Statements to include.
 *
 * @return New split node.
 */
private SplitNode createBlockSplitNode(final Block parent, final FunctionNode function, final List<Statement> statements, final long weight) {
    final long   token      = parent.getToken();
    final int    finish     = parent.getFinish();
    final String name       = function.uniqueName(SPLIT_PREFIX.symbolName());

    final Block newBlock = new Block(token, finish, statements);

    return new SplitNode(name, newBlock, compiler.findUnit(weight + WeighNodes.FUNCTION_WEIGHT));
}
 
Example 6
Source File: Splitter.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create a new split node from statements contained in a parent block.
 *
 * @param parent     Parent block.
 * @param statements Statements to include.
 *
 * @return New split node.
 */
private SplitNode createBlockSplitNode(final Block parent, final FunctionNode function, final List<Statement> statements, final long weight) {
    final long   token      = parent.getToken();
    final int    finish     = parent.getFinish();
    final String name       = function.uniqueName(SPLIT_PREFIX.symbolName());

    final Block newBlock = new Block(token, finish, statements);

    return new SplitNode(name, newBlock, compiler.findUnit(weight + WeighNodes.FUNCTION_WEIGHT));
}
 
Example 7
Source File: Splitter.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create a new split node from statements contained in a parent block.
 *
 * @param parent     Parent block.
 * @param statements Statements to include.
 *
 * @return New split node.
 */
private SplitNode createBlockSplitNode(final Block parent, final FunctionNode function, final List<Statement> statements, final long weight) {
    final long   token      = parent.getToken();
    final int    finish     = parent.getFinish();
    final String name       = function.uniqueName(SPLIT_PREFIX.symbolName());

    final Block newBlock = new Block(token, finish, statements);

    return new SplitNode(name, newBlock, compiler.findUnit(weight + WeighNodes.FUNCTION_WEIGHT));
}
 
Example 8
Source File: Lower.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private static JumpToInlinedFinally createJumpToInlinedFinally(final FunctionNode fn, final List<Block> inlinedFinallies, final Block finallyBlock) {
    final String labelName = fn.uniqueName(":finally");
    final long token = finallyBlock.getToken();
    final int finish = finallyBlock.getFinish();
    inlinedFinallies.add(new Block(token, finish, new LabelNode(finallyBlock.getFirstStatementLineNumber(),
            token, finish, labelName, finallyBlock)));
    return new JumpToInlinedFinally(labelName);
}
 
Example 9
Source File: Splitter.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create a new split node from statements contained in a parent block.
 *
 * @param parent     Parent block.
 * @param statements Statements to include.
 *
 * @return New split node.
 */
private SplitNode createBlockSplitNode(final Block parent, final FunctionNode function, final List<Statement> statements, final long weight) {
    final long   token      = parent.getToken();
    final int    finish     = parent.getFinish();
    final String name       = function.uniqueName(SPLIT_PREFIX.symbolName());

    final Block newBlock = new Block(token, finish, statements);

    return new SplitNode(name, newBlock, compiler.findUnit(weight + WeighNodes.FUNCTION_WEIGHT));
}
 
Example 10
Source File: Lower.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private static JumpToInlinedFinally createJumpToInlinedFinally(final FunctionNode fn, final List<Block> inlinedFinallies, final Block finallyBlock) {
    final String labelName = fn.uniqueName(":finally");
    final long token = finallyBlock.getToken();
    final int finish = finallyBlock.getFinish();
    inlinedFinallies.add(new Block(token, finish, new LabelNode(finallyBlock.getFirstStatementLineNumber(),
            token, finish, labelName, finallyBlock)));
    return new JumpToInlinedFinally(labelName);
}
 
Example 11
Source File: Splitter.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create a new split node from statements contained in a parent block.
 *
 * @param parent     Parent block.
 * @param statements Statements to include.
 *
 * @return New split node.
 */
private SplitNode createBlockSplitNode(final Block parent, final FunctionNode function, final List<Statement> statements, final long weight) {
    final long   token      = parent.getToken();
    final int    finish     = parent.getFinish();
    final String name       = function.uniqueName(SPLIT_PREFIX.symbolName());

    final Block newBlock = new Block(token, finish, statements);

    return new SplitNode(name, newBlock, compiler.findUnit(weight + WeighNodes.FUNCTION_WEIGHT));
}
 
Example 12
Source File: Lower.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private static JumpToInlinedFinally createJumpToInlinedFinally(final FunctionNode fn, final List<Block> inlinedFinallies, final Block finallyBlock) {
    final String labelName = fn.uniqueName(":finally");
    final long token = finallyBlock.getToken();
    final int finish = finallyBlock.getFinish();
    inlinedFinallies.add(new Block(token, finish, new LabelNode(finallyBlock.getFirstStatementLineNumber(),
            token, finish, labelName, finallyBlock)));
    return new JumpToInlinedFinally(labelName);
}
 
Example 13
Source File: Splitter.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create a new split node from statements contained in a parent block.
 *
 * @param parent     Parent block.
 * @param statements Statements to include.
 *
 * @return New split node.
 */
private SplitNode createBlockSplitNode(final Block parent, final FunctionNode function, final List<Statement> statements, final long weight) {
    final long   token      = parent.getToken();
    final int    finish     = parent.getFinish();
    final String name       = function.uniqueName(SPLIT_PREFIX.symbolName());

    final Block newBlock = new Block(token, finish, statements);

    return new SplitNode(name, newBlock, compiler.findUnit(weight + WeighNodes.FUNCTION_WEIGHT));
}
 
Example 14
Source File: Lower.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private static JumpToInlinedFinally createJumpToInlinedFinally(final FunctionNode fn, final List<Block> inlinedFinallies, final Block finallyBlock) {
    final String labelName = fn.uniqueName(":finally");
    final long token = finallyBlock.getToken();
    final int finish = finallyBlock.getFinish();
    inlinedFinallies.add(new Block(token, finish, new LabelNode(finallyBlock.getFirstStatementLineNumber(),
            token, finish, labelName, finallyBlock)));
    return new JumpToInlinedFinally(labelName);
}
 
Example 15
Source File: Splitter.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create a new split node from statements contained in a parent block.
 *
 * @param parent     Parent block.
 * @param statements Statements to include.
 *
 * @return New split node.
 */
private SplitNode createBlockSplitNode(final Block parent, final FunctionNode function, final List<Statement> statements, final long weight) {
    final long   token      = parent.getToken();
    final int    finish     = parent.getFinish();
    final String name       = function.uniqueName(SPLIT_PREFIX.symbolName());

    final Block newBlock = new Block(token, finish, statements);

    return new SplitNode(name, newBlock, compiler.findUnit(weight + WeighNodes.FUNCTION_WEIGHT));
}
 
Example 16
Source File: Lower.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private static JumpToInlinedFinally createJumpToInlinedFinally(final FunctionNode fn, final List<Block> inlinedFinallies, final Block finallyBlock) {
    final String labelName = fn.uniqueName(":finally");
    final long token = finallyBlock.getToken();
    final int finish = finallyBlock.getFinish();
    inlinedFinallies.add(new Block(token, finish, new LabelNode(finallyBlock.getFirstStatementLineNumber(),
            token, finish, labelName, finallyBlock)));
    return new JumpToInlinedFinally(labelName);
}
 
Example 17
Source File: Splitter.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create a new split node from statements contained in a parent block.
 *
 * @param parent     Parent block.
 * @param statements Statements to include.
 *
 * @return New split node.
 */
private SplitNode createBlockSplitNode(final Block parent, final FunctionNode function, final List<Statement> statements, final long weight) {
    final long   token      = parent.getToken();
    final int    finish     = parent.getFinish();
    final String name       = function.uniqueName(SPLIT_PREFIX.symbolName());

    final Block newBlock = new Block(token, finish, statements);

    return new SplitNode(name, newBlock, compiler.findUnit(weight + WeighNodes.FUNCTION_WEIGHT));
}