jdk.nashorn.internal.ir.SplitNode Java Examples

The following examples show how to use jdk.nashorn.internal.ir.SplitNode. 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: SplitIntoFunctions.java    From jdk8u_nashorn with GNU General Public License v2.0 5 votes vote down vote up
private JumpStatement leaveJumpNode(final JumpStatement jump) {
    if (inSplitNode()) {
        final SplitState splitState = getCurrentSplitState();
        final SplitNode splitNode = splitState.splitNode;
        if (lc.isExternalTarget(splitNode, jump.getTarget(lc))) {
            appendSplitReturn(splitState.getSplitStateIndex(jump), jump.getLineNumber());
            return jump;
        }
    }
    appendStatement(jump);
    return jump;
}
 
Example #2
Source File: PrintVisitor.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Node leaveSplitNode(final SplitNode splitNode) {
    sb.append("</split>");
    sb.append(EOLN);
    indent -= TABWIDTH;
    indent();
    return splitNode;
}
 
Example #3
Source File: PrintVisitor.java    From jdk8u_nashorn with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Node leaveSplitNode(final SplitNode splitNode) {
    sb.append("</split>");
    sb.append(EOLN);
    indent -= TABWIDTH;
    indent();
    return splitNode;
}
 
Example #4
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 #5
Source File: SplitIntoFunctions.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private JumpStatement leaveJumpNode(final JumpStatement jump) {
    if (inSplitNode()) {
        final SplitState splitState = getCurrentSplitState();
        final SplitNode splitNode = splitState.splitNode;
        if (lc.isExternalTarget(splitNode, jump.getTarget(lc))) {
            appendSplitReturn(splitState.getSplitStateIndex(jump), jump.getLineNumber());
            return jump;
        }
    }
    appendStatement(jump);
    return jump;
}
 
Example #6
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));
}
 
Example #7
Source File: PrintVisitor.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Override
public boolean enterSplitNode(final SplitNode splitNode) {
    splitNode.toString(sb, printTypes);
    sb.append(EOLN);
    indent += TABWIDTH;
    indent();
    return true;
}
 
Example #8
Source File: PrintVisitor.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Node leaveSplitNode(final SplitNode splitNode) {
    sb.append("</split>");
    sb.append(EOLN);
    indent -= TABWIDTH;
    indent();
    return splitNode;
}
 
Example #9
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 #10
Source File: PrintVisitor.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
@Override
public boolean enterSplitNode(final SplitNode splitNode) {
    splitNode.toString(sb, printTypes);
    sb.append(EOLN);
    indent += TABWIDTH;
    indent();
    return true;
}
 
Example #11
Source File: PrintVisitor.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Node leaveSplitNode(final SplitNode splitNode) {
    sb.append("</split>");
    sb.append(EOLN);
    indent -= TABWIDTH;
    indent();
    return splitNode;
}
 
Example #12
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 #13
Source File: SplitIntoFunctions.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private JumpStatement leaveJumpNode(final JumpStatement jump) {
    if (inSplitNode()) {
        final SplitState splitState = getCurrentSplitState();
        final SplitNode splitNode = splitState.splitNode;
        if (lc.isExternalTarget(splitNode, jump.getTarget(lc))) {
            appendSplitReturn(splitState.getSplitStateIndex(jump), jump.getLineNumber());
            return jump;
        }
    }
    appendStatement(jump);
    return jump;
}
 
Example #14
Source File: PrintVisitor.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public boolean enterSplitNode(final SplitNode splitNode) {
    splitNode.toString(sb, printTypes);
    sb.append(EOLN);
    indent += TABWIDTH;
    indent();
    return true;
}
 
Example #15
Source File: PrintVisitor.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Node leaveSplitNode(final SplitNode splitNode) {
    sb.append("</split>");
    sb.append(EOLN);
    indent -= TABWIDTH;
    indent();
    return splitNode;
}
 
Example #16
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 #17
Source File: SplitIntoFunctions.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private JumpStatement leaveJumpNode(final JumpStatement jump) {
    if (inSplitNode()) {
        final SplitState splitState = getCurrentSplitState();
        final SplitNode splitNode = splitState.splitNode;
        if (lc.isExternalTarget(splitNode, jump.getTarget(lc))) {
            appendSplitReturn(splitState.getSplitStateIndex(jump), jump.getLineNumber());
            return jump;
        }
    }
    appendStatement(jump);
    return jump;
}
 
Example #18
Source File: PrintVisitor.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
@Override
public boolean enterSplitNode(final SplitNode splitNode) {
    splitNode.toString(sb, printTypes);
    sb.append(EOLN);
    indent += TABWIDTH;
    indent();
    return true;
}
 
Example #19
Source File: PrintVisitor.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Node leaveSplitNode(final SplitNode splitNode) {
    sb.append("</split>");
    sb.append(EOLN);
    indent -= TABWIDTH;
    indent();
    return splitNode;
}
 
Example #20
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 #21
Source File: SplitIntoFunctions.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private JumpStatement leaveJumpNode(final JumpStatement jump) {
    if (inSplitNode()) {
        final SplitState splitState = getCurrentSplitState();
        final SplitNode splitNode = splitState.splitNode;
        if (lc.isExternalTarget(splitNode, jump.getTarget(lc))) {
            appendSplitReturn(splitState.getSplitStateIndex(jump), jump.getLineNumber());
            return jump;
        }
    }
    appendStatement(jump);
    return jump;
}
 
Example #22
Source File: PrintVisitor.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Node leaveSplitNode(final SplitNode splitNode) {
    sb.append("</split>");
    sb.append(EOLN);
    indent -= TABWIDTH;
    indent();
    return splitNode;
}
 
Example #23
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 #24
Source File: PrintVisitor.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public boolean enterSplitNode(final SplitNode splitNode) {
    splitNode.toString(sb);
    sb.append(EOLN);
    indent += TABWIDTH;
    indent();
    return true;
}
 
Example #25
Source File: PrintVisitor.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Node leaveSplitNode(final SplitNode splitNode) {
    sb.append("</split>");
    sb.append(EOLN);
    indent -= TABWIDTH;
    indent();
    return splitNode;
}
 
Example #26
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 #27
Source File: PrintVisitor.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public boolean enterSplitNode(final SplitNode splitNode) {
    splitNode.toString(sb, printTypes);
    sb.append(EOLN);
    indent += TABWIDTH;
    indent();
    return true;
}
 
Example #28
Source File: SplitIntoFunctions.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
SplitState(final SplitNode splitNode) {
    this.splitNode = splitNode;
}
 
Example #29
Source File: SplitIntoFunctions.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
@Override
public boolean enterSplitNode(final SplitNode splitNode) {
    getCurrentFunctionState().splitDepth++;
    splitStates.push(new SplitState(splitNode));
    return true;
}
 
Example #30
Source File: JSONWriter.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
@Override
public boolean enterSplitNode(final SplitNode splitNode) {
    return false;
}