/** * Get the value number assigned to the given parameter upon entry to the * method. * * @param param * a parameter (0 == first parameter) * @return the ValueNumber assigned to that parameter */ public ValueNumber getEntryValueForParameter(int param) { SignatureParser sigParser = new SignatureParser(methodGen.getSignature()); int p = 0; int slotOffset = methodGen.isStatic() ? 0 : 1; for ( String paramSig : sigParser.parameterSignatures()) { if (p == param) { return getEntryValue(slotOffset); } p++; slotOffset += SignatureParser.getNumSlotsForType(paramSig); } throw new IllegalStateException(); }
private void registerParameterSources() { ValueNumberFrame vnaFrameAtEntry = vnaDataflow.getStartFact(cfg.getEntry()); SignatureParser sigParser = new SignatureParser(xmethod.getSignature()); int firstParamSlot = xmethod.isStatic() ? 0 : 1; int param = 0; int slotOffset = 0; for ( String paramSig : sigParser.parameterSignatures()) { // Get the TypeQualifierAnnotation for this parameter SourceSinkInfo info; TypeQualifierAnnotation tqa = TypeQualifierApplications.getEffectiveTypeQualifierAnnotation(xmethod, param, typeQualifierValue); When when = (tqa != null) ? tqa.when : When.UNKNOWN; ValueNumber vn = vnaFrameAtEntry.getValue(slotOffset + firstParamSlot); info = new SourceSinkInfo(SourceSinkType.PARAMETER, cfg.getLocationAtEntry(), vn, when); info.setParameterAndLocal(param, slotOffset + firstParamSlot); registerSourceSink(info); param++; slotOffset += SignatureParser.getNumSlotsForType(paramSig); } }
/** * Get the value number assigned to the given parameter upon entry to the * method. * * @param param * a parameter (0 == first parameter) * @return the ValueNumber assigned to that parameter */ public ValueNumber getEntryValueForParameter(int param) { SignatureParser sigParser = new SignatureParser(methodGen.getSignature()); int p = 0; int slotOffset = methodGen.isStatic() ? 0 : 1; for ( String paramSig : sigParser.parameterSignatures()) { if (p == param) { return getEntryValue(slotOffset); } param++; slotOffset += SignatureParser.getNumSlotsForType(paramSig); } throw new IllegalStateException(); }
private void registerParameterSources() { ValueNumberFrame vnaFrameAtEntry = vnaDataflow.getStartFact(cfg.getEntry()); SignatureParser sigParser = new SignatureParser(xmethod.getSignature()); int firstParamSlot = xmethod.isStatic() ? 0 : 1; int param = 0; int slotOffset = 0; for ( String paramSig : sigParser.parameterSignatures()) { // Get the TypeQualifierAnnotation for this parameter SourceSinkInfo info; TypeQualifierAnnotation tqa = TypeQualifierApplications.getEffectiveTypeQualifierAnnotation(xmethod, param, typeQualifierValue); When when = (tqa != null) ? tqa.when : When.UNKNOWN; ValueNumber vn = vnaFrameAtEntry.getValue(slotOffset + firstParamSlot); info = new SourceSinkInfo(SourceSinkType.PARAMETER, cfg.getLocationAtEntry(), vn, when); info.setParameterAndLocal(param, slotOffset + firstParamSlot); registerSourceSink(info); param++; slotOffset += SignatureParser.getNumSlotsForType(paramSig); } }