Static Analysis: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
| Line 3: | Line 3: | ||
* Develop the AST-pattern-matching [http://weblogs.mozillazine.org/roadmap/archives/2006/11/oinkbased_patch_generation.html patch generation] tool. | * Develop the AST-pattern-matching [http://weblogs.mozillazine.org/roadmap/archives/2006/11/oinkbased_patch_generation.html patch generation] tool. | ||
** Automate part of deCOMtamination. [[Gecko:DeCOMtamination Algorithm]] | ** Automate part of deCOMtamination. [[Gecko:DeCOMtamination Algorithm]] | ||
** Automation of ownership cleanups (see below). | |||
* "Semantic grep" (super-LXR) tasks: | * "Semantic grep" (super-LXR) tasks: | ||
** Clean up uses of obsolete API. [[Gecko:Obsolete API]] | ** Clean up uses of obsolete API. [[Gecko:Obsolete API]] | ||
| Line 9: | Line 10: | ||
*** Strong/weak pointers. | *** Strong/weak pointers. | ||
*** Optional annotations for strong vs. weak pointer. | *** Optional annotations for strong vs. weak pointer. | ||
*** Finding raw pointers that should be weak or strong. | |||
*** Static cycle detection. | *** Static cycle detection. | ||
*** Static reference-counting elimination. | *** Static reference-counting elimination. | ||
Revision as of 00:41, 29 November 2006
Applications for Oink static analysis tools for Mozilla 2:
- Develop the AST-pattern-matching patch generation tool.
- Automate part of deCOMtamination. Gecko:DeCOMtamination Algorithm
- Automation of ownership cleanups (see below).
- "Semantic grep" (super-LXR) tasks:
- Clean up uses of obsolete API. Gecko:Obsolete API
- Automatically identify unused or hardly-used code.
- Ownership analysis:
- Strong/weak pointers.
- Optional annotations for strong vs. weak pointer.
- Finding raw pointers that should be weak or strong.
- Static cycle detection.
- Static reference-counting elimination.
- "Who can point to" analysis.
- Auto-generate traverse and unlink methods for the Cycle Collector
- Oink finds outgoing pointers, generates iterators.
- Check and enforce exception safety.
- Find stack pointers to malloc'ed temporary hazards.
- Refactoring opportunities arising from exceptions.
- Control flow analysis
- Generate patches to convert from nsresults to C++ exceptions.
- Identify C++ to convert to JS2...
- ... and translate it automatically.
- C++ candidate code uses only scriptable interfaces, strings, primitives.
- Canonicalization:
- Replace XPCOM portability veneer with std-C++ equivalents.
- Replace NSPR C portability veneer with std-C equivalents?
- Enforce confidentiality properties:
- Chrome never evals a content-tainted string.
- C++ never snprintfs using a content-tainted string.
- SpiderMonkey Exact-GC safety bugs.
- "Not stored in the heap" pointer dataflow analysis.
- Dataflow enforcement of correct API usage (CQual++):
- String character set encoding mistakes.
- More dataflow enforcement (beyond the reach of CQual++):
- Unit analysis (twips vs. pixels) for layout and rendering.
- Code metrics, to compare to similar open source projects:
- Virtual method declaration and call populations.
- Cohesion, coupling, other modularity measures.