/** * Used for <code>break foo</code> inside a loop to end the * execution of the marked loop. This method will return the * break label of the loop if there is one found for the name. * If not, the current break label is returned. */ protected Label getNamedBreakLabel(String name) { Label label = getBreakLabel(); Label endLabel = null; if (name!=null) endLabel = (Label) namedLoopBreakLabel.get(name); if (endLabel!=null) label = endLabel; return label; }
/** * Used for <code>break foo</code> inside a loop to end the * execution of the marked loop. This method will return the * break label of the loop if there is one found for the name. * If not, the current break label is returned. */ protected Label getNamedBreakLabel(String name) { Label label = getBreakLabel(); Label endLabel = null; if (name!=null) endLabel = (Label) namedLoopBreakLabel.get(name); if (endLabel!=null) label = endLabel; return label; }
/** * Used for <code>break foo</code> inside a loop to end the * execution of the marked loop. This method will return the * break label of the loop if there is one found for the name. * If not, the current break label is returned. */ protected Label getNamedBreakLabel(String name) { Label label = getBreakLabel(); Label endLabel = null; if (name!=null) endLabel = (Label) namedLoopBreakLabel.get(name); if (endLabel!=null) label = endLabel; return label; }
public void visitDoWhileLoop(DoWhileStatement loop) { onLineNumber(loop, "visitDoWhileLoop"); visitStatement(loop); compileStack.pushLoop(loop.getStatementLabel()); Label breakLabel = compileStack.getBreakLabel(); Label continueLabel = compileStack.getContinueLabel(); mv.visitLabel(continueLabel); loop.getLoopBlock().visit(this); loop.getBooleanExpression().visit(this); mv.visitJumpInsn(IFEQ, continueLabel); mv.visitLabel(breakLabel); compileStack.pop(); }
public void visitDoWhileLoop(DoWhileStatement loop) { onLineNumber(loop, "visitDoWhileLoop"); visitStatement(loop); compileStack.pushLoop(loop.getStatementLabel()); Label breakLabel = compileStack.getBreakLabel(); Label continueLabel = compileStack.getContinueLabel(); mv.visitLabel(continueLabel); loop.getLoopBlock().visit(this); loop.getBooleanExpression().visit(this); mv.visitJumpInsn(IFEQ, continueLabel); mv.visitLabel(breakLabel); compileStack.pop(); }
Label breakLabel = compileStack.getBreakLabel();
Label breakLabel = compileStack.getBreakLabel();
public void visitWhileLoop(WhileStatement loop) { onLineNumber(loop, "visitWhileLoop"); visitStatement(loop); compileStack.pushLoop(loop.getStatementLabel()); Label continueLabel = compileStack.getContinueLabel(); Label breakLabel = compileStack.getBreakLabel(); mv.visitLabel(continueLabel); Expression bool = loop.getBooleanExpression(); boolean boolHandled = false; if (bool instanceof ConstantExpression) { ConstantExpression constant = (ConstantExpression) bool; if (constant.getValue()==Boolean.TRUE) { boolHandled = true; // do nothing } else if (constant.getValue()==Boolean.FALSE) { boolHandled = true; mv.visitJumpInsn(GOTO, breakLabel); } } if(!boolHandled) { bool.visit(this); mv.visitJumpInsn(IFEQ, breakLabel); } loop.getLoopBlock().visit(this); mv.visitJumpInsn(GOTO, continueLabel); mv.visitLabel(breakLabel); compileStack.pop(); }
public void visitWhileLoop(WhileStatement loop) { onLineNumber(loop, "visitWhileLoop"); visitStatement(loop); compileStack.pushLoop(loop.getStatementLabel()); Label continueLabel = compileStack.getContinueLabel(); Label breakLabel = compileStack.getBreakLabel(); mv.visitLabel(continueLabel); Expression bool = loop.getBooleanExpression(); boolean boolHandled = false; if (bool instanceof ConstantExpression) { ConstantExpression constant = (ConstantExpression) bool; if (constant.getValue()==Boolean.TRUE) { boolHandled = true; // do nothing } else if (constant.getValue()==Boolean.FALSE) { boolHandled = true; mv.visitJumpInsn(GOTO, breakLabel); } } if(!boolHandled) { bool.visit(this); mv.visitJumpInsn(IFEQ, breakLabel); } loop.getLoopBlock().visit(this); mv.visitJumpInsn(GOTO, continueLabel); mv.visitLabel(breakLabel); compileStack.pop(); }
public void visitDoWhileLoop(DoWhileStatement loop) { onLineNumber(loop, "visitDoWhileLoop"); visitStatement(loop); compileStack.pushLoop(loop.getStatementLabel()); Label breakLabel = compileStack.getBreakLabel(); Label continueLabel = compileStack.getContinueLabel(); mv.visitLabel(continueLabel); loop.getLoopBlock().visit(this); loop.getBooleanExpression().visit(this); mv.visitJumpInsn(IFEQ, continueLabel); mv.visitLabel(breakLabel); compileStack.pop(); }
Label breakLabel = compileStack.getBreakLabel();
Label breakLabel = compileStack.getBreakLabel();
Label breakLabel = compileStack.getBreakLabel();
public void visitWhileLoop(WhileStatement loop) { onLineNumber(loop, "visitWhileLoop"); visitStatement(loop); compileStack.pushLoop(loop.getStatementLabel()); Label continueLabel = compileStack.getContinueLabel(); Label breakLabel = compileStack.getBreakLabel(); mv.visitLabel(continueLabel); Expression bool = loop.getBooleanExpression(); boolean boolHandled = false; if (bool instanceof ConstantExpression) { ConstantExpression constant = (ConstantExpression) bool; if (constant.getValue()==Boolean.TRUE) { boolHandled = true; // do nothing } else if (constant.getValue()==Boolean.FALSE) { boolHandled = true; mv.visitJumpInsn(GOTO, breakLabel); } } if(!boolHandled) { bool.visit(this); mv.visitJumpInsn(IFEQ, breakLabel); } loop.getLoopBlock().visit(this); mv.visitJumpInsn(GOTO, continueLabel); mv.visitLabel(breakLabel); compileStack.pop(); }
Label breakLabel = compileStack.getBreakLabel();