Package com.google.test.metric

Examples of com.google.test.metric.Type


  public void visitMethodInsn(final int opcode, final String clazz,
      final String name, final String desc) {
    SignatureParser signature = parse(desc);
    final List<Type> params = signature.getParameters();
    final Type returnType = signature.getReturnType();
    recorder.add(new Runnable() {
      public void run() {
        String className = namer.nameClass(clazz);
        block.addOp(new Invoke(lineNumber, className, namer.nameMethod(className, name, desc),
            params, opcode == Opcodes.INVOKESTATIC, returnType));
View Full Code Here


      final String eType) {
    extraLinkSteps.add(new Runnable() {
      public void run() {
        Block endBlock = frames.get(end).block;
        Block handlerBlock = frames.get(handler).block;
        Type type = eType == null ? Type.fromClass(Throwable.class) : Type.fromJava(eType);
        handlerBlock.setExceptionHandler(-1, new Constant("?", type));
        endBlock.addNextBlock(handlerBlock);
      }
    });
  }
View Full Code Here

    this.name = name;
    this.desc = desc;
    this.visibility = visibility;
    int slot = 0;
    if (!isStatic) {
      Type thisType = Type.fromJava(classInfo.getName());
      methodThis = new LocalVariableInfo("this", thisType);
      slots.put(slot++, methodThis);
      localVariables.add((LocalVariableInfo) methodThis);
    }
    for (Type type : parse(desc).getParameters()) {
View Full Code Here

    });
  }

  public void visitLocalVariable(String name, String desc, String signature,
      Label start, Label end, int slotNum) {
    Type type = Type.fromDesc(desc);
    Variable variable = slots.get(slotNum);
    if (variable == null) {
      LocalVariableInfo localVar = new LocalVariableInfo(name, type);
      slots.put(slotNum, localVar);
      localVariables.add(localVar);
View Full Code Here

  public void visitTypeInsn(final int opcode, final String desc) {
    if (desc.length() == 1) {
      throw new IllegalStateException(
          "WARNING! I don't expect primitive types:" + desc);
    }
    final Type type = desc.contains(";") ? Type.fromDesc(desc) : Type
        .fromJava(desc);
    recorder.add(new Runnable() {
      public void run() {
        switch (opcode) {
          case Opcodes.NEW :
            Constant constant = new Constant("new", type);
            block.addOp(new Load(lineNumber, constant));
            break;
          case Opcodes.NEWARRAY :
          case Opcodes.ANEWARRAY :
            block.addOp(new Transform(lineNumber, "newarray", Type.INT, null,
                type.toArray()));
            break;
          case Opcodes.INSTANCEOF :
            block.addOp(new Transform(lineNumber, "instanceof", Type.OBJECT,
                null, Type.INT));
            break;
View Full Code Here

      LocalVariableInfo localVar = new LocalVariableInfo("local_" + varIndex, type);
      slots.put(varIndex, localVar);
      localVariables.add(localVar);
      variable = localVar;
    }
    Type varType = variable.getType();
    if (!varType.equals(type) && (type.isPrimitive() || varType.isPrimitive())) {
      // Apparently the compiler reuses local variables and it is possible
      // that the types change. So if types change we have to drop
      // the variable and try again.
      slots.put(varIndex, null);
      return variable(varIndex, type);
View Full Code Here

  public void visitMethodInsn(final int opcode, final String clazz,
      final String name, final String desc) {
    SignatureParser signature = parse(desc);
    final List<Type> params = signature.getParameters();
    final Type returnType = signature.getReturnType();
    recorder.add(new Runnable() {
      public void run() {
        block.addOp(new Invoke(lineNumber, clazz.replace('/', '.'), name, desc,
            params, opcode == Opcodes.INVOKESTATIC, returnType));
      }
View Full Code Here

    return 1;
  }

  @Override
  public List<Variable> apply(List<Variable> input) {
    Type array = clazz;
    for (int i = 0; i < dims; i++) {
      array = array.toArray();
    }
    return list(new Constant("?", array));
  }
View Full Code Here

  public FieldVisitorBuilder(ClassInfo classInfo, int access, String name,
      String desc, String signature, Object value) {
    boolean isStatic = (access & Opcodes.ACC_STATIC) == Opcodes.ACC_STATIC;
    boolean isPrivate = Visibility.valueOf(access) == Visibility.PRIVATE;
    boolean isFinal = (access & Opcodes.ACC_FINAL) == Opcodes.ACC_FINAL;
    Type type = Type.fromDesc(desc);
    classInfo.addField(new FieldInfo(classInfo, name, type, isFinal,
        isStatic, isPrivate));
  }
View Full Code Here

TOP

Related Classes of com.google.test.metric.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.