Purity analysis for JavaScript through abstract interpretation. Issue 12 (25th August 2017)
- Record Type:
- Journal Article
- Title:
- Purity analysis for JavaScript through abstract interpretation. Issue 12 (25th August 2017)
- Main Title:
- Purity analysis for JavaScript through abstract interpretation
- Authors:
- Nicolay, Jens
Stiévenart, Quentin
De Meuter, Wolfgang
De Roover, Coen - Other Names:
- Khomh Foutse guestEditor.
Lo David guestEditor.
Godfrey Michael W. guestEditor. - Abstract:
- Abstract: We present a static analysis for determining whether and to what extent functions in JavaScript programs are pure. To this end, the analysis classifies functions as pure functions, observers, or procedures. A function is pure if none of its executions generate or depend upon externally observable side effects. A function is an observer as soon as one of its executions depends on an external side effect, but none of its executions generate observable side effects. Otherwise, the function is classified as a procedure. Function executions and associated callers are found by traversing all reachable function execution contexts on the call stack at the point where an effect occurs. Our approach is based on a flow analysis that, in addition to computing traditional control and value flow, keeps track of read and write effects. To increase the precision of our purity analysis, we combine it with an intraprocedural analysis that determines freshness of variables and objects. We formalize the core aspects of our technique and discuss its implementation and results on common JavaScript benchmarks. Results show that our approach is capable of determining function purity in the presence of higher‐order functions, dynamic property expressions, and prototypal inheritance. When compared with existing purity analyses, we find that our approach is as precise or more precise than the existing analyses. Abstract : We present a static analysis for determining whether and to whatAbstract: We present a static analysis for determining whether and to what extent functions in JavaScript programs are pure. To this end, the analysis classifies functions as pure functions, observers, or procedures. A function is pure if none of its executions generate or depend upon externally observable side effects. A function is an observer as soon as one of its executions depends on an external side effect, but none of its executions generate observable side effects. Otherwise, the function is classified as a procedure. Function executions and associated callers are found by traversing all reachable function execution contexts on the call stack at the point where an effect occurs. Our approach is based on a flow analysis that, in addition to computing traditional control and value flow, keeps track of read and write effects. To increase the precision of our purity analysis, we combine it with an intraprocedural analysis that determines freshness of variables and objects. We formalize the core aspects of our technique and discuss its implementation and results on common JavaScript benchmarks. Results show that our approach is capable of determining function purity in the presence of higher‐order functions, dynamic property expressions, and prototypal inheritance. When compared with existing purity analyses, we find that our approach is as precise or more precise than the existing analyses. Abstract : We present a static analysis for determining whether and to what extent functions in JavaScript programs are pure. Our approach is based on a flow analysis that, in addition to computing traditional control and value flow, keeps track of read and write effects. When compared to existing purity analyses, we find that our approach is as precise as or more precise than the existing analyses. … (more)
- Is Part Of:
- Journal of software. Volume 29:Issue 12(2017)
- Journal:
- Journal of software
- Issue:
- Volume 29:Issue 12(2017)
- Issue Display:
- Volume 29, Issue 12 (2017)
- Year:
- 2017
- Volume:
- 29
- Issue:
- 12
- Issue Sort Value:
- 2017-0029-0012-0000
- Page Start:
- n/a
- Page End:
- n/a
- Publication Date:
- 2017-08-25
- Subjects:
- abstract interpretation -- freshness analysis -- JavaScript -- purity analysis -- side effect analysis
Software engineering -- Periodicals
Computer software -- Development -- Periodicals
Software maintenance -- Periodicals
005.1 - Journal URLs:
- http://onlinelibrary.wiley.com/journal/10.1002/(ISSN)2047-7481 ↗
http://onlinelibrary.wiley.com/ ↗ - DOI:
- 10.1002/smr.1889 ↗
- Languages:
- English
- ISSNs:
- 2047-7473
- Deposit Type:
- Legaldeposit
- View Content:
- Available online (eLD content is only available in our Reading Rooms) ↗
- Physical Locations:
- British Library DSC - BLDSS-3PM
British Library HMNTS - ELD Digital store - Ingest File:
- 5540.xml