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

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...

Full description

Bibliographic Details
Main Authors: V. . Vardanyan, V. . Ivanishin, S. . Asryan, A. . Khachatryan, J. . Hakobyan
Format: Article
Language:English
Published: Ivannikov Institute for System Programming of the Russian Academy of Sciences 2018-10-01
Series:Труды Института системного программирования РАН
Subjects:
Online Access:https://ispranproceedings.elpub.ru/jour/article/view/912
_version_ 1828520291401203712
author V. . Vardanyan
V. . Ivanishin
S. . Asryan
A. . Khachatryan
J. . Hakobyan
author_facet V. . Vardanyan
V. . Ivanishin
S. . Asryan
A. . Khachatryan
J. . Hakobyan
author_sort V. . Vardanyan
collection DOAJ
description 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.
first_indexed 2024-12-11T19:28:19Z
format Article
id doaj.art-0bf416530497482b8de41556aebd8c7b
institution Directory Open Access Journal
issn 2079-8156
2220-6426
language English
last_indexed 2024-12-11T19:28:19Z
publishDate 2018-10-01
publisher Ivannikov Institute for System Programming of the Russian Academy of Sciences
record_format Article
series Труды Института системного программирования РАН
spelling doaj.art-0bf416530497482b8de41556aebd8c7b2022-12-22T00:53:21ZengIvannikov Institute for System Programming of the Russian Academy of SciencesТруды Института системного программирования РАН2079-81562220-64262018-10-01276334810.15514/ISPRAS-2015-27(6)-3912Dynamic compilation of JavaScript programs to the statically typed LLVM intermediate representationV. . Vardanyan0V. . Ivanishin1S. . Asryan2A. . Khachatryan3J. . Hakobyan4ИСП РАНИСП РАНЕГУЕГУЕГУ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.https://ispranproceedings.elpub.ru/jour/article/view/912javascript, v8, llvm, оптимизация программ, динамическая компиляция
spellingShingle V. . Vardanyan
V. . Ivanishin
S. . Asryan
A. . Khachatryan
J. . Hakobyan
Dynamic compilation of JavaScript programs to the statically typed LLVM intermediate representation
Труды Института системного программирования РАН
javascript, v8, llvm, оптимизация программ, динамическая компиляция
title Dynamic compilation of JavaScript programs to the statically typed LLVM intermediate representation
title_full Dynamic compilation of JavaScript programs to the statically typed LLVM intermediate representation
title_fullStr Dynamic compilation of JavaScript programs to the statically typed LLVM intermediate representation
title_full_unstemmed Dynamic compilation of JavaScript programs to the statically typed LLVM intermediate representation
title_short Dynamic compilation of JavaScript programs to the statically typed LLVM intermediate representation
title_sort dynamic compilation of javascript programs to the statically typed llvm intermediate representation
topic javascript, v8, llvm, оптимизация программ, динамическая компиляция
url https://ispranproceedings.elpub.ru/jour/article/view/912
work_keys_str_mv AT vvardanyan dynamiccompilationofjavascriptprogramstothestaticallytypedllvmintermediaterepresentation
AT vivanishin dynamiccompilationofjavascriptprogramstothestaticallytypedllvmintermediaterepresentation
AT sasryan dynamiccompilationofjavascriptprogramstothestaticallytypedllvmintermediaterepresentation
AT akhachatryan dynamiccompilationofjavascriptprogramstothestaticallytypedllvmintermediaterepresentation
AT jhakobyan dynamiccompilationofjavascriptprogramstothestaticallytypedllvmintermediaterepresentation