deprecate Trace
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3432 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
This commit is contained in:
parent
9490bbd26f
commit
957cb2b8ca
|
@ -5,7 +5,6 @@ import com.ibm.wala.cast.java.client.JavaSourceAnalysisEngine;
|
|||
import com.ibm.wala.cast.java.ipa.callgraph.JavaSourceAnalysisScope;
|
||||
import com.ibm.wala.cast.java.translator.polyglot.PolyglotJavaSourceAnalysisEngine;
|
||||
import com.ibm.wala.core.tests.callGraph.CallGraphTestUtil;
|
||||
import com.ibm.wala.eclipse.util.EclipseProjectPath;
|
||||
import com.ibm.wala.ipa.callgraph.AnalysisScope;
|
||||
import com.ibm.wala.ipa.callgraph.Entrypoint;
|
||||
import com.ibm.wala.ipa.callgraph.impl.Util;
|
||||
|
|
|
@ -10,7 +10,6 @@ import com.ibm.wala.cast.tree.CAst;
|
|||
import com.ibm.wala.cast.tree.impl.CAstRewriter;
|
||||
import com.ibm.wala.cast.tree.impl.CAstRewriterFactory;
|
||||
import com.ibm.wala.core.tests.callGraph.CallGraphTestUtil;
|
||||
import com.ibm.wala.eclipse.util.EclipseProjectPath;
|
||||
import com.ibm.wala.ipa.callgraph.AnalysisScope;
|
||||
import com.ibm.wala.ipa.callgraph.Entrypoint;
|
||||
import com.ibm.wala.ipa.callgraph.impl.Util;
|
||||
|
|
|
@ -58,7 +58,6 @@ import com.ibm.wala.types.TypeReference;
|
|||
import com.ibm.wala.util.collections.HashSetFactory;
|
||||
import com.ibm.wala.util.collections.Pair;
|
||||
import com.ibm.wala.util.debug.Assertions;
|
||||
import com.ibm.wala.util.debug.Trace;
|
||||
import com.ibm.wala.util.strings.Atom;
|
||||
|
||||
public abstract class IRTests extends WalaTestCase {
|
||||
|
@ -169,11 +168,11 @@ public abstract class IRTests extends WalaTestCase {
|
|||
Set<CGNode> srcNodes = callGraph.getNodes(srcMethod);
|
||||
|
||||
if (srcNodes.size() == 0) {
|
||||
Trace.println("Unreachable/non-existent method: " + srcMethod);
|
||||
System.err.println(("Unreachable/non-existent method: " + srcMethod));
|
||||
return;
|
||||
}
|
||||
if (srcNodes.size() > 1) {
|
||||
Trace.println("Context-sensitive call graph?");
|
||||
System.err.println("Context-sensitive call graph?");
|
||||
}
|
||||
|
||||
// Assume only one node for src method
|
||||
|
@ -184,7 +183,7 @@ public abstract class IRTests extends WalaTestCase {
|
|||
// Assume only one node for target method
|
||||
Set<CGNode> tgtNodes = callGraph.getNodes(tgtMethod);
|
||||
if (tgtNodes.size() == 0) {
|
||||
Trace.println("Unreachable/non-existent method: " + tgtMethod);
|
||||
System.err.println(("Unreachable/non-existent method: " + tgtMethod));
|
||||
continue;
|
||||
}
|
||||
CGNode tgtNode = tgtNodes.iterator().next();
|
||||
|
@ -199,7 +198,7 @@ public abstract class IRTests extends WalaTestCase {
|
|||
}
|
||||
}
|
||||
if (!found) {
|
||||
Trace.println("Missing edge: " + srcMethod + " -> " + tgtMethod);
|
||||
System.err.println(("Missing edge: " + srcMethod + " -> " + tgtMethod));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -228,7 +227,7 @@ public abstract class IRTests extends WalaTestCase {
|
|||
}
|
||||
|
||||
boolean check(IMethod m, IR ir) {
|
||||
Trace.println("check for " + variableName + " defined at " + definingLineNumber);
|
||||
System.err.println(("check for " + variableName + " defined at " + definingLineNumber));
|
||||
SSAInstruction[] insts = ir.getInstructions();
|
||||
for (int i = 0; i < insts.length; i++) {
|
||||
if (insts[i] != null) {
|
||||
|
@ -240,14 +239,14 @@ public abstract class IRTests extends WalaTestCase {
|
|||
Assertions.UNREACHABLE();
|
||||
}
|
||||
if (ln == definingLineNumber) {
|
||||
Trace.println(" found " + insts[i] + " at " + ln);
|
||||
System.err.println((" found " + insts[i] + " at " + ln));
|
||||
for (int j = 0; j < insts[i].getNumberOfDefs(); j++) {
|
||||
int def = insts[i].getDef(j);
|
||||
Trace.println(" looking at def " + j + ": " + def);
|
||||
System.err.println((" looking at def " + j + ": " + def));
|
||||
String[] names = ir.getLocalNames(i, def);
|
||||
if (names != null) {
|
||||
for (String name : names) {
|
||||
Trace.println(" looking at name " + name);
|
||||
System.err.println((" looking at name " + name));
|
||||
if (name.equals(variableName)) {
|
||||
return true;
|
||||
}
|
||||
|
@ -288,7 +287,7 @@ public abstract class IRTests extends WalaTestCase {
|
|||
populateScope(engine, sources, libs);
|
||||
|
||||
CallGraph callGraph = engine.buildDefaultCallGraph();
|
||||
Trace.println(callGraph.toString());
|
||||
System.err.println(callGraph.toString());
|
||||
|
||||
// If we've gotten this far, IR has been produced.
|
||||
dumpIR(callGraph, assertReachable);
|
||||
|
@ -314,22 +313,22 @@ public abstract class IRTests extends WalaTestCase {
|
|||
for (Iterator iter = sourceLoader.iterateAllClasses(); iter.hasNext();) {
|
||||
IClass clazz = (IClass) iter.next();
|
||||
|
||||
Trace.println(clazz);
|
||||
System.err.println(clazz);
|
||||
if (clazz.isInterface())
|
||||
continue;
|
||||
|
||||
for (IMethod m : clazz.getDeclaredMethods()) {
|
||||
if (m.isAbstract()) {
|
||||
Trace.println(m);
|
||||
System.err.println(m);
|
||||
} else {
|
||||
Iterator nodeIter = cg.getNodes(m.getReference()).iterator();
|
||||
if (!nodeIter.hasNext()) {
|
||||
Trace.println("Method " + m.getReference() + " not reachable?");
|
||||
System.err.println(("Method " + m.getReference() + " not reachable?"));
|
||||
unreachable.add(m);
|
||||
continue;
|
||||
}
|
||||
CGNode node = (CGNode) nodeIter.next();
|
||||
Trace.println(node.getIR());
|
||||
System.err.println(node.getIR());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,7 +36,6 @@ import com.ibm.wala.ssa.IR;
|
|||
import com.ibm.wala.ssa.SSANewInstruction;
|
||||
import com.ibm.wala.ssa.SymbolTable;
|
||||
import com.ibm.wala.util.debug.Assertions;
|
||||
import com.ibm.wala.util.debug.Trace;
|
||||
import com.ibm.wala.util.intset.IntSetAction;
|
||||
|
||||
public class AstJavaSSAPropagationCallGraphBuilder extends AstSSAPropagationCallGraphBuilder {
|
||||
|
@ -90,14 +89,14 @@ public class AstJavaSSAPropagationCallGraphBuilder extends AstSSAPropagationCall
|
|||
TypeInference ti = new AstJavaTypeInference(ir, cha, false);
|
||||
|
||||
if (DEBUG_TYPE_INFERENCE) {
|
||||
Trace.println("IR of " + ir.getMethod());
|
||||
Trace.println(ir);
|
||||
Trace.println("TypeInference of " + ir.getMethod());
|
||||
System.err.println(("IR of " + ir.getMethod()));
|
||||
System.err.println(ir);
|
||||
System.err.println(("TypeInference of " + ir.getMethod()));
|
||||
for (int i = 0; i <= ir.getSymbolTable().getMaxValueNumber(); i++) {
|
||||
if (ti.isUndefined(i)) {
|
||||
Trace.println(" value " + i + " is undefined");
|
||||
System.err.println((" value " + i + " is undefined"));
|
||||
} else {
|
||||
Trace.println(" value " + i + " has type " + ti.getType(i));
|
||||
System.err.println((" value " + i + " has type " + ti.getType(i)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -238,7 +237,7 @@ public class AstJavaSSAPropagationCallGraphBuilder extends AstSSAPropagationCall
|
|||
else
|
||||
objKey = getPointerKeyForLocal(1);
|
||||
|
||||
Trace.println("class is " + klass + ", enclosing is " + enclosingClass + ", method is " + node.getMethod());
|
||||
System.err.println(("class is " + klass + ", enclosing is " + enclosingClass + ", method is " + node.getMethod()));
|
||||
|
||||
if (node.getMethod().isSynthetic()) {
|
||||
return;
|
||||
|
|
|
@ -27,7 +27,6 @@ import com.ibm.wala.ipa.cha.ClassHierarchyException;
|
|||
import com.ibm.wala.ipa.cha.IClassHierarchy;
|
||||
import com.ibm.wala.util.collections.HashSetFactory;
|
||||
import com.ibm.wala.util.debug.Assertions;
|
||||
import com.ibm.wala.util.debug.Trace;
|
||||
|
||||
public class JavaScopeMappingInstanceKeys extends ScopeMappingInstanceKeys {
|
||||
|
||||
|
@ -55,7 +54,7 @@ public class JavaScopeMappingInstanceKeys extends ScopeMappingInstanceKeys {
|
|||
|
||||
if (!result.isEmpty()) {
|
||||
if (AstTranslator.DEBUG_LEXICAL)
|
||||
Trace.println(base + " has parents: " + result);
|
||||
System.err.println((base + " has parents: " + result));
|
||||
|
||||
return (LexicalParent[]) result.toArray(new LexicalParent[result.size()]);
|
||||
}
|
||||
|
@ -65,7 +64,7 @@ public class JavaScopeMappingInstanceKeys extends ScopeMappingInstanceKeys {
|
|||
}
|
||||
|
||||
if (AstTranslator.DEBUG_LEXICAL)
|
||||
Trace.println(base + " has no parents");
|
||||
System.err.println((base + " has no parents"));
|
||||
|
||||
return new LexicalParent[0];
|
||||
}
|
||||
|
@ -77,7 +76,7 @@ public class JavaScopeMappingInstanceKeys extends ScopeMappingInstanceKeys {
|
|||
protected boolean needsScopeMappingKey(InstanceKey base) {
|
||||
boolean result = getParents(base).length > 0;
|
||||
if (AstTranslator.DEBUG_LEXICAL)
|
||||
Trace.println("does " + base + " need scope mapping? " + result);
|
||||
System.err.println(("does " + base + " need scope mapping? " + result));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -20,7 +20,6 @@ import com.ibm.wala.ipa.slicer.Statement;
|
|||
import com.ibm.wala.ssa.IR;
|
||||
import com.ibm.wala.ssa.SSAInstruction;
|
||||
import com.ibm.wala.util.collections.Pair;
|
||||
import com.ibm.wala.util.debug.Trace;
|
||||
import com.ibm.wala.util.graph.traverse.DFS;
|
||||
|
||||
public class AstJavaSlicer extends Slicer {
|
||||
|
@ -63,7 +62,7 @@ public class AstJavaSlicer extends Slicer {
|
|||
Collection<CGNode> partialRoots) throws IllegalArgumentException, CancelException {
|
||||
CallGraph pcg = PartialCallGraph.make(CG, new LinkedHashSet<CGNode>(partialRoots));
|
||||
SDG sdg = new SDG(pcg, pa, new AstJavaModRef(), DataDependenceOptions.FULL, ControlDependenceOptions.FULL);
|
||||
Trace.println("SDG:\n" + sdg);
|
||||
System.err.println(("SDG:\n" + sdg));
|
||||
return Pair.make(AstJavaSlicer.computeBackwardSlice(sdg, gatherAssertions(CG, partialRoots)), sdg);
|
||||
}
|
||||
|
||||
|
|
|
@ -53,7 +53,6 @@ import com.ibm.wala.types.TypeName;
|
|||
import com.ibm.wala.types.TypeReference;
|
||||
import com.ibm.wala.util.collections.HashMapFactory;
|
||||
import com.ibm.wala.util.debug.Assertions;
|
||||
import com.ibm.wala.util.debug.Trace;
|
||||
import com.ibm.wala.util.strings.Atom;
|
||||
|
||||
/**
|
||||
|
@ -300,12 +299,12 @@ public abstract class JavaSourceLoaderImpl extends ClassLoaderImpl {
|
|||
|
||||
public LexicalParent[] getParents() {
|
||||
if (AstTranslator.DEBUG_LEXICAL) {
|
||||
Trace.println("resolving parents of " + this);
|
||||
System.err.println(("resolving parents of " + this));
|
||||
}
|
||||
|
||||
if (lexicalInfo() == null) {
|
||||
if (AstTranslator.DEBUG_LEXICAL)
|
||||
Trace.println("no info");
|
||||
System.err.println("no info");
|
||||
return new LexicalParent[0];
|
||||
}
|
||||
|
||||
|
@ -313,7 +312,7 @@ public abstract class JavaSourceLoaderImpl extends ClassLoaderImpl {
|
|||
|
||||
if (parents == null) {
|
||||
if (AstTranslator.DEBUG_LEXICAL)
|
||||
Trace.println("no parents");
|
||||
System.err.println("no parents");
|
||||
return new LexicalParent[0];
|
||||
}
|
||||
|
||||
|
@ -336,7 +335,7 @@ public abstract class JavaSourceLoaderImpl extends ClassLoaderImpl {
|
|||
final Selector sel = new Selector(name, desc);
|
||||
|
||||
if (AstTranslator.DEBUG_LEXICAL)
|
||||
Trace.println("get " + typeName + ", " + nameStr + ", " + descStr);
|
||||
System.err.println(("get " + typeName + ", " + nameStr + ", " + descStr));
|
||||
|
||||
final int hack = i;
|
||||
result[i] = new LexicalParent() {
|
||||
|
@ -350,7 +349,7 @@ public abstract class JavaSourceLoaderImpl extends ClassLoaderImpl {
|
|||
};
|
||||
|
||||
if (AstTranslator.DEBUG_LEXICAL)
|
||||
Trace.println("parent " + result[i].getName() + " is " + result[i].getMethod());
|
||||
System.err.println(("parent " + result[i].getName() + " is " + result[i].getMethod()));
|
||||
}
|
||||
|
||||
return result;
|
||||
|
|
|
@ -12,7 +12,7 @@ package com.ibm.wala.cast.js.ipa.callgraph;
|
|||
|
||||
import com.ibm.wala.cast.ipa.callgraph.AstCallGraph;
|
||||
import com.ibm.wala.cast.js.cfg.JSInducedCFG;
|
||||
import com.ibm.wala.cast.js.loader.*;
|
||||
import com.ibm.wala.cast.js.loader.JSCallSiteReference;
|
||||
import com.ibm.wala.cast.js.ssa.JavaScriptInvoke;
|
||||
import com.ibm.wala.cast.js.ssa.JavaScriptNewInstruction;
|
||||
import com.ibm.wala.cast.js.types.JavaScriptTypes;
|
||||
|
|
|
@ -58,7 +58,6 @@ import com.ibm.wala.ssa.SSABinaryOpInstruction;
|
|||
import com.ibm.wala.ssa.SSAUnaryOpInstruction;
|
||||
import com.ibm.wala.ssa.SymbolTable;
|
||||
import com.ibm.wala.util.collections.HashSetFactory;
|
||||
import com.ibm.wala.util.debug.Trace;
|
||||
import com.ibm.wala.util.intset.IntSetAction;
|
||||
import com.ibm.wala.util.intset.IntSetUtil;
|
||||
import com.ibm.wala.util.intset.MutableIntSet;
|
||||
|
@ -106,14 +105,14 @@ public class JSSSAPropagationCallGraphBuilder extends AstSSAPropagationCallGraph
|
|||
TypeInference ti = new JSTypeInference(ir, cha);
|
||||
|
||||
if (DEBUG_TYPE_INFERENCE) {
|
||||
Trace.println("IR of " + ir.getMethod());
|
||||
Trace.println(ir);
|
||||
Trace.println("TypeInference of " + ir.getMethod());
|
||||
System.err.println(("IR of " + ir.getMethod()));
|
||||
System.err.println(ir);
|
||||
System.err.println(("TypeInference of " + ir.getMethod()));
|
||||
for (int i = 0; i <= ir.getSymbolTable().getMaxValueNumber(); i++) {
|
||||
if (ti.isUndefined(i)) {
|
||||
Trace.println(" value " + i + " is undefined");
|
||||
System.err.println((" value " + i + " is undefined"));
|
||||
} else {
|
||||
Trace.println(" value " + i + " has type " + ti.getType(i));
|
||||
System.err.println((" value " + i + " has type " + ti.getType(i)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,7 +48,6 @@ import com.ibm.wala.types.TypeReference;
|
|||
import com.ibm.wala.util.collections.HashMapFactory;
|
||||
import com.ibm.wala.util.collections.Pair;
|
||||
import com.ibm.wala.util.debug.Assertions;
|
||||
import com.ibm.wala.util.debug.Trace;
|
||||
|
||||
public class JavaScriptConstructTargetSelector implements MethodTargetSelector {
|
||||
private static final boolean DEBUG = false;
|
||||
|
@ -374,7 +373,7 @@ public class JavaScriptConstructTargetSelector implements MethodTargetSelector {
|
|||
.getStringValue(callStmt.getUse(1))));
|
||||
|
||||
if (DEBUG) {
|
||||
Trace.println("ctor type name is " + (String) ST.getStringValue(callStmt.getUse(1)));
|
||||
System.err.println(("ctor type name is " + (String) ST.getStringValue(callStmt.getUse(1))));
|
||||
}
|
||||
|
||||
IClass cls2 = cha.lookupClass(ref);
|
||||
|
@ -415,7 +414,7 @@ public class JavaScriptConstructTargetSelector implements MethodTargetSelector {
|
|||
cha.addClass(fcls);
|
||||
|
||||
if (DEBUG)
|
||||
Trace.println("looking for ctor " + ctorCount + " and got " + fcls);
|
||||
System.err.println(("looking for ctor " + ctorCount + " and got " + fcls));
|
||||
|
||||
if (fcls != null)
|
||||
return makeFunctionConstructor(cls, fcls);
|
||||
|
|
|
@ -11,9 +11,11 @@
|
|||
package com.ibm.wala.cast.js.ipa.callgraph;
|
||||
|
||||
import com.ibm.wala.cast.ipa.callgraph.ScriptEntryPoints;
|
||||
import com.ibm.wala.cast.js.loader.*;
|
||||
import com.ibm.wala.cast.js.loader.JSCallSiteReference;
|
||||
import com.ibm.wala.cast.js.types.JavaScriptTypes;
|
||||
import com.ibm.wala.classLoader.*;
|
||||
import com.ibm.wala.classLoader.CallSiteReference;
|
||||
import com.ibm.wala.classLoader.IClassLoader;
|
||||
import com.ibm.wala.classLoader.IMethod;
|
||||
import com.ibm.wala.ipa.cha.IClassHierarchy;
|
||||
|
||||
public class JavaScriptEntryPoints extends ScriptEntryPoints {
|
||||
|
|
|
@ -45,7 +45,6 @@ import com.ibm.wala.types.TypeName;
|
|||
import com.ibm.wala.types.TypeReference;
|
||||
import com.ibm.wala.util.collections.HashSetFactory;
|
||||
import com.ibm.wala.util.debug.Assertions;
|
||||
import com.ibm.wala.util.debug.Trace;
|
||||
import com.ibm.wala.util.strings.Atom;
|
||||
|
||||
public class JavaScriptLoader extends CAstAbstractLoader {
|
||||
|
@ -237,7 +236,7 @@ public class JavaScriptLoader extends CAstAbstractLoader {
|
|||
}
|
||||
};
|
||||
|
||||
Trace.println("parent " + result[i].getName() + " is " + result[i].getMethod());
|
||||
System.err.println(("parent " + result[i].getName() + " is " + result[i].getMethod()));
|
||||
}
|
||||
|
||||
return result;
|
||||
|
|
|
@ -10,17 +10,17 @@
|
|||
*****************************************************************************/
|
||||
package com.ibm.wala.cast.js.ssa;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import com.ibm.wala.cast.ir.ssa.AbstractLexicalInvoke;
|
||||
import com.ibm.wala.cast.ir.ssa.AstLexicalAccess.Access;
|
||||
import com.ibm.wala.cast.js.types.JavaScriptMethods;
|
||||
import com.ibm.wala.classLoader.CallSiteReference;
|
||||
import com.ibm.wala.ssa.SSAInstruction;
|
||||
import com.ibm.wala.ssa.SymbolTable;
|
||||
import com.ibm.wala.types.TypeReference;
|
||||
import com.ibm.wala.util.debug.Assertions;
|
||||
|
||||
import com.ibm.wala.cast.ir.ssa.*;
|
||||
import com.ibm.wala.cast.ir.ssa.AstLexicalAccess.Access;
|
||||
import com.ibm.wala.cast.js.types.*;
|
||||
import com.ibm.wala.classLoader.*;
|
||||
import com.ibm.wala.ssa.*;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class JavaScriptInvoke extends AbstractLexicalInvoke {
|
||||
/**
|
||||
* The value numbers of the arguments passed to the call.
|
||||
|
|
|
@ -10,14 +10,14 @@
|
|||
*****************************************************************************/
|
||||
package com.ibm.wala.cast.js.ssa;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import com.ibm.wala.cast.ir.ssa.AbstractReflectivePut;
|
||||
import com.ibm.wala.ssa.SSAInstruction;
|
||||
import com.ibm.wala.ssa.SymbolTable;
|
||||
import com.ibm.wala.types.TypeReference;
|
||||
import com.ibm.wala.util.debug.Assertions;
|
||||
|
||||
import com.ibm.wala.cast.ir.ssa.*;
|
||||
import com.ibm.wala.ssa.*;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class JavaScriptPropertyWrite extends AbstractReflectivePut {
|
||||
|
||||
public JavaScriptPropertyWrite(int objectRef, int memberRef, int value) {
|
||||
|
|
|
@ -44,7 +44,6 @@ import com.ibm.wala.types.MethodReference;
|
|||
import com.ibm.wala.types.TypeName;
|
||||
import com.ibm.wala.types.TypeReference;
|
||||
import com.ibm.wala.util.debug.Assertions;
|
||||
import com.ibm.wala.util.debug.Trace;
|
||||
import com.ibm.wala.util.strings.Atom;
|
||||
|
||||
public class JSAstTranslator extends AstTranslator {
|
||||
|
@ -138,10 +137,12 @@ public class JSAstTranslator extends AstTranslator {
|
|||
AstLexicalInformation LI,
|
||||
DebuggingInformation debugInfo)
|
||||
{
|
||||
if (DEBUG) Trace.println("\n\nAdding code for " + N);
|
||||
if (DEBUG)
|
||||
System.err.println(("\n\nAdding code for " + N));
|
||||
String fnName = composeEntityName(definingContext, N);
|
||||
|
||||
if (DEBUG) Trace.println( cfg );
|
||||
if (DEBUG)
|
||||
System.err.println(cfg);
|
||||
|
||||
((JavaScriptLoader)loader).defineCodeBodyCode("L"+fnName,
|
||||
cfg,
|
||||
|
|
|
@ -50,7 +50,6 @@ import com.ibm.wala.util.collections.EmptyIterator;
|
|||
import com.ibm.wala.util.collections.HashMapFactory;
|
||||
import com.ibm.wala.util.collections.HashSetFactory;
|
||||
import com.ibm.wala.util.debug.Assertions;
|
||||
import com.ibm.wala.util.debug.Trace;
|
||||
|
||||
public class RhinoToAstTranslator {
|
||||
|
||||
|
@ -1334,7 +1333,7 @@ public class RhinoToAstTranslator {
|
|||
compilerEnv.setErrorReporter(reporter);
|
||||
|
||||
if (DEBUG)
|
||||
Trace.println("translating " + scriptName + " with Rhino");
|
||||
System.err.println(("translating " + scriptName + " with Rhino"));
|
||||
|
||||
Parser P = new Parser(compilerEnv, compilerEnv.getErrorReporter());
|
||||
|
||||
|
|
|
@ -17,7 +17,6 @@ import java.net.URL;
|
|||
|
||||
import com.ibm.wala.classLoader.SourceFileModule;
|
||||
import com.ibm.wala.util.debug.Assertions;
|
||||
import com.ibm.wala.util.debug.Trace;
|
||||
|
||||
public class WebUtil {
|
||||
private static final String outputDir;
|
||||
|
@ -55,7 +54,7 @@ public class WebUtil {
|
|||
urlFile.substring(urlFile.lastIndexOf('/')):
|
||||
url.getHost() + ".html";
|
||||
File F = new File(outputDir + urlName);
|
||||
Trace.println("making driver at " + F + " " + outputDir);
|
||||
System.err.println(("making driver at " + F + " " + outputDir));
|
||||
if (F.exists()) F.delete();
|
||||
|
||||
generator.generate(url, F);
|
||||
|
|
|
@ -11,7 +11,8 @@
|
|||
import com.ibm.wala.cast.js.ipa.callgraph.JSCFABuilder;
|
||||
import com.ibm.wala.cast.js.ipa.callgraph.JSZeroOrOneXCFABuilder;
|
||||
import com.ibm.wala.cast.js.ipa.callgraph.Util;
|
||||
import com.ibm.wala.cast.js.loader.*;
|
||||
import com.ibm.wala.cast.js.loader.JavaScriptLoader;
|
||||
import com.ibm.wala.cast.js.loader.JavaScriptLoaderFactory;
|
||||
import com.ibm.wala.ipa.callgraph.AnalysisCache;
|
||||
import com.ibm.wala.ipa.callgraph.AnalysisOptions;
|
||||
import com.ibm.wala.ipa.callgraph.AnalysisScope;
|
||||
|
|
|
@ -25,7 +25,6 @@ import com.ibm.wala.cast.util.CAstPrinter;
|
|||
import com.ibm.wala.cast.util.CAstPattern.Segments;
|
||||
import com.ibm.wala.core.tests.util.WalaTestCase;
|
||||
import com.ibm.wala.util.debug.Assertions;
|
||||
import com.ibm.wala.util.debug.Trace;
|
||||
|
||||
public class TestCAstPattern extends WalaTestCase {
|
||||
|
||||
|
@ -61,8 +60,8 @@ public class TestCAstPattern extends WalaTestCase {
|
|||
}
|
||||
|
||||
private void test(CAstPattern p, CAstNode n, Map names) {
|
||||
Trace.println("testing pattern " + p);
|
||||
Trace.println("testing with input " + CAstPrinter.print(n));
|
||||
System.err.println(("testing pattern " + p));
|
||||
System.err.println(("testing with input " + CAstPrinter.print(n)));
|
||||
|
||||
if (names == null) {
|
||||
Assert.assertFalse(p.match(n, null));
|
||||
|
@ -73,12 +72,12 @@ public class TestCAstPattern extends WalaTestCase {
|
|||
String nm = (String) ns.next();
|
||||
Object o = names.get(nm);
|
||||
if (o instanceof CAstNode) {
|
||||
Trace.println("found " + CAstPrinter.print(s.getSingle(nm)) + " for " + nm);
|
||||
System.err.println(("found " + CAstPrinter.print(s.getSingle(nm)) + " for " + nm));
|
||||
Assert.assertTrue("for name " + nm + ": expected " + names.get(nm) + " but got " + s.getSingle(nm), names.get(nm).equals(
|
||||
s.getSingle(nm)));
|
||||
} else {
|
||||
for (Iterator cs = s.getMultiple(nm).iterator(); cs.hasNext();) {
|
||||
Trace.println("found " + CAstPrinter.print((CAstNode) cs.next()) + " for " + nm);
|
||||
System.err.println(("found " + CAstPrinter.print((CAstNode) cs.next()) + " for " + nm));
|
||||
}
|
||||
Assert.assertTrue("for name " + nm + ": expected " + names.get(nm) + " but got " + s.getMultiple(nm), names.get(nm)
|
||||
.equals(s.getMultiple(nm)));
|
||||
|
|
|
@ -27,7 +27,6 @@ import com.ibm.wala.ssa.IRFactory;
|
|||
import com.ibm.wala.ssa.SSAOptions;
|
||||
import com.ibm.wala.util.collections.HashMapFactory;
|
||||
import com.ibm.wala.util.collections.Pair;
|
||||
import com.ibm.wala.util.debug.Trace;
|
||||
|
||||
public abstract class TestCAstTranslator extends WalaTestCase {
|
||||
|
||||
|
@ -132,25 +131,25 @@ public abstract class TestCAstTranslator extends WalaTestCase {
|
|||
protected void dump(ClassHierarchy cha) {
|
||||
for (Iterator<?> clss = cha.iterator(); clss.hasNext();) {
|
||||
IClass cls = (IClass) clss.next();
|
||||
Trace.println("class " + cls);
|
||||
System.err.println(("class " + cls));
|
||||
for (Iterator<?> flds = cls.getDeclaredInstanceFields().iterator(); flds.hasNext();) {
|
||||
IField fld = (IField) flds.next();
|
||||
Trace.println("instance field " + fld);
|
||||
System.err.println(("instance field " + fld));
|
||||
}
|
||||
for (Iterator<?> flds = cls.getDeclaredStaticFields().iterator(); flds.hasNext();) {
|
||||
IField fld = (IField) flds.next();
|
||||
Trace.println("static field " + fld);
|
||||
System.err.println(("static field " + fld));
|
||||
}
|
||||
for (Iterator<?> mths = cls.getDeclaredMethods().iterator(); mths.hasNext();) {
|
||||
IMethod mth = (IMethod) mths.next();
|
||||
if (mth.isStatic())
|
||||
Trace.print("static ");
|
||||
Trace.println("method " + mth + " with " +
|
||||
mth.getNumberOfParameters() + " parameters");
|
||||
System.err.print("static ");
|
||||
System.err.println(("method " + mth + " with " +
|
||||
mth.getNumberOfParameters() + " parameters"));
|
||||
for (int i = 0; i < mth.getNumberOfParameters(); i++) {
|
||||
Trace.println("param " + i + ": " + mth.getParameterType(i));
|
||||
System.err.println(("param " + i + ": " + mth.getParameterType(i)));
|
||||
}
|
||||
Trace.println(factory.makeIR(mth, Everywhere.EVERYWHERE, options));
|
||||
System.err.println(factory.makeIR(mth, Everywhere.EVERYWHERE, options));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -231,7 +230,7 @@ public abstract class TestCAstTranslator extends WalaTestCase {
|
|||
if (assertions != null) {
|
||||
checkAssertions(cha, assertions);
|
||||
} else {
|
||||
Trace.println("WARNING: no assertions for " + getClass());
|
||||
System.err.println(("WARNING: no assertions for " + getClass()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,6 @@ import com.ibm.wala.ipa.callgraph.CGNode;
|
|||
import com.ibm.wala.ipa.callgraph.CallGraph;
|
||||
import com.ibm.wala.ssa.IR;
|
||||
import com.ibm.wala.util.collections.NonNullSingletonIterator;
|
||||
import com.ibm.wala.util.debug.Trace;
|
||||
|
||||
public abstract class TestCallGraphShape extends WalaTestCase {
|
||||
|
||||
|
@ -48,7 +47,7 @@ public abstract class TestCallGraphShape extends WalaTestCase {
|
|||
Name[] names = (Name[]) assertionData[i][1];
|
||||
for (int j = 0; j < names.length; j++) {
|
||||
|
||||
Trace.println("looking for " + names[j].name + ", " + names[j].vn + " in " + N);
|
||||
System.err.println(("looking for " + names[j].name + ", " + names[j].vn + " in " + N));
|
||||
|
||||
String[] localNames = ir.getLocalNames(names[j].instructionIndex, names[j].vn);
|
||||
|
||||
|
@ -66,7 +65,7 @@ public abstract class TestCallGraphShape extends WalaTestCase {
|
|||
}
|
||||
|
||||
protected void verifyGraphAssertions(CallGraph CG, Object[][] assertionData) {
|
||||
Trace.println(CG);
|
||||
System.err.println(CG);
|
||||
|
||||
if (assertionData == null) {
|
||||
return;
|
||||
|
@ -92,7 +91,7 @@ public abstract class TestCallGraphShape extends WalaTestCase {
|
|||
CGNode dst = (CGNode) dsts.next();
|
||||
for (Iterator tos = CG.getPossibleTargets(src, sr).iterator(); tos.hasNext();) {
|
||||
if (tos.next().equals(dst)) {
|
||||
Trace.println("found expected " + src + " --> " + dst + " at " + sr);
|
||||
System.err.println(("found expected " + src + " --> " + dst + " at " + sr));
|
||||
continue check_target;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,7 +13,17 @@ package com.ibm.wala.cast.analysis.typeInference;
|
|||
import com.ibm.wala.analysis.typeInference.ConeType;
|
||||
import com.ibm.wala.analysis.typeInference.TypeAbstraction;
|
||||
import com.ibm.wala.analysis.typeInference.TypeInference;
|
||||
import com.ibm.wala.cast.ir.ssa.*;
|
||||
import com.ibm.wala.cast.ir.ssa.AstAssertInstruction;
|
||||
import com.ibm.wala.cast.ir.ssa.AstEchoInstruction;
|
||||
import com.ibm.wala.cast.ir.ssa.AstGlobalRead;
|
||||
import com.ibm.wala.cast.ir.ssa.AstGlobalWrite;
|
||||
import com.ibm.wala.cast.ir.ssa.AstInstructionVisitor;
|
||||
import com.ibm.wala.cast.ir.ssa.AstIsDefinedInstruction;
|
||||
import com.ibm.wala.cast.ir.ssa.AstLexicalRead;
|
||||
import com.ibm.wala.cast.ir.ssa.AstLexicalWrite;
|
||||
import com.ibm.wala.cast.ir.ssa.EachElementGetInstruction;
|
||||
import com.ibm.wala.cast.ir.ssa.EachElementHasNextInstruction;
|
||||
import com.ibm.wala.cast.ir.ssa.NonExceptingThrowInstruction;
|
||||
import com.ibm.wala.ipa.cha.IClassHierarchy;
|
||||
import com.ibm.wala.ssa.IR;
|
||||
|
||||
|
|
|
@ -70,7 +70,6 @@ import com.ibm.wala.util.collections.EmptyIterator;
|
|||
import com.ibm.wala.util.collections.HashSetFactory;
|
||||
import com.ibm.wala.util.collections.Pair;
|
||||
import com.ibm.wala.util.debug.Assertions;
|
||||
import com.ibm.wala.util.debug.Trace;
|
||||
import com.ibm.wala.util.functions.Function;
|
||||
import com.ibm.wala.util.graph.traverse.NumberedDFSDiscoverTimeIterator;
|
||||
import com.ibm.wala.util.intset.IntSet;
|
||||
|
@ -522,7 +521,7 @@ public abstract class AstSSAPropagationCallGraphBuilder extends SSAPropagationCa
|
|||
final int vn = accesses[i].valueNumber;
|
||||
|
||||
if (AstTranslator.DEBUG_LEXICAL)
|
||||
Trace.println("looking up lexical parent " + definer);
|
||||
System.err.println(("looking up lexical parent " + definer));
|
||||
|
||||
for (Iterator<CGNode> DS = getLexicalDefiners(node, definer).iterator(); DS.hasNext();) {
|
||||
final CGNode D = DS.next();
|
||||
|
@ -776,7 +775,7 @@ public abstract class AstSSAPropagationCallGraphBuilder extends SSAPropagationCa
|
|||
I.addLexicalUse(new Access(name, definer, values[i]));
|
||||
|
||||
if (SSAConversion.DEBUG_UNDO)
|
||||
Trace.println("copy use #" + (-i - 1) + " to use #" + (I.getNumberOfUses() - 1) + " at inst " + pc);
|
||||
System.err.println(("copy use #" + (-i - 1) + " to use #" + (I.getNumberOfUses() - 1) + " at inst " + pc));
|
||||
|
||||
SSAConversion.copyUse(ir, pc, -i - 1, pc, I.getNumberOfUses() - 1);
|
||||
|
||||
|
@ -839,7 +838,7 @@ public abstract class AstSSAPropagationCallGraphBuilder extends SSAPropagationCa
|
|||
I.addLexicalDef(new Access(name, definer, values[i]));
|
||||
|
||||
if (SSAConversion.DEBUG_UNDO)
|
||||
Trace.println("new def of " + values[i] + " at inst " + pc + ": " + I);
|
||||
System.err.println(("new def of " + values[i] + " at inst " + pc + ": " + I));
|
||||
|
||||
// new def has broken SSA form for values[i], so fix for that
|
||||
// value
|
||||
|
@ -890,31 +889,31 @@ public abstract class AstSSAPropagationCallGraphBuilder extends SSAPropagationCa
|
|||
// log field access
|
||||
if (DEBUG_PROPERTIES) {
|
||||
if (isLoadOperation)
|
||||
Trace.print("adding read of " + objKey + "." + fieldKey + ":");
|
||||
System.err.print(("adding read of " + objKey + "." + fieldKey + ":"));
|
||||
else
|
||||
Trace.print("adding write of " + objKey + "." + fieldKey + ":");
|
||||
System.err.print(("adding write of " + objKey + "." + fieldKey + ":"));
|
||||
|
||||
if (contentsAreInvariant(symtab, du, objVn)) {
|
||||
Trace.print(" constant obj:");
|
||||
System.err.print(" constant obj:");
|
||||
InstanceKey[] x = getInvariantContents(symtab, du, opNode, objVn);
|
||||
for (int i = 0; i < x.length; i++) {
|
||||
Trace.print(x[i].toString() + " ");
|
||||
System.err.print((x[i].toString() + " "));
|
||||
}
|
||||
} else {
|
||||
Trace.print(" obj:" + system.findOrCreatePointsToSet(objKey));
|
||||
System.err.print((" obj:" + system.findOrCreatePointsToSet(objKey)));
|
||||
}
|
||||
|
||||
if (contentsAreInvariant(symtab, du, fieldsVn)) {
|
||||
Trace.print(" constant prop:");
|
||||
System.err.print(" constant prop:");
|
||||
InstanceKey[] x = getInvariantContents(symtab, du, opNode, fieldsVn);
|
||||
for (int i = 0; i < x.length; i++) {
|
||||
Trace.print(x[i].toString() + " ");
|
||||
System.err.print((x[i].toString() + " "));
|
||||
}
|
||||
} else {
|
||||
Trace.print(" props:" + system.findOrCreatePointsToSet(fieldKey));
|
||||
System.err.print((" props:" + system.findOrCreatePointsToSet(fieldKey)));
|
||||
}
|
||||
|
||||
Trace.print("\n");
|
||||
System.err.print("\n");
|
||||
}
|
||||
|
||||
// make sure instance keys get mapped for PointerAnalysisImpl
|
||||
|
@ -1106,7 +1105,7 @@ public abstract class AstSSAPropagationCallGraphBuilder extends SSAPropagationCa
|
|||
}
|
||||
|
||||
if (DEBUG_PROPERTIES) {
|
||||
Trace.println("finished\n");
|
||||
System.err.println("finished\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1128,9 +1127,9 @@ public abstract class AstSSAPropagationCallGraphBuilder extends SSAPropagationCa
|
|||
|
||||
newFieldOperation(opNode, objVn, fieldsVn, false, new ReflectedFieldAction() {
|
||||
public void dump(AbstractFieldPointerKey fieldKey, boolean constObj, boolean constProp) {
|
||||
Trace.println("writing fixed rvals to " + fieldKey + " " + constObj + ", " + constProp);
|
||||
System.err.println(("writing fixed rvals to " + fieldKey + " " + constObj + ", " + constProp));
|
||||
for (int i = 0; i < rhsFixedValues.length; i++) {
|
||||
Trace.println("writing " + rhsFixedValues[i]);
|
||||
System.err.println(("writing " + rhsFixedValues[i]));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1154,7 +1153,7 @@ public abstract class AstSSAPropagationCallGraphBuilder extends SSAPropagationCa
|
|||
protected void newFieldWrite(CGNode opNode, int objVn, int fieldsVn, final PointerKey rhs) {
|
||||
newFieldOperation(opNode, objVn, fieldsVn, false, new ReflectedFieldAction() {
|
||||
public void dump(AbstractFieldPointerKey fieldKey, boolean constObj, boolean constProp) {
|
||||
Trace.println("write " + rhs + " to " + fieldKey + " " + constObj + ", " + constProp);
|
||||
System.err.println(("write " + rhs + " to " + fieldKey + " " + constObj + ", " + constProp));
|
||||
}
|
||||
|
||||
public void action(AbstractFieldPointerKey fieldKey) {
|
||||
|
@ -1172,7 +1171,7 @@ public abstract class AstSSAPropagationCallGraphBuilder extends SSAPropagationCa
|
|||
protected void newFieldRead(CGNode opNode, int objVn, int fieldsVn, final PointerKey lhs) {
|
||||
newFieldOperation(opNode, objVn, fieldsVn, true, new ReflectedFieldAction() {
|
||||
public void dump(AbstractFieldPointerKey fieldKey, boolean constObj, boolean constProp) {
|
||||
Trace.println("read " + lhs + " from " + fieldKey + " " + constObj + ", " + constProp);
|
||||
System.err.println(("read " + lhs + " from " + fieldKey + " " + constObj + ", " + constProp));
|
||||
}
|
||||
|
||||
public void action(AbstractFieldPointerKey fieldKey) {
|
||||
|
|
|
@ -30,7 +30,6 @@ import com.ibm.wala.types.TypeName;
|
|||
import com.ibm.wala.types.TypeReference;
|
||||
import com.ibm.wala.util.collections.HashSetFactory;
|
||||
import com.ibm.wala.util.debug.Assertions;
|
||||
import com.ibm.wala.util.debug.Trace;
|
||||
import com.ibm.wala.util.strings.Atom;
|
||||
|
||||
public class MiscellaneousHacksContextSelector implements ContextSelector {
|
||||
|
@ -105,7 +104,7 @@ public class MiscellaneousHacksContextSelector implements ContextSelector {
|
|||
}
|
||||
}
|
||||
|
||||
Trace.println("hacking context selector for methods " + methodsToSpecialize);
|
||||
System.err.println(("hacking context selector for methods " + methodsToSpecialize));
|
||||
}
|
||||
|
||||
public Context getCalleeTarget(CGNode caller, CallSiteReference site, IMethod callee, InstanceKey receiver) {
|
||||
|
|
|
@ -28,7 +28,6 @@ import com.ibm.wala.ipa.callgraph.propagation.PropagationCallGraphBuilder;
|
|||
import com.ibm.wala.types.TypeReference;
|
||||
import com.ibm.wala.util.collections.HashSetFactory;
|
||||
import com.ibm.wala.util.debug.Assertions;
|
||||
import com.ibm.wala.util.debug.Trace;
|
||||
|
||||
abstract public class ScopeMappingInstanceKeys implements InstanceKeyFactory {
|
||||
|
||||
|
@ -57,7 +56,7 @@ abstract public class ScopeMappingInstanceKeys implements InstanceKeyFactory {
|
|||
LexicalParent restoreParent = null;
|
||||
|
||||
if (AstTranslator.DEBUG_LEXICAL)
|
||||
Trace.println(level + ": searching " + node + " for parents");
|
||||
System.err.println((level + ": searching " + node + " for parents"));
|
||||
|
||||
for (int i = 0; i < parents.length; i++) {
|
||||
|
||||
|
@ -65,7 +64,7 @@ abstract public class ScopeMappingInstanceKeys implements InstanceKeyFactory {
|
|||
continue;
|
||||
|
||||
if (AstTranslator.DEBUG_LEXICAL)
|
||||
Trace.println(level + ": searching " + parents[i]);
|
||||
System.err.println((level + ": searching " + parents[i]));
|
||||
|
||||
if (node.getMethod() == parents[i].getMethod()) {
|
||||
if (containsKey(parents[i].getName()))
|
||||
|
@ -73,8 +72,8 @@ abstract public class ScopeMappingInstanceKeys implements InstanceKeyFactory {
|
|||
else {
|
||||
put(parents[i].getName(), node);
|
||||
if (AstTranslator.DEBUG_LEXICAL)
|
||||
Trace.println(level + ": Adding lexical parent " + parents[i].getName() + " for " + base + " at " + creator
|
||||
+ "(toDo is now " + toDo + ")");
|
||||
System.err.println((level + ": Adding lexical parent " + parents[i].getName() + " for " + base + " at " + creator
|
||||
+ "(toDo is now " + toDo + ")"));
|
||||
}
|
||||
|
||||
toDo--;
|
||||
|
@ -107,7 +106,7 @@ abstract public class ScopeMappingInstanceKeys implements InstanceKeyFactory {
|
|||
LexicalParent[] parents = getParents(base);
|
||||
|
||||
if (AstTranslator.DEBUG_LEXICAL)
|
||||
Trace.println("starting search for parents at " + creator);
|
||||
System.err.println(("starting search for parents at " + creator));
|
||||
|
||||
HashSet<CGNode> s = HashSetFactory.make(5);
|
||||
scan(0, parents.length, parents, creator, s);
|
||||
|
|
|
@ -21,7 +21,6 @@ import com.ibm.wala.ipa.cha.IClassHierarchy;
|
|||
import com.ibm.wala.types.ClassLoaderReference;
|
||||
import com.ibm.wala.types.MethodReference;
|
||||
import com.ibm.wala.types.TypeReference;
|
||||
import com.ibm.wala.util.debug.*;
|
||||
|
||||
public class StandardFunctionTargetSelector implements MethodTargetSelector {
|
||||
private final IClassHierarchy cha;
|
||||
|
@ -47,17 +46,15 @@ public class StandardFunctionTargetSelector implements MethodTargetSelector {
|
|||
receiver;
|
||||
|
||||
if (declarer == null) {
|
||||
Trace.println(
|
||||
"cannot find declarer for " +
|
||||
site + ", " + receiver + " in " + caller);
|
||||
System.err.println(("cannot find declarer for " +
|
||||
site + ", " + receiver + " in " + caller));
|
||||
}
|
||||
|
||||
IClass fun = cha.lookupClass(functionTypeRef);
|
||||
|
||||
if (fun == null) {
|
||||
Trace.println(
|
||||
"cannot find function " + functionTypeRef + " for " +
|
||||
site + ", " + receiver + " in " + caller);
|
||||
System.err.println(("cannot find function " + functionTypeRef + " for " +
|
||||
site + ", " + receiver + " in " + caller));
|
||||
}
|
||||
|
||||
if (fun != null && declarer != null && cha.isSubclassOf(declarer, fun)) {
|
||||
|
|
|
@ -10,20 +10,26 @@
|
|||
*****************************************************************************/
|
||||
package com.ibm.wala.cast.ipa.callgraph;
|
||||
|
||||
import java.io.*;
|
||||
import java.net.*;
|
||||
import java.util.*;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
|
||||
import com.ibm.wala.cast.ir.ssa.*;
|
||||
import com.ibm.wala.cast.loader.*;
|
||||
import com.ibm.wala.classLoader.*;
|
||||
import com.ibm.wala.ipa.callgraph.*;
|
||||
import com.ibm.wala.cast.ir.ssa.AstIRFactory;
|
||||
import com.ibm.wala.cast.loader.SingleClassLoaderFactory;
|
||||
import com.ibm.wala.classLoader.Language;
|
||||
import com.ibm.wala.classLoader.SourceFileModule;
|
||||
import com.ibm.wala.ipa.callgraph.AnalysisCache;
|
||||
import com.ibm.wala.ipa.callgraph.AnalysisScope;
|
||||
import com.ibm.wala.ipa.callgraph.CGNode;
|
||||
import com.ibm.wala.ipa.callgraph.CallGraph;
|
||||
import com.ibm.wala.ipa.callgraph.propagation.PointerAnalysis;
|
||||
import com.ibm.wala.ipa.callgraph.propagation.PointerKey;
|
||||
import com.ibm.wala.ipa.callgraph.propagation.PropagationCallGraphBuilder;
|
||||
import com.ibm.wala.ssa.IR;
|
||||
import com.ibm.wala.util.debug.Assertions;
|
||||
import com.ibm.wala.util.debug.Trace;
|
||||
|
||||
public class Util {
|
||||
|
||||
|
@ -66,16 +72,16 @@ public class Util {
|
|||
}
|
||||
|
||||
public static void dumpCG(PropagationCallGraphBuilder builder, CallGraph CG) {
|
||||
Trace.println(CG);
|
||||
System.err.println(CG);
|
||||
|
||||
for (Iterator x = CG.iterator(); x.hasNext();) {
|
||||
CGNode N = (CGNode) x.next();
|
||||
Trace.println("\nIR of node " + N);
|
||||
System.err.println(("\nIR of node " + N));
|
||||
IR ir = N.getIR();
|
||||
if (ir != null) {
|
||||
Trace.println(ir);
|
||||
System.err.println(ir);
|
||||
} else {
|
||||
Trace.println("no IR!");
|
||||
System.err.println("no IR!");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -83,9 +89,9 @@ public class Util {
|
|||
for (Iterator x = PA.getPointerKeys().iterator(); x.hasNext();) {
|
||||
PointerKey n = (PointerKey) x.next();
|
||||
try {
|
||||
Trace.println(n + " --> " + PA.getPointsToSet(n));
|
||||
System.err.println((n + " --> " + PA.getPointsToSet(n)));
|
||||
} catch (Throwable e) {
|
||||
Trace.println("error computing set for " + n);
|
||||
System.err.println(("error computing set for " + n));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,7 +10,10 @@
|
|||
*****************************************************************************/
|
||||
package com.ibm.wala.cast.ipa.cha;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import com.ibm.wala.classLoader.ClassLoaderFactory;
|
||||
import com.ibm.wala.classLoader.IClass;
|
||||
|
|
|
@ -2,7 +2,17 @@ package com.ibm.wala.cast.ipa.modref;
|
|||
|
||||
import java.util.Collection;
|
||||
|
||||
import com.ibm.wala.cast.ir.ssa.*;
|
||||
import com.ibm.wala.cast.ir.ssa.AstAssertInstruction;
|
||||
import com.ibm.wala.cast.ir.ssa.AstEchoInstruction;
|
||||
import com.ibm.wala.cast.ir.ssa.AstGlobalRead;
|
||||
import com.ibm.wala.cast.ir.ssa.AstGlobalWrite;
|
||||
import com.ibm.wala.cast.ir.ssa.AstInstructionVisitor;
|
||||
import com.ibm.wala.cast.ir.ssa.AstIsDefinedInstruction;
|
||||
import com.ibm.wala.cast.ir.ssa.AstLexicalRead;
|
||||
import com.ibm.wala.cast.ir.ssa.AstLexicalWrite;
|
||||
import com.ibm.wala.cast.ir.ssa.EachElementGetInstruction;
|
||||
import com.ibm.wala.cast.ir.ssa.EachElementHasNextInstruction;
|
||||
import com.ibm.wala.cast.ir.ssa.NonExceptingThrowInstruction;
|
||||
import com.ibm.wala.ipa.callgraph.CGNode;
|
||||
import com.ibm.wala.ipa.callgraph.propagation.PointerAnalysis;
|
||||
import com.ibm.wala.ipa.callgraph.propagation.PointerKey;
|
||||
|
|
|
@ -10,7 +10,17 @@
|
|||
*****************************************************************************/
|
||||
package com.ibm.wala.cast.ir.cfg;
|
||||
|
||||
import com.ibm.wala.cast.ir.ssa.*;
|
||||
import com.ibm.wala.cast.ir.ssa.AstAssertInstruction;
|
||||
import com.ibm.wala.cast.ir.ssa.AstEchoInstruction;
|
||||
import com.ibm.wala.cast.ir.ssa.AstGlobalRead;
|
||||
import com.ibm.wala.cast.ir.ssa.AstGlobalWrite;
|
||||
import com.ibm.wala.cast.ir.ssa.AstInstructionVisitor;
|
||||
import com.ibm.wala.cast.ir.ssa.AstIsDefinedInstruction;
|
||||
import com.ibm.wala.cast.ir.ssa.AstLexicalRead;
|
||||
import com.ibm.wala.cast.ir.ssa.AstLexicalWrite;
|
||||
import com.ibm.wala.cast.ir.ssa.EachElementGetInstruction;
|
||||
import com.ibm.wala.cast.ir.ssa.EachElementHasNextInstruction;
|
||||
import com.ibm.wala.cast.ir.ssa.NonExceptingThrowInstruction;
|
||||
import com.ibm.wala.cfg.InducedCFG;
|
||||
import com.ibm.wala.classLoader.IMethod;
|
||||
import com.ibm.wala.ipa.callgraph.Context;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package com.ibm.wala.cast.ir.ssa;
|
||||
|
||||
import com.ibm.wala.classLoader.*;
|
||||
import com.ibm.wala.ssa.*;
|
||||
import com.ibm.wala.classLoader.CallSiteReference;
|
||||
import com.ibm.wala.ssa.SSAAbstractInvokeInstruction;
|
||||
|
||||
abstract class MultiReturnValueInvokeInstruction
|
||||
extends SSAAbstractInvokeInstruction
|
||||
|
|
|
@ -30,7 +30,6 @@ import com.ibm.wala.ssa.IR.SSA2LocalMap;
|
|||
import com.ibm.wala.util.collections.HashMapFactory;
|
||||
import com.ibm.wala.util.collections.HashSetFactory;
|
||||
import com.ibm.wala.util.debug.Assertions;
|
||||
import com.ibm.wala.util.debug.Trace;
|
||||
import com.ibm.wala.util.intset.BitVector;
|
||||
import com.ibm.wala.util.intset.BitVectorIntSet;
|
||||
import com.ibm.wala.util.intset.IntSet;
|
||||
|
@ -137,7 +136,7 @@ public class SSAConversion extends AbstractSSAConversion {
|
|||
|
||||
private CopyPropagationRecord(int instructionIndex, int lhs, int rhs) {
|
||||
if (DEBUG_UNDO)
|
||||
Trace.println("new copy record for instruction #" + instructionIndex + ", rhs value is " + rhs);
|
||||
System.err.println(("new copy record for instruction #" + instructionIndex + ", rhs value is " + rhs));
|
||||
this.lhs = lhs;
|
||||
this.rhs = rhs;
|
||||
this.instructionIndex = instructionIndex;
|
||||
|
@ -145,14 +144,14 @@ public class SSAConversion extends AbstractSSAConversion {
|
|||
|
||||
private void addChild(CopyPropagationRecord rec) {
|
||||
if (DEBUG_UNDO)
|
||||
Trace.println("(" + rec.instructionIndex + "," + rec.rhs + ") is a child of (" + instructionIndex + "," + rhs + ")");
|
||||
System.err.println(("(" + rec.instructionIndex + "," + rec.rhs + ") is a child of (" + instructionIndex + "," + rhs + ")"));
|
||||
childRecords.add(rec);
|
||||
}
|
||||
|
||||
private void addUse(int instructionIndex, int use) {
|
||||
if (DEBUG_UNDO)
|
||||
Trace.println("propagated use of (" + this.instructionIndex + "," + this.rhs + ") at use #" + use + " of instruction #"
|
||||
+ instructionIndex);
|
||||
System.err.println(("propagated use of (" + this.instructionIndex + "," + this.rhs + ") at use #" + use + " of instruction #"
|
||||
+ instructionIndex));
|
||||
UseRecord rec = new UseRecord(instructionIndex, use);
|
||||
copyPropagationMap.put(rec, this);
|
||||
renamedUses.add(rec);
|
||||
|
@ -183,7 +182,7 @@ public class SSAConversion extends AbstractSSAConversion {
|
|||
instructions[instructionIndex] = new AssignInstruction(lhs, rhs);
|
||||
|
||||
if (DEBUG_UNDO)
|
||||
Trace.println("recreating assignment at " + instructionIndex + " as " + lhs + " = " + rhs);
|
||||
System.err.println(("recreating assignment at " + instructionIndex + " as " + lhs + " = " + rhs));
|
||||
|
||||
for (Iterator<Object> uses = renamedUses.iterator(); uses.hasNext();) {
|
||||
Object x = uses.next();
|
||||
|
@ -193,7 +192,7 @@ public class SSAConversion extends AbstractSSAConversion {
|
|||
SSAInstruction inst = instructions[idx];
|
||||
|
||||
if (DEBUG_UNDO)
|
||||
Trace.println("Changing use #" + use.useNumber + " of inst #" + idx + " to val " + lhs);
|
||||
System.err.println(("Changing use #" + use.useNumber + " of inst #" + idx + " to val " + lhs));
|
||||
|
||||
if (use.useNumber >= 0) {
|
||||
instructions[idx] = undo(inst, use.useNumber, lhs);
|
||||
|
@ -249,7 +248,7 @@ public class SSAConversion extends AbstractSSAConversion {
|
|||
private void undoCopyPropagation(int instructionIndex, int useNumber) {
|
||||
|
||||
if (DEBUG_UNDO)
|
||||
Trace.println("undoing for use #" + useNumber + " of inst #" + instructionIndex);
|
||||
System.err.println(("undoing for use #" + useNumber + " of inst #" + instructionIndex));
|
||||
|
||||
UseRecord use = new UseRecord(instructionIndex, useNumber);
|
||||
if (copyPropagationMap.containsKey(use)) {
|
||||
|
@ -328,7 +327,7 @@ public class SSAConversion extends AbstractSSAConversion {
|
|||
SSAPhiInstruction phi = new SSAPhiInstruction(value, params);
|
||||
|
||||
if (DEBUG)
|
||||
Trace.println("Placing " + phi + " at " + Y);
|
||||
System.err.println(("Placing " + phi + " at " + Y));
|
||||
|
||||
addPhi(Y, phi);
|
||||
}
|
||||
|
@ -472,7 +471,7 @@ public class SSAConversion extends AbstractSSAConversion {
|
|||
this.liveness = LiveAnalysis.perform(CFG, symtab, v);
|
||||
|
||||
if (DEBUG) {
|
||||
Trace.println(liveness);
|
||||
System.err.println(liveness);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -544,16 +543,16 @@ public class SSAConversion extends AbstractSSAConversion {
|
|||
super.perform();
|
||||
|
||||
if (DUMP) {
|
||||
Trace.println(ir);
|
||||
System.err.println(ir);
|
||||
if (lexicalInfo != null) {
|
||||
for (int i = 0; i < instructions.length; i++) {
|
||||
int[] lexicalUses = lexicalInfo.getExposedUses(i);
|
||||
if (lexicalUses != null) {
|
||||
Trace.print("extra uses for " + instructions[i] + ": ");
|
||||
System.err.print(("extra uses for " + instructions[i] + ": "));
|
||||
for (int j = 0; j < lexicalUses.length; j++) {
|
||||
Trace.print(new Integer(lexicalUses[j]).toString() + " ");
|
||||
System.err.print((new Integer(lexicalUses[j]).toString() + " "));
|
||||
}
|
||||
Trace.println("");
|
||||
System.err.println("");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -593,11 +592,11 @@ public class SSAConversion extends AbstractSSAConversion {
|
|||
public static SSA2LocalMap convert(AstMethod M, final AstIR ir, SSAOptions options, final IntSet values) {
|
||||
try {
|
||||
if (DEBUG) {
|
||||
Trace.println("starting conversion for " + values);
|
||||
Trace.println(ir);
|
||||
System.err.println(("starting conversion for " + values));
|
||||
System.err.println(ir);
|
||||
}
|
||||
if (DEBUG_UNDO)
|
||||
Trace.println(">>> starting " + ir.getMethod());
|
||||
System.err.println((">>> starting " + ir.getMethod()));
|
||||
SSAConversion ssa = new SSAConversion(M, ir, options) {
|
||||
final int limit = ir.getSymbolTable().getMaxValueNumber();
|
||||
|
||||
|
@ -607,15 +606,15 @@ public class SSAConversion extends AbstractSSAConversion {
|
|||
};
|
||||
ssa.perform();
|
||||
if (DEBUG_UNDO)
|
||||
Trace.println("<<< done " + ir.getMethod());
|
||||
System.err.println(("<<< done " + ir.getMethod()));
|
||||
return ssa.getComputedLocalMap();
|
||||
} catch (RuntimeException e) {
|
||||
Trace.println("exception " + e + " while converting:");
|
||||
Trace.println(ir);
|
||||
System.err.println(("exception " + e + " while converting:"));
|
||||
System.err.println(ir);
|
||||
throw e;
|
||||
} catch (Error e) {
|
||||
Trace.println("error " + e + " while converting:");
|
||||
Trace.println(ir);
|
||||
System.err.println(("error " + e + " while converting:"));
|
||||
System.err.println(ir);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,15 +10,45 @@
|
|||
*****************************************************************************/
|
||||
package com.ibm.wala.cast.ir.translator;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.Stack;
|
||||
|
||||
import com.ibm.wala.cast.ir.ssa.*;
|
||||
import com.ibm.wala.cast.ir.ssa.AssignInstruction;
|
||||
import com.ibm.wala.cast.ir.ssa.AstAssertInstruction;
|
||||
import com.ibm.wala.cast.ir.ssa.AstConstants;
|
||||
import com.ibm.wala.cast.ir.ssa.AstEchoInstruction;
|
||||
import com.ibm.wala.cast.ir.ssa.AstGlobalRead;
|
||||
import com.ibm.wala.cast.ir.ssa.AstGlobalWrite;
|
||||
import com.ibm.wala.cast.ir.ssa.AstIsDefinedInstruction;
|
||||
import com.ibm.wala.cast.ir.ssa.AstLexicalAccess;
|
||||
import com.ibm.wala.cast.ir.ssa.AstLexicalRead;
|
||||
import com.ibm.wala.cast.ir.ssa.AstLexicalWrite;
|
||||
import com.ibm.wala.cast.ir.ssa.EachElementGetInstruction;
|
||||
import com.ibm.wala.cast.ir.ssa.EachElementHasNextInstruction;
|
||||
import com.ibm.wala.cast.ir.ssa.AstLexicalAccess.Access;
|
||||
import com.ibm.wala.cast.loader.AstMethod.DebuggingInformation;
|
||||
import com.ibm.wala.cast.loader.AstMethod.LexicalInformation;
|
||||
import com.ibm.wala.cast.tree.*;
|
||||
import com.ibm.wala.cast.tree.CAstControlFlowMap;
|
||||
import com.ibm.wala.cast.tree.CAstEntity;
|
||||
import com.ibm.wala.cast.tree.CAstNode;
|
||||
import com.ibm.wala.cast.tree.CAstSourcePositionMap;
|
||||
import com.ibm.wala.cast.tree.CAstSymbol;
|
||||
import com.ibm.wala.cast.tree.CAstType;
|
||||
import com.ibm.wala.cast.tree.CAstSourcePositionMap.Position;
|
||||
import com.ibm.wala.cast.tree.impl.*;
|
||||
import com.ibm.wala.cast.tree.impl.CAstCloner;
|
||||
import com.ibm.wala.cast.tree.impl.CAstImpl;
|
||||
import com.ibm.wala.cast.tree.impl.CAstOperator;
|
||||
import com.ibm.wala.cast.tree.impl.CAstRewriter;
|
||||
import com.ibm.wala.cast.tree.impl.CAstSymbolImpl;
|
||||
import com.ibm.wala.cast.tree.impl.CAstSymbolImplBase;
|
||||
import com.ibm.wala.cast.tree.visit.CAstVisitor;
|
||||
import com.ibm.wala.cast.types.AstTypeReference;
|
||||
import com.ibm.wala.cast.util.CAstPrinter;
|
||||
|
@ -32,14 +62,18 @@ import com.ibm.wala.shrikeBT.IBinaryOpInstruction;
|
|||
import com.ibm.wala.shrikeBT.IConditionalBranchInstruction;
|
||||
import com.ibm.wala.shrikeBT.IUnaryOpInstruction;
|
||||
import com.ibm.wala.shrikeBT.ShiftInstruction;
|
||||
import com.ibm.wala.ssa.*;
|
||||
import com.ibm.wala.ssa.SSAAbstractInvokeInstruction;
|
||||
import com.ibm.wala.ssa.SSAGetCaughtExceptionInstruction;
|
||||
import com.ibm.wala.ssa.SSAInstruction;
|
||||
import com.ibm.wala.ssa.SSAInstructionFactory;
|
||||
import com.ibm.wala.ssa.SSALoadClassInstruction;
|
||||
import com.ibm.wala.ssa.SymbolTable;
|
||||
import com.ibm.wala.types.FieldReference;
|
||||
import com.ibm.wala.types.TypeName;
|
||||
import com.ibm.wala.types.TypeReference;
|
||||
import com.ibm.wala.util.collections.HashSetFactory;
|
||||
import com.ibm.wala.util.collections.Pair;
|
||||
import com.ibm.wala.util.debug.Assertions;
|
||||
import com.ibm.wala.util.debug.Trace;
|
||||
import com.ibm.wala.util.graph.INodeWithNumber;
|
||||
import com.ibm.wala.util.graph.impl.SparseNumberedGraph;
|
||||
import com.ibm.wala.util.intset.IntSet;
|
||||
|
@ -632,10 +666,10 @@ public abstract class AstTranslator extends CAstVisitor implements ArrayOpHandle
|
|||
blocks.add(currentBlock);
|
||||
|
||||
if (DEBUG_CFG)
|
||||
Trace.println("adding new block (node) " + currentBlock);
|
||||
System.err.println(("adding new block (node) " + currentBlock));
|
||||
if (fallThruFromPrior) {
|
||||
if (DEBUG_CFG)
|
||||
Trace.println("adding fall-thru edge " + previous + " --> " + currentBlock);
|
||||
System.err.println(("adding fall-thru edge " + previous + " --> " + currentBlock));
|
||||
addEdge(previous, currentBlock);
|
||||
} else {
|
||||
deadBlocks.add(currentBlock);
|
||||
|
@ -719,7 +753,7 @@ public abstract class AstTranslator extends CAstVisitor implements ArrayOpHandle
|
|||
|
||||
public void addPreNode(CAstNode n, UnwindState context) {
|
||||
if (DEBUG_CFG)
|
||||
Trace.println("adding pre-node " + n);
|
||||
System.err.println(("adding pre-node " + n));
|
||||
nodeToBlock.put(n, currentBlock);
|
||||
deadBlocks.remove(currentBlock);
|
||||
if (context != null)
|
||||
|
@ -739,7 +773,7 @@ public abstract class AstTranslator extends CAstVisitor implements ArrayOpHandle
|
|||
} else if (nodeToBlock.containsKey(dst)) {
|
||||
PreBasicBlock target = nodeToBlock.get(dst);
|
||||
if (DEBUG_CFG)
|
||||
Trace.println("adding pre-edge " + src + " --> " + dst);
|
||||
System.err.println(("adding pre-edge " + src + " --> " + dst));
|
||||
if (unwind == null) {
|
||||
addEdge(src, target);
|
||||
} else {
|
||||
|
@ -747,7 +781,7 @@ public abstract class AstTranslator extends CAstVisitor implements ArrayOpHandle
|
|||
}
|
||||
} else {
|
||||
if (DEBUG_CFG)
|
||||
Trace.println("adding delayed pre-edge " + src + " --> " + dst);
|
||||
System.err.println(("adding delayed pre-edge " + src + " --> " + dst));
|
||||
addDelayedEdge(src, dst, exception);
|
||||
}
|
||||
}
|
||||
|
@ -806,7 +840,7 @@ public abstract class AstTranslator extends CAstVisitor implements ArrayOpHandle
|
|||
}
|
||||
|
||||
if (DEBUG_CFG) {
|
||||
Trace.println("adding " + n + " at " + inst + " to " + currentBlock);
|
||||
System.err.println(("adding " + n + " at " + inst + " to " + currentBlock));
|
||||
}
|
||||
|
||||
currentBlock.instructions().add(n);
|
||||
|
@ -843,10 +877,10 @@ public abstract class AstTranslator extends CAstVisitor implements ArrayOpHandle
|
|||
}
|
||||
|
||||
if (DEBUG_CFG)
|
||||
Trace.println("added " + blocks.get(i) + " to final CFG as " + getNumber(blocks.get(i)));
|
||||
System.err.println(("added " + blocks.get(i) + " to final CFG as " + getNumber(blocks.get(i))));
|
||||
}
|
||||
if (DEBUG_CFG)
|
||||
Trace.println(getMaxNumber() + " blocks total");
|
||||
System.err.println((getMaxNumber() + " blocks total"));
|
||||
|
||||
init();
|
||||
|
||||
|
@ -856,13 +890,13 @@ public abstract class AstTranslator extends CAstVisitor implements ArrayOpHandle
|
|||
PreBasicBlock dst = (PreBasicBlock) j.next();
|
||||
if (isCatchBlock(dst.getNumber()) || (dst.isExitBlock() && icfg.exceptionalToExit.contains(src))) {
|
||||
if (DEBUG_CFG)
|
||||
Trace.println("exceptonal edge " + src + " -> " + dst);
|
||||
System.err.println(("exceptonal edge " + src + " -> " + dst));
|
||||
addExceptionalEdge(src, dst);
|
||||
}
|
||||
|
||||
if (dst.isExitBlock() ? icfg.normalToExit.contains(src) : !isCatchBlock(dst.getNumber())) {
|
||||
if (DEBUG_CFG)
|
||||
Trace.println("normal edge " + src + " -> " + dst);
|
||||
System.err.println(("normal edge " + src + " -> " + dst));
|
||||
addNormalEdge(src, dst);
|
||||
}
|
||||
}
|
||||
|
@ -1122,7 +1156,7 @@ public abstract class AstTranslator extends CAstVisitor implements ArrayOpHandle
|
|||
} else if (o == CAstControlFlowMap.SWITCH_DEFAULT) {
|
||||
return getUnderlyingSymtab().getConstant("__default label");
|
||||
} else {
|
||||
Trace.println("cannot handle constant " + o);
|
||||
System.err.println(("cannot handle constant " + o));
|
||||
Assertions.UNREACHABLE();
|
||||
return -1;
|
||||
}
|
||||
|
@ -2007,8 +2041,8 @@ public abstract class AstTranslator extends CAstVisitor implements ArrayOpHandle
|
|||
scopingParents = parents.toArray(new String[parents.size()]);
|
||||
|
||||
if (DEBUG_LEXICAL) {
|
||||
Trace.println("scoping parents of " + scope.getEntity());
|
||||
Trace.println(parents.toString());
|
||||
System.err.println(("scoping parents of " + scope.getEntity()));
|
||||
System.err.println(parents.toString());
|
||||
}
|
||||
|
||||
} else {
|
||||
|
@ -2016,12 +2050,12 @@ public abstract class AstTranslator extends CAstVisitor implements ArrayOpHandle
|
|||
}
|
||||
|
||||
if (DEBUG_NAMES) {
|
||||
Trace.println("lexical uses of " + scope.getEntity());
|
||||
System.err.println(("lexical uses of " + scope.getEntity()));
|
||||
for (int i = 0; i < instructionLexicalUses.length; i++) {
|
||||
if (instructionLexicalUses[i] != null) {
|
||||
Trace.println(" lexical uses of " + instrs[i]);
|
||||
System.err.println((" lexical uses of " + instrs[i]));
|
||||
for (int j = 0; j < instructionLexicalUses[i].length; j++) {
|
||||
Trace.println(" " + this.exposedNames[j].fst + ": " + instructionLexicalUses[i][j]);
|
||||
System.err.println((" " + this.exposedNames[j].fst + ": " + instructionLexicalUses[i][j]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2088,7 +2122,7 @@ public abstract class AstTranslator extends CAstVisitor implements ArrayOpHandle
|
|||
if (results.containsKey(n))
|
||||
return results.get(n).intValue();
|
||||
else {
|
||||
Trace.println("no value for " + n.getKind());
|
||||
System.err.println(("no value for " + n.getKind()));
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
@ -2221,7 +2255,7 @@ public abstract class AstTranslator extends CAstVisitor implements ArrayOpHandle
|
|||
String[] map = new String[scopes.iterator().next().size() + 1];
|
||||
|
||||
if (DEBUG_NAMES) {
|
||||
Trace.println("names array of size " + map.length);
|
||||
System.err.println(("names array of size " + map.length));
|
||||
}
|
||||
|
||||
for (Iterator<Scope> S = scopes.iterator(); S.hasNext();) {
|
||||
|
@ -2244,7 +2278,7 @@ public abstract class AstTranslator extends CAstVisitor implements ArrayOpHandle
|
|||
map[v.valueNumber()] = nm;
|
||||
|
||||
if (DEBUG_NAMES) {
|
||||
Trace.println("mapping name " + nm + " to " + v.valueNumber());
|
||||
System.err.println(("mapping name " + nm + " to " + v.valueNumber()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2293,7 +2327,7 @@ public abstract class AstTranslator extends CAstVisitor implements ArrayOpHandle
|
|||
|
||||
protected boolean enterEntity(final CAstEntity n, Context context, CAstVisitor visitor) {
|
||||
if (DEBUG_TOP)
|
||||
Trace.println("translating " + n.getName());
|
||||
System.err.println(("translating " + n.getName()));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -3483,8 +3517,8 @@ public abstract class AstTranslator extends CAstVisitor implements ArrayOpHandle
|
|||
CAstEntity included = getIncludedEntity(n);
|
||||
|
||||
if (included == null) {
|
||||
Trace.println("cannot find include for " + CAstPrinter.print(n));
|
||||
Trace.println("from:\n" + namedEntityResolver);
|
||||
System.err.println(("cannot find include for " + CAstPrinter.print(n)));
|
||||
System.err.println(("from:\n" + namedEntityResolver));
|
||||
} else {
|
||||
final boolean isMacroExpansion = (included.getKind() == CAstEntity.MACRO_ENTITY);
|
||||
|
||||
|
@ -3522,7 +3556,7 @@ public abstract class AstTranslator extends CAstVisitor implements ArrayOpHandle
|
|||
}).rewrite(included);
|
||||
|
||||
if (copy.getAST() == null) {
|
||||
Trace.println(copy.getName() + " has no AST");
|
||||
System.err.println((copy.getName() + " has no AST"));
|
||||
|
||||
} else {
|
||||
visit(copy.getAST(), new DelegatingContext(wc) {
|
||||
|
@ -3610,7 +3644,7 @@ public abstract class AstTranslator extends CAstVisitor implements ArrayOpHandle
|
|||
|
||||
public void translate(final CAstEntity N, final String nm) {
|
||||
if (DEBUG_TOP)
|
||||
Trace.println("translating " + nm);
|
||||
System.err.println(("translating " + nm));
|
||||
// this.inlinedSourceMap = inlinedSourceMap;
|
||||
walkEntities(N, new DefaultContext(this, N, nm));
|
||||
}
|
||||
|
|
|
@ -18,8 +18,8 @@ import com.ibm.wala.classLoader.IClass;
|
|||
import com.ibm.wala.classLoader.IClassLoader;
|
||||
import com.ibm.wala.classLoader.IField;
|
||||
import com.ibm.wala.classLoader.IMethod;
|
||||
import com.ibm.wala.ipa.cha.IClassHierarchy;
|
||||
import com.ibm.wala.ipa.cha.ClassHierarchyException;
|
||||
import com.ibm.wala.ipa.cha.IClassHierarchy;
|
||||
import com.ibm.wala.types.FieldReference;
|
||||
import com.ibm.wala.types.Selector;
|
||||
import com.ibm.wala.types.TypeName;
|
||||
|
|
|
@ -75,11 +75,11 @@ public abstract class CAstAbstractModuleLoader extends CAstAbstractLoader {
|
|||
topLevelEntities.add(Pair.make(fileEntity, fn));
|
||||
}
|
||||
} catch (MalformedURLException e) {
|
||||
Trace.println("unpected problems with " + f);
|
||||
System.err.println(("unpected problems with " + f));
|
||||
e.printStackTrace(Trace.getTraceStream());
|
||||
Assertions.UNREACHABLE();
|
||||
} catch (RuntimeException e) {
|
||||
Trace.println("unpected problems with " + f);
|
||||
System.err.println(("unpected problems with " + f));
|
||||
e.printStackTrace(Trace.getTraceStream());
|
||||
}
|
||||
|
||||
|
@ -96,18 +96,18 @@ public abstract class CAstAbstractModuleLoader extends CAstAbstractLoader {
|
|||
CAstEntity fileEntity = xlatorToCAst.translateToCAst();
|
||||
|
||||
if (fileEntity != null) {
|
||||
Trace.println(CAstPrinter.print(fileEntity));
|
||||
System.err.println(CAstPrinter.print(fileEntity));
|
||||
|
||||
topLevelEntities.add(Pair.make(fileEntity, fileName));
|
||||
}
|
||||
|
||||
F.delete();
|
||||
} catch (IOException e) {
|
||||
Trace.println("unexpected problems with " + fileName);
|
||||
System.err.println(("unexpected problems with " + fileName));
|
||||
e.printStackTrace(Trace.getTraceStream());
|
||||
Assertions.UNREACHABLE();
|
||||
} catch (RuntimeException e) {
|
||||
Trace.println("unexpected problems with " + fileName);
|
||||
System.err.println(("unexpected problems with " + fileName));
|
||||
e.printStackTrace(Trace.getTraceStream());
|
||||
}
|
||||
}
|
||||
|
@ -138,7 +138,7 @@ public abstract class CAstAbstractModuleLoader extends CAstAbstractLoader {
|
|||
for (Iterator ts = types.keySet().iterator(); ts.hasNext();) {
|
||||
TypeName tn = (TypeName) ts.next();
|
||||
try {
|
||||
Trace.println("found type " + tn + " : " + types.get(tn) + " < " + ((IClass) types.get(tn)).getSuperclass());
|
||||
System.err.println(("found type " + tn + " : " + types.get(tn) + " < " + ((IClass) types.get(tn)).getSuperclass()));
|
||||
} catch (Exception e) {
|
||||
System.err.println(e);
|
||||
}
|
||||
|
|
|
@ -13,7 +13,9 @@
|
|||
*/
|
||||
package com.ibm.wala.cast.tree;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public interface CAstType {
|
||||
/**
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
*/
|
||||
package com.ibm.wala.cast.tree;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.Iterator;
|
||||
|
||||
public interface CAstTypeDictionary/*<ASTType>*/ extends Iterable {
|
||||
|
||||
|
|
|
@ -30,7 +30,6 @@ import com.ibm.wala.util.collections.HashSetFactory;
|
|||
import com.ibm.wala.util.collections.IteratorPlusOne;
|
||||
import com.ibm.wala.util.collections.Pair;
|
||||
import com.ibm.wala.util.debug.Assertions;
|
||||
import com.ibm.wala.util.debug.Trace;
|
||||
|
||||
public abstract class CAstRewriter<C extends CAstRewriter.RewriteContext<K>, K extends CAstRewriter.CopyKey<K>> {
|
||||
|
||||
|
@ -102,7 +101,7 @@ public abstract class CAstRewriter<C extends CAstRewriter.RewriteContext<K>, K e
|
|||
newMap.map(newSource, newSource);
|
||||
|
||||
if (DEBUG) {
|
||||
Trace.println("\n\nlooking at " + key + ":" + CAstPrinter.print(oldSource));
|
||||
System.err.println(("\n\nlooking at " + key + ":" + CAstPrinter.print(oldSource)));
|
||||
}
|
||||
|
||||
if (oldSources.contains(oldSource)) {
|
||||
|
@ -116,7 +115,7 @@ public abstract class CAstRewriter<C extends CAstRewriter.RewriteContext<K>, K e
|
|||
CAstNode oldTarget = orig.getTarget(oldSource, label);
|
||||
|
||||
if (DEBUG) {
|
||||
Trace.println("old: " + label + " --> " + CAstPrinter.print(oldTarget));
|
||||
System.err.println(("old: " + label + " --> " + CAstPrinter.print(oldTarget)));
|
||||
}
|
||||
|
||||
Pair targetKey;
|
||||
|
@ -145,8 +144,8 @@ public abstract class CAstRewriter<C extends CAstRewriter.RewriteContext<K>, K e
|
|||
}
|
||||
|
||||
if (DEBUG) {
|
||||
Trace.println("mapping:old: " + CAstPrinter.print(oldSource) + "-- " + label + " --> " + CAstPrinter.print(oldTarget));
|
||||
Trace.println("mapping:new: " + CAstPrinter.print(newSource) + "-- " + label + " --> " + CAstPrinter.print(newTarget));
|
||||
System.err.println(("mapping:old: " + CAstPrinter.print(oldSource) + "-- " + label + " --> " + CAstPrinter.print(oldTarget)));
|
||||
System.err.println(("mapping:new: " + CAstPrinter.print(newSource) + "-- " + label + " --> " + CAstPrinter.print(newTarget)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -272,7 +271,7 @@ public abstract class CAstRewriter<C extends CAstRewriter.RewriteContext<K>, K e
|
|||
|
||||
public CAstEntity rewrite(final CAstEntity root) {
|
||||
|
||||
Trace.println("Rewriting " + root.getName());
|
||||
System.err.println(("Rewriting " + root.getName()));
|
||||
|
||||
if (root.getAST() != null) {
|
||||
final Rewrite rewrite = rewrite(root.getAST(), root.getControlFlow(), root.getSourceMap(), root.getNodeTypeMap(), root
|
||||
|
|
|
@ -13,13 +13,14 @@
|
|||
*/
|
||||
package com.ibm.wala.cast.tree.impl;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
|
||||
import com.ibm.wala.cast.tree.CAstReference;
|
||||
import com.ibm.wala.cast.tree.CAstType;
|
||||
import com.ibm.wala.cast.tree.CAstTypeDictionary;
|
||||
import com.ibm.wala.util.collections.HashMapFactory;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class CAstTypeDictionaryImpl implements CAstTypeDictionary {
|
||||
protected final Map fMap = HashMapFactory.make();
|
||||
|
||||
|
|
|
@ -19,7 +19,6 @@ import com.ibm.wala.cast.tree.CAstNode;
|
|||
import com.ibm.wala.cast.util.CAstPrinter;
|
||||
import com.ibm.wala.util.collections.HashMapFactory;
|
||||
import com.ibm.wala.util.debug.Assertions;
|
||||
import com.ibm.wala.util.debug.Trace;
|
||||
|
||||
/**
|
||||
* @author Igor Peshansky
|
||||
|
@ -201,7 +200,7 @@ public abstract class CAstVisitor {
|
|||
}
|
||||
default: {
|
||||
if (!visitor.doVisitEntity(n, context, visitor)) {
|
||||
Trace.println("No handler for entity " + n.getName());
|
||||
System.err.println(("No handler for entity " + n.getName()));
|
||||
Assertions.UNREACHABLE("cannot handle entity of kind" + n.getKind());
|
||||
}
|
||||
}
|
||||
|
@ -818,7 +817,7 @@ public abstract class CAstVisitor {
|
|||
|
||||
default: {
|
||||
if (!visitor.doVisit(n, context, visitor)) {
|
||||
Trace.println("looking at unhandled " + n + "(" + NT + ")" + " of " + n.getClass());
|
||||
System.err.println(("looking at unhandled " + n + "(" + NT + ")" + " of " + n.getClass()));
|
||||
Assertions.UNREACHABLE("cannot handle node of kind " + NT);
|
||||
}
|
||||
}
|
||||
|
@ -902,7 +901,7 @@ public abstract class CAstVisitor {
|
|||
|
||||
default: {
|
||||
if (!visitor.doVisitAssignNodes(n, context, v, a, visitor)) {
|
||||
Trace.println("cannot handle assign to kind " + n.getKind());
|
||||
System.err.println(("cannot handle assign to kind " + n.getKind()));
|
||||
throw new UnsupportedOperationException(
|
||||
"cannot handle assignment: " +
|
||||
CAstPrinter.print(a, context.top().getSourceMap()));
|
||||
|
|
|
@ -10,7 +10,11 @@
|
|||
*****************************************************************************/
|
||||
package com.ibm.wala.cast.types;
|
||||
|
||||
import com.ibm.wala.types.*;
|
||||
import com.ibm.wala.types.Descriptor;
|
||||
import com.ibm.wala.types.MethodReference;
|
||||
import com.ibm.wala.types.Selector;
|
||||
import com.ibm.wala.types.TypeName;
|
||||
import com.ibm.wala.types.TypeReference;
|
||||
import com.ibm.wala.util.strings.Atom;
|
||||
|
||||
public class AstMethodReference {
|
||||
|
|
|
@ -21,7 +21,6 @@ import java.util.TreeMap;
|
|||
import com.ibm.wala.cast.tree.CAstNode;
|
||||
import com.ibm.wala.util.collections.HashMapFactory;
|
||||
import com.ibm.wala.util.debug.Assertions;
|
||||
import com.ibm.wala.util.debug.Trace;
|
||||
|
||||
public class CAstPattern {
|
||||
private static boolean DEBUG_PARSER = false;
|
||||
|
@ -192,7 +191,7 @@ public class CAstPattern {
|
|||
if (cs[j].kind == CHILD_KIND) {
|
||||
|
||||
if (DEBUG_MATCH) {
|
||||
Trace.println("* matches " + CAstPrinter.print(tree.getChild(i)));
|
||||
System.err.println(("* matches " + CAstPrinter.print(tree.getChild(i))));
|
||||
}
|
||||
|
||||
if (s != null && cs[j].name != null) {
|
||||
|
@ -204,7 +203,7 @@ public class CAstPattern {
|
|||
if (tryMatchChildren(tree, i, cs, j + 1, s)) {
|
||||
|
||||
if (DEBUG_MATCH) {
|
||||
Trace.println("** matches nothing");
|
||||
System.err.println("** matches nothing");
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -212,7 +211,7 @@ public class CAstPattern {
|
|||
} else {
|
||||
|
||||
if (DEBUG_MATCH) {
|
||||
Trace.println("** matches " + CAstPrinter.print(tree.getChild(i)));
|
||||
System.err.println(("** matches " + CAstPrinter.print(tree.getChild(i))));
|
||||
}
|
||||
|
||||
if (s != null && cs[j].name != null) {
|
||||
|
@ -230,7 +229,7 @@ public class CAstPattern {
|
|||
}
|
||||
|
||||
if (DEBUG_MATCH) {
|
||||
Trace.println(cs[j] + " matches " + CAstPrinter.print(tree.getChild(i)));
|
||||
System.err.println((cs[j] + " matches " + CAstPrinter.print(tree.getChild(i))));
|
||||
}
|
||||
|
||||
return matchChildren(tree, i + 1, cs, j, s);
|
||||
|
@ -238,7 +237,7 @@ public class CAstPattern {
|
|||
} else {
|
||||
|
||||
if (DEBUG_MATCH) {
|
||||
Trace.println(cs[j] + " matches nothing");
|
||||
System.err.println((cs[j] + " matches nothing"));
|
||||
}
|
||||
|
||||
return matchChildren(tree, i, cs, j + 1, s);
|
||||
|
@ -248,7 +247,7 @@ public class CAstPattern {
|
|||
if (tryMatchChildren(tree, i, cs, j + 1, s)) {
|
||||
|
||||
if (DEBUG_MATCH) {
|
||||
Trace.println(cs[j] + " matches nothing");
|
||||
System.err.println((cs[j] + " matches nothing"));
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -257,7 +256,7 @@ public class CAstPattern {
|
|||
if (optionalPattern.tryMatch(tree.getChild(i), s)) {
|
||||
|
||||
if (DEBUG_MATCH) {
|
||||
Trace.println(cs[j] + " matches " + CAstPrinter.print(tree.getChild(i)));
|
||||
System.err.println((cs[j] + " matches " + CAstPrinter.print(tree.getChild(i))));
|
||||
}
|
||||
|
||||
return matchChildren(tree, i + 1, cs, j + 1, s);
|
||||
|
@ -274,7 +273,7 @@ public class CAstPattern {
|
|||
|
||||
public boolean match(CAstNode tree, Segments s) {
|
||||
if (DEBUG_MATCH) {
|
||||
Trace.println("matching " + this + " against " + CAstPrinter.print(tree));
|
||||
System.err.println(("matching " + this + " against " + CAstPrinter.print(tree)));
|
||||
}
|
||||
|
||||
if (kind == REFERENCE_PATTERN_KIND) {
|
||||
|
@ -292,7 +291,7 @@ public class CAstPattern {
|
|||
}
|
||||
|
||||
if (DEBUG_MATCH) {
|
||||
Trace.println("match failed (a)");
|
||||
System.err.println("match failed (a)");
|
||||
}
|
||||
return false;
|
||||
|
||||
|
@ -300,7 +299,7 @@ public class CAstPattern {
|
|||
if ((value == null) ? tree.getKind() != kind : (tree.getKind() != CAstNode.CONSTANT || !value.equals(tree.getValue()
|
||||
.toString()))) {
|
||||
if (DEBUG_MATCH) {
|
||||
Trace.println("match failed (b)");
|
||||
System.err.println("match failed (b)");
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -311,7 +310,7 @@ public class CAstPattern {
|
|||
|
||||
if (children == null || children.length == 0) {
|
||||
if (DEBUG_MATCH && tree.getChildCount() != 0) {
|
||||
Trace.println("match failed (c)");
|
||||
System.err.println("match failed (c)");
|
||||
}
|
||||
return tree.getChildCount() == 0;
|
||||
} else {
|
||||
|
@ -396,7 +395,7 @@ public class CAstPattern {
|
|||
|
||||
public CAstPattern parse() throws NoSuchFieldException, IllegalAccessException {
|
||||
if (DEBUG_PARSER) {
|
||||
Trace.println("parsing " + patternString.substring(start));
|
||||
System.err.println(("parsing " + patternString.substring(start)));
|
||||
}
|
||||
|
||||
String internalName = parseName(true);
|
||||
|
@ -441,7 +440,7 @@ public class CAstPattern {
|
|||
end += 2;
|
||||
|
||||
if (DEBUG_PARSER) {
|
||||
Trace.println("repeated pattern: " + children[0]);
|
||||
System.err.println(("repeated pattern: " + children[0]));
|
||||
}
|
||||
|
||||
result = new CAstPattern(name, REPEATED_PATTERN_KIND, children);
|
||||
|
@ -453,7 +452,7 @@ public class CAstPattern {
|
|||
end += 2;
|
||||
|
||||
if (DEBUG_PARSER) {
|
||||
Trace.println("optional pattern: " + children[0]);
|
||||
System.err.println(("optional pattern: " + children[0]));
|
||||
}
|
||||
|
||||
result = new CAstPattern(name, OPTIONAL_PATTERN_KIND, children);
|
||||
|
@ -476,7 +475,7 @@ public class CAstPattern {
|
|||
start = end + 1;
|
||||
|
||||
if (DEBUG_PARSER) {
|
||||
Trace.println("parsing children: " + patternString.substring(end));
|
||||
System.err.println(("parsing children: " + patternString.substring(end)));
|
||||
}
|
||||
|
||||
} while (patternString.charAt(end) == ',');
|
||||
|
|
|
@ -15,11 +15,11 @@ import java.io.IOException;
|
|||
import com.ibm.wala.classLoader.IClass;
|
||||
import com.ibm.wala.core.tests.util.TestConstants;
|
||||
import com.ibm.wala.core.tests.util.WalaTestCase;
|
||||
import com.ibm.wala.util.config.AnalysisScopeReader;
|
||||
import com.ibm.wala.ipa.callgraph.AnalysisScope;
|
||||
import com.ibm.wala.ipa.cha.ClassHierarchy;
|
||||
import com.ibm.wala.ipa.cha.ClassHierarchyException;
|
||||
import com.ibm.wala.types.TypeReference;
|
||||
import com.ibm.wala.util.config.AnalysisScopeReader;
|
||||
|
||||
/**
|
||||
* A test of support for source file mapping
|
||||
|
|
|
@ -47,7 +47,6 @@ import com.ibm.wala.demandpa.alg.refinepolicy.AlwaysRefineCGPolicy;
|
|||
import com.ibm.wala.demandpa.alg.refinepolicy.AlwaysRefineFieldsPolicy;
|
||||
import com.ibm.wala.demandpa.alg.refinepolicy.SinglePassRefinementPolicy;
|
||||
import com.ibm.wala.demandpa.alg.statemachine.StateMachineFactory;
|
||||
import com.ibm.wala.demandpa.driver.WalaUtil;
|
||||
import com.ibm.wala.demandpa.flowgraph.IFlowLabel;
|
||||
import com.ibm.wala.eclipse.util.CancelException;
|
||||
import com.ibm.wala.ipa.callgraph.CGNode;
|
||||
|
@ -61,7 +60,6 @@ public class ContextSensitiveTest extends AbstractPtrTest {
|
|||
|
||||
@Override
|
||||
protected void setUp() {
|
||||
WalaUtil.initializeTraceFile();
|
||||
}
|
||||
|
||||
public void testArraySet() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException {
|
||||
|
|
|
@ -39,7 +39,6 @@ package com.ibm.wala.core.tests.demandpa;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
import com.ibm.wala.demandpa.driver.WalaUtil;
|
||||
import com.ibm.wala.eclipse.util.CancelException;
|
||||
import com.ibm.wala.ipa.cha.ClassHierarchyException;
|
||||
|
||||
|
@ -47,7 +46,6 @@ public class NoRefinePtrTest extends AbstractPtrTest {
|
|||
|
||||
@Override
|
||||
protected void setUp() {
|
||||
WalaUtil.initializeTraceFile();
|
||||
}
|
||||
|
||||
public void testOnTheFlySimple() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException {
|
||||
|
|
|
@ -43,7 +43,6 @@ import com.ibm.wala.demandpa.alg.DemandRefinementPointsTo;
|
|||
import com.ibm.wala.demandpa.alg.refinepolicy.AlwaysRefineFieldsPolicy;
|
||||
import com.ibm.wala.demandpa.alg.refinepolicy.NeverRefineCGPolicy;
|
||||
import com.ibm.wala.demandpa.alg.refinepolicy.SinglePassRefinementPolicy;
|
||||
import com.ibm.wala.demandpa.driver.WalaUtil;
|
||||
import com.ibm.wala.eclipse.util.CancelException;
|
||||
import com.ibm.wala.ipa.cha.ClassHierarchyException;
|
||||
|
||||
|
@ -51,7 +50,6 @@ public class RefineFieldsPtrTest extends AbstractPtrTest {
|
|||
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
WalaUtil.initializeTraceFile();
|
||||
}
|
||||
|
||||
public void testNastyPtrs() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException {
|
||||
|
|
|
@ -26,7 +26,6 @@ import com.ibm.wala.ssa.SSAOptions;
|
|||
import com.ibm.wala.types.MethodReference;
|
||||
import com.ibm.wala.util.config.AnalysisScopeReader;
|
||||
import com.ibm.wala.util.debug.Assertions;
|
||||
import com.ibm.wala.util.debug.Trace;
|
||||
import com.ibm.wala.util.graph.GraphIntegrity;
|
||||
import com.ibm.wala.util.graph.GraphIntegrity.UnsoundGraphException;
|
||||
import com.ibm.wala.util.io.FileProvider;
|
||||
|
@ -66,7 +65,7 @@ public class CFGTest extends WalaTestCase {
|
|||
GraphIntegrity.check(cfg);
|
||||
} catch (UnsoundGraphException e) {
|
||||
e.printStackTrace();
|
||||
Trace.println(ir);
|
||||
System.err.println(ir);
|
||||
assertTrue(" failed cfg integrity check for " + methodSig, false);
|
||||
}
|
||||
|
||||
|
@ -74,8 +73,8 @@ public class CFGTest extends WalaTestCase {
|
|||
GraphIntegrity.check(cfg);
|
||||
} catch (UnsoundGraphException e) {
|
||||
e.printStackTrace();
|
||||
Trace.println(ir);
|
||||
Trace.println(cfg);
|
||||
System.err.println(ir);
|
||||
System.err.println(cfg);
|
||||
assertTrue(" failed 2-exit cfg integrity check for " + methodSig, false);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
|
|
@ -32,7 +32,6 @@ import com.ibm.wala.types.Selector;
|
|||
import com.ibm.wala.types.TypeReference;
|
||||
import com.ibm.wala.util.config.AnalysisScopeReader;
|
||||
import com.ibm.wala.util.debug.Assertions;
|
||||
import com.ibm.wala.util.debug.Trace;
|
||||
import com.ibm.wala.util.io.FileProvider;
|
||||
import com.ibm.wala.util.strings.Atom;
|
||||
import com.ibm.wala.util.strings.ImmutableByteArray;
|
||||
|
@ -110,7 +109,7 @@ public class LocalNamesTest extends WalaTestCase {
|
|||
if (instr != null) {
|
||||
String[] localNames = ir.getLocalNames(offsetIndex, instr.getDef());
|
||||
if (localNames != null && localNames.length > 0 && localNames[0] == null) {
|
||||
Trace.println(ir);
|
||||
System.err.println(ir);
|
||||
assertTrue(" getLocalNames() returned [null,...] for the def of instruction at offset " + offsetIndex + "\n\tinstr",
|
||||
false);
|
||||
}
|
||||
|
|
|
@ -67,7 +67,6 @@ import com.ibm.wala.ssa.IR;
|
|||
import com.ibm.wala.types.MethodReference;
|
||||
import com.ibm.wala.util.config.AnalysisScopeReader;
|
||||
import com.ibm.wala.util.debug.Assertions;
|
||||
import com.ibm.wala.util.debug.Trace;
|
||||
import com.ibm.wala.util.intset.OrdinalSet;
|
||||
|
||||
/**
|
||||
|
@ -82,7 +81,6 @@ public class CompareToZeroOneCFADriver {
|
|||
* @param args
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
WalaUtil.initializeTraceFile();
|
||||
// for (String testCase : TestInfo.ALL_TEST_CASES) {
|
||||
// runUnitTestCase(testCase);
|
||||
// }
|
||||
|
@ -92,8 +90,8 @@ public class CompareToZeroOneCFADriver {
|
|||
|
||||
@SuppressWarnings("unused")
|
||||
private static void runUnitTestCase(String mainClass) throws IllegalArgumentException, CancelException, IOException {
|
||||
Trace.println("=======---------------=============");
|
||||
Trace.println("ANALYZING " + mainClass + "\n\n");
|
||||
System.err.println("=======---------------=============");
|
||||
System.err.println(("ANALYZING " + mainClass + "\n\n"));
|
||||
// describe the "scope", what is the program we're analyzing
|
||||
AnalysisScope scope = CallGraphTestUtil.makeJ2SEAnalysisScope(TestInfo.SCOPE_FILE, CallGraphTestUtil.REGRESSION_EXCLUSIONS);
|
||||
Object warnings = new Object();
|
||||
|
@ -114,13 +112,13 @@ public class CompareToZeroOneCFADriver {
|
|||
|
||||
// run existing pointer analysis
|
||||
doTests(scope, cha, options);
|
||||
Trace.println("ALL FINE");
|
||||
System.err.println("ALL FINE");
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private static void runApplication(String appJar) throws IllegalArgumentException, CancelException, IOException {
|
||||
Trace.println("=======---------------=============");
|
||||
Trace.println("ANALYZING " + appJar + "\n\n");
|
||||
System.err.println("=======---------------=============");
|
||||
System.err.println(("ANALYZING " + appJar + "\n\n"));
|
||||
|
||||
AnalysisScope scope = AnalysisScopeReader.makeJavaBinaryAnalysisScope(appJar, new File(CallGraphTestUtil.REGRESSION_EXCLUSIONS));
|
||||
|
||||
|
@ -138,7 +136,7 @@ public class CompareToZeroOneCFADriver {
|
|||
Iterable<Entrypoint> entrypoints = com.ibm.wala.ipa.callgraph.impl.Util.makeMainEntrypoints(scope, cha);
|
||||
AnalysisOptions options = new AnalysisOptions(scope, entrypoints);
|
||||
doTests(scope, cha, options);
|
||||
Trace.println("ALL FINE");
|
||||
System.err.println("ALL FINE");
|
||||
}
|
||||
|
||||
private static void doTests(AnalysisScope scope, final ClassHierarchy cha, AnalysisOptions options) throws IllegalArgumentException, CancelException {
|
||||
|
@ -160,14 +158,14 @@ public class CompareToZeroOneCFADriver {
|
|||
void checkPointersInMethod(CGNode node) {
|
||||
// TODO remove this hack
|
||||
if (node.getMethod().getReference().toString().indexOf("clone()Ljava/lang/Object;") != -1) {
|
||||
Trace.println("SKIPPING " + node);
|
||||
System.err.println(("SKIPPING " + node));
|
||||
return;
|
||||
}
|
||||
CGNode oldNode = CallGraphMapUtil.mapCGNode(node, cg, oldCG);
|
||||
if (oldNode == null) {
|
||||
return;
|
||||
}
|
||||
Trace.println("METHOD " + node);
|
||||
System.err.println(("METHOD " + node));
|
||||
IR ir = node.getIR();
|
||||
TypeInference ti = TypeInference.make(ir, false);
|
||||
for (int i = 1; i <= ir.getSymbolTable().getMaxValueNumber(); i++) {
|
||||
|
@ -178,16 +176,16 @@ public class CompareToZeroOneCFADriver {
|
|||
LocalPointerKey oldPk = (LocalPointerKey) CallGraphMapUtil.mapPointerKey(pk, cg, oldCG, heapModel);
|
||||
Collection<InstanceKey> p2set = dmp.getPointsTo(pk);
|
||||
OrdinalSet<InstanceKey> otherP2Set = pa.getPointsToSet(oldPk);
|
||||
Trace.println("OLD POINTS-TO " + otherP2Set);
|
||||
System.err.println(("OLD POINTS-TO " + otherP2Set));
|
||||
for (InstanceKey key : otherP2Set) {
|
||||
if (knownBug(key)) {
|
||||
continue;
|
||||
}
|
||||
InstanceKey newKey = CallGraphMapUtil.mapInstKey(key, oldCG, cg, heapModel);
|
||||
if (!p2set.contains(newKey)) {
|
||||
Trace.println("BADNESS");
|
||||
Trace.println("pointer key " + pk);
|
||||
Trace.println("missing " + newKey);
|
||||
System.err.println("BADNESS");
|
||||
System.err.println(("pointer key " + pk));
|
||||
System.err.println(("missing " + newKey));
|
||||
Assertions.UNREACHABLE();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -64,7 +64,6 @@ import com.ibm.wala.ipa.callgraph.propagation.SSAPropagationCallGraphBuilder;
|
|||
import com.ibm.wala.ipa.cha.ClassHierarchy;
|
||||
import com.ibm.wala.ipa.cha.ClassHierarchyException;
|
||||
import com.ibm.wala.ssa.IR;
|
||||
import com.ibm.wala.util.debug.Trace;
|
||||
|
||||
/**
|
||||
* Driver that tests a pointer analysis results against the results of
|
||||
|
@ -79,7 +78,6 @@ public class TestAgainstSimpleDriver {
|
|||
|
||||
public static void main(String[] args) throws IllegalArgumentException, CancelException, IOException {
|
||||
|
||||
WalaUtil.initializeTraceFile();
|
||||
// for (String String : ALL_TEST_CASES) {
|
||||
// runAnalysisForString(String.mainClass, String.scopeFileName);
|
||||
// }
|
||||
|
@ -88,8 +86,8 @@ public class TestAgainstSimpleDriver {
|
|||
}
|
||||
|
||||
private static void runAnalysisForTestCase(String mainClass) throws IllegalArgumentException, CancelException, IOException {
|
||||
Trace.println("=======---------------=============");
|
||||
Trace.println("ANALYZING " + mainClass + "\n\n");
|
||||
System.err.println("=======---------------=============");
|
||||
System.err.println(("ANALYZING " + mainClass + "\n\n"));
|
||||
// describe the "scope", what is the program we're analyzing
|
||||
AnalysisScope scope = CallGraphTestUtil.makeJ2SEAnalysisScope(TestInfo.SCOPE_FILE, CallGraphTestUtil.REGRESSION_EXCLUSIONS);
|
||||
|
||||
|
@ -129,8 +127,8 @@ public class TestAgainstSimpleDriver {
|
|||
Collection<InstanceKey> p = dmp.getPointsTo(v);
|
||||
Collection<InstanceKey> oldP = simpleDmp.getPointsTo(v);
|
||||
if (!sameContents(p, oldP)) {
|
||||
Trace.println("different result for " + v);
|
||||
Trace.println("old " + oldP + "\n\nnew " + p);
|
||||
System.err.println(("different result for " + v));
|
||||
System.err.println(("old " + oldP + "\n\nnew " + p));
|
||||
}
|
||||
printResult(v, p);
|
||||
}
|
||||
|
|
|
@ -49,9 +49,6 @@ import com.ibm.wala.ipa.callgraph.CGNode;
|
|||
import com.ibm.wala.ipa.callgraph.CallGraph;
|
||||
import com.ibm.wala.properties.WalaProperties;
|
||||
import com.ibm.wala.ssa.IR;
|
||||
import com.ibm.wala.util.debug.Assertions;
|
||||
import com.ibm.wala.util.debug.Trace;
|
||||
import com.ibm.wala.util.warnings.WalaException;
|
||||
|
||||
/**
|
||||
* Various utility methods for working with WALA.
|
||||
|
@ -60,22 +57,6 @@ import com.ibm.wala.util.warnings.WalaException;
|
|||
*/
|
||||
public class WalaUtil {
|
||||
|
||||
public static void initializeTraceFile() {
|
||||
Properties prop = null;
|
||||
;
|
||||
try {
|
||||
prop = WalaProperties.loadProperties();
|
||||
} catch (WalaException e) {
|
||||
e.printStackTrace();
|
||||
Assertions.UNREACHABLE();
|
||||
}
|
||||
|
||||
String outputDir = prop.getProperty(WalaProperties.OUTPUT_DIR);
|
||||
String fileName = outputDir + File.separator + "trace.txt";
|
||||
// String fileName = outputDir + File.separator + "perf.txt";
|
||||
|
||||
Trace.setTraceFile(fileName);
|
||||
}
|
||||
|
||||
public static void dumpAllIR(CallGraph cg, String benchName, Properties p) throws IllegalArgumentException, IllegalArgumentException {
|
||||
if (cg == null) {
|
||||
|
|
|
@ -44,8 +44,8 @@ import com.ibm.wala.util.io.CommandLine;
|
|||
import com.ibm.wala.util.io.FileProvider;
|
||||
import com.ibm.wala.util.warnings.WalaException;
|
||||
import com.ibm.wala.viz.DotUtil;
|
||||
import com.ibm.wala.viz.PDFViewUtil;
|
||||
import com.ibm.wala.viz.NodeDecorator;
|
||||
import com.ibm.wala.viz.PDFViewUtil;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
|
@ -55,8 +55,8 @@ import com.ibm.wala.util.io.CommandLine;
|
|||
import com.ibm.wala.util.io.FileProvider;
|
||||
import com.ibm.wala.util.warnings.WalaException;
|
||||
import com.ibm.wala.viz.DotUtil;
|
||||
import com.ibm.wala.viz.PDFViewUtil;
|
||||
import com.ibm.wala.viz.NodeDecorator;
|
||||
import com.ibm.wala.viz.PDFViewUtil;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
|
@ -17,14 +17,13 @@ import java.util.Properties;
|
|||
|
||||
import com.ibm.wala.classLoader.IClass;
|
||||
import com.ibm.wala.core.tests.callGraph.CallGraphTestUtil;
|
||||
import com.ibm.wala.ipa.callgraph.AnalysisScope;
|
||||
import com.ibm.wala.util.config.AnalysisScopeReader;
|
||||
|
||||
import com.ibm.wala.examples.properties.WalaExamplesProperties;
|
||||
import com.ibm.wala.ipa.callgraph.AnalysisScope;
|
||||
import com.ibm.wala.ipa.cha.ClassHierarchy;
|
||||
import com.ibm.wala.properties.WalaProperties;
|
||||
import com.ibm.wala.util.collections.CollectionFilter;
|
||||
import com.ibm.wala.util.collections.Filter;
|
||||
import com.ibm.wala.util.config.AnalysisScopeReader;
|
||||
import com.ibm.wala.util.debug.Assertions;
|
||||
import com.ibm.wala.util.graph.Graph;
|
||||
import com.ibm.wala.util.graph.GraphSlicer;
|
||||
|
|
|
@ -16,18 +16,17 @@ import java.util.Properties;
|
|||
|
||||
import com.ibm.wala.classLoader.IMethod;
|
||||
import com.ibm.wala.core.tests.callGraph.CallGraphTestUtil;
|
||||
import com.ibm.wala.ipa.callgraph.AnalysisScope;
|
||||
import com.ibm.wala.util.config.AnalysisScopeReader;
|
||||
|
||||
import com.ibm.wala.examples.properties.WalaExamplesProperties;
|
||||
import com.ibm.wala.ipa.callgraph.AnalysisCache;
|
||||
import com.ibm.wala.ipa.callgraph.AnalysisOptions;
|
||||
import com.ibm.wala.ipa.callgraph.AnalysisScope;
|
||||
import com.ibm.wala.ipa.callgraph.impl.Everywhere;
|
||||
import com.ibm.wala.ipa.cha.ClassHierarchy;
|
||||
import com.ibm.wala.properties.WalaProperties;
|
||||
import com.ibm.wala.ssa.IR;
|
||||
import com.ibm.wala.ssa.SSAOptions;
|
||||
import com.ibm.wala.types.MethodReference;
|
||||
import com.ibm.wala.util.config.AnalysisScopeReader;
|
||||
import com.ibm.wala.util.debug.Assertions;
|
||||
import com.ibm.wala.util.io.FileProvider;
|
||||
import com.ibm.wala.util.strings.StringStuff;
|
||||
|
|
|
@ -38,7 +38,6 @@ import com.ibm.wala.types.TypeReference;
|
|||
import com.ibm.wala.util.collections.HashMapFactory;
|
||||
import com.ibm.wala.util.collections.HashSetFactory;
|
||||
import com.ibm.wala.util.debug.Assertions;
|
||||
import com.ibm.wala.util.debug.Trace;
|
||||
import com.ibm.wala.util.warnings.Warning;
|
||||
|
||||
/**
|
||||
|
@ -225,7 +224,7 @@ public abstract class AbstractReflectionInterpreter implements SSAContextInterpr
|
|||
// assert we haven't allocated this type already.
|
||||
assert !typesAllocated.contains(t);
|
||||
if (DEBUG) {
|
||||
Trace.println("addStatementsForConcreteType: " + t);
|
||||
System.err.println(("addStatementsForConcreteType: " + t));
|
||||
}
|
||||
NewSiteReference ref = NewSiteReference.make(getNewSiteForType(t), t);
|
||||
int alloc = getLocalForType(t);
|
||||
|
|
|
@ -56,7 +56,6 @@ import com.ibm.wala.types.TypeReference;
|
|||
import com.ibm.wala.util.collections.HashMapFactory;
|
||||
import com.ibm.wala.util.collections.HashSetFactory;
|
||||
import com.ibm.wala.util.debug.Assertions;
|
||||
import com.ibm.wala.util.debug.Trace;
|
||||
import com.ibm.wala.util.warnings.Warnings;
|
||||
|
||||
/**
|
||||
|
@ -364,7 +363,7 @@ class FactoryBypassInterpreter extends AbstractReflectionInterpreter {
|
|||
|
||||
this.context = context;
|
||||
if (DEBUG) {
|
||||
Trace.println("Create SpecializedFactoryMethod " + m + S);
|
||||
System.err.println(("Create SpecializedFactoryMethod " + m + S));
|
||||
}
|
||||
|
||||
this.method = m;
|
||||
|
@ -386,7 +385,7 @@ class FactoryBypassInterpreter extends AbstractReflectionInterpreter {
|
|||
protected void addStatementsForTypeAbstraction(TypeAbstraction T) {
|
||||
|
||||
if (DEBUG) {
|
||||
Trace.println("adding " + T + " to " + method);
|
||||
System.err.println(("adding " + T + " to " + method));
|
||||
}
|
||||
T = interceptType(T);
|
||||
if (T == null) {
|
||||
|
@ -398,7 +397,7 @@ class FactoryBypassInterpreter extends AbstractReflectionInterpreter {
|
|||
|
||||
if (DEBUG) {
|
||||
IClass klass = options.getClassTargetSelector().getAllocatedTarget(null, site);
|
||||
Trace.println("Selected allocated target: " + klass + " for " + T);
|
||||
System.err.println(("Selected allocated target: " + klass + " for " + T));
|
||||
}
|
||||
if (T instanceof PointType) {
|
||||
if (!typesAllocated.contains(ref)) {
|
||||
|
@ -406,16 +405,16 @@ class FactoryBypassInterpreter extends AbstractReflectionInterpreter {
|
|||
}
|
||||
} else if (T instanceof ConeType) {
|
||||
if (DEBUG) {
|
||||
Trace.println("Cone clause for " + T);
|
||||
System.err.println(("Cone clause for " + T));
|
||||
}
|
||||
if (((ConeType) T).isInterface()) {
|
||||
Set<IClass> implementors = T.getType().getClassHierarchy().getImplementors(ref);
|
||||
if (DEBUG) {
|
||||
Trace.println("Implementors for " + T + " " + implementors);
|
||||
System.err.println(("Implementors for " + T + " " + implementors));
|
||||
}
|
||||
if (implementors.isEmpty()) {
|
||||
if (DEBUG) {
|
||||
Trace.println("Found no implementors of type " + T);
|
||||
System.err.println(("Found no implementors of type " + T));
|
||||
}
|
||||
Warnings.add(NoSubtypesWarning.create(T));
|
||||
}
|
||||
|
@ -427,11 +426,11 @@ class FactoryBypassInterpreter extends AbstractReflectionInterpreter {
|
|||
} else {
|
||||
Collection<IClass> subclasses = T.getType().getClassHierarchy().computeSubClasses(ref);
|
||||
if (DEBUG) {
|
||||
Trace.println("Subclasses for " + T + " " + subclasses);
|
||||
System.err.println(("Subclasses for " + T + " " + subclasses));
|
||||
}
|
||||
if (subclasses.isEmpty()) {
|
||||
if (DEBUG) {
|
||||
Trace.println("Found no subclasses of type " + T);
|
||||
System.err.println(("Found no subclasses of type " + T));
|
||||
}
|
||||
Warnings.add(NoSubtypesWarning.create(T));
|
||||
}
|
||||
|
|
|
@ -55,7 +55,6 @@ import com.ibm.wala.shrikeBT.Util;
|
|||
import com.ibm.wala.types.ClassLoaderReference;
|
||||
import com.ibm.wala.types.TypeReference;
|
||||
import com.ibm.wala.util.debug.Assertions;
|
||||
import com.ibm.wala.util.debug.Trace;
|
||||
import com.ibm.wala.util.shrike.ShrikeUtil;
|
||||
|
||||
/**
|
||||
|
@ -888,14 +887,14 @@ public abstract class AbstractIntStackMachine implements FixedPointConstants {
|
|||
currentSuccessorBlock = null;
|
||||
IInstruction[] instructions = getInstructions();
|
||||
if (DEBUG) {
|
||||
Trace.println("Entry to BB" + cfg.getNumber(basicBlock) + " " + workingState);
|
||||
System.err.println(("Entry to BB" + cfg.getNumber(basicBlock) + " " + workingState));
|
||||
}
|
||||
for (int i = basicBlock.getFirstInstructionIndex(); i <= basicBlock.getLastInstructionIndex(); i++) {
|
||||
currentInstructionIndex = i;
|
||||
instructions[i].visit(visitor);
|
||||
|
||||
if (DEBUG) {
|
||||
Trace.println("After " + instructions[i] + " " + workingState);
|
||||
System.err.println(("After " + instructions[i] + " " + workingState));
|
||||
}
|
||||
}
|
||||
return workingState;
|
||||
|
@ -907,13 +906,13 @@ public abstract class AbstractIntStackMachine implements FixedPointConstants {
|
|||
currentSuccessorBlock = to;
|
||||
IInstruction[] instructions = getInstructions();
|
||||
if (DEBUG) {
|
||||
Trace.println("Entry to BB" + cfg.getNumber(from) + " " + workingState);
|
||||
System.err.println(("Entry to BB" + cfg.getNumber(from) + " " + workingState));
|
||||
}
|
||||
for (int i = from.getFirstInstructionIndex(); i <= from.getLastInstructionIndex(); i++) {
|
||||
currentInstructionIndex = i;
|
||||
instructions[i].visit(edgeVisitor);
|
||||
if (DEBUG) {
|
||||
Trace.println("After " + instructions[i] + " " + workingState);
|
||||
System.err.println(("After " + instructions[i] + " " + workingState));
|
||||
}
|
||||
}
|
||||
return workingState;
|
||||
|
|
|
@ -37,7 +37,6 @@ import com.ibm.wala.ssa.SSAThrowInstruction;
|
|||
import com.ibm.wala.util.collections.ArrayIterator;
|
||||
import com.ibm.wala.util.collections.HashSetFactory;
|
||||
import com.ibm.wala.util.debug.Assertions;
|
||||
import com.ibm.wala.util.debug.Trace;
|
||||
import com.ibm.wala.util.graph.GraphIntegrity;
|
||||
import com.ibm.wala.util.graph.GraphIntegrity.UnsoundGraphException;
|
||||
import com.ibm.wala.util.graph.impl.NodeWithNumber;
|
||||
|
@ -78,7 +77,7 @@ public class InducedCFG extends AbstractCFG<SSAInstruction, InducedCFG.BasicBloc
|
|||
this.context = context;
|
||||
this.instructions = instructions;
|
||||
if (DEBUG) {
|
||||
Trace.println("compute InducedCFG: " + method);
|
||||
System.err.println(("compute InducedCFG: " + method));
|
||||
}
|
||||
i2block = new BasicBlock[instructions.length];
|
||||
if (instructions.length == 0) {
|
||||
|
@ -185,7 +184,7 @@ public class InducedCFG extends AbstractCFG<SSAInstruction, InducedCFG.BasicBloc
|
|||
}
|
||||
|
||||
if (DEBUG) {
|
||||
Trace.println("Add basic block " + b);
|
||||
System.err.println(("Add basic block " + b));
|
||||
}
|
||||
}
|
||||
if (instructions[i] instanceof SSAPiInstruction) {
|
||||
|
@ -197,7 +196,7 @@ public class InducedCFG extends AbstractCFG<SSAInstruction, InducedCFG.BasicBloc
|
|||
// allocate the exit block
|
||||
BasicBlock exit = new BasicBlock(-1);
|
||||
if (DEBUG) {
|
||||
Trace.println("Add exit block " + exit);
|
||||
System.err.println(("Add exit block " + exit));
|
||||
}
|
||||
addNode(exit);
|
||||
clearPhis(instructions);
|
||||
|
@ -439,7 +438,7 @@ public class InducedCFG extends AbstractCFG<SSAInstruction, InducedCFG.BasicBloc
|
|||
private void computeOutgoingEdges() {
|
||||
|
||||
if (DEBUG) {
|
||||
Trace.println("Block " + this + ": computeOutgoingEdges()");
|
||||
System.err.println(("Block " + this + ": computeOutgoingEdges()"));
|
||||
}
|
||||
// TODO: we don't currently model branches
|
||||
|
||||
|
@ -452,7 +451,7 @@ public class InducedCFG extends AbstractCFG<SSAInstruction, InducedCFG.BasicBloc
|
|||
if (true) {
|
||||
// if (last.isFallThrough()) {
|
||||
if (DEBUG) {
|
||||
Trace.println("Add fallthru to " + getNode(getGraphNodeId() + 1));
|
||||
System.err.println(("Add fallthru to " + getNode(getGraphNodeId() + 1)));
|
||||
}
|
||||
addNormalEdgeTo(getNode(normalSuccNodeNumber));
|
||||
}
|
||||
|
|
|
@ -15,7 +15,6 @@ import java.util.Iterator;
|
|||
import java.util.Set;
|
||||
|
||||
import com.ibm.wala.util.collections.HashSetFactory;
|
||||
import com.ibm.wala.util.debug.Trace;
|
||||
|
||||
/**
|
||||
* A module containing files under some directory.
|
||||
|
@ -56,7 +55,7 @@ public abstract class DirectoryTreeModule implements Module {
|
|||
} else {
|
||||
// TODO: replace this with a real warning when the WarningSets are
|
||||
// revamped
|
||||
Trace.println("Warning: failed to retrieve files in " + dir);
|
||||
System.err.println(("Warning: failed to retrieve files in " + dir));
|
||||
}
|
||||
|
||||
return result;
|
||||
|
|
|
@ -23,7 +23,6 @@ import com.ibm.wala.shrikeCT.ClassReader;
|
|||
import com.ibm.wala.shrikeCT.InvalidClassFileException;
|
||||
import com.ibm.wala.util.collections.HashMapFactory;
|
||||
import com.ibm.wala.util.debug.Assertions;
|
||||
import com.ibm.wala.util.debug.Trace;
|
||||
import com.ibm.wala.util.io.FileSuffixes;
|
||||
|
||||
/**
|
||||
|
@ -74,7 +73,7 @@ public class NestedJarFileModule implements Module {
|
|||
final JarInputStream stream = new JarInputStream(new ByteArrayInputStream(b));
|
||||
for (ZipEntry z = stream.getNextEntry(); z != null; z = stream.getNextEntry()) {
|
||||
if (DEBUG) {
|
||||
Trace.println("got entry: " + z.getName());
|
||||
System.err.println(("got entry: " + z.getName()));
|
||||
}
|
||||
if (FileSuffixes.isClassFile(z.getName()) || FileSuffixes.isSourceFile(z.getName())) {
|
||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||
|
|
|
@ -34,7 +34,6 @@ import com.ibm.wala.types.annotations.Annotation;
|
|||
import com.ibm.wala.types.generics.ClassSignature;
|
||||
import com.ibm.wala.util.collections.HashSetFactory;
|
||||
import com.ibm.wala.util.debug.Assertions;
|
||||
import com.ibm.wala.util.debug.Trace;
|
||||
import com.ibm.wala.util.shrike.ShrikeClassReaderHandle;
|
||||
import com.ibm.wala.util.strings.Atom;
|
||||
import com.ibm.wala.util.strings.ImmutableByteArray;
|
||||
|
@ -161,7 +160,7 @@ public final class ShrikeClass extends JVMClass<IClassLoader> {
|
|||
for (int i = 0; i < methodCount; i++) {
|
||||
ShrikeCTMethod m = new ShrikeCTMethod(this, i);
|
||||
if (DEBUG) {
|
||||
Trace.println("Register method " + m + " for class " + this);
|
||||
System.err.println(("Register method " + m + " for class " + this));
|
||||
}
|
||||
result[i] = m;
|
||||
}
|
||||
|
|
|
@ -21,7 +21,6 @@ import com.ibm.wala.ssa.IR;
|
|||
import com.ibm.wala.ssa.SSAInstruction;
|
||||
import com.ibm.wala.ssa.SymbolTable;
|
||||
import com.ibm.wala.util.debug.Assertions;
|
||||
import com.ibm.wala.util.debug.Trace;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -146,7 +145,7 @@ public abstract class SSAInference<T extends IVariable> extends DefaultFixedPoin
|
|||
throw new IllegalArgumentException("Illegal valueNumber " + valueNumber);
|
||||
}
|
||||
if (DEBUG) {
|
||||
Trace.println("getVariable for " + valueNumber + " returns " + vars[valueNumber]);
|
||||
System.err.println(("getVariable for " + valueNumber + " returns " + vars[valueNumber]));
|
||||
}
|
||||
if (Assertions.verifyAssertions) {
|
||||
if (vars == null) {
|
||||
|
|
|
@ -55,7 +55,6 @@ import com.ibm.wala.util.collections.Filter;
|
|||
import com.ibm.wala.util.collections.FilterIterator;
|
||||
import com.ibm.wala.util.collections.Iterator2Collection;
|
||||
import com.ibm.wala.util.debug.Assertions;
|
||||
import com.ibm.wala.util.debug.Trace;
|
||||
import com.ibm.wala.util.debug.UnimplementedError;
|
||||
import com.ibm.wala.util.graph.traverse.SlowDFSDiscoverTimeIterator;
|
||||
|
||||
|
@ -94,7 +93,7 @@ public class SimpleDemandPointsTo extends AbstractDemandPointsTo {
|
|||
}
|
||||
|
||||
if (VERBOSE) {
|
||||
Trace.println(g.toString());
|
||||
System.err.println(g.toString());
|
||||
}
|
||||
|
||||
Filter iKeyFilter = new Filter() {
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
package com.ibm.wala.demandpa.alg.refinepolicy;
|
||||
|
||||
import com.ibm.wala.classLoader.IField;
|
||||
import com.ibm.wala.demandpa.alg.refinepolicy.FieldRefinePolicy;
|
||||
import com.ibm.wala.demandpa.alg.statemachine.StateMachine;
|
||||
import com.ibm.wala.demandpa.flowgraph.IFlowLabel;
|
||||
import com.ibm.wala.ipa.callgraph.propagation.PointerKey;
|
||||
|
|
|
@ -67,7 +67,6 @@ import com.ibm.wala.util.collections.EmptyIterator;
|
|||
import com.ibm.wala.util.collections.HashMapFactory;
|
||||
import com.ibm.wala.util.collections.HashSetFactory;
|
||||
import com.ibm.wala.util.debug.Assertions;
|
||||
import com.ibm.wala.util.debug.Trace;
|
||||
import com.ibm.wala.util.intset.BitVectorIntSet;
|
||||
import com.ibm.wala.util.ref.ReferenceCleanser;
|
||||
|
||||
|
@ -256,7 +255,7 @@ public abstract class AbstractDemandFlowGraph extends AbstractFlowGraph {
|
|||
protected void unconditionallyAddConstraintsFromNode(CGNode node, IR ir) {
|
||||
|
||||
if (DEBUG) {
|
||||
Trace.println("Adding constraints for CGNode " + node);
|
||||
System.err.println(("Adding constraints for CGNode " + node));
|
||||
}
|
||||
|
||||
if (SSAPropagationCallGraphBuilder.PERIODIC_WIPE_SOFT_CACHES) {
|
||||
|
|
|
@ -66,7 +66,6 @@ import com.ibm.wala.types.TypeReference;
|
|||
import com.ibm.wala.util.collections.HashMapFactory;
|
||||
import com.ibm.wala.util.collections.HashSetFactory;
|
||||
import com.ibm.wala.util.debug.Assertions;
|
||||
import com.ibm.wala.util.debug.Trace;
|
||||
import com.ibm.wala.util.debug.UnimplementedError;
|
||||
import com.ibm.wala.util.graph.impl.SlowSparseNumberedGraph;
|
||||
import com.ibm.wala.util.intset.BitVectorIntSet;
|
||||
|
@ -393,7 +392,7 @@ public class SimpleDemandPointerFlowGraph extends SlowSparseNumberedGraph<Object
|
|||
protected void unconditionallyAddConstraintsFromNode(CGNode node) {
|
||||
|
||||
if (DEBUG) {
|
||||
Trace.println("Visiting CGNode " + node);
|
||||
System.err.println(("Visiting CGNode " + node));
|
||||
}
|
||||
|
||||
if (SSAPropagationCallGraphBuilder.PERIODIC_WIPE_SOFT_CACHES) {
|
||||
|
@ -562,10 +561,10 @@ public class SimpleDemandPointerFlowGraph extends SlowSparseNumberedGraph<Object
|
|||
private void debugPrintIR(IR ir) {
|
||||
if (DEBUG) {
|
||||
if (ir == null) {
|
||||
Trace.println("\n No statements\n");
|
||||
System.err.println("\n No statements\n");
|
||||
} else {
|
||||
try {
|
||||
Trace.println(ir.toString());
|
||||
System.err.println(ir.toString());
|
||||
} catch (Error e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
|
|
|
@ -55,7 +55,6 @@ import com.ibm.wala.ipa.callgraph.propagation.ReturnValueKey;
|
|||
import com.ibm.wala.ipa.callgraph.propagation.cfa.ExceptionReturnValueKey;
|
||||
import com.ibm.wala.types.MethodReference;
|
||||
import com.ibm.wala.util.debug.Assertions;
|
||||
import com.ibm.wala.util.debug.Trace;
|
||||
import com.ibm.wala.util.debug.UnimplementedError;
|
||||
|
||||
/**
|
||||
|
@ -89,7 +88,7 @@ public class CallGraphMapUtil {
|
|||
// NOTE: clone() is cloned one level, even by RTA, so we need to handle it
|
||||
CGNode ret = toCG.getNode(orig.getMethod(), orig.getContext());
|
||||
if (ret == null) {
|
||||
Trace.println("WEIRD can't map node " + orig);
|
||||
System.err.println(("WEIRD can't map node " + orig));
|
||||
}
|
||||
return ret;
|
||||
} else {
|
||||
|
|
|
@ -31,7 +31,6 @@ import com.ibm.wala.ipa.slicer.Slicer.DataDependenceOptions;
|
|||
import com.ibm.wala.ipa.slicer.thin.CISlicer;
|
||||
import com.ibm.wala.util.collections.MapUtil;
|
||||
import com.ibm.wala.util.debug.Assertions;
|
||||
import com.ibm.wala.util.debug.Trace;
|
||||
|
||||
/**
|
||||
* A {@link MemoryAccessMap} that makes use of a pre-computed
|
||||
|
@ -74,7 +73,7 @@ public class PABasedMemoryAccessMap implements MemoryAccessMap {
|
|||
public Collection<MemoryAccess> getArrayReads(PointerKey arrayRef) {
|
||||
Collection<MemoryAccess> memAccesses = new ArrayList<MemoryAccess>();
|
||||
if (DEBUG) {
|
||||
Trace.println("looking at reads of array ref " + arrayRef);
|
||||
System.err.println(("looking at reads of array ref " + arrayRef));
|
||||
}
|
||||
for (InstanceKey ik : pa.getPointsToSet(arrayRef)) {
|
||||
PointerKey ack = heapModel.getPointerKeyForArrayContents(ik);
|
||||
|
@ -86,11 +85,11 @@ public class PABasedMemoryAccessMap implements MemoryAccessMap {
|
|||
public Collection<MemoryAccess> getArrayWrites(PointerKey arrayRef) {
|
||||
Collection<MemoryAccess> memAccesses = new ArrayList<MemoryAccess>();
|
||||
if (DEBUG) {
|
||||
Trace.println("looking at writes to array ref " + arrayRef);
|
||||
System.err.println(("looking at writes to array ref " + arrayRef));
|
||||
}
|
||||
for (InstanceKey ik : pa.getPointsToSet(arrayRef)) {
|
||||
if (DEBUG) {
|
||||
Trace.println("instance key " + ik + " class " + ik.getClass());
|
||||
System.err.println(("instance key " + ik + " class " + ik.getClass()));
|
||||
}
|
||||
PointerKey ack = heapModel.getPointerKeyForArrayContents(ik);
|
||||
convertStmtsToMemoryAccess(invMod.get(ack), memAccesses);
|
||||
|
@ -133,7 +132,7 @@ public class PABasedMemoryAccessMap implements MemoryAccessMap {
|
|||
return;
|
||||
}
|
||||
if (DEBUG) {
|
||||
Trace.println("statements: " + stmts);
|
||||
System.err.println(("statements: " + stmts));
|
||||
}
|
||||
for (Statement s : stmts) {
|
||||
switch (s.getKind()) {
|
||||
|
|
|
@ -21,7 +21,6 @@ import com.ibm.wala.fixpoint.FixedPointConstants;
|
|||
import com.ibm.wala.fixpoint.IFixedPointSolver;
|
||||
import com.ibm.wala.fixpoint.IFixedPointStatement;
|
||||
import com.ibm.wala.fixpoint.IVariable;
|
||||
import com.ibm.wala.util.debug.Trace;
|
||||
import com.ibm.wala.util.debug.VerboseAction;
|
||||
|
||||
/**
|
||||
|
@ -139,7 +138,7 @@ public abstract class AbstractFixedPointSolver<T extends IVariable> implements I
|
|||
AbstractStatement s = workList.takeStatement();
|
||||
|
||||
if (DEBUG) {
|
||||
Trace.println("Before evaluation " + s);
|
||||
System.err.println(("Before evaluation " + s));
|
||||
}
|
||||
byte code = s.evaluate();
|
||||
if (verbose) {
|
||||
|
@ -153,7 +152,7 @@ public abstract class AbstractFixedPointSolver<T extends IVariable> implements I
|
|||
|
||||
}
|
||||
if (DEBUG) {
|
||||
Trace.println("After evaluation " + s + " " + isChanged(code));
|
||||
System.err.println(("After evaluation " + s + " " + isChanged(code)));
|
||||
}
|
||||
if (isChanged(code)) {
|
||||
globalChange = true;
|
||||
|
|
|
@ -44,7 +44,6 @@ import com.ibm.wala.util.collections.HashMapFactory;
|
|||
import com.ibm.wala.util.collections.HashSetFactory;
|
||||
import com.ibm.wala.util.collections.MapUtil;
|
||||
import com.ibm.wala.util.debug.Assertions;
|
||||
import com.ibm.wala.util.debug.Trace;
|
||||
import com.ibm.wala.util.strings.Atom;
|
||||
import com.ibm.wala.util.strings.ImmutableByteArray;
|
||||
|
||||
|
@ -215,7 +214,7 @@ public class AnalysisScope {
|
|||
public void addToScope(ClassLoaderReference loader, JarFile file) {
|
||||
List<Module> s = MapUtil.findOrCreateList(moduleMap, loader);
|
||||
if (DEBUG_LEVEL > 0) {
|
||||
Trace.println("AnalysisScope: add JarFileModule " + file.getName());
|
||||
System.err.println(("AnalysisScope: add JarFileModule " + file.getName()));
|
||||
}
|
||||
s.add(new JarFileModule(file));
|
||||
}
|
||||
|
@ -229,7 +228,7 @@ public class AnalysisScope {
|
|||
}
|
||||
List<Module> s = MapUtil.findOrCreateList(moduleMap, loader);
|
||||
if (DEBUG_LEVEL > 0) {
|
||||
Trace.println("AnalysisScope: add module " + m);
|
||||
System.err.println(("AnalysisScope: add module " + m));
|
||||
}
|
||||
s.add(m);
|
||||
}
|
||||
|
@ -260,7 +259,7 @@ public class AnalysisScope {
|
|||
}
|
||||
List<Module> s = MapUtil.findOrCreateList(moduleMap, loader);
|
||||
if (DEBUG_LEVEL > 0) {
|
||||
Trace.println("AnalysisScope: add overriding module " + m);
|
||||
System.err.println(("AnalysisScope: add overriding module " + m));
|
||||
}
|
||||
s.add(0, m);
|
||||
}
|
||||
|
|
|
@ -18,7 +18,6 @@ import com.ibm.wala.classLoader.IMethod;
|
|||
import com.ibm.wala.ipa.callgraph.AnalysisScope;
|
||||
import com.ibm.wala.ipa.callgraph.Entrypoint;
|
||||
import com.ibm.wala.ipa.cha.IClassHierarchy;
|
||||
import com.ibm.wala.util.debug.Trace;
|
||||
|
||||
/**
|
||||
* Includes all application methods in an analysis scope as entrypoints.
|
||||
|
@ -51,7 +50,7 @@ public class AllApplicationEntrypoints extends HashSet<Entrypoint> {
|
|||
}
|
||||
}
|
||||
if (DEBUG) {
|
||||
Trace.println(getClass() + "Number of EntryPoints:" + size());
|
||||
System.err.println((getClass() + "Number of EntryPoints:" + size()));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -30,7 +30,6 @@ import com.ibm.wala.util.collections.HashMapFactory;
|
|||
import com.ibm.wala.util.collections.HashSetFactory;
|
||||
import com.ibm.wala.util.collections.NonNullSingletonIterator;
|
||||
import com.ibm.wala.util.debug.Assertions;
|
||||
import com.ibm.wala.util.debug.Trace;
|
||||
import com.ibm.wala.util.debug.UnimplementedError;
|
||||
import com.ibm.wala.util.graph.AbstractNumberedGraph;
|
||||
import com.ibm.wala.util.graph.NodeManager;
|
||||
|
@ -121,8 +120,8 @@ public abstract class BasicCallGraph extends AbstractNumberedGraph<CGNode> imple
|
|||
Set<CGNode> s = findOrCreateMr2Nodes(K.m);
|
||||
s.add(N);
|
||||
if (DEBUG) {
|
||||
Trace.println("registered Node: " + N + " for key " + K);
|
||||
Trace.println("now size = " + getNumberOfNodes());
|
||||
System.err.println(("registered Node: " + N + " for key " + K));
|
||||
System.err.println(("now size = " + getNumberOfNodes()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -16,7 +16,6 @@ import com.ibm.wala.ipa.callgraph.CGNode;
|
|||
import com.ibm.wala.ipa.callgraph.Context;
|
||||
import com.ibm.wala.ipa.callgraph.ContextSelector;
|
||||
import com.ibm.wala.ipa.callgraph.propagation.InstanceKey;
|
||||
import com.ibm.wala.util.debug.Trace;
|
||||
|
||||
/**
|
||||
* A context selector that first checks with A, then defaults to B.
|
||||
|
@ -41,20 +40,20 @@ public class DelegatingContextSelector implements ContextSelector {
|
|||
|
||||
public Context getCalleeTarget(CGNode caller, CallSiteReference site, IMethod callee, InstanceKey receiver) {
|
||||
if (DEBUG) {
|
||||
Trace.println("getCalleeTarget " + caller + " " + site + " " + callee);
|
||||
System.err.println(("getCalleeTarget " + caller + " " + site + " " + callee));
|
||||
}
|
||||
if (A != null) {
|
||||
Context C = A.getCalleeTarget(caller, site, callee, receiver);
|
||||
if (C != null) {
|
||||
if (DEBUG) {
|
||||
Trace.println("Case A " + A.getClass() + " " + C);
|
||||
System.err.println(("Case A " + A.getClass() + " " + C));
|
||||
}
|
||||
return C;
|
||||
}
|
||||
}
|
||||
Context C = B.getCalleeTarget(caller, site, callee, receiver);
|
||||
if (DEBUG) {
|
||||
Trace.println("Case B " + B.getClass() + " " + C);
|
||||
System.err.println(("Case B " + B.getClass() + " " + C));
|
||||
}
|
||||
return C;
|
||||
}
|
||||
|
|
|
@ -46,7 +46,6 @@ import com.ibm.wala.types.TypeName;
|
|||
import com.ibm.wala.types.TypeReference;
|
||||
import com.ibm.wala.util.collections.HashSetFactory;
|
||||
import com.ibm.wala.util.debug.Assertions;
|
||||
import com.ibm.wala.util.debug.Trace;
|
||||
import com.ibm.wala.util.graph.Graph;
|
||||
import com.ibm.wala.util.graph.traverse.SlowDFSDiscoverTimeIterator;
|
||||
import com.ibm.wala.util.strings.Atom;
|
||||
|
@ -507,13 +506,13 @@ public class Util {
|
|||
Set<T> nodeDiff = setify(subG.iterator());
|
||||
nodeDiff.removeAll(setify(supG.iterator()));
|
||||
if (!nodeDiff.isEmpty()) {
|
||||
Trace.println("supergraph: ");
|
||||
Trace.println(supG.toString());
|
||||
Trace.println("subgraph: ");
|
||||
Trace.println(subG.toString());
|
||||
Trace.println("nodeDiff: ");
|
||||
System.err.println("supergraph: ");
|
||||
System.err.println(supG.toString());
|
||||
System.err.println("subgraph: ");
|
||||
System.err.println(subG.toString());
|
||||
System.err.println("nodeDiff: ");
|
||||
for (Iterator it = nodeDiff.iterator(); it.hasNext();) {
|
||||
Trace.println(it.next().toString());
|
||||
System.err.println(it.next().toString());
|
||||
}
|
||||
Assertions.productionAssertion(nodeDiff.isEmpty(), "bad superset, see tracefile\n");
|
||||
}
|
||||
|
@ -530,13 +529,13 @@ public class Util {
|
|||
Set<T> predDiff = setify(subG.getPredNodes(m));
|
||||
predDiff.removeAll(setify(supG.getPredNodes(m)));
|
||||
if (!predDiff.isEmpty()) {
|
||||
Trace.println("supergraph: ");
|
||||
Trace.println(supG.toString());
|
||||
Trace.println("subgraph: ");
|
||||
Trace.println(subG.toString());
|
||||
Trace.println("predDiff: ");
|
||||
System.err.println("supergraph: ");
|
||||
System.err.println(supG.toString());
|
||||
System.err.println("subgraph: ");
|
||||
System.err.println(subG.toString());
|
||||
System.err.println("predDiff: ");
|
||||
for (Iterator it = predDiff.iterator(); it.hasNext();) {
|
||||
Trace.println(it.next().toString());
|
||||
System.err.println(it.next().toString());
|
||||
}
|
||||
Assertions.UNREACHABLE("bad superset for predecessors of " + m + ":" + predDiff);
|
||||
}
|
||||
|
|
|
@ -19,7 +19,6 @@ import com.ibm.wala.ipa.callgraph.CGNode;
|
|||
import com.ibm.wala.ipa.cha.IClassHierarchy;
|
||||
import com.ibm.wala.types.TypeReference;
|
||||
import com.ibm.wala.util.debug.Assertions;
|
||||
import com.ibm.wala.util.debug.Trace;
|
||||
|
||||
/**
|
||||
* This class provides Instance Key call backs where each instance is in the same equivalence class as all other
|
||||
|
@ -70,12 +69,12 @@ public class ClassBasedInstanceKeys implements InstanceKeyFactory {
|
|||
*/
|
||||
public InstanceKey getInstanceKeyForMultiNewArray(CGNode node, NewSiteReference allocation, int dim) {
|
||||
if (DEBUG) {
|
||||
Trace.println("getInstanceKeyForMultiNewArray " + allocation + " " + dim);
|
||||
System.err.println(("getInstanceKeyForMultiNewArray " + allocation + " " + dim));
|
||||
}
|
||||
ArrayClass type = (ArrayClass) options.getClassTargetSelector().getAllocatedTarget(node, allocation);
|
||||
assert (type != null);
|
||||
if (DEBUG) {
|
||||
Trace.println("type: " + type);
|
||||
System.err.println(("type: " + type));
|
||||
}
|
||||
if (Assertions.verifyAssertions) {
|
||||
if (type == null) {
|
||||
|
@ -90,11 +89,11 @@ public class ClassBasedInstanceKeys implements InstanceKeyFactory {
|
|||
}
|
||||
type = (ArrayClass) type.getElementClass();
|
||||
if (DEBUG) {
|
||||
Trace.println("intermediate: " + i + " " + type);
|
||||
System.err.println(("intermediate: " + i + " " + type));
|
||||
}
|
||||
}
|
||||
if (DEBUG) {
|
||||
Trace.println("final type: " + type);
|
||||
System.err.println(("final type: " + type));
|
||||
}
|
||||
if (type == null) {
|
||||
return null;
|
||||
|
|
|
@ -31,7 +31,6 @@ import com.ibm.wala.util.collections.FilterIterator;
|
|||
import com.ibm.wala.util.collections.HashSetFactory;
|
||||
import com.ibm.wala.util.collections.SmallMap;
|
||||
import com.ibm.wala.util.debug.Assertions;
|
||||
import com.ibm.wala.util.debug.Trace;
|
||||
import com.ibm.wala.util.debug.UnimplementedError;
|
||||
import com.ibm.wala.util.graph.AbstractNumberedGraph;
|
||||
import com.ibm.wala.util.graph.EdgeManager;
|
||||
|
@ -246,14 +245,14 @@ public class PropagationGraph implements IFixedPointSystem<PointsToSetVariable>
|
|||
|
||||
private void addImplicitStatement(UnaryStatement<PointsToSetVariable> eq) {
|
||||
if (DEBUG) {
|
||||
Trace.println("addImplicitStatement " + eq);
|
||||
System.err.println(("addImplicitStatement " + eq));
|
||||
}
|
||||
delegateGraph.addVariable(eq.getLHS());
|
||||
delegateGraph.addVariable(eq.getRightHandSide());
|
||||
int lhs = eq.getLHS().getGraphNodeId();
|
||||
int rhs = eq.getRightHandSide().getGraphNodeId();
|
||||
if (DEBUG) {
|
||||
Trace.println("lhs rhs " + lhs + " " + rhs);
|
||||
System.err.println(("lhs rhs " + lhs + " " + rhs));
|
||||
}
|
||||
IBinaryNaturalRelation R = findOrCreateRelation(implicitUnaryMap, eq.getOperator());
|
||||
boolean b = R.add(lhs, rhs);
|
||||
|
@ -266,12 +265,12 @@ public class PropagationGraph implements IFixedPointSystem<PointsToSetVariable>
|
|||
|
||||
private void removeImplicitStatement(UnaryStatement<PointsToSetVariable> eq) {
|
||||
if (DEBUG) {
|
||||
Trace.println("removeImplicitStatement " + eq);
|
||||
System.err.println(("removeImplicitStatement " + eq));
|
||||
}
|
||||
int lhs = eq.getLHS().getGraphNodeId();
|
||||
int rhs = eq.getRightHandSide().getGraphNodeId();
|
||||
if (DEBUG) {
|
||||
Trace.println("lhs rhs " + lhs + " " + rhs);
|
||||
System.err.println(("lhs rhs " + lhs + " " + rhs));
|
||||
}
|
||||
IBinaryNaturalRelation R = findOrCreateRelation(implicitUnaryMap, eq.getOperator());
|
||||
R.remove(lhs, rhs);
|
||||
|
@ -316,8 +315,8 @@ public class PropagationGraph implements IFixedPointSystem<PointsToSetVariable>
|
|||
PointsToSetVariable lhs = (PointsToSetVariable) delegateGraph.getNode(l);
|
||||
UnaryStatement temp = op.makeEquation(lhs, use);
|
||||
if (DEBUG) {
|
||||
Trace.print("XX Return temp: " + temp);
|
||||
Trace.println("lhs rhs " + l + " " + use.getGraphNodeId());
|
||||
System.err.print(("XX Return temp: " + temp));
|
||||
System.err.println(("lhs rhs " + l + " " + use.getGraphNodeId()));
|
||||
}
|
||||
return temp;
|
||||
}
|
||||
|
@ -354,7 +353,7 @@ public class PropagationGraph implements IFixedPointSystem<PointsToSetVariable>
|
|||
PointsToSetVariable rhs = (PointsToSetVariable) delegateGraph.getNode(r);
|
||||
UnaryStatement temp = op.makeEquation(def, rhs);
|
||||
if (DEBUG) {
|
||||
Trace.print("YY Return temp: " + temp);
|
||||
System.err.print(("YY Return temp: " + temp));
|
||||
}
|
||||
return temp;
|
||||
}
|
||||
|
@ -757,23 +756,23 @@ public class PropagationGraph implements IFixedPointSystem<PointsToSetVariable>
|
|||
*/
|
||||
public void performVerboseAction() {
|
||||
if (VERBOSE) {
|
||||
Trace.println("stats for " + getClass());
|
||||
Trace.println("number of variables: " + delegateGraph.getVarCount());
|
||||
Trace.println("implicit equations: " + (implicitUnaryCount));
|
||||
Trace.println("explicit equations: " + delegateGraph.getEquationCount());
|
||||
Trace.println("implicit map:");
|
||||
System.err.println(("stats for " + getClass()));
|
||||
System.err.println(("number of variables: " + delegateGraph.getVarCount()));
|
||||
System.err.println(("implicit equations: " + (implicitUnaryCount)));
|
||||
System.err.println(("explicit equations: " + delegateGraph.getEquationCount()));
|
||||
System.err.println("implicit map:");
|
||||
int count = 0;
|
||||
int totalBytes = 0;
|
||||
for (Iterator it = implicitUnaryMap.entrySet().iterator(); it.hasNext();) {
|
||||
count++;
|
||||
Map.Entry e = (Map.Entry) it.next();
|
||||
IBinaryNaturalRelation R = (IBinaryNaturalRelation) e.getValue();
|
||||
Trace.println("entry " + count);
|
||||
System.err.println(("entry " + count));
|
||||
R.performVerboseAction();
|
||||
HeapTracer.Result result = HeapTracer.traceHeap(Collections.singleton(R), false);
|
||||
totalBytes += result.getTotalSize();
|
||||
}
|
||||
Trace.println("bytes in implicit map: " + totalBytes);
|
||||
System.err.println(("bytes in implicit map: " + totalBytes));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -56,7 +56,6 @@ import com.ibm.wala.types.MethodReference;
|
|||
import com.ibm.wala.types.TypeReference;
|
||||
import com.ibm.wala.util.collections.HashSetFactory;
|
||||
import com.ibm.wala.util.debug.Assertions;
|
||||
import com.ibm.wala.util.debug.Trace;
|
||||
|
||||
/**
|
||||
* Abstract superclass of various RTA flavors
|
||||
|
@ -130,7 +129,7 @@ public abstract class AbstractRTABuilder extends PropagationCallGraphBuilder {
|
|||
markAlreadyVisited(node);
|
||||
}
|
||||
if (DEBUG) {
|
||||
Trace.println("\n\nAdd constraints from node " + node);
|
||||
System.err.println(("\n\nAdd constraints from node " + node));
|
||||
}
|
||||
|
||||
// add all relevant constraints
|
||||
|
@ -181,7 +180,7 @@ public abstract class AbstractRTABuilder extends PropagationCallGraphBuilder {
|
|||
*/
|
||||
private void processFieldAccess(CGNode node, FieldReference f) {
|
||||
if (DEBUG) {
|
||||
Trace.println("processFieldAccess: " + f);
|
||||
System.err.println(("processFieldAccess: " + f));
|
||||
}
|
||||
TypeReference t = f.getDeclaringClass();
|
||||
IClass klass = getClassHierarchy().lookupClass(t);
|
||||
|
@ -201,7 +200,7 @@ public abstract class AbstractRTABuilder extends PropagationCallGraphBuilder {
|
|||
|
||||
if (klass.getClassInitializer() != null) {
|
||||
if (DEBUG) {
|
||||
Trace.println("process class initializer for " + klass);
|
||||
System.err.println(("process class initializer for " + klass));
|
||||
}
|
||||
|
||||
// add an invocation from the fake root method to the <clinit>
|
||||
|
@ -246,7 +245,7 @@ public abstract class AbstractRTABuilder extends PropagationCallGraphBuilder {
|
|||
throw new IllegalArgumentException("site is null");
|
||||
}
|
||||
if (DEBUG) {
|
||||
Trace.println("visitInvoke: " + site);
|
||||
System.err.println(("visitInvoke: " + site));
|
||||
}
|
||||
|
||||
// if non-virtual, add callgraph edges directly
|
||||
|
@ -275,7 +274,7 @@ public abstract class AbstractRTABuilder extends PropagationCallGraphBuilder {
|
|||
}
|
||||
|
||||
if (DEBUG) {
|
||||
Trace.println("Add side effect, dispatch to " + site);
|
||||
System.err.println(("Add side effect, dispatch to " + site));
|
||||
}
|
||||
UnaryOperator<PointsToSetVariable> dispatchOperator = makeDispatchOperator(site, node);
|
||||
system.newSideEffect(dispatchOperator, selector);
|
||||
|
@ -296,7 +295,7 @@ public abstract class AbstractRTABuilder extends PropagationCallGraphBuilder {
|
|||
void processResolvedCall(CGNode caller, CallSiteReference site, CGNode target) {
|
||||
|
||||
if (DEBUG) {
|
||||
Trace.println("processResolvedCall: " + caller + " ," + site + " , " + target);
|
||||
System.err.println(("processResolvedCall: " + caller + " ," + site + " , " + target));
|
||||
}
|
||||
caller.addTarget(site, target);
|
||||
|
||||
|
@ -321,7 +320,7 @@ public abstract class AbstractRTABuilder extends PropagationCallGraphBuilder {
|
|||
throw new IllegalArgumentException("newSite is null");
|
||||
}
|
||||
if (DEBUG) {
|
||||
Trace.println("visitNew: " + newSite);
|
||||
System.err.println(("visitNew: " + newSite));
|
||||
}
|
||||
InstanceKey iKey = getInstanceKeyForAllocation(node, newSite);
|
||||
if (iKey == null) {
|
||||
|
@ -331,7 +330,7 @@ public abstract class AbstractRTABuilder extends PropagationCallGraphBuilder {
|
|||
IClass klass = iKey.getConcreteType();
|
||||
|
||||
if (DEBUG) {
|
||||
Trace.println("iKey: " + iKey + " " + system.findOrCreateIndexForInstanceKey(iKey));
|
||||
System.err.println(("iKey: " + iKey + " " + system.findOrCreateIndexForInstanceKey(iKey)));
|
||||
}
|
||||
|
||||
if (klass == null) {
|
||||
|
|
|
@ -33,7 +33,6 @@ import com.ibm.wala.ipa.cha.ClassHierarchyException;
|
|||
import com.ibm.wala.ipa.cha.IClassHierarchy;
|
||||
import com.ibm.wala.types.Selector;
|
||||
import com.ibm.wala.util.debug.Assertions;
|
||||
import com.ibm.wala.util.debug.Trace;
|
||||
import com.ibm.wala.util.intset.IntSet;
|
||||
import com.ibm.wala.util.intset.IntSetAction;
|
||||
import com.ibm.wala.util.intset.IntSetUtil;
|
||||
|
@ -82,14 +81,14 @@ public class BasicRTABuilder extends AbstractRTABuilder {
|
|||
*/
|
||||
private void registerImplementedMethods(IClass declarer, InstanceKey iKey) {
|
||||
if (DEBUG) {
|
||||
Trace.println("registerImplementedMethods: " + declarer + " " + iKey);
|
||||
System.err.println(("registerImplementedMethods: " + declarer + " " + iKey));
|
||||
}
|
||||
for (Iterator it = declarer.getDeclaredMethods().iterator(); it.hasNext();) {
|
||||
IMethod M = (IMethod) it.next();
|
||||
Selector selector = M.getReference().getSelector();
|
||||
PointerKey sKey = getKeyForSelector(selector);
|
||||
if (DEBUG) {
|
||||
Trace.println("Add constraint: " + selector + " U= " + iKey.getConcreteType());
|
||||
System.err.println(("Add constraint: " + selector + " U= " + iKey.getConcreteType()));
|
||||
}
|
||||
system.newConstraint(sKey, iKey);
|
||||
}
|
||||
|
@ -140,15 +139,15 @@ public class BasicRTABuilder extends AbstractRTABuilder {
|
|||
// TODO: be more careful about what goes on the worklist to
|
||||
// avoid this.
|
||||
if (DEBUG) {
|
||||
Trace.println("EVAL dispatch with value null");
|
||||
System.err.println("EVAL dispatch with value null");
|
||||
}
|
||||
return NOT_CHANGED;
|
||||
}
|
||||
if (DEBUG) {
|
||||
String S = "EVAL dispatch to " + caller + ":" + site;
|
||||
Trace.println(S);
|
||||
System.err.println(S);
|
||||
if (DEBUG_LEVEL >= 2) {
|
||||
Trace.println("receivers: " + value);
|
||||
System.err.println(("receivers: " + value));
|
||||
}
|
||||
}
|
||||
// TODO: cache this!!!
|
||||
|
@ -158,12 +157,12 @@ public class BasicRTABuilder extends AbstractRTABuilder {
|
|||
}
|
||||
value = filterForClass(value, recvClass);
|
||||
if (DEBUG_LEVEL >= 2) {
|
||||
Trace.println("filtered value: " + value);
|
||||
System.err.println(("filtered value: " + value));
|
||||
}
|
||||
IntSetAction action = new IntSetAction() {
|
||||
public void act(int ptr) {
|
||||
if (DEBUG) {
|
||||
Trace.println(" dispatch to ptr " + ptr);
|
||||
System.err.println((" dispatch to ptr " + ptr));
|
||||
}
|
||||
InstanceKey iKey = system.getInstanceKey(ptr);
|
||||
|
||||
|
@ -172,7 +171,7 @@ public class BasicRTABuilder extends AbstractRTABuilder {
|
|||
// This indicates an error; I sure hope getTargetForCall
|
||||
// raised a warning about this!
|
||||
if (DEBUG) {
|
||||
Trace.println("Warning: null target for call " + site + " " + iKey);
|
||||
System.err.println(("Warning: null target for call " + site + " " + iKey));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -22,7 +22,6 @@ import com.ibm.wala.ipa.callgraph.CGNode;
|
|||
import com.ibm.wala.ipa.callgraph.impl.FakeRootMethod;
|
||||
import com.ibm.wala.ipa.callgraph.propagation.cfa.ContextInsensitiveSSAInterpreter;
|
||||
import com.ibm.wala.types.FieldReference;
|
||||
import com.ibm.wala.util.debug.Trace;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -50,7 +49,7 @@ public class DefaultRTAInterpreter implements RTAContextInterpreter {
|
|||
return f.getInterpreter();
|
||||
} else {
|
||||
if (DEBUG) {
|
||||
Trace.println("providing context insensitive interpreter for node " + node);
|
||||
System.err.println(("providing context insensitive interpreter for node " + node));
|
||||
}
|
||||
return defaultInterpreter;
|
||||
}
|
||||
|
|
|
@ -44,7 +44,6 @@ import com.ibm.wala.util.collections.Iterator2Collection;
|
|||
import com.ibm.wala.util.collections.MapIterator;
|
||||
import com.ibm.wala.util.collections.MapUtil;
|
||||
import com.ibm.wala.util.debug.Assertions;
|
||||
import com.ibm.wala.util.debug.Trace;
|
||||
import com.ibm.wala.util.debug.UnimplementedError;
|
||||
import com.ibm.wala.util.functions.Function;
|
||||
import com.ibm.wala.util.ref.CacheReference;
|
||||
|
@ -254,7 +253,7 @@ public class ClassHierarchy implements IClassHierarchy {
|
|||
*/
|
||||
private void addAllClasses(IClassLoader loader, IProgressMonitor progressMonitor) throws CancelCHAConstructionException {
|
||||
if (DEBUG) {
|
||||
Trace.println("Add all classes from loader " + loader);
|
||||
System.err.println(("Add all classes from loader " + loader));
|
||||
}
|
||||
Collection<IClass> toRemove = HashSetFactory.make();
|
||||
for (Iterator<IClass> it = loader.iterateAllClasses(); it.hasNext();) {
|
||||
|
@ -287,7 +286,7 @@ public class ClassHierarchy implements IClassHierarchy {
|
|||
}
|
||||
}
|
||||
if (DEBUG) {
|
||||
Trace.println("Attempt to add class " + klass);
|
||||
System.err.println(("Attempt to add class " + klass));
|
||||
}
|
||||
Set<IClass> loadedSuperclasses;
|
||||
Collection loadedSuperInterfaces;
|
||||
|
@ -298,7 +297,7 @@ public class ClassHierarchy implements IClassHierarchy {
|
|||
// a little cleanup
|
||||
if (klass instanceof ShrikeClass) {
|
||||
if (DEBUG) {
|
||||
Trace.println("Exception. Clearing " + klass);
|
||||
System.err.println(("Exception. Clearing " + klass));
|
||||
}
|
||||
}
|
||||
Warnings.add(ClassExclusion.create(klass.getReference(), e.getMessage()));
|
||||
|
@ -327,7 +326,7 @@ public class ClassHierarchy implements IClassHierarchy {
|
|||
workingSuperclasses.remove(superclass);
|
||||
Node supernode = findOrCreateNode(superclass);
|
||||
if (DEBUG) {
|
||||
Trace.println("addChild " + node.getJavaClass() + " to " + supernode.getJavaClass());
|
||||
System.err.println(("addChild " + node.getJavaClass() + " to " + supernode.getJavaClass()));
|
||||
}
|
||||
supernode.addChild(node);
|
||||
if (supernode.getJavaClass().getReference().equals(rootTypeRef)) {
|
||||
|
@ -561,12 +560,12 @@ public class ClassHierarchy implements IClassHierarchy {
|
|||
}
|
||||
if (superclass == null) {
|
||||
if (DEBUG) {
|
||||
Trace.println("resolveMethod(" + selector + ") failed: method not found");
|
||||
System.err.println(("resolveMethod(" + selector + ") failed: method not found"));
|
||||
}
|
||||
return null;
|
||||
} else {
|
||||
if (DEBUG) {
|
||||
Trace.println("Attempt to resolve for " + receiverClass + " in superclass: " + superclass + " " + selector);
|
||||
System.err.println(("Attempt to resolve for " + receiverClass + " in superclass: " + superclass + " " + selector));
|
||||
}
|
||||
return resolveMethod(superclass, selector);
|
||||
}
|
||||
|
|
|
@ -21,7 +21,6 @@ import com.ibm.wala.ipa.cha.IClassHierarchy;
|
|||
import com.ibm.wala.types.TypeName;
|
||||
import com.ibm.wala.types.TypeReference;
|
||||
import com.ibm.wala.util.debug.Assertions;
|
||||
import com.ibm.wala.util.debug.Trace;
|
||||
|
||||
/**
|
||||
* A {@link ClassTargetSelector} that looks up the declared type of a {@link NewSiteReference}
|
||||
|
@ -80,13 +79,13 @@ public class BypassClassTargetSelector implements ClassTargetSelector {
|
|||
}
|
||||
TypeReference nominalRef = site.getDeclaredType();
|
||||
if (DEBUG) {
|
||||
Trace.println("BypassClassTargetSelector getAllocatedTarget: " + nominalRef);
|
||||
System.err.println(("BypassClassTargetSelector getAllocatedTarget: " + nominalRef));
|
||||
}
|
||||
|
||||
IClass realType = cha.lookupClass(nominalRef);
|
||||
if (realType == null) {
|
||||
if (DEBUG) {
|
||||
Trace.println("cha lookup failed. Delegating to " + parent.getClass());
|
||||
System.err.println(("cha lookup failed. Delegating to " + parent.getClass()));
|
||||
}
|
||||
return parent.getAllocatedTarget(caller, site);
|
||||
}
|
||||
|
@ -94,7 +93,7 @@ public class BypassClassTargetSelector implements ClassTargetSelector {
|
|||
|
||||
if (allocatableTypes.contains(realRef)) {
|
||||
if (DEBUG) {
|
||||
Trace.println("allocatableType! ");
|
||||
System.err.println("allocatableType! ");
|
||||
}
|
||||
if (realType.isAbstract() || realType.isInterface()) {
|
||||
TypeName syntheticName = BypassSyntheticClass.getName(realRef);
|
||||
|
@ -111,7 +110,7 @@ public class BypassClassTargetSelector implements ClassTargetSelector {
|
|||
}
|
||||
} else {
|
||||
if (DEBUG) {
|
||||
Trace.println("not allocatable. Delegating to " + parent.getClass());
|
||||
System.err.println(("not allocatable. Delegating to " + parent.getClass()));
|
||||
}
|
||||
return parent.getAllocatedTarget(caller, site);
|
||||
}
|
||||
|
|
|
@ -25,7 +25,6 @@ import com.ibm.wala.types.TypeReference;
|
|||
import com.ibm.wala.util.collections.HashMapFactory;
|
||||
import com.ibm.wala.util.collections.HashSetFactory;
|
||||
import com.ibm.wala.util.debug.Assertions;
|
||||
import com.ibm.wala.util.debug.Trace;
|
||||
import com.ibm.wala.util.strings.Atom;
|
||||
|
||||
/**
|
||||
|
@ -87,7 +86,7 @@ public class MethodBypass {
|
|||
*/
|
||||
private SyntheticMethod getBypass(MethodReference m) {
|
||||
if (DEBUG) {
|
||||
Trace.println("MethodBypass.getBypass? " + m);
|
||||
System.err.println(("MethodBypass.getBypass? " + m));
|
||||
}
|
||||
SyntheticMethod result = findOrCreateSyntheticMethod(m);
|
||||
if (result != null) {
|
||||
|
@ -129,7 +128,7 @@ public class MethodBypass {
|
|||
MethodSummary result = (MethodSummary) methodSummaries.get(m);
|
||||
if (result != null) {
|
||||
if (DEBUG) {
|
||||
Trace.println("findSummary succeeded: " + m);
|
||||
System.err.println(("findSummary succeeded: " + m));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
@ -139,7 +138,7 @@ public class MethodBypass {
|
|||
result = (MethodSummary) methodSummaries.get(t);
|
||||
if (result != null) {
|
||||
if (DEBUG) {
|
||||
Trace.println("findSummary succeeded: " + t);
|
||||
System.err.println(("findSummary succeeded: " + t));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
@ -151,12 +150,12 @@ public class MethodBypass {
|
|||
result = (MethodSummary) methodSummaries.get(p);
|
||||
if (result != null) {
|
||||
if (DEBUG) {
|
||||
Trace.println("findSummary succeeded: " + p);
|
||||
System.err.println(("findSummary succeeded: " + p));
|
||||
}
|
||||
return result;
|
||||
} else {
|
||||
if (DEBUG) {
|
||||
Trace.println("findSummary failed: " + m);
|
||||
System.err.println(("findSummary failed: " + m));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
@ -203,7 +202,7 @@ public class MethodBypass {
|
|||
IMethod m = getClassHierarchy().resolveMethod(target);
|
||||
if (m != null) {
|
||||
if (DEBUG) {
|
||||
Trace.println("resolveTarget: resolved to " + m);
|
||||
System.err.println(("resolveTarget: resolved to " + m));
|
||||
}
|
||||
target = m.getReference();
|
||||
}
|
||||
|
|
|
@ -20,7 +20,6 @@ import com.ibm.wala.ssa.SSAOptions;
|
|||
import com.ibm.wala.types.MethodReference;
|
||||
import com.ibm.wala.types.TypeReference;
|
||||
import com.ibm.wala.util.debug.Assertions;
|
||||
import com.ibm.wala.util.debug.Trace;
|
||||
|
||||
/**
|
||||
* @author sfink
|
||||
|
@ -38,7 +37,7 @@ public class SummarizedMethod extends SyntheticMethod {
|
|||
Assertions._assert(declaringClass != null);
|
||||
}
|
||||
if (DEBUG) {
|
||||
Trace.println("SummarizedMethod ctor: " + ref + " " + summary);
|
||||
System.err.println(("SummarizedMethod ctor: " + ref + " " + summary));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -85,7 +84,7 @@ public class SummarizedMethod extends SyntheticMethod {
|
|||
@Override
|
||||
public SSAInstruction[] getStatements(SSAOptions options) {
|
||||
if (DEBUG) {
|
||||
Trace.println("getStatements: " + this);
|
||||
System.err.println(("getStatements: " + this));
|
||||
}
|
||||
return summary.getStatements();
|
||||
}
|
||||
|
|
|
@ -49,7 +49,6 @@ import com.ibm.wala.types.TypeReference;
|
|||
import com.ibm.wala.util.collections.HashMapFactory;
|
||||
import com.ibm.wala.util.collections.HashSetFactory;
|
||||
import com.ibm.wala.util.debug.Assertions;
|
||||
import com.ibm.wala.util.debug.Trace;
|
||||
import com.ibm.wala.util.strings.Atom;
|
||||
import com.ibm.wala.util.warnings.Warning;
|
||||
|
||||
|
@ -787,7 +786,7 @@ public class XMLMethodSummaryReader implements BytecodeConstants {
|
|||
governingMethod = new MethodSummary(ref);
|
||||
|
||||
if (DEBUG) {
|
||||
Trace.println("Register method summary: " + ref);
|
||||
System.err.println(("Register method summary: " + ref));
|
||||
}
|
||||
summaries.put(ref, governingMethod);
|
||||
|
||||
|
|
|
@ -37,7 +37,6 @@ import com.ibm.wala.types.TypeName;
|
|||
import com.ibm.wala.types.TypeReference;
|
||||
import com.ibm.wala.util.collections.HashMapFactory;
|
||||
import com.ibm.wala.util.debug.Assertions;
|
||||
import com.ibm.wala.util.debug.Trace;
|
||||
import com.ibm.wala.util.strings.Atom;
|
||||
|
||||
/**
|
||||
|
@ -266,7 +265,7 @@ public class XMLReflectionReader implements BytecodeConstants, ReflectionSpecifi
|
|||
governingMethod = new ReflectionSummary();
|
||||
|
||||
if (DEBUG) {
|
||||
Trace.println("Register method summary: " + ref);
|
||||
System.err.println(("Register method summary: " + ref));
|
||||
}
|
||||
summaries.put(ref, governingMethod);
|
||||
}
|
||||
|
|
|
@ -15,7 +15,6 @@ import java.util.Iterator;
|
|||
|
||||
import com.ibm.wala.util.collections.EmptyIterator;
|
||||
import com.ibm.wala.util.debug.Assertions;
|
||||
import com.ibm.wala.util.debug.Trace;
|
||||
import com.ibm.wala.util.intset.IntIterator;
|
||||
import com.ibm.wala.util.intset.IntSet;
|
||||
import com.ibm.wala.util.intset.IntSetUtil;
|
||||
|
@ -68,7 +67,7 @@ public class DefUse {
|
|||
defs = new SSAInstruction[getMaxValueNumber() + 1];
|
||||
uses = new MutableIntSet[getMaxValueNumber() + 1];
|
||||
if (DEBUG) {
|
||||
Trace.println("DefUse: defs.length " + defs.length);
|
||||
System.err.println(("DefUse: defs.length " + defs.length));
|
||||
}
|
||||
Iterator it = allInstructions.iterator();
|
||||
for (int i = 0; i < allInstructions.size(); i++) {
|
||||
|
|
|
@ -34,7 +34,6 @@ import com.ibm.wala.util.collections.HashMapFactory;
|
|||
import com.ibm.wala.util.collections.Iterator2Collection;
|
||||
import com.ibm.wala.util.collections.MapIterator;
|
||||
import com.ibm.wala.util.debug.Assertions;
|
||||
import com.ibm.wala.util.debug.Trace;
|
||||
import com.ibm.wala.util.debug.UnimplementedError;
|
||||
import com.ibm.wala.util.functions.Function;
|
||||
import com.ibm.wala.util.graph.impl.NumberedNodeIterator;
|
||||
|
@ -85,8 +84,8 @@ public class SSACFG implements ControlFlowGraph<SSAInstruction, ISSABasicBlock>
|
|||
}
|
||||
this.cfg = cfg;
|
||||
if (DEBUG) {
|
||||
Trace.println("Incoming CFG for " + method + ":");
|
||||
Trace.println(cfg.toString());
|
||||
System.err.println(("Incoming CFG for " + method + ":"));
|
||||
System.err.println(cfg.toString());
|
||||
}
|
||||
|
||||
this.method = method;
|
||||
|
|
|
@ -13,8 +13,6 @@ package com.ibm.wala.util.collections;
|
|||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
|
||||
import com.ibm.wala.util.debug.Trace;
|
||||
|
||||
/**
|
||||
* simple implementation of IVector
|
||||
*/
|
||||
|
@ -84,8 +82,8 @@ public class SimpleVector<T> implements IVector<T> {
|
|||
* @see com.ibm.wala.util.intset.IntVector#reportStats()
|
||||
*/
|
||||
public void performVerboseAction() {
|
||||
Trace.println("size: " + store.length);
|
||||
Trace.println("occupancy: " + computeOccupancy());
|
||||
System.err.println(("size: " + store.length));
|
||||
System.err.println(("occupancy: " + computeOccupancy()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -14,7 +14,6 @@ import java.util.Iterator;
|
|||
import java.util.NoSuchElementException;
|
||||
|
||||
import com.ibm.wala.util.debug.Assertions;
|
||||
import com.ibm.wala.util.debug.Trace;
|
||||
import com.ibm.wala.util.intset.IntIterator;
|
||||
import com.ibm.wala.util.intset.MutableSparseIntSet;
|
||||
import com.ibm.wala.util.intset.TunedMutableSparseIntSet;
|
||||
|
@ -96,9 +95,9 @@ public class SparseVector<T> implements IVector<T> {
|
|||
* @see com.ibm.wala.util.debug.VerboseAction#performVerboseAction()
|
||||
*/
|
||||
public void performVerboseAction() {
|
||||
Trace.println(getClass() + " stats: ");
|
||||
Trace.println("data.length " + data.length);
|
||||
Trace.println("indices.size() " + indices.size());
|
||||
System.err.println((getClass() + " stats: "));
|
||||
System.err.println(("data.length " + data.length));
|
||||
System.err.println(("indices.size() " + indices.size()));
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -15,18 +15,12 @@ import java.io.FileNotFoundException;
|
|||
import java.io.FileOutputStream;
|
||||
import java.io.PrintStream;
|
||||
import java.io.PrintWriter;
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
|
||||
/**
|
||||
* Simple utility for printing trace messages.
|
||||
*
|
||||
* TODO: should this be nuked and replaced with some java.util.Logging
|
||||
* functions?
|
||||
*
|
||||
* @author sfink
|
||||
*
|
||||
*/
|
||||
@Deprecated
|
||||
public class Trace {
|
||||
|
||||
private static final String TRACEFILE_KEY = "com.ibm.wala.tracefile";
|
||||
|
@ -87,47 +81,29 @@ public class Trace {
|
|||
}
|
||||
|
||||
/**
|
||||
* Method println.
|
||||
*
|
||||
* @param string
|
||||
*/
|
||||
public static synchronized void println(String string) {
|
||||
if (setTraceFile()) {
|
||||
out.println(string);
|
||||
}
|
||||
System.err.println(string);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param o
|
||||
* @throws IllegalArgumentException if o is null
|
||||
*/
|
||||
public static synchronized void println(Object o) {
|
||||
if (o == null) {
|
||||
throw new IllegalArgumentException("o is null");
|
||||
}
|
||||
Trace.println(o.toString());
|
||||
System.err.println(o);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string
|
||||
*/
|
||||
public static synchronized void print(String string) {
|
||||
if (setTraceFile()) {
|
||||
out.print(string);
|
||||
}
|
||||
System.err.print(string);
|
||||
}
|
||||
|
||||
public static synchronized void format(String format, Object ... args) {
|
||||
|
||||
if (setTraceFile()) {
|
||||
out.format(format, args);
|
||||
}
|
||||
System.err.format(format, args);
|
||||
}
|
||||
|
||||
public static void flush() {
|
||||
if (setTraceFile()) {
|
||||
out.flush();
|
||||
}
|
||||
System.err.flush();
|
||||
}
|
||||
|
||||
public static PrintWriter getTraceWriter() {
|
||||
|
@ -149,7 +125,7 @@ public class Trace {
|
|||
throw new IllegalArgumentException("S == null");
|
||||
}
|
||||
if (substring == null || S.indexOf(substring) > -1) {
|
||||
println(S);
|
||||
System.err.println(S);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
|
@ -169,33 +145,13 @@ public class Trace {
|
|||
throw new IllegalArgumentException("S == null");
|
||||
}
|
||||
if (substring == null || S.indexOf(substring) > -1) {
|
||||
print(S);
|
||||
System.err.print(S);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string
|
||||
* @param c
|
||||
* @throws IllegalArgumentException if c is null
|
||||
*/
|
||||
public static void printCollection(String string, Collection c) {
|
||||
if (c == null) {
|
||||
throw new IllegalArgumentException("c is null");
|
||||
}
|
||||
println(string);
|
||||
if (c.isEmpty()) {
|
||||
println("none\n");
|
||||
} else {
|
||||
for (Iterator it = c.iterator(); it.hasNext();) {
|
||||
println(it.next().toString());
|
||||
}
|
||||
println("\n");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Returns the traceFile.
|
||||
*/
|
||||
|
|
|
@ -10,11 +10,11 @@
|
|||
*******************************************************************************/
|
||||
package com.ibm.wala.util.graph;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
|
||||
import com.ibm.wala.util.collections.HashSetFactory;
|
||||
import com.ibm.wala.util.debug.Trace;
|
||||
import com.ibm.wala.util.graph.traverse.BFSIterator;
|
||||
import com.ibm.wala.util.graph.traverse.DFS;
|
||||
|
||||
|
@ -128,7 +128,7 @@ public class GraphIntegrity {
|
|||
for (Iterator it = G.iterator(); it.hasNext();) {
|
||||
Object n = it.next();
|
||||
if (DEBUG_LEVEL > 1) {
|
||||
Trace.println("n2 loop: " + n);
|
||||
System.err.println(("n2 loop: " + n));
|
||||
}
|
||||
n2++;
|
||||
}
|
||||
|
@ -183,8 +183,8 @@ public class GraphIntegrity {
|
|||
return new UnsoundGraphException("set2 already contained " + o2);
|
||||
}
|
||||
}
|
||||
Trace.printCollection("set 1 ", set1);
|
||||
Trace.printCollection("set 2 ", set2);
|
||||
GraphIntegrity.printCollection("set 1 ", set1);
|
||||
GraphIntegrity.printCollection("set 2 ", set2);
|
||||
HashSet s1clone = (HashSet) set1.clone();
|
||||
set1.removeAll(set2);
|
||||
if (set1.size() > 0) {
|
||||
|
@ -219,4 +219,24 @@ public class GraphIntegrity {
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string
|
||||
* @param c
|
||||
* @throws IllegalArgumentException if c is null
|
||||
*/
|
||||
public static void printCollection(String string, Collection c) {
|
||||
if (c == null) {
|
||||
throw new IllegalArgumentException("c is null");
|
||||
}
|
||||
System.err.println(string);
|
||||
if (c.isEmpty()) {
|
||||
System.err.println("none\n");
|
||||
} else {
|
||||
for (Iterator it = c.iterator(); it.hasNext();) {
|
||||
System.err.println(it.next().toString());
|
||||
}
|
||||
System.err.println("\n");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -22,7 +22,6 @@ import com.ibm.wala.util.collections.Filter;
|
|||
import com.ibm.wala.util.collections.HashMapFactory;
|
||||
import com.ibm.wala.util.collections.HashSetFactory;
|
||||
import com.ibm.wala.util.collections.NonNullSingletonIterator;
|
||||
import com.ibm.wala.util.debug.Trace;
|
||||
import com.ibm.wala.util.graph.Graph;
|
||||
|
||||
/**
|
||||
|
@ -172,7 +171,7 @@ public class BFSPathFinder<T> {
|
|||
while (!Q.isEmpty()) {
|
||||
T N = Q.removeFirst();
|
||||
if (DEBUG) {
|
||||
Trace.println("visit " + N);
|
||||
System.err.println(("visit " + N));
|
||||
}
|
||||
if (filter.accepts(N)) {
|
||||
return makePath(N, history);
|
||||
|
|
|
@ -30,7 +30,6 @@ import com.ibm.wala.util.collections.HashMapFactory;
|
|||
import com.ibm.wala.util.collections.HashSetFactory;
|
||||
import com.ibm.wala.util.collections.Pair;
|
||||
import com.ibm.wala.util.debug.Assertions;
|
||||
import com.ibm.wala.util.debug.Trace;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -310,7 +309,7 @@ public class HeapTracer {
|
|||
private void traverse(Field root, Result result, IdentityHashMap<Object, Object> objectsVisited) throws IllegalArgumentException,
|
||||
IllegalAccessException {
|
||||
if (DEBUG) {
|
||||
Trace.println("traverse root " + root);
|
||||
System.err.println(("traverse root " + root));
|
||||
}
|
||||
root.setAccessible(true);
|
||||
Object contents = root.get(null);
|
||||
|
@ -361,7 +360,7 @@ public class HeapTracer {
|
|||
private void traverseArray(Field root, Object array, Object container, Result result, IdentityHashMap<Object, Object> objectsVisited)
|
||||
throws IllegalArgumentException {
|
||||
if (DEBUG) {
|
||||
Trace.println("traverse array " + array.getClass());
|
||||
System.err.println(("traverse array " + array.getClass()));
|
||||
}
|
||||
Class elementKlass = array.getClass().getComponentType();
|
||||
if (elementKlass.isPrimitive()) {
|
||||
|
@ -393,7 +392,7 @@ public class HeapTracer {
|
|||
|
||||
Class c = scalar.getClass();
|
||||
if (DEBUG) {
|
||||
Trace.println("traverse scalar " + c);
|
||||
System.err.println(("traverse scalar " + c));
|
||||
}
|
||||
Field[] fields = getAllReferenceInstanceFields(c);
|
||||
for (int i = 0; i < fields.length; i++) {
|
||||
|
@ -420,13 +419,13 @@ public class HeapTracer {
|
|||
} else {
|
||||
if (p.getName() != null && p.getName().indexOf("sun.reflect") != -1) {
|
||||
if (DEBUG) {
|
||||
Trace.println("making " + p + " a BAD package");
|
||||
System.err.println(("making " + p + " a BAD package"));
|
||||
}
|
||||
packageStatus.put(p, BAD);
|
||||
return true;
|
||||
} else {
|
||||
if (DEBUG) {
|
||||
Trace.println("making " + p + " an OK package");
|
||||
System.err.println(("making " + p + " an OK package"));
|
||||
}
|
||||
packageStatus.put(p, OK);
|
||||
return false;
|
||||
|
@ -549,11 +548,11 @@ public class HeapTracer {
|
|||
System.gc();
|
||||
long t = Runtime.getRuntime().totalMemory();
|
||||
long f = Runtime.getRuntime().freeMemory();
|
||||
Trace.println("Total Memory: " + t);
|
||||
Trace.println("Occupied Memory: " + (t - f));
|
||||
System.err.println(("Total Memory: " + t));
|
||||
System.err.println(("Occupied Memory: " + (t - f)));
|
||||
HeapTracer.Result r = (new HeapTracer(traceStatics)).perform();
|
||||
Trace.println("HeapTracer Analysis:");
|
||||
Trace.println(r.toString());
|
||||
System.err.println("HeapTracer Analysis:");
|
||||
System.err.println(r.toString());
|
||||
} catch (IllegalArgumentException e) {
|
||||
e.printStackTrace();
|
||||
} catch (ClassNotFoundException e) {
|
||||
|
@ -580,11 +579,11 @@ public class HeapTracer {
|
|||
System.gc();
|
||||
long t = Runtime.getRuntime().totalMemory();
|
||||
long f = Runtime.getRuntime().freeMemory();
|
||||
Trace.println("Total Memory: " + t);
|
||||
Trace.println("Occupied Memory: " + (t - f));
|
||||
System.err.println(("Total Memory: " + t));
|
||||
System.err.println(("Occupied Memory: " + (t - f)));
|
||||
HeapTracer.Result r = (new HeapTracer(instances, traceStatics)).perform();
|
||||
Trace.println("HeapTracer Analysis:");
|
||||
Trace.println(r.toString());
|
||||
System.err.println("HeapTracer Analysis:");
|
||||
System.err.println(r.toString());
|
||||
return r;
|
||||
} catch (IllegalArgumentException e) {
|
||||
e.printStackTrace();
|
||||
|
|
|
@ -16,7 +16,6 @@ import com.ibm.wala.util.collections.IVector;
|
|||
import com.ibm.wala.util.collections.SimpleVector;
|
||||
import com.ibm.wala.util.collections.TwoLevelVector;
|
||||
import com.ibm.wala.util.debug.Assertions;
|
||||
import com.ibm.wala.util.debug.Trace;
|
||||
|
||||
/**
|
||||
* A relation between non-negative integers
|
||||
|
@ -388,12 +387,12 @@ public final class BasicNaturalRelation implements IBinaryNaturalRelation {
|
|||
*/
|
||||
public void performVerboseAction() {
|
||||
if (VERBOSE) {
|
||||
Trace.println(getClass() + " stats:");
|
||||
Trace.println("count: " + countPairs());
|
||||
Trace.println("delegate: " + delegateStore.getClass());
|
||||
System.err.println((getClass() + " stats:"));
|
||||
System.err.println(("count: " + countPairs()));
|
||||
System.err.println(("delegate: " + delegateStore.getClass()));
|
||||
delegateStore.performVerboseAction();
|
||||
for (int i = 0; i < smallStore.length; i++) {
|
||||
Trace.println("smallStore[" + i + "]: " + smallStore[i].getClass());
|
||||
System.err.println(("smallStore[" + i + "]: " + smallStore[i].getClass()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,7 +16,6 @@ import java.util.WeakHashMap;
|
|||
|
||||
import com.ibm.wala.util.collections.HashMapFactory;
|
||||
import com.ibm.wala.util.collections.MapUtil;
|
||||
import com.ibm.wala.util.debug.Trace;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -86,8 +85,8 @@ public class BitVectorRepository {
|
|||
*/
|
||||
private static void reportStats() {
|
||||
double percent = 100.0 * hits / queries;
|
||||
Trace.println("BitVectorRepository: queries " + queries + " hits " + percent);
|
||||
Trace.println(" entries " + countEntries());
|
||||
System.err.println(("BitVectorRepository: queries " + queries + " hits " + percent));
|
||||
System.err.println((" entries " + countEntries()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
package com.ibm.wala.util.intset;
|
||||
|
||||
import com.ibm.wala.util.debug.Assertions;
|
||||
import com.ibm.wala.util.debug.Trace;
|
||||
import com.ibm.wala.util.debug.UnimplementedError;
|
||||
|
||||
/**
|
||||
|
@ -31,7 +30,7 @@ public class IntSetUtil {
|
|||
MutableIntSetFactory intSetFactory = (MutableIntSetFactory) intSetFactoryClass.newInstance();
|
||||
setDefaultIntSetFactory(intSetFactory);
|
||||
} catch (Exception e) {
|
||||
Trace.println("Cannot use int set factory " + System.getProperty(INT_SET_FACTORY_CONFIG_PROPERTY_NAME));
|
||||
System.err.println(("Cannot use int set factory " + System.getProperty(INT_SET_FACTORY_CONFIG_PROPERTY_NAME)));
|
||||
setDefaultIntSetFactory(defaultFactory);
|
||||
}
|
||||
} else {
|
||||
|
@ -99,17 +98,17 @@ public class IntSetUtil {
|
|||
// TODO: this is slow ... optimize please.
|
||||
MutableIntSet result = factory.makeCopy(A);
|
||||
if (DEBUG) {
|
||||
Trace.println("initial result " + result + " " + result.getClass());
|
||||
System.err.println(("initial result " + result + " " + result.getClass()));
|
||||
}
|
||||
for (IntIterator it = B.intIterator(); it.hasNext();) {
|
||||
int I = it.next();
|
||||
result.remove(I);
|
||||
if (DEBUG) {
|
||||
Trace.println("removed " + I + " now is " + result);
|
||||
System.err.println(("removed " + I + " now is " + result));
|
||||
}
|
||||
}
|
||||
if (DEBUG) {
|
||||
Trace.println("return " + result);
|
||||
System.err.println(("return " + result));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
@ -151,7 +150,7 @@ public class IntSetUtil {
|
|||
}
|
||||
if (A instanceof SemiSparseMutableIntSet && B instanceof SemiSparseMutableIntSet) {
|
||||
if (DEBUG) {
|
||||
Trace.println("call SemiSparseMutableIntSet.removeAll");
|
||||
System.err.println("call SemiSparseMutableIntSet.removeAll");
|
||||
}
|
||||
return ((SemiSparseMutableIntSet) A).removeAll((SemiSparseMutableIntSet) B);
|
||||
} else {
|
||||
|
@ -159,11 +158,11 @@ public class IntSetUtil {
|
|||
int I = it.next();
|
||||
A.remove(I);
|
||||
if (DEBUG) {
|
||||
Trace.println("removed " + I + " now is " + A);
|
||||
System.err.println(("removed " + I + " now is " + A));
|
||||
}
|
||||
}
|
||||
if (DEBUG) {
|
||||
Trace.println("return " + A);
|
||||
System.err.println(("return " + A));
|
||||
}
|
||||
return A;
|
||||
}
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
package com.ibm.wala.util.intset;
|
||||
|
||||
import com.ibm.wala.util.debug.Assertions;
|
||||
import com.ibm.wala.util.debug.Trace;
|
||||
import com.ibm.wala.util.debug.UnimplementedError;
|
||||
|
||||
/**
|
||||
|
@ -31,7 +30,7 @@ public class LongSetUtil {
|
|||
MutableLongSetFactory intSetFactory = (MutableLongSetFactory) intSetFactoryClass.newInstance();
|
||||
setDefaultLongSetFactory(intSetFactory);
|
||||
} catch (Exception e) {
|
||||
Trace.println("Cannot use int set factory " + System.getProperty(INT_SET_FACTORY_CONFIG_PROPERTY_NAME));
|
||||
System.err.println(("Cannot use int set factory " + System.getProperty(INT_SET_FACTORY_CONFIG_PROPERTY_NAME)));
|
||||
setDefaultLongSetFactory(defaultFactory);
|
||||
}
|
||||
} else {
|
||||
|
@ -88,17 +87,17 @@ public class LongSetUtil {
|
|||
// TODO: this is slow ... optimize please.
|
||||
MutableLongSet result = factory.makeCopy(A);
|
||||
if (DEBUG) {
|
||||
Trace.println("initial result " + result + " " + result.getClass());
|
||||
System.err.println(("initial result " + result + " " + result.getClass()));
|
||||
}
|
||||
for (LongIterator it = B.longIterator(); it.hasNext();) {
|
||||
long I = it.next();
|
||||
result.remove(I);
|
||||
if (DEBUG) {
|
||||
Trace.println("removed " + I + " now is " + result);
|
||||
System.err.println(("removed " + I + " now is " + result));
|
||||
}
|
||||
}
|
||||
if (DEBUG) {
|
||||
Trace.println("return " + result);
|
||||
System.err.println(("return " + result));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
@ -136,11 +135,11 @@ public class LongSetUtil {
|
|||
long I = it.next();
|
||||
A.remove(I);
|
||||
if (DEBUG) {
|
||||
Trace.println("removed " + I + " now is " + A);
|
||||
System.err.println(("removed " + I + " now is " + A));
|
||||
}
|
||||
}
|
||||
if (DEBUG) {
|
||||
Trace.println("return " + A);
|
||||
System.err.println(("return " + A));
|
||||
}
|
||||
return A;
|
||||
}
|
||||
|
|
|
@ -12,8 +12,6 @@ package com.ibm.wala.util.intset;
|
|||
|
||||
import java.util.Arrays;
|
||||
|
||||
import com.ibm.wala.util.debug.Trace;
|
||||
|
||||
/**
|
||||
* simple implementation of IntVector
|
||||
*/
|
||||
|
@ -109,8 +107,8 @@ public class SimpleIntVector implements IntVector {
|
|||
* @see com.ibm.wala.util.intset.IntVector#reportStats()
|
||||
*/
|
||||
public void performVerboseAction() {
|
||||
Trace.println("size: " + store.length);
|
||||
Trace.println("occupancy: " + computeOccupancy());
|
||||
System.err.println(("size: " + store.length));
|
||||
System.err.println(("occupancy: " + computeOccupancy()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
*******************************************************************************/
|
||||
package com.ibm.wala.util.intset;
|
||||
|
||||
import com.ibm.wala.util.debug.Trace;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -83,9 +82,9 @@ public class SparseIntVector implements IntVector {
|
|||
* @see com.ibm.wala.util.debug.VerboseAction#performVerboseAction()
|
||||
*/
|
||||
public void performVerboseAction() {
|
||||
Trace.println(getClass() + " stats: ");
|
||||
Trace.println("data.length " + data.length);
|
||||
Trace.println("indices.size() " + indices.size());
|
||||
System.err.println((getClass() + " stats: "));
|
||||
System.err.println(("data.length " + data.length));
|
||||
System.err.println(("indices.size() " + indices.size()));
|
||||
}
|
||||
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue