HOME

TheInfoList



OR:

V8 is a
JavaScript JavaScript (), often abbreviated as JS, is a programming language and core technology of the World Wide Web, alongside HTML and CSS. Ninety-nine percent of websites use JavaScript on the client side for webpage behavior. Web browsers have ...
and WebAssembly engine developed by
Google Google LLC (, ) is an American multinational corporation and technology company focusing on online advertising, search engine technology, cloud computing, computer software, quantum computing, e-commerce, consumer electronics, and artificial ...
for its Chrome browser. V8 is free and open-source software that is part of the Chromium project and also used separately in non-browser contexts, notably the Node.js runtime system. Other server-side JavaScript runtimes use alternative engines, such as Bun (which uses
JavaScriptCore WebKit is a browser engine primarily used in Apple's Safari web browser, as well as all web browsers on iOS and iPadOS. WebKit is also used by the PlayStation consoles starting with the PS3, the Tizen mobile operating systems, the Amazon ...
) and Hermes (used by React Native).


History

Google Google LLC (, ) is an American multinational corporation and technology company focusing on online advertising, search engine technology, cloud computing, computer software, quantum computing, e-commerce, consumer electronics, and artificial ...
created V8 for its Chrome browser, and both were first released in 2008. The lead developer of V8 was Lars Bak, and it was named after the powerful car engine. For several years, Chrome was faster than other browsers at executing
JavaScript JavaScript (), often abbreviated as JS, is a programming language and core technology of the World Wide Web, alongside HTML and CSS. Ninety-nine percent of websites use JavaScript on the client side for webpage behavior. Web browsers have ...
. The V8 assembler is based on the Strongtalk assembler. On 7 December 2010, a new compiling infrastructure named Crankshaft was released, with speed improvements. In version 41 of Chrome in 2015, project TurboFan was added to provide more performance improvements with previously challenging workloads such as asm.js. Much of V8's development is strongly inspired by the Java HotSpot Virtual Machine developed by
Sun Microsystems Sun Microsystems, Inc., often known as Sun for short, was an American technology company that existed from 1982 to 2010 which developed and sold computers, computer components, software, and information technology services. Sun contributed sig ...
, with the newer execution pipelines being very similar to those of HotSpot's. Support for the new WebAssembly language began in 2015. In 2016, the Ignition interpreter was added to V8 with the design goal of reducing the
memory Memory is the faculty of the mind by which data or information is encoded, stored, and retrieved when needed. It is the retention of information over time for the purpose of influencing future action. If past events could not be remembe ...
usage on small memory Android phones in comparison with TurboFan and Crankshaft. Ignition is a register based machine and shares a similar (albeit not the exact same) design to the templating interpreter utilized by HotSpot. In 2017, V8 shipped a brand-new
compiler In computing, a compiler is a computer program that Translator (computing), translates computer code written in one programming language (the ''source'' language) into another language (the ''target'' language). The name "compiler" is primaril ...
pipeline, consisting of Ignition (the interpreter) and TurboFan (the optimizing compiler). Starting with V8 version 5.9, Full-codegen (the early baseline compiler) and Crankshaft are no longer used in V8 for JavaScript execution, since the team believed they were no longer able to keep pace with new JavaScript language features and the optimizations those features required. In 2021, a new tiered compilation pipeline was introduced with the release of the SparkPlug compiler, which supplements the existing TurboFan compiler within V8, in a direct parallel to the profiling C1 Compiler used by HotSpot. In 2023, the Maglev SSA-based compiler was added, which is 10 times slower than Sparkplug but 10 times faster than TurboFan, bridging the gap between Sparkplug and TurboFan for less frequently run loops that do not get "hot" enough to be optimised by TurboFan, as is the case for most web applications that spend more time interacting with the browser than in JavaScript execution.


Design

V8 first generates an abstract syntax tree with its own parser. Then, Ignition generates bytecode from this syntax tree using the internal V8 bytecode format. TurboFan compiles this bytecode into machine code. In other words, V8 compiles
ECMAScript ECMAScript (; ES) is a standard for scripting languages, including JavaScript, JScript, and ActionScript. It is best known as a JavaScript standard intended to ensure the interoperability of web pages across different web browsers. It is stan ...
directly to native machine code using just-in-time compilation before executing it. The compiled code is additionally optimized (and re-optimized) dynamically at runtime, based on heuristics of the code's execution profile. Optimization techniques used include inlining,
elision In linguistics, an elision or deletion is the omission of one or more sounds (such as a vowel, a consonant, or a whole syllable) in a word or phrase. However, these terms are also used to refer more narrowly to cases where two words are run to ...
of expensive runtime properties, and inline caching. The garbage collector is a generational incremental collector.


Usage

V8 can compile to x86, ARM or MIPS instruction set architectures in both their 32-bit and 64-bit editions; it has additionally been ported to PowerPC, and to IBM ESA/390 and z/Architecture, for use in servers. V8 can be used in a browser or integrated into independent projects. V8 is used in the following software: * Chromium-based
web browser A web browser, often shortened to browser, is an application for accessing websites. When a user requests a web page from a particular website, the browser retrieves its files from a web server and then displays the page on the user's scr ...
s - Google Chrome, Brave,
Opera Opera is a form of History of theatre#European theatre, Western theatre in which music is a fundamental component and dramatic roles are taken by Singing, singers. Such a "work" (the literal translation of the Italian word "opera") is typically ...
, Vivaldi and
Microsoft Edge Microsoft Edge is a Proprietary Software, proprietary cross-platform software, cross-platform web browser created by Microsoft and based on the Chromium (web browser), Chromium open-source project, superseding Edge Legacy. In Windows 11, Edge ...
. * Cloud-based environments, like Google Apps Script * Couchbase database server * Deno runtime environment *
Electron The electron (, or in nuclear reactions) is a subatomic particle with a negative one elementary charge, elementary electric charge. It is a fundamental particle that comprises the ordinary matter that makes up the universe, along with up qua ...
desktop application framework, used by the
Atom Atoms are the basic particles of the chemical elements. An atom consists of a atomic nucleus, nucleus of protons and generally neutrons, surrounded by an electromagnetically bound swarm of electrons. The chemical elements are distinguished fr ...
and Visual Studio Code text editors * MarkLogic database server * NativeScript mobile application framework * Node.js runtime environment


See also

* Blink, the Chromium browser engine


References


External links

* {{NodeJs 2008 software Free and open source interpreters Google Chrome Google software JavaScript engines Software using the BSD license Virtual machines