Commit Graph

79 Commits

Author SHA1 Message Date
Ben Liblit a888a49fdd Fix all Eclipse warnings about unnecessary semicolons
I have *not* upgraded this problem to be treated as an error in the
future.  Unfortunately Eclipse uses a single configuration setting for
both unnecessary semicolons and also for empty control-flow statements
like `while (p) ;`.  I'm not convinced that it's worth rewriting all
instances of the latter into `while (p) { }`.  So this is just going
to stay as a warning for now.
2017-07-14 22:39:01 -07:00
Ben Liblit e316471d88 Fix nearly all Eclipse warnings about using raw types
Along the way, I also converted many "for (;;)" loops into modern
"for (:)" loops.  I didn't systematically look for all opportunities
to do this, though.  I merely made this change where I was already
converting raw Iterator uses into modern Iterator<...> uses.

Better use of generics also allowed many casts to become statically
redundant.  I have removed all such redundant casts.

Only three raw-types warnings remain after this batch of fixes.  All
three involve raw uses of CallGraphBuilder.  I've tried to fix these
too, but it quickly snowballs into a cascade of changes that may or
may not eventually reach a statically-type-save fixed point.  I may
give these last few problem areas another go in the future.  For now,
though, the hundreds of other fixes seem worth keeping even if there
are a few stragglers.

This commit may change some public APIs, but only by making weaker
type signatures stronger by replacing raw types with generic types.
For example, we may change something like "Set" into "Set<String>",
but we're not adding new arguments, changing any
underlying (post-generics-erasure) types, etc.
2017-07-12 10:39:06 -07:00
Ben Liblit 72c754e874 Declare private methods static wherever possible
If a method is private, there's no risk that a subclass elsewhere
might be overriding it and depending on dynamic dispatch to choose the
right implementation.  So all of these private methods can safely be
declared static without risk of regression in either WALA code or
unseen third-party code.
2017-06-07 08:29:23 -07:00
Ben Liblit 65be11f222 Merge branch 'master' into warning-fixes-unnecessary-code-controversial 2017-03-25 22:12:03 -05:00
Ben Liblit c94d4210ab Merge branch 'warning-fixes-unnecessary-code-uncontroversial' 2017-03-24 10:33:01 -05:00
Ben Liblit 16492c7b78 Revert "Suppress 157 Eclipse warnings about unused exception parameters"
This reverts commit fe9f7a793a.
2017-03-23 16:32:00 -05:00
Ben Liblit 17ee9c3f98 Fix assorted Javadoc typos, such as omitted "}" 2017-03-22 20:40:52 -05:00
Ben Liblit 059810c1ca Fix 9 Eclipse warnings about unused methods
Note: some of these methods are decidedly nontrivial.  Perhaps they
should not actually be removed?  If any should be kept around, please
identify them to me.  I'll revise this change to retain those methods
and simply annotate them as needed to suppress Eclipse's warning.
2017-03-20 00:44:36 -05:00
Ben Liblit fe9f7a793a Suppress 157 Eclipse warnings about unused exception parameters
In the cases addressed here, the caught exception is truly not needed
by the handling code.
2017-03-20 00:44:06 -05:00
Ben Liblit 6766f1e261 Fix 42 Eclipse warnings about unused imports 2017-03-20 00:43:48 -05:00
Julian Dolby f595eb357e add some abstraction to IR, using IRView 2017-03-11 13:22:45 -05:00
Julian Dolby d24519e974 cross-cutting changes to make more of WALA runnable with TeaVM. The biggest change is refactoring to AnalysisCache and friends; since TeaVM does not support SoftReference, I needed to add a layer of interfaces so that I can use a more simpleminded caching implementation for TeaVM. There are other changes to Module and friends to break connections with File and URL, which also cause TeaVM grief. I also organized imports in many places to remove unused types that caused trouble. 2017-02-02 20:33:27 -05:00
Julian Dolby 0975441a43 changes for hybrid analysis 2015-04-05 21:19:56 -04:00
Julian Dolby c9ad359d65 new test to remind me that prototype no longer works with correlation tracking:
com.ibm.wala.cast.js.rhino.test/harness-src/com/ibm/wala/cast/js/test/TestPrototypeCallGraphShapeRhino.java
com.ibm.wala.cast.js.test/harness-src/com/ibm/wala/cast/js/test/TestPrototypeCallGraphShape.java
com.ibm.wala.cast.js.test.data/examples-src/pages/prototype.html

work (not yet finished) on fixes to property accesses for JavaScript:
com.ibm.wala.cast/source/java/com/ibm/wala/cast/ipa/callgraph/AstSSAPropagationCallGraphBuilder.java
com.ibm.wala.cast.java/src/com/ibm/wala/cast/java/ipa/callgraph/AstJavaSSAPropagationCallGraphBuilder.java
com.ibm.wala.cast.js/source/com/ibm/wala/cast/js/ipa/callgraph/JSSSAPropagationCallGraphBuilder.java

