Package org.springframework.asm

Examples of org.springframework.asm.Label


 
  @Override
  public void generateCode(MethodVisitor mv, CodeFlow cf) {
    this.children[0].generateCode(mv, cf);
    cf.unboxBooleanIfNecessary(mv);
    Label elseTarget = new Label();
    Label endOfIf = new Label();
    mv.visitJumpInsn(IFNE,elseTarget);   
    mv.visitInsn(ICONST_1); // TRUE
    mv.visitJumpInsn(GOTO,endOfIf);
    mv.visitLabel(elseTarget);
    mv.visitInsn(ICONST_0); // FALSE
View Full Code Here


    if (unboxRight) {
      CodeFlow.insertUnboxInsns(mv, targetType, rightDesc);
    }

    // assert: SpelCompiler.boxingCompatible(leftDesc, rightDesc)
    Label elseTarget = new Label();
    Label endOfIf = new Label();
    if (targetType=='D') {
      mv.visitInsn(DCMPG);
      mv.visitJumpInsn(compInstruction1, elseTarget);
    }
    else if (targetType=='F') {
View Full Code Here

 
  @Override
  public void generateCode(MethodVisitor mv, CodeFlow cf) {
    String leftDesc = getLeftOperand().exitTypeDescriptor;
    String rightDesc = getRightOperand().exitTypeDescriptor;
    Label elseTarget = new Label();
    Label endOfIf = new Label();
    boolean leftPrim = CodeFlow.isPrimitive(leftDesc);
    boolean rightPrim = CodeFlow.isPrimitive(rightDesc);

    DescriptorComparison dc = DescriptorComparison.checkNumericCompatibility(leftDesc, rightDesc, leftActualDescriptor, rightActualDescriptor);
   
View Full Code Here

 
  @Override
  public void generateCode(MethodVisitor mv, CodeFlow cf) {
    String leftDesc = getLeftOperand().exitTypeDescriptor;
    String rightDesc = getRightOperand().exitTypeDescriptor;
    Label elseTarget = new Label();
    Label endOfIf = new Label();
    boolean leftPrim = CodeFlow.isPrimitive(leftDesc);
    boolean rightPrim = CodeFlow.isPrimitive(rightDesc);

    DescriptorComparison dc = DescriptorComparison.checkNumericCompatibility(leftDesc, rightDesc,
        this.leftActualDescriptor, this.rightActualDescriptor);
   
    if (dc.areNumbers && dc.areCompatible) {
      char targetType = dc.compatibleType;
     
      getLeftOperand().generateCode(mv, cf);
      if (!leftPrim) {
        CodeFlow.insertUnboxInsns(mv, targetType, leftDesc);
      }
   
      cf.enterCompilationScope();
      getRightOperand().generateCode(mv, cf);
      cf.exitCompilationScope();
      if (!rightPrim) {
        CodeFlow.insertUnboxInsns(mv, targetType, rightDesc);
      }
      // assert: SpelCompiler.boxingCompatible(leftDesc, rightDesc)
      if (targetType=='D') {
        mv.visitInsn(DCMPL);
        mv.visitJumpInsn(IFNE, elseTarget);
      }
      else if (targetType=='F') {
        mv.visitInsn(FCMPL);   
        mv.visitJumpInsn(IFNE, elseTarget);
      }
      else if (targetType=='J') {
        mv.visitInsn(LCMP);   
        mv.visitJumpInsn(IFNE, elseTarget);
      }
      else if (targetType=='I' || targetType=='Z') {
        mv.visitJumpInsn(IF_ICMPNE, elseTarget);   
      }
      else {
        throw new IllegalStateException("Unexpected descriptor "+leftDesc);
      }
    }
    else {
      getLeftOperand().generateCode(mv, cf);
      getRightOperand().generateCode(mv, cf);
      Label leftNotNull = new Label();
      mv.visitInsn(DUP_X1); // Dup right on the top of the stack
      mv.visitJumpInsn(IFNONNULL,leftNotNull);
      // Right is null!
      mv.visitInsn(SWAP);
      mv.visitInsn(POP); // remove it
      Label rightNotNull = new Label();
      mv.visitJumpInsn(IFNONNULL, rightNotNull);
      // Left is null too
      mv.visitInsn(ICONST_1);
      mv.visitJumpInsn(GOTO, endOfIf);
      mv.visitLabel(rightNotNull);
View Full Code Here

  @Override
  public void generateCode(MethodVisitor mv, CodeFlow cf) {
    // exit type descriptor can be null if both components are literal expressions
    computeExitTypeDescriptor();
    this.children[0].generateCode(mv, cf);
    Label elseTarget = new Label();
    Label endOfIf = new Label();
    mv.visitInsn(DUP);
    mv.visitJumpInsn(IFNULL, elseTarget);
    mv.visitJumpInsn(GOTO, endOfIf);
    mv.visitLabel(elseTarget);
    mv.visitInsn(POP);
View Full Code Here

  }
 
  @Override
  public void generateCode(MethodVisitor mv, CodeFlow cf) {
    // Pseudo: if (!leftOperandValue) { result=false; } else { result=rightOperandValue; }
    Label elseTarget = new Label();
    Label endOfIf = new Label();
    cf.enterCompilationScope();
    getLeftOperand().generateCode(mv, cf);
    cf.unboxBooleanIfNecessary(mv);
    cf.exitCompilationScope();
    mv.visitJumpInsn(IFNE, elseTarget);
View Full Code Here

  }
 
  @Override
  public void generateCode(MethodVisitor mv, CodeFlow cf) {
    // pseudo: if (leftOperandValue) { result=true; } else { result=rightOperandValue; }
    Label elseTarget = new Label();
    Label endOfIf = new Label();
    cf.enterCompilationScope();
    getLeftOperand().generateCode(mv, cf);
    cf.unboxBooleanIfNecessary(mv);
    cf.exitCompilationScope();
    mv.visitJumpInsn(IFEQ, elseTarget);
View Full Code Here

    this.children[0].generateCode(mv, cf);
    if (!CodeFlow.isPrimitive(cf.lastDescriptor())) {
      CodeFlow.insertUnboxInsns(mv, 'Z', cf.lastDescriptor());
    }
    cf.exitCompilationScope();
    Label elseTarget = new Label();
    Label endOfIf = new Label();
    mv.visitJumpInsn(IFEQ, elseTarget);
    cf.enterCompilationScope();
    this.children[1].generateCode(mv, cf);
    if (!CodeFlow.isPrimitive(this.exitTypeDescriptor)) {
      CodeFlow.insertBoxIfNecessary(mv, cf.lastDescriptor().charAt(0));
View Full Code Here

TOP

Related Classes of org.springframework.asm.Label

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.