DocumentCode
1902880
Title
Just-in-time value specialization
Author
Costa, I. ; Alves, P. ; Santos, H.N. ; Pereira, Fernando M. Q.
Author_Institution
Dept. of Comput. Sci., Fed. Univ. of Minas Gerais (UFMG), Belo Horizonte, Brazil
fYear
2013
fDate
23-27 Feb. 2013
Firstpage
1
Lastpage
11
Abstract
JavaScript emerges today as one of the most important programming languages for the development of client-side web applications. Therefore, it is essential that browsers be able to execute JavaScript programs efficiently. However, the dynamic nature of this programming language makes it very challenging to achieve this much needed efficiency. In this paper we propose parameter-based value specialization as a way to improve the quality of the code produced by JIT engines. We have empirically observed that almost 60% of the JavaScript functions found in the world´s 100 most popular websites are called only once, or are called with the same parameters. Capitalizing on this observation, we adapt a number of classic compiler optimizations to specialize code based on the runtime values of function´s actual parameters. We have implemented the techniques proposed in this paper in IonMonkey, an industrial quality JavaScript JIT compiler developed in the Mozilla Foundation. Our experiments, run across three popular JavaScript benchmarks, SunSpider, V8 and Kraken, show that, in spite of its highly speculative nature, our optimization pays for itself. As an example, we have been able to speedup SunSpider by 5.38%, and to reduce the size of its native code by 16.72%.
Keywords
Internet; Java; program compilers; JIT engine; JavaScript function; JavaScript program; Kraken Java; Mozilla Foundation; SunSpider Java; V8 Java; client-side Web application; code size; code specialization; compiler optimization; just-in-time value specialization; parameter-based value specialization; programming language; Benchmark testing; Browsers; Engines; Google; Histograms; Optimization; Runtime; JIT; JavaScript; Speculation; compilation;
fLanguage
English
Publisher
ieee
Conference_Titel
Code Generation and Optimization (CGO), 2013 IEEE/ACM International Symposium on
Conference_Location
Shenzhen
Print_ISBN
978-1-4673-5524-7
Type
conf
DOI
10.1109/CGO.2013.6495006
Filename
6495006
Link To Document