Skip to main content
Log in

Ahead-of-time compilation of JavaScript programs

  • Published:
Programming and Computer Software Aims and scope Submit manuscript

Abstract

Modern virtual machines for JavaScript use just-in-time (JIT) compilation to produce binary code. JIT compilers cannot perform complex optimizations. In contrast, static compilation has unlimited capabilities for complex optimizing transformations, but it cannot be efficiently applied to dynamic languages, such as JavaScript. In this paper, a general approach to the ahead-of-time compilation of programs in dynamic languages is proposed, and this approach is used for improving two virtual machines JavaScript- Core and V8. In the implementation of the improved JavaScriptCore engine with ahead-of-time compilation, the specifics of using JavaScript programs as a part of locally stored applications for the ARM platform were taken into account. In the V8 engine for the x86-64 platform, the ahead-of-time compilation is implemented by caching an optimized internal representation in a separate file.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Institutional subscriptions

Similar content being viewed by others

References

  1. JavaScriptCore webpage on WebKit website. http://trac.webkit.org/wiki/JavaScriptCore

  2. WebKit Browser Engine website. http://www.webkit.org

  3. V8 Browser Engine webpage. https://code.google.com/p/v8/

  4. Hong, S., Kim, J., Shin, J.W., Moon, S., Oh, H. Lee, J., and Choi, H., Java client ahead-of-time compiler for embedded systems, in Proc. of the 2007 ACM SIGPLAN/SIGBED Conference on Languages, Compilers, and Tools for Embedded Systems, 2007, pp. 63–72.

    Google Scholar 

  5. Hong, S. and Moon, S., Client-ahead-of-time compilation for digital TV software platform, in 3rd Workshop on Dynamic Compilation Everywhere, preprint, 2013. http: //sites.google.com/site/dynamiccompilationeverywhere /home/dce-2014/DCE-2014-Sunghyun-Hong-article. pdf

    Google Scholar 

  6. Zhuykov, R., Melnik, D., Buchatskiy, R., Vardanyan, V., Ivanishin, V., and Sharygin, E., Dynamic and ahead of time optimization for JavaScript programs, Trudy Inst. Sist. Programmirovaniya RAN, 2014, vol. 26, issue 1, pp. 297–314.

    Google Scholar 

  7. ECMA-262 Standard 5.1 edition description. http://www.ecma-international.org/ecma-262/5.1/index.html

  8. Asm.js language website. http://asmjs.org/

  9. “Are we fast yet?” https://arewefastyet.com/

  10. Tramp3d testing webpage. http://gcc.opensuse.org/c++bench/tramp3d/

  11. Emscripten project website. http://kripken.github.io/emscripten-site/

  12. WebKit JavaScriptCore ahead-of-time compilation project sources at github.com website. http://github.com/ispras/webkit-aotc

  13. V8 ahead-of-time compilation project sources at github.com website. http://github.com/ispras/v8-aotc

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to R. Zhuykov.

Additional information

Original Russian Text © R. Zhuykov, E. Sharygin, 2017, published in Trudy Instituta Sistemnogo Programmirovaniya, vol. 27, issue 6, 2015, pp. 67–86.

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Zhuykov, R., Sharygin, E. Ahead-of-time compilation of JavaScript programs. Program Comput Soft 43, 51–59 (2017). https://doi.org/10.1134/S036176881701008X

Download citation

  • Received:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1134/S036176881701008X

Navigation