Package nginx.clojure.asm

Examples of nginx.clojure.asm.Type


    }

    @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

    }

    @Override
    public BasicValue merge(final BasicValue v, final BasicValue w) {
        if (!v.equals(w)) {
            Type t = v.getType();
            Type u = w.getType();
            if (t != null
                    && (t.getSort() == Type.OBJECT || t.getSort() == Type.ARRAY)) {
                if (u != null
                        && (u.getSort() == Type.OBJECT || u.getSort() == Type.ARRAY)) {
                    if ("Lnull;".equals(t.getDescriptor())) {
                        return w;
                    }
                    if ("Lnull;".equals(u.getDescriptor())) {
                        return v;
                    }
                    if (isAssignableFrom(t, u)) {
                        return v;
                    }
View Full Code Here

            if (isAssignableFrom(t, currentSuperClass)) {
                return true;
            }
            if (currentClassInterfaces != null) {
                for (int i = 0; i < currentClassInterfaces.size(); ++i) {
                    Type v = currentClassInterfaces.get(i);
                    if (isAssignableFrom(t, v)) {
                        return true;
                    }
                }
            }
View Full Code Here

    public static void verify(final ClassReader cr, final ClassLoader loader,
            final boolean dump, final PrintWriter pw) {
        ClassNode cn = new ClassNode();
        cr.accept(new CheckClassAdapter(cn, false), ClassReader.SKIP_DEBUG);

        Type syperType = cn.superName == null ? null : Type
                .getObjectType(cn.superName);
        List<MethodNode> methods = cn.methods;

        List<Type> interfaces = new ArrayList<Type>();
        for (Iterator<String> i = cn.interfaces.iterator(); i.hasNext();) {
View Full Code Here

                                }
                                push(value);
                            }
                        }
                    }
                    Type returnType = Type.getReturnType(desc);
                    if (returnType != Type.VOID_TYPE) {
                        push(interpreter.newValue(returnType));
                    }
                    break;
                }
View Full Code Here

    }
   
    private void assertIsAssignableFrom(Class<?> to, Class<?> from) {
     
        assertTrue("Assertion is not consistent with Class.isAssignableFrom", to.isAssignableFrom(from));
        Type toType = Type.getType(to);
        Type fromType = Type.getType(from);
        assertTrue("Type Hierarchy visitor is not consistent with Class.isAssignableFrom",
                ti.checkAssignableFrom(toType, fromType));
    }
View Full Code Here

                ti.checkAssignableFrom(toType, fromType));
    }

    private void assertIsNotAssignableFrom(Class<?> to, Class<?> from) {
        assertFalse("Assertion is not consistent with Class.isAssignableFrom", to.isAssignableFrom(from));
        Type toType = Type.getType(to);
        Type fromType = Type.getType(from);
        assertFalse("Type Hierarchy visitor is not consistent with Class.isAssignableFrom",
                ti.checkAssignableFrom(toType, fromType));
    }
View Full Code Here

    }

    @Override
    public BasicValue binaryOperation(AbstractInsnNode insn, BasicValue value1, BasicValue value2) throws AnalyzerException {
        if(insn.getOpcode() == Opcodes.AALOAD) {
            Type t1 = value1.getType();
            if(t1 == null || t1.getSort() != Type.ARRAY) {
                throw new AnalyzerException(insn, "AALOAD needs an array as first parameter");
            }
           
            Type resultType = Type.getType(t1.getDescriptor().substring(1));
            return new BasicValue(resultType);
        }
        return super.binaryOperation(insn, value1, value2);
    }
View Full Code Here

      if (us == Type.ARRAY) {
        if ( ts == Type.ARRAY ) {
          if (t.getDimensions() == u.getDimensions() && isAssignableFrom(t.getElementType(), u.getElementType())) {
            return true;
          }else if (t.getDimensions() < u.getDimensions()) {
            Type ti = t.getElementType();
            String tin = ti.getInternalName();
            if (ti.getSort() == Type.OBJECT && ("java/lang/Object".equals(tin) || ("java/lang/Cloneable".equals(tin) || "java/io/Serializable".equals(tin) ))) {
              return true;
            }
          }
          return false;
        }else if (ts == Type.OBJECT && ("java/lang/Cloneable".equals(tn) || "java/io/Serializable".equals(tn) )){
View Full Code Here

TOP

Related Classes of nginx.clojure.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.