@Override public void visitInstanceof(SSAInstanceofInstruction instruction) { if (doPrimitives) { result = new DeclaredTypeOperator(language.getPrimitive(language.getConstantType(Boolean.TRUE))); } }
public CoreClass(TypeName name, TypeName superName, IClassLoader loader, CAstSourcePositionMap.Position sourcePosition) { super(sourcePosition, name, loader, (short) 0, Collections.emptyMap(), CAstAbstractModuleLoader.this.getLanguage().getRootType()); types.put(name, this); this.superName = superName; }
public JSCFABuilder(IClassHierarchy cha, AnalysisOptions options, IAnalysisCacheView cache) { super(JavaScriptLoader.JS.getFakeRootMethod(cha, options, cache), options, cache, new AstCFAPointerKeys() {
public static CrossLanguageClassHierarchy make(AnalysisScope scope, ClassLoaderFactory factory) throws ClassHierarchyException { Set<Language> languages = scope.getBaseLanguages(); Map<Atom, IClassHierarchy> hierarchies = HashMapFactory.make(); for (Language L : languages) { Set<Language> ll = HashSetFactory.make(L.getDerivedLanguages()); ll.add(L); hierarchies.put(L.getName(), ClassHierarchyFactory.make(scope, factory, ll)); } return new CrossLanguageClassHierarchy(scope, factory, hierarchies); }
Language l = cfg.getMethod().getDeclaringClass().getClassLoader().getLanguage(); TypeReference type = l.getConstantType(instruction.getValue()); int symbol = 0; if (l.isNullType(type)) { symbol = symbolTable.getNullConstant(); } else if (l.isIntType(type)) { Integer value = (Integer) instruction.getValue(); symbol = symbolTable.getConstant(value.intValue()); } else if (l.isLongType(type)) { Long value = (Long) instruction.getValue(); symbol = symbolTable.getConstant(value.longValue()); } else if (l.isFloatType(type)) { Float value = (Float) instruction.getValue(); symbol = symbolTable.getConstant(value.floatValue()); } else if (l.isDoubleType(type)) { Double value = (Double) instruction.getValue(); symbol = symbolTable.getConstant(value.doubleValue()); } else if (l.isStringType(type)) { String value = (String) instruction.getValue(); symbol = symbolTable.getConstant(value); } else if (l.isMetadataType(type)) { Object rval = l.getMetadataToken(instruction.getValue()); symbol = reuseOrCreateDef(); emitInstruction(insts.LoadMetadataInstruction(getCurrentInstructionIndex(), symbol, type, rval));
@Override public SSAInstructionFactory getInstructionFactory() { return JS.instructionFactory(); }
public <T> InstanceKey getInstanceKeyForConstant(T S) { TypeReference type = node.getMethod().getDeclaringClass().getClassLoader().getLanguage().getConstantType(S); return getBuilder().getInstanceKeyForConstant(type, S); }
for (Language lang : languages) { this.languages.add(lang); this.languages.addAll(lang.getDerivedLanguages()); langNames.add(lang.getName()); if (lang.getRootType() != null && lang.getRootType() != this.rootTypeRef) { if (this.rootTypeRef != null) { throw new IllegalArgumentException("AnalysisScope must have only 1 root type: " + lang.getRootType() + ", " + rootTypeRef); } else { this.rootTypeRef = lang.getRootType();
@Override public void visitConversion(SSAConversionInstruction instruction) { if (doPrimitives) { result = new DeclaredTypeOperator(language.getPrimitive(instruction.getToType())); } }
protected AnalysisScope(Collection<? extends Language> languages) { super(); this.languages = new HashMap<>(); for (Language l : languages) { this.languages.put(l.getName(), l); } }
Language l = cfg.getMethod().getDeclaringClass().getClassLoader().getLanguage(); TypeReference type = l.getConstantType(instruction.getValue()); int symbol = 0; if (l.isNullType(type)) { symbol = symbolTable.getNullConstant(); } else if (l.isIntType(type)) { Integer value = (Integer) instruction.getValue(); symbol = symbolTable.getConstant(value.intValue()); } else if (l.isLongType(type)) { Long value = (Long) instruction.getValue(); symbol = symbolTable.getConstant(value.longValue()); } else if (l.isFloatType(type)) { Float value = (Float) instruction.getValue(); symbol = symbolTable.getConstant(value.floatValue()); } else if (l.isDoubleType(type)) { Double value = (Double) instruction.getValue(); symbol = symbolTable.getConstant(value.doubleValue()); } else if (l.isStringType(type)) { String value = (String) instruction.getValue(); symbol = symbolTable.getConstant(value); } else if (l.isMetadataType(type)) { Object rval = l.getMetadataToken(instruction.getValue()); symbol = reuseOrCreateDef(); emitInstruction(insts.LoadMetadataInstruction(getCurrentInstructionIndex(), symbol, type, rval));
@Override public SSAInstructionFactory getInstructionFactory() { return JS.instructionFactory(); }
public <T> InstanceKey getInstanceKeyForConstant(T S) { TypeReference type = node.getMethod().getDeclaringClass().getClassLoader().getLanguage().getConstantType(S); return getBuilder().getInstanceKeyForConstant(type, S); }
for (Language lang : languages) { this.languages.add(lang); this.languages.addAll(lang.getDerivedLanguages()); langNames.add(lang.getName()); if (lang.getRootType() != null && lang.getRootType() != this.rootTypeRef) { if (this.rootTypeRef != null) { throw new IllegalArgumentException("AnalysisScope must have only 1 root type: " + lang.getRootType() + ", " + rootTypeRef); } else { this.rootTypeRef = lang.getRootType();
@Override public void visitConversion(SSAConversionInstruction instruction) { if (doPrimitives) { result = new DeclaredTypeOperator(language.getPrimitive(instruction.getToType())); } }
public static CrossLanguageClassHierarchy make(AnalysisScope scope, ClassLoaderFactory factory) throws ClassHierarchyException { Set<Language> languages = scope.getBaseLanguages(); Map<Atom, IClassHierarchy> hierarchies = HashMapFactory.make(); for (Language L : languages) { Set<Language> ll = HashSetFactory.make(L.getDerivedLanguages()); ll.add(L); hierarchies.put(L.getName(), ClassHierarchyFactory.make(scope, factory, ll)); } return new CrossLanguageClassHierarchy(scope, factory, hierarchies); }
protected AnalysisScope(Collection<? extends Language> languages) { super(); this.languages = new HashMap<>(); for (Language l : languages) { this.languages.put(l.getName(), l); } }
@Override public void visitInstanceof(SSAInstanceofInstruction instruction) { if (doPrimitives) { result = new DeclaredTypeOperator(language.getPrimitive(language.getConstantType(Boolean.TRUE))); } }
public CoreClass(TypeName name, TypeName superName, IClassLoader loader, CAstSourcePositionMap.Position sourcePosition) { super(sourcePosition, name, loader, (short) 0, Collections.emptyMap(), CAstAbstractModuleLoader.this.getLanguage().getRootType()); types.put(name, this); this.superName = superName; }
@Override public SSAInstructionFactory getInstructionFactory() { return getLanguage().instructionFactory(); } }