public DynamicMethodObject(IClass cls, Collection<CAstQualifier> qualifiers, AbstractCFG<?, ?> cfg, SymbolTable symtab, boolean hasCatchBlock, Map<IBasicBlock<SSAInstruction>, TypeReference[]> caughtTypes, boolean hasMonitorOp, AstLexicalInformation lexicalInfo, DebuggingInformation debugInfo) { super(cls, qualifiers, cfg, symtab, AstMethodReference.fnReference(cls.getReference()), hasCatchBlock, caughtTypes, hasMonitorOp, lexicalInfo, debugInfo, null); // force creation of these constants by calling the getter methods symtab.getNullConstant(); }
public DynamicMethodObject(IClass cls, Collection<CAstQualifier> qualifiers, AbstractCFG<?, ?> cfg, SymbolTable symtab, boolean hasCatchBlock, Map<IBasicBlock<SSAInstruction>, TypeReference[]> caughtTypes, boolean hasMonitorOp, AstLexicalInformation lexicalInfo, DebuggingInformation debugInfo) { super(cls, qualifiers, cfg, symtab, AstMethodReference.fnReference(cls.getReference()), hasCatchBlock, caughtTypes, hasMonitorOp, lexicalInfo, debugInfo, null); // force creation of these constants by calling the getter methods symtab.getNullConstant(); }
@Override public int getConstantValue(Object o) { if (o instanceof Integer) { return getUnderlyingSymtab().getConstant(((Integer) o).intValue()); } else if (o instanceof Float) { return getUnderlyingSymtab().getConstant(((Float) o).floatValue()); } else if (o instanceof Double) { return getUnderlyingSymtab().getConstant(((Double) o).doubleValue()); } else if (o instanceof Long) { return getUnderlyingSymtab().getConstant(((Long) o).longValue()); } else if (o instanceof String) { return getUnderlyingSymtab().getConstant((String) o); } else if (o instanceof Boolean) { return getUnderlyingSymtab().getConstant((Boolean) o); } else if (o instanceof Character) { return getUnderlyingSymtab().getConstant(((Character) o).charValue()); } else if (o instanceof Byte) { return getUnderlyingSymtab().getConstant(((Byte) o).byteValue()); } else if (o instanceof Short) { return getUnderlyingSymtab().getConstant(((Short) o).shortValue()); } else if (o == null) { return getUnderlyingSymtab().getNullConstant(); } else if (o == CAstControlFlowMap.SWITCH_DEFAULT) { return getUnderlyingSymtab().getConstant("__default label"); } else { System.err.println(("cannot handle constant " + o)); Assertions.UNREACHABLE(); return -1; } }
@Override public int getConstantValue(Object o) { if (o instanceof Integer) { return getUnderlyingSymtab().getConstant(((Integer) o).intValue()); } else if (o instanceof Float) { return getUnderlyingSymtab().getConstant(((Float) o).floatValue()); } else if (o instanceof Double) { return getUnderlyingSymtab().getConstant(((Double) o).doubleValue()); } else if (o instanceof Long) { return getUnderlyingSymtab().getConstant(((Long) o).longValue()); } else if (o instanceof String) { return getUnderlyingSymtab().getConstant((String) o); } else if (o instanceof Boolean) { return getUnderlyingSymtab().getConstant((Boolean) o); } else if (o instanceof Character) { return getUnderlyingSymtab().getConstant(((Character) o).charValue()); } else if (o instanceof Byte) { return getUnderlyingSymtab().getConstant(((Byte) o).byteValue()); } else if (o instanceof Short) { return getUnderlyingSymtab().getConstant(((Short) o).shortValue()); } else if (o == null) { return getUnderlyingSymtab().getNullConstant(); } else if (o == CAstControlFlowMap.SWITCH_DEFAULT) { return getUnderlyingSymtab().getConstant("__default label"); } else { System.err.println(("cannot handle constant " + o)); Assertions.UNREACHABLE(); return -1; } }
@Override protected void defineFunction(CAstEntity N, WalkContext definingContext, AbstractCFG<SSAInstruction, ? extends IBasicBlock<SSAInstruction>> cfg, SymbolTable symtab, boolean hasCatchBlock, Map<IBasicBlock<SSAInstruction>,TypeReference[]> caughtTypes, boolean hasMonitorOp, AstLexicalInformation lexicalInfo, DebuggingInformation debugInfo) { // N.B.: base class may actually ask to create a synthetic type to wrap // code bodies, so we may see other things than TYPE_ENTITY here. CAstType.Method methodType = (Method) N.getType(); CAstType owningType = methodType.getDeclaringType(); TypeName typeName = makeType(owningType).getName(); IClass owner = loader.lookupClass(typeName); assert owner != null || exclusions.contains(owningType.getName()) : typeName.toString() + " not found in " + loader; if (owner != null) { symtab.getConstant(0); symtab.getNullConstant(); ((JavaSourceLoaderImpl) loader).defineFunction(N, owner, cfg, symtab, hasCatchBlock, caughtTypes, hasMonitorOp, lexicalInfo, debugInfo); } }
@Override protected void defineFunction(CAstEntity N, WalkContext definingContext, AbstractCFG<SSAInstruction, ? extends IBasicBlock<SSAInstruction>> cfg, SymbolTable symtab, boolean hasCatchBlock, Map<IBasicBlock<SSAInstruction>,TypeReference[]> caughtTypes, boolean hasMonitorOp, AstLexicalInformation lexicalInfo, DebuggingInformation debugInfo) { // N.B.: base class may actually ask to create a synthetic type to wrap // code bodies, so we may see other things than TYPE_ENTITY here. CAstType.Method methodType = (Method) N.getType(); CAstType owningType = methodType.getDeclaringType(); TypeName typeName = makeType(owningType).getName(); IClass owner = loader.lookupClass(typeName); assert owner != null || exclusions.contains(owningType.getName()) : typeName.toString() + " not found in " + loader; if (owner != null) { symtab.getConstant(0); symtab.getNullConstant(); ((JavaSourceLoaderImpl) loader).defineFunction(N, owner, cfg, symtab, hasCatchBlock, caughtTypes, hasMonitorOp, lexicalInfo, debugInfo); } }
int symbol = 0; if (l.isNullType(type)) { symbol = symbolTable.getNullConstant(); } else if (l.isIntType(type)) { Integer value = (Integer) instruction.getValue();
int symbol = 0; if (l.isNullType(type)) { symbol = symbolTable.getNullConstant(); } else if (l.isIntType(type)) { Integer value = (Integer) instruction.getValue();
int nullvn = sourceST.getNullConstant(); DefUse sourceDU = builder.getCFAContextInterpreter().getDU(caller); InstanceKey[] nullkeys = builder.getInvariantContents(sourceST, sourceDU, caller, nullvn, builder);
int nullvn = sourceST.getNullConstant(); DefUse sourceDU = builder.getCFAContextInterpreter().getDU(caller); InstanceKey[] nullkeys = builder.getInvariantContents(sourceST, sourceDU, caller, nullvn, builder);