@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 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 visitAstGlobalRead(AstGlobalRead instruction) { 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 visitLoadMetadata(SSALoadMetadataInstruction instruction) { IClass jlClassKlass = cha.lookupClass(instruction.getType()); assert jlClassKlass != null; result = new DeclaredTypeOperator(new ConeType(jlClassKlass)); }
@Override public void visitLoadMetadata(SSALoadMetadataInstruction instruction) { IClass jlClassKlass = cha.lookupClass(instruction.getType()); assert jlClassKlass != null; result = new DeclaredTypeOperator(new ConeType(jlClassKlass)); }
@Override public void visitEnclosingObjectReference(EnclosingObjectReference inst) { TypeReference type = inst.getEnclosingType(); IClass klass = cha.lookupClass(type); if (klass == null) { Assertions.UNREACHABLE(); } else { result = new DeclaredTypeOperator(new ConeType(klass)); } }
@Override public void visitEnclosingObjectReference(EnclosingObjectReference inst) { TypeReference type = inst.getEnclosingType(); IClass klass = cha.lookupClass(type); if (klass == null) { Assertions.UNREACHABLE(); } else { result = new DeclaredTypeOperator(new ConeType(klass)); } }
/** * @return a TypeAbstraction object representing this type. We just use ConeTypes by default, since we don't propagate * information allowing us to distinguish between points and cones yet. */ protected TypeAbstraction typeRef2TypeAbstraction(IClassHierarchy cha, TypeReference type) { IClass klass = cha.lookupClass(type); if (klass != null) { return new ConeType(klass); } Assertions.UNREACHABLE(type.toString()); return null; }
/** * @return a TypeAbstraction object representing this type. We just use ConeTypes by default, since we don't propagate * information allowing us to distinguish between points and cones yet. */ protected TypeAbstraction typeRef2TypeAbstraction(IClassHierarchy cha, TypeReference type) { IClass klass = cha.lookupClass(type); if (klass != null) { return new ConeType(klass); } Assertions.UNREACHABLE(type.toString()); return null; }
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 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; } }
protected TypeInference(IR ir, boolean doPrimitives) { if (ir == null) { throw new IllegalArgumentException("ir is null"); } this.language = ir.getMethod().getDeclaringClass().getClassLoader().getLanguage(); this.cha = ir.getMethod().getDeclaringClass().getClassHierarchy(); this.ir = ir; this.doPrimitives = doPrimitives; this.BOTTOM = new ConeType(cha.getRootClass()); initialize(); solve(); }
protected TypeInference(IR ir, boolean doPrimitives) { if (ir == null) { throw new IllegalArgumentException("ir is null"); } this.language = ir.getMethod().getDeclaringClass().getClassLoader().getLanguage(); this.cha = ir.getMethod().getDeclaringClass().getClassHierarchy(); this.ir = ir; this.doPrimitives = doPrimitives; this.BOTTOM = new ConeType(cha.getRootClass()); initialize(); solve(); }