currently unused tests to remind me to fix bugs:
com.ibm.wala.cast.js.test/harness-src/com/ibm/wala/cast/js/test/TestSimpleCallGraphShape.java
com.ibm.wala.cast.js.test.data/examples-src/tests/loops.js
com.ibm.wala.cast.js.test.data/examples-src/tests/primitive_strings.js

fixes to exception handler code generation in JavaScript:
com.ibm.wala.cast.js.rhino/source/com/ibm/wala/cast/js/translator/RhinoToAstTranslator.java
com.ibm.wala.cast.js.test.data/examples-src/tests/try.js
com.ibm.wala.cast.js.test/harness-src/com/ibm/wala/cast/js/test/TestSimpleCallGraphShape.java

fixes to make the system build on both juno and luna
com.ibm.wala.cast.js.test.data/pom.xml
pom.xml
targets/e42/e42.target
targets/e44/e44.target
targets/pom.xml
com.ibm.wala.core.tests/META-INF/MANIFEST.MF
com.ibm.wala.dalvik.test/META-INF/MANIFEST.MF
com.ibm.wala.ide.jdt.test/META-INF/MANIFEST.MF
com.ibm.wala.ide.jdt/source/com/ibm/wala/cast/java/translator/jdt/FakeExceptionTypeBinding.java
com.ibm.wala.ide.jdt/source/com/ibm/wala/ide/util/JavaEclipseProjectPath.java
com.ibm.wala.ide.jsdt.tests/META-INF/MANIFEST.MF
com.ibm.wala.ide.jsdt.tests/src/com/ibm/wala/ide/jsdt/tests/AbstractJSProjectScopeTest.java
com.ibm.wala.ide/src/com/ibm/wala/ide/util/EclipseProjectPath.java
com.ibm.wala.ide/src/com/ibm/wala/ide/util/ProgressMonitorDelegate.java

beginnings of "pointer analysis" on top of field-based analysis
com.ibm.wala.cast.js/source/com/ibm/wala/cast/js/callgraph/fieldbased/flowgraph/FlowGraph.java
com.ibm.wala.cast.js/source/com/ibm/wala/cast/js/callgraph/fieldbased/flowgraph/vertices/PropVertex.java
com.ibm.wala.cast.js/source/com/ibm/wala/cast/js/callgraph/fieldbased/flowgraph/vertices/RetVertex.java
com.ibm.wala.cast.js/source/com/ibm/wala/cast/js/callgraph/fieldbased/flowgraph/vertices/VarVertex.java
com.ibm.wala.cast.js/source/com/ibm/wala/cast/js/callgraph/fieldbased/flowgraph/vertices/VertexFactory.java
com.ibm.wala.core/src/com/ibm/wala/ipa/callgraph/propagation/PointerAnalysis.java
com.ibm.wala.core/src/com/ibm/wala/ipa/callgraph/propagation/cfa/ExceptionReturnValueKey.java

fixes for crashes in correlartion tracking
com.ibm.wala.cast.js/source/com/ibm/wala/cast/js/ipa/callgraph/correlations/extraction/ClosureExtractor.java

fixes for Dalvik IR generation
com.ibm.wala.core/src/com/ibm/wala/cfg/BytecodeCFG.java
com.ibm.wala.core/src/com/ibm/wala/cfg/ShrikeCFG.java
com.ibm.wala.core/src/com/ibm/wala/ssa/SSACFG.java
com.ibm.wala.dalvik.test/source/com/ibm/wala/dalvik/drivers/APKCallGraphDriver.java
com.ibm.wala.dalvik.test/source/com/ibm/wala/dalvik/test/callGraph/JVMLDalvikComparison.java
com.ibm.wala.dalvik/src/com/ibm/wala/dalvik/classLoader/DexCFG.java
com.ibm.wala.dalvik/src/com/ibm/wala/dalvik/dex/instructions/UnaryOperation.java
com.ibm.wala.dalvik/src/com/ibm/wala/dalvik/ssa/AbstractIntRegisterMachine.java
com.ibm.wala.dalvik/src/com/ibm/wala/dalvik/ssa/DexSSABuilder.java

