@Override public void visitArrayLength(SSAArrayLengthInstruction instruction) { if (!doPrimitives) { result = null; } else { result = new DeclaredTypeOperator(language.getPrimitive(language.getConstantType(Integer.valueOf(1)))); } }
@Override public void visitCheckCast(SSACheckCastInstruction instruction) { TypeAbstraction typeAbs = null; for (TypeReference type : instruction.getDeclaredResultTypes()) { IClass klass = cha.lookupClass(type); if (klass == null) { // a type that cannot be loaded. // be pessimistic typeAbs = BOTTOM; } else { TypeAbstraction x = null; if (doPrimitives && type.isPrimitiveType()) { x = language.getPrimitive(type); } else if (type.isReferenceType()) { x = new ConeType(klass); } if (x != null) { if (typeAbs == null) { typeAbs = x; } else { typeAbs = typeAbs.meet(x); } } } } result = new DeclaredTypeOperator(typeAbs); }
@Override public void visitCheckCast(SSACheckCastInstruction instruction) { TypeAbstraction typeAbs = null; for (TypeReference type : instruction.getDeclaredResultTypes()) { IClass klass = cha.lookupClass(type); if (klass == null) { // a type that cannot be loaded. // be pessimistic typeAbs = BOTTOM; } else { TypeAbstraction x = null; if (doPrimitives && type.isPrimitiveType()) { x = language.getPrimitive(type); } else if (type.isReferenceType()) { x = new ConeType(klass); } if (x != null) { if (typeAbs == null) { typeAbs = x; } else { typeAbs = typeAbs.meet(x); } } } } result = new DeclaredTypeOperator(typeAbs); }
@Override public void visitJavaInvoke(AstJavaInvokeInstruction instruction) { TypeReference type = instruction.getDeclaredResultType(); if (type.isReferenceType()) { IClass klass = cha.lookupClass(type); if (klass == null) { // a type that cannot be loaded. // be pessimistic result = new DeclaredTypeOperator(BOTTOM); } else { result = new DeclaredTypeOperator(new ConeType(klass)); } } else { if (doPrimitives && type.isPrimitiveType()) { result = new DeclaredTypeOperator(PrimitiveType.getPrimitive(type)); } else { result = null; } } } }
@Override public void visitJavaInvoke(AstJavaInvokeInstruction instruction) { TypeReference type = instruction.getDeclaredResultType(); if (type.isReferenceType()) { IClass klass = cha.lookupClass(type); if (klass == null) { // a type that cannot be loaded. // be pessimistic result = new DeclaredTypeOperator(BOTTOM); } else { result = new DeclaredTypeOperator(new ConeType(klass)); } } else { if (doPrimitives && type.isPrimitiveType()) { result = new DeclaredTypeOperator(PrimitiveType.getPrimitive(type)); } else { result = null; } } } }
@Override public void visitGet(SSAGetInstruction instruction) { TypeReference type = instruction.getDeclaredFieldType(); if (doPrimitives && type.isPrimitiveType()) { PrimitiveType p = language.getPrimitive(type); assert p != null : "no type for " + type; result = new DeclaredTypeOperator(p); } else { IClass klass = cha.lookupClass(type); if (klass == null) { // get from a field of a type that cannot be loaded. // be pessimistic result = new DeclaredTypeOperator(BOTTOM); } else { result = new DeclaredTypeOperator(new ConeType(klass)); } } }
@Override public void visitInvoke(SSAInvokeInstruction instruction) { TypeReference type = instruction.getDeclaredResultType(); if (type.isReferenceType()) { IClass klass = cha.lookupClass(type); if (klass == null) { // a type that cannot be loaded. // be pessimistic result = new DeclaredTypeOperator(BOTTOM); } else { result = new DeclaredTypeOperator(new ConeType(klass)); } } else if (doPrimitives && type.isPrimitiveType()) { result = new DeclaredTypeOperator(language.getPrimitive(type)); } else { result = null; } }
@Override public void visitInvoke(SSAInvokeInstruction instruction) { TypeReference type = instruction.getDeclaredResultType(); if (type.isReferenceType()) { IClass klass = cha.lookupClass(type); if (klass == null) { // a type that cannot be loaded. // be pessimistic result = new DeclaredTypeOperator(BOTTOM); } else { result = new DeclaredTypeOperator(new ConeType(klass)); } } else if (doPrimitives && type.isPrimitiveType()) { result = new DeclaredTypeOperator(language.getPrimitive(type)); } else { result = null; } }
@Override public void visitGet(SSAGetInstruction instruction) { TypeReference type = instruction.getDeclaredFieldType(); if (doPrimitives && type.isPrimitiveType()) { PrimitiveType p = language.getPrimitive(type); assert p != null : "no type for " + type; result = new DeclaredTypeOperator(p); } else { IClass klass = cha.lookupClass(type); if (klass == null) { // get from a field of a type that cannot be loaded. // be pessimistic result = new DeclaredTypeOperator(BOTTOM); } else { result = new DeclaredTypeOperator(new ConeType(klass)); } } }
private DeclaredTypeOperator getPointerTypeOperator(TypeReference type) { if (type.isPrimitiveType()) { return new DeclaredTypeOperator(language.getPrimitive(type)); } else { IClass klass = cha.lookupClass(type); if (klass == null) { // a type that cannot be loaded. // be pessimistic return new DeclaredTypeOperator(BOTTOM); } else { return new DeclaredTypeOperator(new ConeType(klass)); } } }
private DeclaredTypeOperator getPointerTypeOperator(TypeReference type) { if (type.isPrimitiveType()) { return new DeclaredTypeOperator(language.getPrimitive(type)); } else { IClass klass = cha.lookupClass(type); if (klass == null) { // a type that cannot be loaded. // be pessimistic return new DeclaredTypeOperator(BOTTOM); } else { return new DeclaredTypeOperator(new ConeType(klass)); } } }
@Override public void visitEachElementGet(EachElementGetInstruction inst) { result = new DeclaredTypeOperator(new ConeType(cha.getRootClass())); }
@Override public void visitPropertyRead(AstPropertyRead inst) { result = new DeclaredTypeOperator(new ConeType(cha.getRootClass())); }
@Override public void visitEachElementGet(EachElementGetInstruction inst) { result = new DeclaredTypeOperator(new ConeType(cha.getRootClass())); }
@Override public void visitPropertyRead(AstPropertyRead inst) { result = new DeclaredTypeOperator(new ConeType(cha.getRootClass())); }
@Override public void visitAstGlobalRead(AstGlobalRead instruction) { result = new DeclaredTypeOperator(new ConeType(cha.getRootClass())); }
@Override public void visitAstLexicalRead(AstLexicalRead inst) { result = new DeclaredTypeOperator(new ConeType(cha.getRootClass())); }
@Override public void visitAstLexicalRead(AstLexicalRead inst) { result = new DeclaredTypeOperator(new ConeType(cha.getRootClass())); }
@Override public void visitGetCaughtException(SSAGetCaughtExceptionInstruction instruction) { TypeAbstraction type = meetDeclaredExceptionTypes(instruction); result = new DeclaredTypeOperator(type); }
@Override public void visitConversion(SSAConversionInstruction instruction) { if (doPrimitives) { result = new DeclaredTypeOperator(language.getPrimitive(instruction.getToType())); } }