Commit Graph

48 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 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 4cef26162c Add @Override annotations wherever possible (#178)
* Fix warnings about unset javacProjectSettings build entries

Specifically, these are all warnings of the form "The
'javacProjectSettings' build entry should be set when there are project
specific compiler settings".

* Add @Override annotations to all methods that do override

This fixes 287 Eclipse code style warnings.

* Cannot add @Override annotations here, so suppress warnings instead

We should be able to add these @Override annotations in the future,
one Eclipse Mars and earlier are no longer supported.  For now,
though, they have to go away in order to be compatible with older
Eclipse releases.
2017-05-08 07:39:49 -07:00
Ben Liblit 994a70500f Remove redundant generic type parameters where possible
Instead, rely on Java's ability to infer type parameters in many
contexts.  This removes 665 Eclipse warnings.

Note: a few of these changes are to files under "test" subdirectories.
Presumably those are files that serve as test inputs rather than being
part of WALA code proper.  As far as I can tell, these changes do not
break any WALA tests.  But if any of those tests were specifically
intended to exercise WALA on code with non-inferred generic type
parameters, then I really should be leaving those alone.
2017-03-11 21:20:51 -06:00
Ben Liblit 1cf7f0f3d3 Merge branch 'master' of github.com:wala/WALA 2017-03-11 20:21:51 -06:00
Ben Liblit 5a5cccc062 Strip execute bits from many non-executable (i.e., non-script) files 2017-02-23 06:10:08 -06: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 2396d0fad3 Revert "Revert "fixes to getting source positions from JVML""
This reverts commit 619df0a83d.
2017-01-19 19:12:22 -05:00
Julian Dolby 619df0a83d Revert "fixes to getting source positions from JVML"
This reverts commit 9e35099326.
2017-01-19 18:49:02 -05:00
Julian Dolby 9e35099326 fixes to getting source positions from JVML
CAst rewriter abstraction
2017-01-19 17:52:42 -05:00
Julian Dolby 31e4028a94 adapt to wala changes 2015-10-14 13:36:48 -04:00
Julian Dolby 487f6cc150 move to Rhino 1.7.6 2015-08-14 12:27:13 -04:00
Julian Dolby 563b6ba6aa fixes for for ... in ... form in JavaScript 2015-07-24 22:44:10 -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 dd3124479e allow control flow in induced cfgs, and various related fixes 2014-07-08 14:44:06 -04:00
Julian Dolby e58ec4dba8 new special parent scope for cases where JavaScript redefines a variable using a reference to the existing definition 2014-06-26 11:05:43 -04:00
Julian Dolby a5a80e7848 heurisitics to make readable names for anonymous functions 2014-05-28 13:32:55 -04:00
Julian Dolby 893f4b7308 type in CAst var decls 2014-03-16 18:05:49 -04:00
Julian Dolby 27dc4c0bb2 ignore debugger token 2014-02-08 21:35:53 -05:00
Julian Dolby 026f04cbfc get more error information from Rhino 2013-11-26 17:20:16 -05:00
Julian Dolby beab92e359 Fixed bugs in the front end handling esoteric cases of weird control
flow.

added support for JavaScript projects read from Eclipse that are based
on HTML files as well as JavaScript files
2013-07-30 14:04:08 -04:00
Julian Dolby 080325b5f6 merge 2013-06-25 11:57:37 -04:00
Julian Dolby 87b856928c fixes for handling parse errors in JS and HTML 2013-03-01 10:07:20 -05:00
Julian Dolby afccdd2189 Annotation support 2013-02-02 21:27:45 -05:00
Julian Dolby 9aa474fdb1 1) added InstanceKey.getCreation sites and its implementations
2) fixes for issues with keys representing dynamic properties
  i) all properties are converted to strings, in an approximation of JS
semantics
3) fix to handling of instance keys representing numbers in binary +;
now it understands that adding constant keys of type Number requires
adding a non-constant Number key to the lval
2013-01-07 20:18:27 -05:00
dolby 319eacc529 merge changes and changes for atomic sets work 2012-08-29 16:35:34 -04:00
dolby b6ee356641 tests for source mapping 2012-05-11 15:03:10 -04:00
dolby dfe06b8ff3 changes to Web source mapping to exploit rhino 1.7R3 source offsets 2012-05-08 13:17:01 -04: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
dolby-oss 00b51cd14c make more stuff into BLOCK_STMT
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@4454 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2012-02-08 17:10:24 +00:00
msridhar1 a52455972c Adding support for unary "void" operator.
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@4447 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2012-02-08 15:34:10 +00:00
msridhar1 daf36902bd Avoid plugging in the same AST node twice when creating code for a
method call.

git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@4444 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2012-02-08 15:33:35 +00:00
msridhar1 1e0ad9dbc6 Put stderr output under DEBUG flag.
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@4437 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2012-02-08 15:32:03 +00:00
dolby-oss f557348885 make some expression into statements
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@4434 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2012-02-08 02:49:21 +00:00
dolby-oss 79946e98d6 purported fixes for Max's latest bugs (with some tests)
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@4433 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2012-02-07 13:50:08 +00:00
dolby-oss 3113f14e23 handling for delete exprs, and a test
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@4432 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2012-02-06 13:54:10 +00:00
dolby-oss b1c8a6bb6d fixes for max
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@4431 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2012-02-01 17:35:32 +00:00
dolby-oss f5fc9a3c56 set source position for whole function
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@4430 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2012-01-31 12:37:17 +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
dolby-oss 78ae5ffece update to latest Rhino, 1.7R2
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@4107 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2011-04-05 19:18:14 +00:00
dolby-oss b20b7d2b91 added recording of script tag locations from which script code is included into the analysis of a Web page
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@4098 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2011-04-04 17:17:01 +00:00
dolby-oss 79b44cc3bc updates to processing of Web pages:
1) adopted the code from Rational for HTML handling
    i) extended it to integrate better source mapping into IR
    ii) integrated fixes from the old html processing to collect more info on forms
    iii) added some copyright comments
  2) updated version of jericho
  3) added support for nu.validator for html5
  4) added script to fetch html parser jars, and removed binary jar
  

git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@4092 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2011-04-04 15:27:11 +00:00
dolby-oss bfb9abe0c0 fix to handle redefinition of 'undefined' (yuck)
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3973 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2010-10-11 14:28:24 +00:00
yinnon_haviv fc0d5ecc47 - Fix the cast rewriter to rewrite labels too.
- Fix the translation of switch statements to keep the labels "alive" (part of the AST).
- Added test case for the bug.

git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3960 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2010-10-02 20:27:17 +00:00
yinnon_haviv 1d4d158de3 Replace manual creating of URL (using, e.g., "file:" + f.getAbsolutePath() ) with progrematic one.
(File.toURI().toURL()). Good for cross platform (Mac vs. Windows)

git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3953 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2010-09-28 16:22:08 +00:00
dolby-oss eede2f13db bug fix for exceptions out of functions
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3933 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2010-09-14 20:25:10 +00:00
msridhar1 8b41d7fc88 update to JUnit 4
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3747 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2009-07-27 23:21:22 +00:00
dolby-oss a3dc6411ae separate Rhino-specific portions of javascript analysis
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3731 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2009-07-16 18:09:54 +00:00