Commit Graph

59 Commits

Author SHA1 Message Date
Erik Derr ee13713c4d Impl of IMethod.is(Wala)Synthetic and IClass.isSynthetic (#359)
* Impl of IMethod isSynthetic and isWalaSynthetic

So far IMethod.isSynthetic referred to WALA-generated helper functions
and there was no equivalent to check whether an IMethod is synthetic in
terms of compiler-generated.

To make naming consistent this patch first renames the isSynthetic to
isWalaSynthetic to clearly indicate that a given IMethod was generated
by WALA. Then, we re-introduce isSynthetic that from now on checks
whether an IMethod is synthetic/compiler-generated (referring to the
synthetic flag in bytecode)

* Implementation of IClass.isSynthetic

Complementary to IMethod.isSynthetic, this method checks whether
an IClass is compiler-generated.

* updated JavaDoc
2018-10-02 22:28:21 -07:00
Ben Liblit 5336a08af2 Avoid using deprecated boxing constructors
Boxing a primitive using the constructor ("new Integer(4)") always
creates a distinct new boxed instance.  That's rarely what you need,
and in fact all of those constructors have been deprecated in Java 9.
Using the static "valueOf" method instead ("Integer.valueOf(4)") can
give better performance by reusing existing instances.  You no longer
get a unique boxed object, but generally that's OK.
2018-06-05 14:44:59 -05:00
Ben Liblit f60c164ec1 Escape "<" and ">" in Javadoc when not used as HTML tag syntax 2017-12-19 16:53:52 -06:00
Ben Liblit 0286c2b048 Use Iterator2Iterable helper to convert more loops to for-each 2017-12-04 14:04:39 -08:00
Ben Liblit 544a71ae72 Remove type arguments that Java 1.7+ can infer for us 2017-12-04 14:04:39 -08:00
Ben Liblit ebfd885d22 Use modern for-each loops where possible
Java sources used as test data have been excluded from this mass
clean-up.
2017-11-28 14:44:53 -06:00
Ben Liblit 8ef6ad5069 Add proper type parameters to nearly all uses of Iterator
Java sources used as test data have been excluded.
2017-11-28 14:09:30 -06:00
Ben Liblit dee2412ab5 Remove several unused locals and clean up surrounding code
In all of these cases, the code used to initialize the unused local
seems nontrivial to me.  I think this can all be removed without
erasing any needed side effects, but the code might still become
useful to someone in the future.  So I'm not really removing the code
entirely, but merely commenting it out.
2017-05-26 14:25:03 -07: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 671bd98977 Java 8 suport enhancements, mostly to model lambdas compiled to
invokedynamic
2015-08-12 15:20:21 -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
Manu Sridharan 8984637b86 make classes public. Fixes #32 2013-09-16 10:32:29 -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
Juergen Graf b82d5dba90 Merge branch 'wala' into master 2012-11-06 04:23:10 +01:00
Manu Sridharan 256cd06460 Convert all Java source files to use Unix line endings; no semantic change 2012-09-04 15:56:05 -07:00
Manu Sridharan bab4777e4c some (very) basic support for pointer / reference types 2012-08-21 16:56:18 -07:00
Juergen Graf 7c518d1867 added instruction index field to SSAInstruction (javascript not working atm) 2011-04-12 19:49:06 +02: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 de6adbc4d7 more migration to Java assertions
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3559 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2009-05-01 17:42:28 +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
dolby-oss e80dc6ef8c refactor handling of constants in Shrike to abstract away from Java bytecode
introduce factories to create SSAInstruction objects


git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3433 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2009-04-10 18:33:07 +00:00
sjfink 957cb2b8ca deprecate Trace
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3432 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2009-04-09 20:31:14 +00:00
sjfink 93411336ba misc. small fixes and documentation
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3372 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2009-03-26 20:56:08 +00:00
dolby-oss b61135c8be adapt to Shrike changes: divorce SSAInstruction from the Shrike Instruction, which requires adding a type parameter to ControlFlowGraph and propagating that change. Also, stop using the JVML opcode in a few places where it was (unnecessarily) being used.
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3227 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2009-02-19 15:58:31 +00:00
sjfink dfcbf65e7b misc. minor cleanups
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@2988 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2008-08-14 21:05:14 +00:00
msridhar1 96952cd431 more generics
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@2772 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2008-04-28 22:24:43 +00:00
msridhar1 eb9cd0e509 added comments and some debugging prints
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@2743 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2008-04-03 19:50:25 +00:00
sjfink 9b266acea0 bug fixes and assertions for reflection corner cases
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@2727 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2008-03-21 15:31:29 +00:00
msridhar1 bf8549d599 added context parameter to SyntheticMethod.makeIR()
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@2652 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2008-03-03 04:02:33 +00:00
sjfink d77357fd5a bug fixes for reflection processing of arrays
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@2639 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2008-02-29 22:14:56 +00:00
sjfink e9f3eb3eaa misc bug fixes with synthetic factory methods
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@2587 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2008-02-15 20:48:57 +00:00
sjfink 84d0253841 new logic to interpret Class.newInstance() on a class constant, such as generated by forName(String constant).
Thanks Marco.

git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@2575 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2008-02-13 18:49:56 +00:00
sjfink bceae49558 enhance reflection support to evaluate Class.forName() on a string constant.
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@2542 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2008-02-05 19:09:23 +00:00
msridhar1 14ceabf781 added more generics
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@2409 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2008-01-17 17:55:48 +00:00
sjfink 3bee1b838e bug fix in understands()
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@2346 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2008-01-10 20:04:23 +00:00
sjfink b131a86e1d fix Bug 1852241 possible hash collisions for CGNodes
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@2198 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2007-12-17 14:31:17 +00:00
sjfink 182a53ee8f generics for control flow graph and filters
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@1712 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2007-09-02 14:45:41 +00:00
sjfink 59368d41ac decouple IR caching from AnalysisOptions with a new AnalysisCache object
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@1520 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2007-07-20 15:20:41 +00:00
sjfink 5eb76541f0 massive overhaul of Warnings management
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@1382 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2007-07-06 22:08:13 +00:00
sjfink 8864b70d50 miscellaneous housekeeping
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@1364 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2007-07-06 03:07:14 +00:00
sjfink b0d31d38cb remove some unnecessary IClassHierarchy parameters
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@1254 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2007-06-06 20:15:37 +00:00
sjfink 65cc4433cd make some fields final
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@1244 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2007-06-05 14:01:26 +00:00
dolby-oss 0ed8d96d55 Changes to allow cross-language call graphs. The three biggest changes are as follows:
1) The visitors nested in the SSAPropagationCallGraph have become static classes so that they can be reused in a delegation pattern for the cross-language call graph builder.
2) The ClassHierarchy is now encapsulated behind an IClassHierarchy interface to allow for a CrossLanguageClassHierarchy that delegates to a set of child hierarchies, one for each language.  The internals of the ClassHierarchy are almost entirely unchanged
3) There is now a new Language interface in com.ibm.wala.classLoader, and all IClassLoader objects have to know what language they load for.  This language object now encapsulates a few language-specific options that were previously hacked into the AnalysisOptions object.


git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@1212 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2007-06-01 03:26:18 +00:00
sjfink 9c58d8e2a8 change some Iterators in API to Collections
remove some unnecessary WarningSet parameters

git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@1208 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2007-05-31 02:38:49 +00:00
sjfink 6f2273f48a eliminate some use of raw types
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@1205 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2007-05-30 20:52:51 +00:00
sjfink ea3caa1e8a mostly clean up old comments.
also rename InferGraphRootsImpl to InferGraphRoots

git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@1200 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2007-05-30 19:05:23 +00:00
sjfink fdb7a17af3 add @Overrides annotations and nuke unnecessary casts
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@1197 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2007-05-30 15:16:05 +00:00