---
title: "Chapter 5. From Interpreter to JIT"
url: "https://www.mikefluff.com/en/read/from-closures-to-autonomous-systems/ch05"
locale: "en"
author: "Mikhail Savchenko (Mike Fluff)"
updated: "2026-11-18T12:24:57.879Z"
book: "https://www.mikefluff.com/en/books/from-closures-to-autonomous-systems"
access: "lead-in"
purchase: "https://www.mikefluff.com/en/books/from-closures-to-autonomous-systems"
alternates:
  - locale: "ru"
    url: "https://www.mikefluff.com/ru/read/from-closures-to-autonomous-systems/ch05"
    markdown: "https://www.mikefluff.com/ru/read/from-closures-to-autonomous-systems/ch05.md"
  - locale: "en"
    url: "https://www.mikefluff.com/en/read/from-closures-to-autonomous-systems/ch05"
    markdown: "https://www.mikefluff.com/en/read/from-closures-to-autonomous-systems/ch05.md"
  - locale: "pt"
    url: "https://www.mikefluff.com/pt/read/from-closures-to-autonomous-systems/ch05"
    markdown: "https://www.mikefluff.com/pt/read/from-closures-to-autonomous-systems/ch05.md"
---

# Chapter 5. From Interpreter to JIT

*[JavaScript: From Closures to Autonomous Systems](https://www.mikefluff.com/en/books/from-closures-to-autonomous-systems)*

The first V8 had no interpreter. On the very first call it translated any function into machine code with a simple and fast compiler that the team called full-codegen. If a function was called often, it was later handed to a second, smart compiler. From 2010 that role was played by Crankshaft: it read the diary of the inline caches and built machine code for the types it saw there. Doing without an interpreter looked natural at the time. The team had come to the browser to compete on speed, and before 2008 JavaScript had been executed by interpreters, and slowness was considered an innate property of the language. Compilers that work right while the program is running are called just-in-time, and that is where the abbreviation JIT in the chapter title comes from.

Eight years later it turned out that machine code takes up too much memory. By the V8 team’s own estimate, the code that full-codegen produced for every function called even once occupied almost a third of all the memory Chrome allotted to JavaScript. On a desktop people put up with it, but on phones, where half a gigabyte had to cover everything, such waste was hard to miss. In 2016 V8 got an interpreter, Ignition. It translates JavaScript into compact bytecode and executes it, and the first to receive it were low-end Android phones in Chrome 53. Memory for unoptimized code on them shrank ninefold. In May 2017 Ignition, together with the new smart compiler TurboFan, became the only way V8 executes JavaScript, and full-codegen and Crankshaft were retired.

Bytecode, meanwhile, had been in JavaScript from the very beginning. Mocha’s ten-day prototype in 1995 also translated the program into bytecode: Netscape’s server team demanded it, because they needed applications to load quickly. V8 started by abandoning bytecode for the sake of speed and came back to it for the sake of memory. Only now bytecode became the bottom rung of a ladder that code climbs if it proves it deserves more.

---

The rest of this chapter is free on the site once the reader confirms an email address: https://www.mikefluff.com/en/read/from-closures-to-autonomous-systems/ch05
