Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Data flow analysis in JDT compiler(Searching for information or documents about Dataflow analysis used in the JDT compiler)
Data flow analysis in JDT compiler [message #1015282] Wed, 27 February 2013 22:15 Go to next message
Gabriel Knight is currently offline Gabriel Knight
Messages: 1
Registered: February 2013
Junior Member
Hi everyone!

I'm looking for information about data flow analysis used by the JDT compiler.
Especially which different data flow analysis are used in the compiler and how they are working.
I know that most data flow stuff (e.g. optimizations) is done by the JVM and not by the sourcecode -> bytecode compiler but the Eclipse compiler is also able to give information about dead code for example.

Is there any documentation about what data flow techniques are used in JDT and how they are working?

Haven't found something about that.

Thanks and Greetings,


Gabriel
Re: Data flow analysis in JDT compiler [message #1015377 is a reply to message #1015282] Thu, 28 February 2013 07:22 Go to previous message
Stephan Herrmann is currently offline Stephan Herrmann
Messages: 994
Registered: July 2009
Senior Member
What analysis is performed, can best be seen from this list of warning options:
http://help.eclipse.org/topic/org.eclipse.jdt.doc.user/reference/preferences/java/compiler/ref-preferences-errors-warnings.htm
Some of these operate at the level of type resolution but some do involve flow analysis. Some flow analysis is mandatory as per the JLS, other is specific to ECJ. Aside from the mandatory definite-assignment analysis the most sophisticated flow analysis is for detecting null dereferences, but, e.g., also the detection of (potential) resource leaks involves flow analysis.

Only few of these analyses are geared towards optimization (e.g., elimination of unused local variables), most relate in fact to the detection of potential programming problems.

If you want to learn how this analysis works, the point of reference is the source code.
The central infra structure for this can be found in
http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/tree/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/flow

The details are implemented in analyseCode methods throughout all classes of the AST.

HTH,
Stephan
Previous Topic:jardesc root folder
Next Topic:Why does Composite have no actual value?
Goto Forum:
  


Current Time: Wed Aug 20 22:35:13 EDT 2014

Powered by FUDForum. Page generated in 0.01926 seconds