Preview

Proceedings of the Institute for System Programming of the RAS (Proceedings of ISP RAS)

Advanced search

Dynamic compilation of JavaScript programs to the statically typed LLVM intermediate representation

https://doi.org/10.15514/ISPRAS-2015-27(6)-3

Abstract

Since its inception in the middle of the 90’s, JavaScript has become one of the most popular web development languages. Although initially developed as a browser-agnostic scripting language, in recent years JavaScript continues its evolution beyond the desktop to areas such as mobile and server-side web applications. Many massive applications are written using JavaScript, such as gmail, google docs, etc. JavaScript is also used in the Node.js - server-side web application developing platform. Moreover, JavaScript is the main language for developing applications on some operating systems for mobile and media devices. Examples of such systems are Tizen and FirefoxOS. Modern JavaScript engines use just-in-time (JIT) compilation to produce binary code. JIT compilers are limited in complexity of optimizations they can perform at runtime without delaying the execution. To maintain a trade-off between quick startup and doing sophisticated optimizations, JavaScript engines usually use multiple tiers for compiling hot functions. Our work is dedicated to performance improvement of JavaScript programs by adding a new optimizing level to the JavaScript V8 compiler. This level uses the LLVM infrastructure to optimize JavaScript functions and generate machine code. The main challenge of adding a new optimizing level is to support all the technologies (speculative compilation, on-stack replacement, concurrent compilation etc.) that are used in the modern multi-tier JIT compilers for increasing the performance and minimizing pauses during the interactive communication. All these technologies are fully supported in our solution. This has resulted in significant performance gains on the JavaScript benchmark suites when compiling hot functions.

About the Authors

V. . Vardanyan
ISP RAS
Russian Federation


V. . Ivanishin
ISP RAS
Russian Federation


S. . Asryan
YSU
Armenia


A. . Khachatryan
YSU
Armenia


J. . Hakobyan
YSU
Armenia


References

1. Node.js website – https://nodejs.org

2. Tizen platform website – http://www.tizen.org

3. Mozilla website – https://www.mozilla.org

4. LLVM website – http://www.llvm.org/

5. ECMA-262 Standard

6. http://www.ecma-international.org/publications/standards/Ecma-262.htm

7. HotSpot dynamic compiler documentation website –http://openjdk.java.net/groups/hotspot/docs/RuntimeOverview.html

8. Webkit website – http://www.webkit.org

9. R. Zhuykov, D. Melnik, R. Buchatskiy, V. Vardanyan, V. Ivanishin, E. Sharygin. Metody dinamicheskoj i predvaritel'noj optimizacii programm na jazyke JavaScript. [Dynamic and ahead of time optimization for JavaScript programs] Trudy ISP RАN [The Proceedings of ISP RAS], Volume 26 (Issue 1). 2014, pp. 297-314. DOI: 10.15514/ISPRAS-2014-26(1)-10 (in Russian)

10. U. Hölzle, C. Chambers, D. Ungar “Optimizing Dynamically-Typed Object-Oriented Languages With Polymorphic Inline Caches” ECOOP '91 Proceedings of the European Conference on Object-Oriented Programming, 21-38, 1991

11. StackMaps structure documentation webpage — http://llvm.org/docs/StackMaps.html

12. LLVM rL229945 revision review page — http://reviews.llvm.org/rL229945

13. StatePoints structure documentation webpage — http://llvm.org/docs/Statepoints.html


Review

For citations:


Vardanyan V., Ivanishin V., Asryan S., Khachatryan A., Hakobyan J. Dynamic compilation of JavaScript programs to the statically typed LLVM intermediate representation. Proceedings of the Institute for System Programming of the RAS (Proceedings of ISP RAS). 2015;27(6):33-48. (In Russ.) https://doi.org/10.15514/ISPRAS-2015-27(6)-3



Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 License.


ISSN 2079-8156 (Print)
ISSN 2220-6426 (Online)