Package net.sf.joafip.asm

Examples of net.sf.joafip.asm.Type


  private final String doNotTransformDesc;

  public NewClassCodeGenerator() {
    super();
    final Type type = Type.getType(DoNotTransform.class);
    doNotTransformDesc = type.getDescriptor();
  }
View Full Code Here


      // methodVisitor.visitVarInsn(ALOAD, 0);
      final Class<?>[] parameterTypes = method.getParameterTypes();
      final int numberOfParams = parameterTypes.length;
      int paramSize = 0;
      for (index = 0; index < numberOfParams; index++) {
        final Type type = Type.getType(parameterTypes[index]);
        paramSize += type.getSize();
        // final int opcode = type.getOpcode(ILOAD);
        // methodVisitor.visitVarInsn(opcode, index + 1);
      }
      // methodVisitor.visitMethodInsn(
      // /**/INVOKESPECIAL,
      // /**/superClassInternalName,
      // /**/methodName,
      // /**/desc);

      final Type returnType = Type.getReturnType(method);
      final int opcode;
      final int returnTypeSize;
      opcode = returnType.getOpcode(IRETURN);
      returnTypeSize = returnType.getSize();
      switch (opcode) {
      case IRETURN:
        methodVisitor.visitInsn(ICONST_0);
        break;
      case RETURN:
View Full Code Here

    } else if (Double.class.equals(clazz)) {
      opcodeDesc = PUSH_DOUBLE;
    } else if (String.class.equals(clazz)) {
      opcodeDesc = PUSH_REF;
    } else if (Type.class.equals(clazz)) {
      final Type type = (Type) cst;
      switch (type.getSort()) {
      case Type.DOUBLE:
        opcodeDesc = PUSH_DOUBLE;
        break;
      case Type.FLOAT:
        opcodeDesc = PUSH_FLOAT;
View Full Code Here

            + " for opcode " + opcode);
      }
      internalCall = !ownedMethodCall || pointer.isThisReference();
      pointer = pop(pointer);
    }
    final Type returnType = Type.getReturnType(desc);
    if (!Type.VOID_TYPE.equals(returnType)) {
      pointer = push(pointer, typeFromAsmType(returnType));
    }
    return pointer;
  }
View Full Code Here

    }
    return push(pointer, EnumType.REF);
  }

  private EnumType typeFromDesc(final String desc) {
    final Type asmType = Type.getType(desc);
    return typeFromAsmType(asmType);
  }
View Full Code Here

  private final static TransformationTypeFromAnnotation INSTANCE =
  /**/new TransformationTypeFromAnnotation();

  private TransformationTypeFromAnnotation() {
    super();
    Type type = Type.getType(DoNotTransform.class);
    doNotTransformDesc = type.getDescriptor();
    type = Type.getType(NoStorableAccess.class);
    noStorableAccessDesc = type.getDescriptor();
    type = Type.getType(StorableAccess.class);
    storableAccessDesc = type.getDescriptor();
    type = Type.getType(StorableClass.class);
    storableClassDesc = type.getDescriptor();
    type = Type.getType(StoreNoLazyLoad.class);
    storeNoLazyLoadDesc = type.getDescriptor();
    type = Type.getType(StoreNotUseStandardSerialization.class);
    storeNotUseStandardSerializationDesc = type.getDescriptor();
    type = Type.getType(StoreSerializeAndGZippedInOneRecord.class);
    storeSerializeAndGZippedInOneRecordDesc = type.getDescriptor();
    type = Type.getType(StoreSerializeAndZippedInOneRecord.class);
    storeSerializeAndZippedInOneRecordDesc = type.getDescriptor();
    type = Type.getType(StoreSerializeInOneRecord.class);
    storeSerializeInOneRecordDesc = type.getDescriptor();
  }
