Package org.eclipse.persistence.internal.libraries.asm

Examples of org.eclipse.persistence.internal.libraries.asm.Type


                locals.add(owner);
            }
        }
        Type[] types = Type.getArgumentTypes(desc);
        for (int i = 0; i < types.length; ++i) {
            Type type = types[i];
            switch (type.getSort()) {
            case Type.BOOLEAN:
            case Type.CHAR:
            case Type.BYTE:
            case Type.SHORT:
            case Type.INT:
View Full Code Here


        }
    }

    @Override
    public void visitTypeInsn(final int opcode, final String type) {
        Type t = Type.getObjectType(type);
        switch (opcode) {
        case Opcodes.NEW:
            anew(t);
            break;
        case Opcodes.ANEWARRAY:
View Full Code Here

* @author Eugene Kuleshov
*/
public abstract class Remapper {

    public String mapDesc(String desc) {
        Type t = Type.getType(desc);
        switch (t.getSort()) {
        case Type.ARRAY:
            String s = mapDesc(t.getElementType().getDescriptor());
            for (int i = 0; i < t.getDimensions(); ++i) {
                s = '[' + s;
            }
            return s;
        case Type.OBJECT:
            String newType = map(t.getInternalName());
            if (newType != null) {
                return 'L' + newType + ';';
            }
        }
        return desc;
View Full Code Here

        Type[] args = Type.getArgumentTypes(desc);
        StringBuffer s = new StringBuffer("(");
        for (int i = 0; i < args.length; i++) {
            s.append(mapDesc(args[i].getDescriptor()));
        }
        Type returnType = Type.getReturnType(desc);
        if (returnType == Type.VOID_TYPE) {
            s.append(")V");
            return s.toString();
        }
        s.append(')').append(mapDesc(returnType.getDescriptor()));
        return s.toString();
    }
View Full Code Here

        firstLocal = nextLocal;
    }

    @Override
    public void visitVarInsn(final int opcode, final int var) {
        Type type;
        switch (opcode) {
        case Opcodes.LLOAD:
        case Opcodes.LSTORE:
            type = Type.LONG_TYPE;
            break;
View Full Code Here

    @Override
    public AnnotationVisitor visitLocalVariableAnnotation(int typeRef,
            TypePath typePath, Label[] start, Label[] end, int[] index,
            String desc, boolean visible) {
        Type t = Type.getType(desc);
        int[] newIndex = new int[index.length];
        for (int i = 0; i < newIndex.length; ++i) {
            newIndex[i] = remap(index[i], t);
        }
        return mv.visitLocalVariableAnnotation(typeRef, typePath, start, end,
View Full Code Here

        int number = 0; // old local variable number
        for (; number < nLocal; ++number) {
            Object t = local[number];
            int size = t == Opcodes.LONG || t == Opcodes.DOUBLE ? 2 : 1;
            if (t != Opcodes.TOP) {
                Type typ = OBJECT_TYPE;
                if (t == Opcodes.INTEGER) {
                    typ = Type.INT_TYPE;
                } else if (t == Opcodes.FLOAT) {
                    typ = Type.FLOAT_TYPE;
                } else if (t == Opcodes.LONG) {
View Full Code Here

        return v;
    }

    @Override
    protected boolean isArrayValue(final BasicValue value) {
        Type t = value.getType();
        return t != null
                && ("Lnull;".equals(t.getDescriptor()) || t.getSort() == Type.ARRAY);
    }
View Full Code Here

    }

    @Override
    protected BasicValue getElementValue(final BasicValue objectArrayValue)
            throws AnalyzerException {
        Type arrayType = objectArrayValue.getType();
        if (arrayType != null) {
            if (arrayType.getSort() == Type.ARRAY) {
                return newValue(Type.getType(arrayType.getDescriptor()
                        .substring(1)));
            } else if ("Lnull;".equals(arrayType.getDescriptor())) {
                return objectArrayValue;
            }
        }
        throw new Error("Internal error");
    }
View Full Code Here

    }

    @Override
    protected boolean isSubTypeOf(final BasicValue value,
            final BasicValue expected) {
        Type expectedType = expected.getType();
        Type type = value.getType();
        switch (expectedType.getSort()) {
        case Type.INT:
        case Type.FLOAT:
        case Type.LONG:
        case Type.DOUBLE:
            return type.equals(expectedType);
        case Type.ARRAY:
        case Type.OBJECT:
            if ("Lnull;".equals(type.getDescriptor())) {
                return true;
            } else if (type.getSort() == Type.OBJECT
                    || type.getSort() == Type.ARRAY) {
                return isAssignableFrom(expectedType, type);
            } else {
                return false;
            }
        default:
View Full Code Here

TOP

Related Classes of org.eclipse.persistence.internal.libraries.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.