referencee.removeReferencer(edge);
}
- // return whether at least one edge was removed
+
protected boolean clearRefEdgesFrom(RefSrcNode referencer,
TypeDescriptor type,
String field,
boolean removeAll) {
+ return clearRefEdgesFrom( referencer, type, field, removeAll, null, null );
+ }
+
+ // return whether at least one edge was removed
+ protected boolean clearRefEdgesFrom(RefSrcNode referencer,
+ TypeDescriptor type,
+ String field,
+ boolean removeAll,
+ Set<EdgeKey> edgeKeysRemoved,
+ FieldDescriptor fd) {
assert referencer != null;
boolean atLeastOneEdgeRemoved = false;
HeapRegionNode referencee = edge.getDst();
+ if( edgeKeysRemoved != null ) {
+ assert fd != null;
+ assert referencer instanceof HeapRegionNode;
+ edgeKeysRemoved.add( new EdgeKey( ((HeapRegionNode)referencer).getID(),
+ referencee.getID(),
+ fd )
+ );
+ }
+
removeRefEdge(referencer,
referencee,
edge.getType(),
assignTempXFieldFEqualToTempY( x,
fdStringBytesField,
tdStrLiteralBytes,
+ null,
+ null,
null );
}
public void assignTempXEqualToTempYFieldF(TempDescriptor x,
TempDescriptor y,
FieldDescriptor f,
- FlatNode currentProgramPoint
+ FlatNode currentProgramPoint,
+ Set<EdgeKey> edgeKeysForLoad
) {
VariableNode lnX = getVariableNodeFromTemp(x);
continue;
}
+ // for definite reach analysis only
+ if( edgeKeysForLoad != null ) {
+ assert f != null;
+ edgeKeysForLoad.add( new EdgeKey( hrnY.getID(),
+ hrnHrn.getID(),
+ f )
+ );
+ }
+
+
TypeDescriptor tdNewEdge =
mostSpecificType(edgeHrn.getType(),
hrnHrn.getType()
public boolean assignTempXFieldFEqualToTempY(TempDescriptor x,
FieldDescriptor f,
TempDescriptor y,
- FlatNode currentProgramPoint
+ FlatNode currentProgramPoint,
+ Set<EdgeKey> edgeKeysRemoved,
+ Set<EdgeKey> edgeKeysAdded
) {
VariableNode lnX = getVariableNodeFromTemp(x);
if( !DISABLE_STRONG_UPDATES ) {
strongUpdateCond = true;
- boolean atLeastOne =
- clearRefEdgesFrom(hrnX,
- f.getType(),
- f.getSymbol(),
- false);
+ boolean atLeastOne = clearRefEdgesFrom(hrnX,
+ f.getType(),
+ f.getSymbol(),
+ false,
+ edgeKeysRemoved,
+ f);
if( atLeastOne ) {
edgeRemovedByStrongUpdate = true;
}
continue;
}
+ // for definite reach analysis only
+ if( edgeKeysAdded != null ) {
+ assert f != null;
+ edgeKeysAdded.add( new EdgeKey( hrnX.getID(),
+ hrnY.getID(),
+ f )
+ );
+ }
+
// prepare the new reference edge hrnX.f -> hrnY
TypeDescriptor tdNewEdge =
mostSpecificType(y.getType(),
predNodeOrEdge.e_hrnDstID,
predNodeOrEdge.e_type,
predNodeOrEdge.e_field,
- stateCallee,
+ stateCaller,
null,
predNodeOrEdge.e_srcOutCalleeContext,
predNodeOrEdge.e_srcOutCallerContext
new Hashtable<String, Integer>();
- // useful since many graphs writes in the method call debug code
private static boolean resolveMethodDebugDOTwriteLabels = true;
private static boolean resolveMethodDebugDOTselectTemps = true;
private static boolean resolveMethodDebugDOTpruneGarbage = true;
- static boolean dbgEquals = false;
+ static public boolean dbgEquals = false;
// it is necessary in the equals() member functions
// there is an edge in the right place with the right field,
// but do they have the same attributes?
- if( edgeA.getBeta().equals(edgeB.getBeta() ) &&
- edgeA.equalsPreds(edgeB)
- ) {
+ if( edgeA.equalsIncludingBetaPredsTaints( edgeB ) ) {
edgeFound = true;
}
}