Java Code Examples for org.objectweb.asm.tree.analysis.BasicValue#UNINITIALIZED_VALUE

The following examples show how to use org.objectweb.asm.tree.analysis.BasicValue#UNINITIALIZED_VALUE . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ArrayWrappingInterpreter.java    From AVM with MIT License 6 votes vote down vote up
@Override
// Override this method to get unmasked type from BasicInterpreter
public BasicValue newValue(final Type type) {
    if (type == null) {
        return BasicValue.UNINITIALIZED_VALUE;
    }
    switch (type.getSort()) {
        case Type.VOID:
            return null;
        case Type.BOOLEAN:
        case Type.CHAR:
        case Type.BYTE:
        case Type.SHORT:
        case Type.INT:
        case Type.FLOAT:
        case Type.LONG:
        case Type.DOUBLE:
        case Type.ARRAY:
        case Type.OBJECT:
            return new BasicValue(type);
        default:
            throw new AssertionError();
    }
}
 
Example 2
Source File: FastClassVerifier.java    From tascalate-javaflow with Apache License 2.0 5 votes vote down vote up
@Override
public BasicValue merge(BasicValue v, BasicValue w) {
    if (!v.equals(w)) {
        Type t = v.getType();
        Type u = w.getType();
        int tsort = t == null ? -1 : t.getSort();
        if (tsort == Type.OBJECT || tsort == Type.ARRAY) {
            int usort = u == null ? -1 : u.getSort();
            if (usort == Type.OBJECT || usort == Type.ARRAY) {
                if ("Lnull;".equals(t.getDescriptor())) {
                    return w;
                }
                if ("Lnull;".equals(u.getDescriptor())) {
                    return v;
                }
                if (isAssignableFrom(t, u)) {
                    return v;
                }
                if (isAssignableFrom(u, t)) {
                    return w;
                }
                return new BasicValue(classHierarchy.getCommonSuperType(t, u));
            }
        }
        return BasicValue.UNINITIALIZED_VALUE;
    }
    return v;
}
 
Example 3
Source File: FastClassVerifier.java    From tascalate-javaflow with Apache License 2.0 5 votes vote down vote up
@Override
public BasicValue merge(BasicValue v, BasicValue w) {
    if (!v.equals(w)) {
        Type t = v.getType();
        Type u = w.getType();
        int tsort = t == null ? -1 : t.getSort();
        if (tsort == Type.OBJECT || tsort == Type.ARRAY) {
            int usort = u == null ? -1 : u.getSort();
            if (usort == Type.OBJECT || usort == Type.ARRAY) {
                if ("Lnull;".equals(t.getDescriptor())) {
                    return w;
                }
                if ("Lnull;".equals(u.getDescriptor())) {
                    return v;
                }
                if (isAssignableFrom(t, u)) {
                    return v;
                }
                if (isAssignableFrom(u, t)) {
                    return w;
                }
                return new BasicValue(classHierarchy.getCommonSuperType(t, u));
            }
        }
        return BasicValue.UNINITIALIZED_VALUE;
    }
    return v;
}
 
Example 4
Source File: FastClassVerifier.java    From tascalate-javaflow with Apache License 2.0 5 votes vote down vote up
@Override
public Value merge(Value v, Value w) {
    if (!v.equals(w)) {
        Type t = ((BasicValue)v).getType();
        Type u = ((BasicValue)w).getType();
        int tsort = t == null ? -1 : t.getSort();
        if (tsort == Type.OBJECT || tsort == Type.ARRAY) {
            int usort = u == null ? -1 : u.getSort();
            if (usort == Type.OBJECT || usort == Type.ARRAY) {
                if ("Lnull;".equals(t.getDescriptor())) {
                    return w;
                }
                if ("Lnull;".equals(u.getDescriptor())) {
                    return v;
                }
                if (isAssignableFrom(t, u)) {
                    return v;
                }
                if (isAssignableFrom(u, t)) {
                    return w;
                }
                return new BasicValue(classHierarchy.getCommonSuperType(t, u));
            }
        }
        return BasicValue.UNINITIALIZED_VALUE;
    }
    return v;
}