V8's New JavaScript Interpreter Improves Memory Consumption

| by David Iffland Follow 3 Followers on Aug 25, 2016. Estimated reading time: 1 minute |

A note to our readers: You asked so we have developed a set of features that allow you to reduce the noise: you can get email and web notifications for topics you are interested in. Learn more about our new features.

Google has announced that their new JavaScript interpreter, Ignition, will go live in Chrome 53 for some limited memory Android devices.

In a blog post, Google Staff Software Engineer Ross McIlroy dove into the reasons behind building Ignition.

Currently, V8 does not have an interpreter. Instead, initial execution JavaScript code is first parsed and compiled into an unoptimized state. Because of the way the parser and compilers work together, some code is later parsed two or even three times. In all, Google says that V8 spends 33% of a page's startup time parsing and compiling code. This also results in significant memory cost.

By using an interpreter, Google hopes to reduce the memory usage of the current system. Ignition still relies on a parser, but the JavaScript is compiled to bytecodes rather than native code. "Rather than compiling to machine code, we're compiling [with Ignition] to concise bytecodes that can be much smaller. So, we can reduce the memory usage, particularly with functions that aren't executed very often," says McIlroy.

Because the bytecode is small, it can compile the entire source rather than trying to avoid compiling code that isn't used. This means the script only has to be parsed once rather than the multiple times of the current compilation process.

McIlroy also provided some technical details:

The Ignition interpreter uses TurboFan’s low-level, architecture-independent macro-assembly instructions to generate bytecode handlers for each opcode. TurboFan compiles these instructions to the target architecture, performing low-level instruction selection and machine register allocation in the process. Ignition is a register machine, with each bytecode specifying its inputs and outputs as explicit register operands, as opposed to a stack machine where each bytecode would consume inputs and push outputs on an implicit stack.

Other browser vendors already use an interpreter as a first stage. Both Mozilla's SpiderMonkey and Microsoft's Chakra JavaScript engines start with an interpreter and both are connected to a two-tier compilation system.

Starting with Chrome 53, set for stable release in early September, Android devices with 512 MB or less of RAM will start using Ignition. For a deep-dive into Ignition, Google has posted the design document.

Rate this Article

Adoption Stage

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

It would be interesting to know: Google planned Dart interpreter? by Andrew Mezoni

JavaScript interpreter is very good thing.
But I think the interpreter for the Google Dart language will also be helpful.

Look forward to the interpreter for the Google Dart.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

1 Discuss

Login to InfoQ to interact with what matters most to you.

Recover your password...


Follow your favorite topics and editors

Quick overview of most important highlights in the industry and on the site.


More signal, less noise

Build your own feed by choosing topics you want to read about and editors you want to hear from.


Stay up-to-date

Set up your notifications and don't miss out on content that matters to you