fixes to stack map generation when instrumenting for Java 7
com.ibm.wala.shrike/src/com/ibm/wala/shrike/cg/DynamicCallGraph.java
com.ibm.wala.shrike/src/com/ibm/wala/shrikeBT/ConstantInstruction.java
com.ibm.wala.shrike/src/com/ibm/wala/shrikeBT/analysis/Analyzer.java
com.ibm.wala.shrike/src/com/ibm/wala/shrikeBT/analysis/ClassHierarchy.java
com.ibm.wala.shrike/src/com/ibm/wala/shrikeBT/analysis/Verifier.java
com.ibm.wala.shrike/src/com/ibm/wala/shrikeBT/shrikeCT/ClassInstrumenter.java
com.ibm.wala.shrike/src/com/ibm/wala/shrikeCT/StackMapConstants.java
com.ibm.wala.shrike/src/com/ibm/wala/shrikeCT/StackMapTableReader.java
com.ibm.wala.shrike/src/com/ibm/wala/shrikeCT/StackMapTableWriter.java
2014-10-15 16:01:38 +09:00
Julian Dolby 774be73672 Merge https://github.com/jgf/wala-mirror 2014-09-11 10:43:13 -04:00
Julian Dolby 26f5254e3e more support for Java 7:
analysis now understands and propagates MethodHandle objects
  fixes to Shrike InvokeDynamic instruction


Former-commit-id: fb826f124423bcbca08f729cee1794fbda711d16
2014-08-07 16:02:48 -04:00
Juergen Graf 8f6ec6bc54 cleanup 2014-07-30 15:05:15 +02:00
Juergen Graf 6f8aee80c6 Merge branch 'wala' into master 2014-07-28 17:09:02 +02:00
Julian Dolby 3910608d60 JavaScript slicer support 2014-07-11 11:55:02 -04:00
Juergen Graf 428a3975ed Merge branch 'wala' into master
Conflicts:
	com.ibm.wala.cast.java/src/com/ibm/wala/cast/java/loader/JavaSourceLoaderImpl.java
	com.ibm.wala.cast.java/src/com/ibm/wala/cast/java/ssa/AstJavaInstructionFactory.java
	com.ibm.wala.cast.java/src/com/ibm/wala/cast/java/ssa/AstJavaInvokeInstruction.java
	com.ibm.wala.cast.js.test/harness-src/com/ibm/wala/cast/js/test/TestSimpleCallGraphShape.java
	com.ibm.wala.cast.js/source/com/ibm/wala/cast/js/html/WebPageLoaderFactory.java
	com.ibm.wala.cast.js/source/com/ibm/wala/cast/js/loader/JavaScriptLoader.java
	com.ibm.wala.cast.js/source/com/ibm/wala/cast/js/ssa/JSInstructionFactory.java
	com.ibm.wala.cast.js/source/com/ibm/wala/cast/js/ssa/JavaScriptInvoke.java
	com.ibm.wala.cast/source/java/com/ibm/wala/cast/ipa/callgraph/AstCallGraph.java
	com.ibm.wala.cast/source/java/com/ibm/wala/cast/ir/ssa/AbstractLexicalInvoke.java
	com.ibm.wala.cast/source/java/com/ibm/wala/cast/ir/ssa/AstInstructionFactory.java
	com.ibm.wala.cast/source/java/com/ibm/wala/cast/ir/ssa/AstLexicalRead.java
	com.ibm.wala.cast/source/java/com/ibm/wala/cast/ir/ssa/AstLexicalWrite.java
	com.ibm.wala.cast/source/java/com/ibm/wala/cast/ir/ssa/FixedParametersInvokeInstruction.java
	com.ibm.wala.cast/source/java/com/ibm/wala/cast/ir/translator/AstTranslator.java
	com.ibm.wala.core/.classpath
	com.ibm.wala.core/.settings/org.eclipse.jdt.core.prefs
	com.ibm.wala.ide/src/com/ibm/wala/ide/util/ProgressMonitorDelegate.java
	com.ibm.wala.util/src/com/ibm/wala/util/NullProgressMonitor.java
	com.ibm.wala.util/src/com/ibm/wala/util/ProgressMaster.java
