Package com.sun.org.apache.bcel.internal.generic

Examples of com.sun.org.apache.bcel.internal.generic.Type


    case INT: ilc.add(InstructionConstants.F2I) ; return;
    case DOUBLE: ilc.add(InstructionConstants.F2D) ; return;
    case LONG: ilc.add(InstructionConstants.F2L) ; return;
    case VOID: ilc.add(InstructionConstants.POP) ; return;
    case OBJECT:
      Type ret_type = new ObjectType("java.lang.Float") ;
      Type[] args= new Type[]{Type.FLOAT} ;
      ilc.add(ilc.getInstructionFactory().createInvoke("java.lang.Float", "valueOf", ret_type, args, Constants.INVOKESTATIC)) ;
      return ;
    default: throw new IllegalArgumentException() ;
    }
View Full Code Here


    case INT: ilc.add(InstructionConstants.D2I) ; return;
    case FLOAT: ilc.add(InstructionConstants.D2F) ; return;
    case LONG: ilc.add(InstructionConstants.D2L) ; return;
    case VOID: ilc.add(InstructionConstants.POP2) ; return;
    case OBJECT:
      Type ret_type = new ObjectType("java.lang.Double") ;
      Type[] args= new Type[]{Type.DOUBLE} ;
      ilc.add(ilc.getInstructionFactory().createInvoke("java.lang.Double", "valueOf", ret_type, args, Constants.INVOKESTATIC)) ;
      return ;
    default: throw new IllegalArgumentException() ;
    }
View Full Code Here

      if (type == TypeCode.VOID) {
        ilc.add(InstructionConstants.POP) ;
      }
      else {
        FieldRef fdef = (FieldRef)lval ;
        Type typ = TypeDefConverter.makeType(fdef.getType()) ;
        ilc.add(ilc.getInstructionFactory().createPutField(fdef.clazz.toString(), fdef.name, typ)) ;
      }
      break ;
    }
    case staticref: {
      if (type != TypeCode.VOID) {       
        StaticFieldRef fdef = (StaticFieldRef)lval ;
        Type typ = TypeDefConverter.makeType(fdef.getType()) ;
        ilc.add(ilc.getInstructionFactory().createPutStatic(fdef.clazz.toString(), fdef.name, typ)) ;
      }
      break ;
    }
    }
View Full Code Here

      if (type == TypeCode.VOID) {
        ilc.add(InstructionConstants.POP) ;
      }
      else {
        FieldRef fdef = (FieldRef)lval;
        Type typ = TypeDefConverter.makeType(fdef.getType()) ;
        ilc.add(ilc.getInstructionFactory().createGetField(fdef.clazz.toString(), fdef.name, typ)) ;
      }
      break ;
    }
    case staticref: {
      if (type != TypeCode.VOID) {
        StaticFieldRef fdef = (StaticFieldRef)lval;
        Type typ = TypeDefConverter.makeType(fdef.getType()) ;
        ilc.add(ilc.getInstructionFactory().createGetStatic(fdef.clazz.toString(), fdef.name, typ)) ;
      }
      break ;
    }
    }
View Full Code Here

      if (t.numDimensions == 0) {
        ObjectType type = new ObjectType(t.type.toString()) ;
        ilc.add(ilc.getInstructionFactory().createNew(type)) ;
      }
      else {
        Type type = TypeDefConverter.makeType(t.type) ;
        ilc.add(ilc.getInstructionFactory().createNewArray(type, (short)t.numDimensions)) ;
      }
    }
View Full Code Here

  }
  private static final class InvokeSpecialConverter implements
      InstConverter<InvokeSpecial> {
    public void convertInst(InvokeSpecial t, InstructionListContext ilc) {
      MethodRef mref = t.method;
      Type ret_type = TypeDefConverter.makeType(mref.returnType) ;
      Type[] args = makeArgList(mref.parameters);
      String ref = mref.clazz.toString();
      ilc.add(ilc.getInstructionFactory().createInvoke(ref, mref.name, ret_type, args, Constants.INVOKESPECIAL)) ;
    }
View Full Code Here

  }
  private static final class InvokeVirtualConverter implements
      InstConverter<InvokeVirtual> {
    public void convertInst(InvokeVirtual t, InstructionListContext ilc) {
      MethodRef mref = t.method;
      Type ret_type = TypeDefConverter.makeType(mref.returnType) ;
      Type[] args = makeArgList(mref.parameters);
      String ref = mref.clazz.toString();
      ilc.add(ilc.getInstructionFactory().createInvoke(ref, mref.name, ret_type, args, Constants.INVOKEVIRTUAL)) ;
    }
View Full Code Here

  }
  private static final class InvokeStaticConverter implements
      InstConverter<InvokeStatic> {
    public void convertInst(InvokeStatic t, InstructionListContext ilc) {
      MethodRef mref = t.method;
      Type ret_type = TypeDefConverter.makeType(mref.returnType) ;
      Type[] args = makeArgList(mref.parameters);
      String ref = mref.clazz.toString();
      ilc.add(ilc.getInstructionFactory().createInvoke(ref, mref.name, ret_type, args, Constants.INVOKESTATIC)) ;
    }
View Full Code Here

  }
  private static final class InvokeInterfaceConverter implements
      InstConverter<InvokeInterface> {
    public void convertInst(InvokeInterface t, InstructionListContext ilc) {
      MethodRef mref = t.method;
      Type ret_type = TypeDefConverter.makeType(mref.returnType) ;
      Type[] args = makeArgList(mref.parameters);
      String ref = mref.clazz.toString();
      ilc.add(ilc.getInstructionFactory().createInvoke(ref, mref.name, ret_type, args, Constants.INVOKEINTERFACE)) ;
    }
View Full Code Here

TOP

Related Classes of com.sun.org.apache.bcel.internal.generic.Type

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.