V8 JavaScript Engine v8.6 releases: Google’s open source high-performance JavaScript engine

V8 compiles and executes JavaScript source code, handles memory allocation for objects, and garbage collects objects it no longer needs. V8’s stop-the-world, generational, accurate garbage collector is one of the keys to V8’s performance. You can learn about this and other performance aspects in V8 Design Elements.

JavaScript is most commonly used for client-side scripting in a browser, being used to manipulate Document Object Model (DOM) objects for example. The DOM is not, however, typically provided by the JavaScript engine but instead by a browser. The same is true of V8—Google Chrome provides the DOM. V8 does however provide all the data types, operators, objects and functions specified in the ECMA standard.

V8 enables any C++ application to expose its own objects and functions to JavaScript code. It’s up to you to decide on the objects and functions you would like to expose to JavaScript. There are many examples of applications that do this, for example: Adobe Flash and the Dashboard Widgets in Apple’s Mac OS X and Yahoo! Widgets.

Image: slideshare

V8 v8.6 is now officially available.



Open sourced JS-Fuzzer

JS-Fuzzer is a mutation-based JavaScript fuzzer originally authored by Oliver Chang. It has been a cornerstone of V8’s stability and security in the past and is now open source.

The fuzzer mutates existing cross-engine test cases using Babel AST transformations configured by extensible mutator classes. We recently also started running an instance of the fuzzer in differential-testing mode for detecting JavaScript correctness issues. Contributions are welcome! See the README for more.

Speed-ups in Number.prototype.toString #

Converting a JavaScript number to a string can be a surprisingly complex operation in the general case; we have to take into account floating point precision, scientific notation, NaNs, infinities, rounding, and so on. We don’t even know how big the resulting string will be before calculating it. Because of this, our implementation of Number.prototype.toString would bail out to a C++ runtime function.

But, a lot of the time, you just want to print a simple, small integer (a “Smi”). This is a much simpler operation, and the overheads of calling a C++ runtime function are no longer worth it. So we’ve worked with our friends at Microsoft to add a simple fast path for small integers to Number.prototype.toString, written in Torque, to reduce these overheads for this common case. This improved number printing microbenchmarks by ~75%.

Atomics.wake removed

Atomics.wake was renamed to Atomics.notify to match a spec change in v7.3. The deprecated Atomics.wake alias is now removed.

Small normative changes

  • Anonymous classes now have a .name property whose value is the empty string ''Spec change.
  • The \8 and \9 escape sequences are now illegal in template string literals in sloppy mode and in all string literals in strict modeSpec change.
  • The built-in Reflect object now has a Symbol.toStringTag property whose value is 'Reflect'Spec change.

For full updates, please read the release notes here.