Document Type

Research

Publication Date

9-2013

Abstract

This poster describes a paper for static analysis of JavaScript, which has proven useful for a variety of tools, including optimization, error checking, security auditing, program refactoring, and more. We propose a technique called type refinement that can improve the precision of such static analyses for JavaScript without any discernible performance impact. The essential idea behind refinement is to use the conditions in branch guards to refine the analysis information propagated along each branch path. The key insight of the paper is to recognize that JavaScript semantics include many implicit conditional checks on types, and that performing type refinement on these checks provides significant benefit for analysis precision.

To demonstate the effectiveness of type refinement, we implement a static analysis tool for reporting potential type-errors in JavaScript programs as an example of analyses that can benefit from this idea. We provide an extensive empirical evaluation of type refinement using a benchmark suite containing a variety of JavaScript application domains, ranging from the standard performance benchmark suites (Sunspider and Octane), to open-source JavaScript applications, to machine-generated JavaScript via Emscripten. We show that type refinement can significantly improve analysis precision, upto 86%, without affecting the performance of the analysis.

Share

COinS