View Full Code Here

  private void initialize() throws EnhanceException {
    try {
      Method method;

      final Type type = Type.getType(DoNotTransform.class);
      doNotTransformDesc = type.getDescriptor();

      method = IProxyInternal.class.getMethod(
      /**/SET_PROXY_CALL_BACK_METHOD_NAME,
      /**/new Class[] { IProxyCallBackToImplement.class });
      setProxyCallBackMethodDesc = Type.getMethodDescriptor(method);
View Full Code Here

    methodVisitor.visitVarInsn(ALOAD, 0);
    final Class<?>[] parameterTypes = constructor.getParameterTypes();
    final int numberOfParams = parameterTypes.length;
    int paramSize = 0;
    for (int paramIndex = 0; paramIndex < numberOfParams; paramIndex++) {
      final Type type = Type.getType(parameterTypes[paramIndex]);
      final int opcode = type.getOpcode(ILOAD);
      methodVisitor.visitVarInsn(opcode, paramSize + 1);
      paramSize += type.getSize();
    }

    methodVisitor.visitMethodInsn(
    /**/INVOKESPECIAL,
    /**/superClassInternalName,
 
View Full Code Here

      methodVisitor.visitVarInsn(ALOAD, 0);
      final Class<?>[] parameterTypes = method.getParameterTypes();
      final int numberOfParams = parameterTypes.length;
      int paramSize = 0;
      for (int paramIndex = 0; paramIndex < numberOfParams; paramIndex++) {
        final Type type = Type.getType(parameterTypes[paramIndex]);
        final int opcode = type.getOpcode(ILOAD);
        methodVisitor.visitVarInsn(opcode, paramSize + 1);
        paramSize += type.getSize();
      }
      final Type returnType = Type.getReturnType(method);

      methodVisitor.visitMethodInsn(
      /**/INVOKESPECIAL,
      /**/superClassInternalName,
      /**/methodName,
      /**/desc);

      final int opcode = returnType.getOpcode(IRETURN);
      methodVisitor.visitInsn(opcode);

      // FIXMELUC _visitmaxs call needed ?
      methodVisitor.visitMaxs(0, 0);
      methodVisitor.visitEnd();
View Full Code Here

      methodVisitor.visitVarInsn(ALOAD, 0);
      final Class<?>[] parameterTypes = method.getParameterTypes();
      final int numberOfParams = parameterTypes.length;
      int paramSize = 0;
      for (int paramIndex = 0; paramIndex < numberOfParams; paramIndex++) {
        final Type type = Type.getType(parameterTypes[paramIndex]);
        final int opcode = type.getOpcode(ILOAD);
        methodVisitor.visitVarInsn(opcode, paramSize + 1);
        paramSize += type.getSize();
      }
      final Type returnType = Type.getReturnType(method);

      methodVisitor.visitMethodInsn(
      /**/INVOKESPECIAL,
      /**/superClassInternalName,
      /**/methodName,
      /**/desc);

      methodVisitor.visitLabel(label1);

      int opcode;
      if (!Type.VOID_TYPE.equals(returnType)) {
        opcode = returnType.getOpcode(ISTORE);
        methodVisitor.visitVarInsn(opcode, paramSize + 1);
      }

      methodVisitor.visitVarInsn(ALOAD, 0);
      methodVisitor.visitMethodInsn(
      /**/INVOKEVIRTUAL,
      /**/classInternalName,
      /**/METHOD_END_METHOD_NAME,
      /**/methodEndMethodDesc);

      if (!Type.VOID_TYPE.equals(returnType)) {
        opcode = returnType.getOpcode(ILOAD);
        methodVisitor.visitVarInsn(opcode, paramSize + 1);
      }

      opcode = returnType.getOpcode(IRETURN);
      methodVisitor.visitInsn(opcode);

      // finally block
      methodVisitor.visitLabel(label2);
      methodVisitor.visitVarInsn(ASTORE, 1);
View Full Code Here

TOP

Related Classes of net.sf.joafip.asm.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.