SAFE
Formal Specification and Implementation of a Scalable Analysis Framework for ECMAscript
PLRG@KAIST Hongki Lee, Sooncheol Won, Joonho Jin, Junhee Cho, and Sukyoung Ryu
SAFE Formal Specification and Implementation of a Scalable Analysis - - PowerPoint PPT Presentation
SAFE Formal Specification and Implementation of a Scalable Analysis Framework for ECMAscript PLRG@KAIST Hongki Lee , Sooncheol Won, Joonho Jin, Junhee Cho, and Sukyoung Ryu Contents Introduction Big Picture Formal Specification
Formal Specification and Implementation of a Scalable Analysis Framework for ECMAscript
PLRG@KAIST Hongki Lee, Sooncheol Won, Joonho Jin, Junhee Cho, and Sukyoung Ryu
JavaScript Parser AST withRewriter Disambiguator Hoister AST2IR IR IR2CFG CFG Interpreter Result CloneDetector CodeCoverage Analyzer
JavaScript Parser AST withRewriter Disambiguator Hoister AST2IR IR IR2CFG CFG Interpreter Result CloneDetector CodeCoverage Analyzer
var sum = 0; for(var i = 1; i <= 10; i++) sum+= i; _<>_print(sum); var i; var sum; sum = 0; for(i = 1; i <= 10; i++) sum+= i; _<>_print(sum);
Entry Exit ExitExc
var i var sum sum = 0 i = 1 <>break<>1 : { while(i <= 10) { <>continue<>2 : sum = sum + i <>old<>3 = i <>new<>4 = <>Global<>toNumber(<>old<>3) i = <>new<>4 + 1 <>Global<>ignore = <>new<>4 }} <>Global<>ignore = <>Global<>print(sum)
JavaScript Parser AST withRewriter Disambiguator Hoister AST2IR IR IR2CFG CFG Interpreter Result CloneDetector CodeCoverage Analyzer
f(); function f() { x = 1 }; var x; // x = 1 function f() { x = 1 }; var x; f(); // x = 1
With Hoister, functions and variables are defined before use
var x = 0; function g() { x; // x = ? var x = 1; } var x_1 = 0; function g() { var x_2; x_2; // x = ? x_2 = 1; }
Distinguish two ‘x’ variables
var o = {x:1, y:2, z:3};
with(o) { with(o.p) { x; } } var o = {x:1, y:2, z:3};
var $f_1 = o; var $f_2 = ("o" in $f_1 ? $f_1.o : o).p; ("x" in $f_2 ? $f_2.x : ("x" in $f_1 ? $f_1.x : x));
An Empirical Study on the Rewritability
JavaScript Parser AST withRewriter Disambiguator Hoister AST2IR IR IR2CFG CFG Interpreter Result CloneDetector CodeCoverage Analyzer
Calculate the ratio of tested code Perform type-based analysis Detect clone code in AST level
JavaScript Parser AST withRewriter Disambiguator Hoister AST2IR IR IR2CFG CFG Interpreter Result CloneDetector CodeCoverage Analyzer
available at http://plrg.kaist.ac.kr/research/safe