2014-05-20 17:59:16 +02:00
Julian Dolby 56236dec53 further work on analysis for JavaScript in Eclipse 2013-10-16 17:37:53 -04:00
Manu Sridharan 059d841c8c removing lexical reads and writes from invoke instructions; WIP 2013-07-10 09:44:46 -07:00
Juergen Graf cdaaddf88b Merge branch 'wala' into master 2013-07-02 14:23:24 +02:00
Julian Dolby 080325b5f6 merge 2013-06-25 11:57:37 -04:00
Manu Sridharan d2933d49b2 delete a little more code and javadoc 2013-06-06 20:02:42 -07:00
Manu Sridharan 321695617c delete more code 2013-06-06 20:02:42 -07:00
Manu Sridharan 472a98d7cf delete some code 2013-06-06 20:02:42 -07:00
Manu Sridharan d4b252ad51 kill NEW_LEXICAL flag 2013-06-06 20:02:41 -07:00
Manu Sridharan dcc7cd206d bug fix: allow each language to determine when a CGNode represents the "definer" method for a lexical access 2013-04-29 20:34:40 -07:00
Juergen Graf 9b1cf1ae07 no warnings in com.ibm.wala.cast 2013-03-12 00:29:01 +01:00
dolby-oss a93dc6fcc5 minor cleanup
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@4543 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2012-03-08 17:34:36 +00:00
dolby-oss a9ec87f360 Changes motivated by analysis issues in JavaScript. The main change is that calls of the form f.x() in JavaScript are now analyzed like 'method calls' so that the 'this' pointer in the receiver functions can be filtered based upon the types that actually have the method being invoked. This requires much more dynamic filtering than in a language like Java, since properties like 'x' are simply properties that happen to hold functions, and so can be assigned in a first-class manner. Thus, the filtering needs to handle variance in both the types and the values of their properties; this is implemented as multiple levels of abstract object directed side effect equations in the dataflow system.
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@4535 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2012-03-01 02:45:51 +00:00
msridhar1 2dda77a0fb another bug fix; looking good...
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@4467 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2012-02-17 20:15:57 +00:00
msridhar1 bfb24934af another bug fix; getting closer...
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@4466 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2012-02-17 20:15:38 +00:00
msridhar1 78ef6e3a03 further work
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@4465 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2012-02-17 20:15:26 +00:00
dolby-oss 4c6d062dbb blunt force trauma to CAst frond end:
1) Structural changes in the AstTranslator to allow retranslation and generation of custom IR.  This is mostly moving state from the translator itself into the context.
2) Some refactoring to share some AST generation code across the Java and JavaScript front ends.
3) Switching to the latest Rhino, release 1.7R3; this is a pervasive change to the JavaScript Rhino translator, since it involves switching to the new AST interface in Rhino.
4) Common code to, as an option, translate Do-style loops by replicating the loop body.  This allows the use of CAstNode.LOOP forms for such loops.
5) Some bug fixes to the mechanisms of the CAstRewriter to handle weird control flow cases.
6) An example of retranslation to specialize JavaScript methods based on how many arguments they receive at call sites.


git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@4425 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2012-01-27 20:15:33 +00:00
msridhar1 72c2c92294 added coarser lexical-scoping resolver. reduces memory usage, but analysis seems to slower. disabled as regression tests don't pass
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@4352 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2012-01-06 21:31:15 +00:00
msridhar1 939f6b3f34 Organise imports.
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@4306 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2012-01-06 21:19:01 +00:00
dolby-oss 9432654ac9 minor performance tuning
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@4195 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2011-07-01 13:40:26 +00:00
dolby-oss b27fd8de26 performance work on lexical scoping
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@4192 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2011-06-30 15:45:58 +00:00
dolby-oss 3e573a992d upgrades to lexical soping implements to address some performance issues
fixes to HTML model to capture use of local vars as window state in scripts


git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@4176 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2011-05-23 16:27:07 +00:00
msridhar1 047ac9f0ce bug fix: add missing check for invariant points-to set
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@4170 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2011-05-05 03:51:14 +00:00
msridhar1 fcdce3f128 javadoc
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@4167 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2011-05-04 20:42:05 +00:00
msridhar1 cbd5613a35 javadoc, formatting, move a DEBUG flag
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@4163 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2011-05-02 22:11:27 +00:00
dolby-oss 4da02a9125 Changes to extend supported context sensitivity to CPA-style:
1) extend ContextSelector interface to allow it to specify parameters of interest
  2) extend filtering mechanism at call sites to allow CPA-style filtering when requested by contexts
  3) various related fixes and extensions:
    a) removed redundant code to handle dispatch for JavaScript, so now it shares the core mechanism
    b) tighten types for operators that take an array of args - now the array is T[] at the cost of a few array allocation methods
    c) a bit more support for empty int sets
    d) void function objects
    e) bug fixes for lexical scoping support, and adaptation to work with core dispatch mechanism
    f) example of CPA-style sensitivity to handle nastiness in a JavaScript for(.. in ...) loop
    

git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@4150 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2011-04-27 13:58:56 +00:00
sjfink fa825de846 refactoring of fixpoint API
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@4033 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2011-01-17 21:43:18 +00:00
dolby-oss c7558b3646 fixes for Rational
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3985 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2010-11-02 19:11:58 +00:00
dolby-oss e4b9d03be5 bug fixes for unicode names and to prevent analysis from modifying the symbol table
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3936 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2010-09-14 20:29:05 +00:00
msridhar1 b8ecc8d48a nuked ReflectionSpecification
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3832 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2010-05-12 17:19:54 +00:00
sjfink 9939142eae switch from Assertions._assert to Java assertions
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3555 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2009-04-30 13:16:52 +00:00