Java 类jdk.nashorn.internal.ir.TryNode 实例源码

项目:OpenJSharp    文件:PrintVisitor.java   
@Override
public boolean enterTryNode(final TryNode tryNode) {
    tryNode.toString(sb, printTypes);
    printLocalVariableConversion(tryNode);
    tryNode.getBody().accept(this);

    final List<Block> catchBlocks = tryNode.getCatchBlocks();

    for (final Block catchBlock : catchBlocks) {
        final CatchNode catchNode = (CatchNode)catchBlock.getStatements().get(0);
        catchNode.toString(sb, printTypes);
        catchNode.getBody().accept(this);
    }

    final Block finallyBody = tryNode.getFinallyBody();

    if (finallyBody != null) {
        sb.append(" finally ");
        finallyBody.accept(this);
    }

    return false;
}
项目:OpenJSharp    文件:Lower.java   
private Block catchAllBlock(final TryNode tryNode) {
    final int  lineNumber = tryNode.getLineNumber();
    final long token      = tryNode.getToken();
    final int  finish     = tryNode.getFinish();

    final IdentNode exception = new IdentNode(token, finish, lc.getCurrentFunction().uniqueName(CompilerConstants.EXCEPTION_PREFIX.symbolName()));

    final Block catchBody = new Block(token, finish, new ThrowNode(lineNumber, token, finish, new IdentNode(exception), true));
    assert catchBody.isTerminal(); //ends with throw, so terminal

    final CatchNode catchAllNode  = new CatchNode(lineNumber, token, finish, new IdentNode(exception), null, catchBody, true);
    final Block     catchAllBlock = new Block(token, finish, catchAllNode);

    //catchallblock -> catchallnode (catchnode) -> exception -> throw

    return (Block)catchAllBlock.accept(this); //not accepted. has to be accepted by lower
}
项目:openjdk-jdk10    文件:IRTranslator.java   
@Override
public boolean enterTryNode(final TryNode tryNode) {
    final List<? extends CatchNode> catchNodes = tryNode.getCatches();
    final List<CatchTreeImpl> catchTrees = new ArrayList<>(catchNodes.size());
    for (final CatchNode catchNode : catchNodes) {
        catchTrees.add(new CatchTreeImpl(catchNode,
                translateExpr(catchNode.getException()),
                (BlockTree) translateBlock(catchNode.getBody()),
                translateExpr(catchNode.getExceptionCondition())));
    }

    curStat = new TryTreeImpl(tryNode,
            (BlockTree) translateBlock(tryNode.getBody()),
            catchTrees,
            (BlockTree) translateBlock(tryNode.getFinallyBody()));

    return false;
}
项目:openjdk-jdk10    文件:PrintVisitor.java   
@Override
public boolean enterTryNode(final TryNode tryNode) {
    tryNode.toString(sb, printTypes);
    printLocalVariableConversion(tryNode);
    tryNode.getBody().accept(this);

    final List<Block> catchBlocks = tryNode.getCatchBlocks();

    for (final Block catchBlock : catchBlocks) {
        final CatchNode catchNode = (CatchNode)catchBlock.getStatements().get(0);
        catchNode.toString(sb, printTypes);
        catchNode.getBody().accept(this);
    }

    final Block finallyBody = tryNode.getFinallyBody();

    if (finallyBody != null) {
        sb.append(" finally ");
        finallyBody.accept(this);
    }

    for (final Block inlinedFinally : tryNode.getInlinedFinallies()) {
        inlinedFinally.accept(this);
    }
    return false;
}
项目:openjdk-jdk10    文件:Lower.java   
private Block catchAllBlock(final TryNode tryNode) {
    final int  lineNumber = tryNode.getLineNumber();
    final long token      = tryNode.getToken();
    final int  finish     = tryNode.getFinish();

    final IdentNode exception = new IdentNode(token, finish, lc.getCurrentFunction().uniqueName(CompilerConstants.EXCEPTION_PREFIX.symbolName()));

    final Block catchBody = new Block(token, finish, new ThrowNode(lineNumber, token, finish, new IdentNode(exception), true));
    assert catchBody.isTerminal(); //ends with throw, so terminal

    final CatchNode catchAllNode  = new CatchNode(lineNumber, token, finish, new IdentNode(exception), null, catchBody, true);
    final Block     catchAllBlock = new Block(token, finish, catchAllNode);

    //catchallblock -> catchallnode (catchnode) -> exception -> throw

    return (Block)catchAllBlock.accept(this); //not accepted. has to be accepted by lower
}
项目:openjdk9    文件:IRTranslator.java   
@Override
public boolean enterTryNode(final TryNode tryNode) {
    final List<? extends CatchNode> catchNodes = tryNode.getCatches();
    final List<CatchTreeImpl> catchTrees = new ArrayList<>(catchNodes.size());
    for (final CatchNode catchNode : catchNodes) {
        catchTrees.add(new CatchTreeImpl(catchNode,
                translateIdent(catchNode.getException()),
                (BlockTree) translateBlock(catchNode.getBody()),
                translateExpr(catchNode.getExceptionCondition())));
    }

    curStat = new TryTreeImpl(tryNode,
            (BlockTree) translateBlock(tryNode.getBody()),
            catchTrees,
            (BlockTree) translateBlock(tryNode.getFinallyBody()));

    return false;
}
项目:openjdk9    文件:PrintVisitor.java   
@Override
public boolean enterTryNode(final TryNode tryNode) {
    tryNode.toString(sb, printTypes);
    printLocalVariableConversion(tryNode);
    tryNode.getBody().accept(this);

    final List<Block> catchBlocks = tryNode.getCatchBlocks();

    for (final Block catchBlock : catchBlocks) {
        final CatchNode catchNode = (CatchNode)catchBlock.getStatements().get(0);
        catchNode.toString(sb, printTypes);
        catchNode.getBody().accept(this);
    }

    final Block finallyBody = tryNode.getFinallyBody();

    if (finallyBody != null) {
        sb.append(" finally ");
        finallyBody.accept(this);
    }

    for (final Block inlinedFinally : tryNode.getInlinedFinallies()) {
        inlinedFinally.accept(this);
    }
    return false;
}
项目:openjdk9    文件:Lower.java   
private Block catchAllBlock(final TryNode tryNode) {
    final int  lineNumber = tryNode.getLineNumber();
    final long token      = tryNode.getToken();
    final int  finish     = tryNode.getFinish();

    final IdentNode exception = new IdentNode(token, finish, lc.getCurrentFunction().uniqueName(CompilerConstants.EXCEPTION_PREFIX.symbolName()));

    final Block catchBody = new Block(token, finish, new ThrowNode(lineNumber, token, finish, new IdentNode(exception), true));
    assert catchBody.isTerminal(); //ends with throw, so terminal

    final CatchNode catchAllNode  = new CatchNode(lineNumber, token, finish, new IdentNode(exception), null, catchBody, true);
    final Block     catchAllBlock = new Block(token, finish, catchAllNode);

    //catchallblock -> catchallnode (catchnode) -> exception -> throw

    return (Block)catchAllBlock.accept(this); //not accepted. has to be accepted by lower
}
项目:kaziranga    文件:PrintVisitor.java   
@Override
public boolean enterTryNode(final TryNode tryNode) {
    tryNode.toString(sb, printTypes);
    printLocalVariableConversion(tryNode);
    tryNode.getBody().accept(this);

    final List<Block> catchBlocks = tryNode.getCatchBlocks();

    for (final Block catchBlock : catchBlocks) {
        final CatchNode catchNode = (CatchNode)catchBlock.getStatements().get(0);
        catchNode.toString(sb, printTypes);
        catchNode.getBody().accept(this);
    }

    final Block finallyBody = tryNode.getFinallyBody();

    if (finallyBody != null) {
        sb.append(" finally ");
        finallyBody.accept(this);
    }

    for (final Block inlinedFinally : tryNode.getInlinedFinallies()) {
        inlinedFinally.accept(this);
    }
    return false;
}
项目:kaziranga    文件:Lower.java   
private Block catchAllBlock(final TryNode tryNode) {
    final int  lineNumber = tryNode.getLineNumber();
    final long token      = tryNode.getToken();
    final int  finish     = tryNode.getFinish();

    final IdentNode exception = new IdentNode(token, finish, lc.getCurrentFunction().uniqueName(CompilerConstants.EXCEPTION_PREFIX.symbolName()));

    final Block catchBody = new Block(token, finish, new ThrowNode(lineNumber, token, finish, new IdentNode(exception), true));
    assert catchBody.isTerminal(); //ends with throw, so terminal

    final CatchNode catchAllNode  = new CatchNode(lineNumber, token, finish, new IdentNode(exception), null, catchBody, true);
    final Block     catchAllBlock = new Block(token, finish, catchAllNode);

    //catchallblock -> catchallnode (catchnode) -> exception -> throw

    return (Block)catchAllBlock.accept(this); //not accepted. has to be accepted by lower
}
项目:lookaside_java-1.8.0-openjdk    文件:PrintVisitor.java   
@Override
public boolean enterTryNode(final TryNode tryNode) {
    tryNode.toString(sb, printTypes);
    printLocalVariableConversion(tryNode);
    tryNode.getBody().accept(this);

    final List<Block> catchBlocks = tryNode.getCatchBlocks();

    for (final Block catchBlock : catchBlocks) {
        final CatchNode catchNode = (CatchNode)catchBlock.getStatements().get(0);
        catchNode.toString(sb, printTypes);
        catchNode.getBody().accept(this);
    }

    final Block finallyBody = tryNode.getFinallyBody();

    if (finallyBody != null) {
        sb.append(" finally ");
        finallyBody.accept(this);
    }

    for (final Block inlinedFinally : tryNode.getInlinedFinallies()) {
        inlinedFinally.accept(this);
    }
    return false;
}
项目:lookaside_java-1.8.0-openjdk    文件:Lower.java   
private Block catchAllBlock(final TryNode tryNode) {
    final int  lineNumber = tryNode.getLineNumber();
    final long token      = tryNode.getToken();
    final int  finish     = tryNode.getFinish();

    final IdentNode exception = new IdentNode(token, finish, lc.getCurrentFunction().uniqueName(CompilerConstants.EXCEPTION_PREFIX.symbolName()));

    final Block catchBody = new Block(token, finish, new ThrowNode(lineNumber, token, finish, new IdentNode(exception), true));
    assert catchBody.isTerminal(); //ends with throw, so terminal

    final CatchNode catchAllNode  = new CatchNode(lineNumber, token, finish, new IdentNode(exception), null, catchBody, true);
    final Block     catchAllBlock = new Block(token, finish, catchAllNode);

    //catchallblock -> catchallnode (catchnode) -> exception -> throw

    return (Block)catchAllBlock.accept(this); //not accepted. has to be accepted by lower
}
项目:jdk8u_nashorn    文件:PrintVisitor.java   
@Override
public boolean enterTryNode(final TryNode tryNode) {
    tryNode.toString(sb, printTypes);
    printLocalVariableConversion(tryNode);
    tryNode.getBody().accept(this);

    final List<Block> catchBlocks = tryNode.getCatchBlocks();

    for (final Block catchBlock : catchBlocks) {
        final CatchNode catchNode = (CatchNode)catchBlock.getStatements().get(0);
        catchNode.toString(sb, printTypes);
        catchNode.getBody().accept(this);
    }

    final Block finallyBody = tryNode.getFinallyBody();

    if (finallyBody != null) {
        sb.append(" finally ");
        finallyBody.accept(this);
    }

    for (final Block inlinedFinally : tryNode.getInlinedFinallies()) {
        inlinedFinally.accept(this);
    }
    return false;
}
项目:jdk8u_nashorn    文件:Lower.java   
private Block catchAllBlock(final TryNode tryNode) {
    final int  lineNumber = tryNode.getLineNumber();
    final long token      = tryNode.getToken();
    final int  finish     = tryNode.getFinish();

    final IdentNode exception = new IdentNode(token, finish, lc.getCurrentFunction().uniqueName(CompilerConstants.EXCEPTION_PREFIX.symbolName()));

    final Block catchBody = new Block(token, finish, new ThrowNode(lineNumber, token, finish, new IdentNode(exception), true));
    assert catchBody.isTerminal(); //ends with throw, so terminal

    final CatchNode catchAllNode  = new CatchNode(lineNumber, token, finish, new IdentNode(exception), null, catchBody, true);
    final Block     catchAllBlock = new Block(token, finish, catchAllNode);

    //catchallblock -> catchallnode (catchnode) -> exception -> throw

    return (Block)catchAllBlock.accept(this); //not accepted. has to be accepted by lower
}
项目:infobip-open-jdk-8    文件:PrintVisitor.java   
@Override
public boolean enterTryNode(final TryNode tryNode) {
    tryNode.toString(sb, printTypes);
    printLocalVariableConversion(tryNode);
    tryNode.getBody().accept(this);

    final List<Block> catchBlocks = tryNode.getCatchBlocks();

    for (final Block catchBlock : catchBlocks) {
        final CatchNode catchNode = (CatchNode)catchBlock.getStatements().get(0);
        catchNode.toString(sb, printTypes);
        catchNode.getBody().accept(this);
    }

    final Block finallyBody = tryNode.getFinallyBody();

    if (finallyBody != null) {
        sb.append(" finally ");
        finallyBody.accept(this);
    }

    return false;
}
项目:infobip-open-jdk-8    文件:Lower.java   
private Block catchAllBlock(final TryNode tryNode) {
    final int  lineNumber = tryNode.getLineNumber();
    final long token      = tryNode.getToken();
    final int  finish     = tryNode.getFinish();

    final IdentNode exception = new IdentNode(token, finish, lc.getCurrentFunction().uniqueName(CompilerConstants.EXCEPTION_PREFIX.symbolName()));

    final Block catchBody = new Block(token, finish, new ThrowNode(lineNumber, token, finish, new IdentNode(exception), true));
    assert catchBody.isTerminal(); //ends with throw, so terminal

    final CatchNode catchAllNode  = new CatchNode(lineNumber, token, finish, new IdentNode(exception), null, catchBody, true);
    final Block     catchAllBlock = new Block(token, finish, catchAllNode);

    //catchallblock -> catchallnode (catchnode) -> exception -> throw

    return (Block)catchAllBlock.accept(this); //not accepted. has to be accepted by lower
}
项目:OLD-OpenJDK8    文件:PrintVisitor.java   
@Override
public boolean enterTryNode(final TryNode tryNode) {
    tryNode.toString(sb);
    tryNode.getBody().accept(this);

    final List<Block> catchBlocks = tryNode.getCatchBlocks();

    for (final Block catchBlock : catchBlocks) {
        final CatchNode catchNode = (CatchNode)catchBlock.getStatements().get(0);
        catchNode.toString(sb);
        catchNode.getBody().accept(this);
    }

    final Block finallyBody = tryNode.getFinallyBody();

    if (finallyBody != null) {
        sb.append(" finally ");
        finallyBody.accept(this);
    }

    return false;
}
项目:OLD-OpenJDK8    文件:Lower.java   
private Block catchAllBlock(final TryNode tryNode) {
    final int  lineNumber = tryNode.getLineNumber();
    final long token      = tryNode.getToken();
    final int  finish     = tryNode.getFinish();

    final IdentNode exception = new IdentNode(token, finish, lc.getCurrentFunction().uniqueName("catch_all"));

    final Block catchBody = new Block(token, finish, new ThrowNode(lineNumber, token, finish, new IdentNode(exception), ThrowNode.IS_SYNTHETIC_RETHROW));
    assert catchBody.isTerminal(); //ends with throw, so terminal

    final CatchNode catchAllNode  = new CatchNode(lineNumber, token, finish, new IdentNode(exception), null, catchBody, CatchNode.IS_SYNTHETIC_RETHROW);
    final Block     catchAllBlock = new Block(token, finish, catchAllNode);

    //catchallblock -> catchallnode (catchnode) -> exception -> throw

    return (Block)catchAllBlock.accept(this); //not accepted. has to be accepted by lower
}
项目:nashorn-backport    文件:PrintVisitor.java   
@Override
public boolean enterTryNode(final TryNode tryNode) {
    tryNode.toString(sb);
    tryNode.getBody().accept(this);

    final List<Block> catchBlocks = tryNode.getCatchBlocks();

    for (final Block catchBlock : catchBlocks) {
        final CatchNode catchNode = (CatchNode)catchBlock.getStatements().get(0);
        catchNode.toString(sb);
        catchNode.getBody().accept(this);
    }

    final Block finallyBody = tryNode.getFinallyBody();

    if (finallyBody != null) {
        sb.append(" finally ");
        finallyBody.accept(this);
    }

    return false;
}
项目:nashorn-backport    文件:Lower.java   
private Block catchAllBlock(final TryNode tryNode) {
    final int  lineNumber = tryNode.getLineNumber();
    final long token      = tryNode.getToken();
    final int  finish     = tryNode.getFinish();

    final IdentNode exception = new IdentNode(token, finish, lc.getCurrentFunction().uniqueName("catch_all"));

    final Block catchBody = new Block(token, finish, new ThrowNode(lineNumber, token, finish, new IdentNode(exception), ThrowNode.IS_SYNTHETIC_RETHROW));
    assert catchBody.isTerminal(); //ends with throw, so terminal

    final CatchNode catchAllNode  = new CatchNode(lineNumber, token, finish, new IdentNode(exception), null, catchBody, CatchNode.IS_SYNTHETIC_RETHROW);
    final Block     catchAllBlock = new Block(token, finish, catchAllNode);

    //catchallblock -> catchallnode (catchnode) -> exception -> throw

    return (Block)catchAllBlock.accept(this); //not accepted. has to be accepted by lower
}
项目:nashorn    文件:PrintVisitor.java   
@Override
public boolean enterTryNode(final TryNode tryNode) {
    tryNode.toString(sb);
    tryNode.getBody().accept(this);

    final List<Block> catchBlocks = tryNode.getCatchBlocks();

    for (final Block catchBlock : catchBlocks) {
        final CatchNode catchNode = (CatchNode)catchBlock.getStatements().get(0);
        catchNode.toString(sb);
        catchNode.getBody().accept(this);
    }

    final Block finallyBody = tryNode.getFinallyBody();

    if (finallyBody != null) {
        sb.append(" finally ");
        finallyBody.accept(this);
    }

    return false;
}
项目:nashorn    文件:Lower.java   
private Block catchAllBlock(final TryNode tryNode) {
    final int  lineNumber = tryNode.getLineNumber();
    final long token      = tryNode.getToken();
    final int  finish     = tryNode.getFinish();

    final IdentNode exception = new IdentNode(token, finish, lc.getCurrentFunction().uniqueName("catch_all"));

    final Block catchBody = new Block(token, finish, new ThrowNode(lineNumber, token, finish, new IdentNode(exception), ThrowNode.IS_SYNTHETIC_RETHROW));
    assert catchBody.isTerminal(); //ends with throw, so terminal

    final CatchNode catchAllNode  = new CatchNode(lineNumber, token, finish, new IdentNode(exception), null, catchBody, CatchNode.IS_SYNTHETIC_RETHROW);
    final Block     catchAllBlock = new Block(token, finish, catchAllNode);

    //catchallblock -> catchallnode (catchnode) -> exception -> throw

    return (Block)catchAllBlock.accept(this); //not accepted. has to be accepted by lower
}
项目:OpenJSharp    文件:MethodEmitter.java   
void beforeTry(final TryNode tryNode, final Label recovery) {
    LocalVariableConversion next = tryNode.getLocalVariableConversion();
    while(next != null) {
        if(next.isLive()) {
            final Type to = emitLocalVariableConversion(next, false);
            recovery.getStack().onLocalStore(to, next.getSymbol().getSlot(to), true);
        }
        next = next.getNext();
    }
}
项目:OpenJSharp    文件:AssignSymbols.java   
@Override
public Node leaveTryNode(final TryNode tryNode) {
    tryNode.setException(exceptionSymbol());
    if (tryNode.getFinallyBody() != null) {
        tryNode.setFinallyCatchAll(exceptionSymbol());
    }

    end(tryNode);

    return tryNode;
}
项目:OpenJSharp    文件:Lower.java   
private TryNode ensureUnconditionalCatch(final TryNode tryNode) {
    final List<CatchNode> catches = tryNode.getCatches();
    if(catches == null || catches.isEmpty() || catches.get(catches.size() - 1).getExceptionCondition() == null) {
        return tryNode;
    }
    // If the last catch block is conditional, add an unconditional rethrow block
    final List<Block> newCatchBlocks = new ArrayList<>(tryNode.getCatchBlocks());

    newCatchBlocks.add(catchAllBlock(tryNode));
    return tryNode.setCatchBlocks(newCatchBlocks);
}
项目:openjdk-jdk10    文件:TryTreeImpl.java   
TryTreeImpl(final TryNode node,
        final BlockTree block,
        final List<? extends CatchTree> catches,
        final BlockTree finallyBlock) {
    super(node);
    this.block = block;
    this.catches = catches;
    this.finallyBlock = finallyBlock;
}
项目:openjdk-jdk10    文件:MethodEmitter.java   
void beforeTry(final TryNode tryNode, final Label recovery) {
    LocalVariableConversion next = tryNode.getLocalVariableConversion();
    while(next != null) {
        if(next.isLive()) {
            final Type to = emitLocalVariableConversion(next, false);
            recovery.getStack().onLocalStore(to, next.getSymbol().getSlot(to), true);
        }
        next = next.getNext();
    }
}
项目:openjdk-jdk10    文件:AssignSymbols.java   
@Override
public Node leaveTryNode(final TryNode tryNode) {
    assert tryNode.getFinallyBody() == null;

    end(tryNode);

    return tryNode.setException(lc, exceptionSymbol());
}
项目:openjdk-jdk10    文件:Lower.java   
private TryNode ensureUnconditionalCatch(final TryNode tryNode) {
    final List<CatchNode> catches = tryNode.getCatches();
    if(catches == null || catches.isEmpty() || catches.get(catches.size() - 1).getExceptionCondition() == null) {
        return tryNode;
    }
    // If the last catch block is conditional, add an unconditional rethrow block
    final List<Block> newCatchBlocks = new ArrayList<>(tryNode.getCatchBlocks());

    newCatchBlocks.add(catchAllBlock(tryNode));
    return tryNode.setCatchBlocks(lc, newCatchBlocks);
}
项目:openjdk9    文件:TryTreeImpl.java   
TryTreeImpl(final TryNode node,
        final BlockTree block,
        final List<? extends CatchTree> catches,
        final BlockTree finallyBlock) {
    super(node);
    this.block = block;
    this.catches = catches;
    this.finallyBlock = finallyBlock;
}
项目:openjdk9    文件:MethodEmitter.java   
void beforeTry(final TryNode tryNode, final Label recovery) {
    LocalVariableConversion next = tryNode.getLocalVariableConversion();
    while(next != null) {
        if(next.isLive()) {
            final Type to = emitLocalVariableConversion(next, false);
            recovery.getStack().onLocalStore(to, next.getSymbol().getSlot(to), true);
        }
        next = next.getNext();
    }
}
项目:openjdk9    文件:AssignSymbols.java   
@Override
public Node leaveTryNode(final TryNode tryNode) {
    assert tryNode.getFinallyBody() == null;

    end(tryNode);

    return tryNode.setException(lc, exceptionSymbol());
}
项目:openjdk9    文件:Lower.java   
private TryNode ensureUnconditionalCatch(final TryNode tryNode) {
    final List<CatchNode> catches = tryNode.getCatches();
    if(catches == null || catches.isEmpty() || catches.get(catches.size() - 1).getExceptionCondition() == null) {
        return tryNode;
    }
    // If the last catch block is conditional, add an unconditional rethrow block
    final List<Block> newCatchBlocks = new ArrayList<>(tryNode.getCatchBlocks());

    newCatchBlocks.add(catchAllBlock(tryNode));
    return tryNode.setCatchBlocks(lc, newCatchBlocks);
}
项目:kaziranga    文件:MethodEmitter.java   
void beforeTry(final TryNode tryNode, final Label recovery) {
    LocalVariableConversion next = tryNode.getLocalVariableConversion();
    while(next != null) {
        if(next.isLive()) {
            final Type to = emitLocalVariableConversion(next, false);
            recovery.getStack().onLocalStore(to, next.getSymbol().getSlot(to), true);
        }
        next = next.getNext();
    }
}
项目:kaziranga    文件:AssignSymbols.java   
@Override
public Node leaveTryNode(final TryNode tryNode) {
    tryNode.setException(exceptionSymbol());
    assert tryNode.getFinallyBody() == null;

    end(tryNode);

    return tryNode;
}
项目:kaziranga    文件:Lower.java   
private TryNode ensureUnconditionalCatch(final TryNode tryNode) {
    final List<CatchNode> catches = tryNode.getCatches();
    if(catches == null || catches.isEmpty() || catches.get(catches.size() - 1).getExceptionCondition() == null) {
        return tryNode;
    }
    // If the last catch block is conditional, add an unconditional rethrow block
    final List<Block> newCatchBlocks = new ArrayList<>(tryNode.getCatchBlocks());

    newCatchBlocks.add(catchAllBlock(tryNode));
    return tryNode.setCatchBlocks(lc, newCatchBlocks);
}
项目:lookaside_java-1.8.0-openjdk    文件:MethodEmitter.java   
void beforeTry(final TryNode tryNode, final Label recovery) {
    LocalVariableConversion next = tryNode.getLocalVariableConversion();
    while(next != null) {
        if(next.isLive()) {
            final Type to = emitLocalVariableConversion(next, false);
            recovery.getStack().onLocalStore(to, next.getSymbol().getSlot(to), true);
        }
        next = next.getNext();
    }
}
项目:lookaside_java-1.8.0-openjdk    文件:AssignSymbols.java   
@Override
public Node leaveTryNode(final TryNode tryNode) {
    assert tryNode.getFinallyBody() == null;

    end(tryNode);

    return tryNode.setException(lc, exceptionSymbol());
}
项目:lookaside_java-1.8.0-openjdk    文件:Lower.java   
private TryNode ensureUnconditionalCatch(final TryNode tryNode) {
    final List<CatchNode> catches = tryNode.getCatches();
    if(catches == null || catches.isEmpty() || catches.get(catches.size() - 1).getExceptionCondition() == null) {
        return tryNode;
    }
    // If the last catch block is conditional, add an unconditional rethrow block
    final List<Block> newCatchBlocks = new ArrayList<>(tryNode.getCatchBlocks());

    newCatchBlocks.add(catchAllBlock(tryNode));
    return tryNode.setCatchBlocks(lc, newCatchBlocks);
}
项目:jdk8u_nashorn    文件:MethodEmitter.java   
void beforeTry(final TryNode tryNode, final Label recovery) {
    LocalVariableConversion next = tryNode.getLocalVariableConversion();
    while(next != null) {
        if(next.isLive()) {
            final Type to = emitLocalVariableConversion(next, false);
            recovery.getStack().onLocalStore(to, next.getSymbol().getSlot(to), true);
        }
        next = next.getNext();
    }
}