Skip to main content

Profile Guided Offline Optimization of Hidden Class Graphs for JavaScript VMs in Embedded Systems

Ugawa, Tomoharu, Marr, Stefan, Jones, Richard (2022) Profile Guided Offline Optimization of Hidden Class Graphs for JavaScript VMs in Embedded Systems. ACM Computer Surveys, . ISSN 0360-0300. E-ISSN 1557-7341. (doi:10.1145/1122445.1122456) (KAR id:97523)

PDF Author's Accepted Manuscript
Language: English

DOI for this version: 10.22024/UniKent/01.02.97523.3281161
Download (697kB) Preview
[thumbnail of preprint.pdf]
This file may not be suitable for users of assistive technology.
Request an accessible format
Official URL:


JavaScript is increasingly used for the Internet of Things (IoT) on embedded systems. However, JavaScript's memory footprint is a challenge, because normal JavaScript virtual machines (VMs) do not fit into the small memory of IoT devices. In part this is because a significant amount of memory is used by hidden classes, which are used to represent JavaScript's dynamic objects efficiently.

In this research, we optimize the hidden class graph to minimize their memory use. Our solution collects the hidden class graph and related information for an application in a profiling run, and optimizes the graph offline. We reduce the number of hidden classes by avoiding introducing intermediate ones, for instance when properties are added one after another. Our optimizations allow the VM to assign the most likely final hidden class to an object at its creation. They also minimize re-allocation of storage for property values, and reduce the polymorphism of inline caches.

We implemented these optimizations in a JavaScript VM, eJSVM, and found that offline optimization can eliminate 61.9% of the hidden classes on average. It also improves execution speed by minimizing the number of hidden class transitions for an object and reducing inline cache misses.

Item Type: Article
DOI/Identification number: 10.1145/1122445.1122456
Uncontrolled keywords: JavaScript, virtual machine, embedded systems, hidden class, inline caching, profiling, offline optimization, IoT
Subjects: Q Science > QA Mathematics (inc Computing science)
Divisions: Divisions > Division of Computing, Engineering and Mathematical Sciences > School of Computing
Funders: Engineering and Physical Sciences Research Council (
Royal Society (
Depositing User: Stefan Marr
Date Deposited: 27 Oct 2022 00:01 UTC
Last Modified: 28 Oct 2022 08:28 UTC
Resource URI: (The current URI for this page, for reference purposes)
Ugawa, Tomoharu:
Marr, Stefan:
Jones, Richard:
  • Depositors only (login required):


Downloads per month over past year