BT

V8 JavaScript Engine 5.1 Brings More ECMAScript Compliance, WASM Support

| by Sergio De Simone Follow 14 Followers on Apr 27, 2016. Estimated reading time: 1 minute |

Google has announced version 5.1 of its V8 JavaScript engine, which improves compliance with the ECMAScript 2017 draft specification and adds preliminary support for WASM, a low-level portable bytecode aimed to enable near-native execution speed.

As usual, the V8 release process is tied to Chrome’s, so V8 5.1 will be finally out when Chrome 51 Stable is released.

The final goal for this release is bringing ECMAScript 2015 support to 97%. To this aim, V8 5.1 includes:

  • Symbol.species, which allows subclasses to override the default constructor for objects that is used by methods such as Array.prototype.map. E.g., you could define a MyArray class that when used with map returns the case class constructor:
    class MyArray extends Array {
      // Overwrite species to the parent Array constructor
      static get [Symbol.species]() { return Array; }
    }
    var a = new MyArray(1,2,3);
    var mapped = a.map(x => x * x);
    
    console.log(mapped instanceof MyArray); // false
    console.log(mapped instanceof Array);   // true
    
  • Symbol.hasInstance, which can be overridden to determine if a constructor recognizes an object as its instance.
  • Iterators now support a close method which is called if the loop terminates early.
  • RegExp subclasses can define their own exec method to change the regular expression algorithm used.
  • Inferred function names are available through the name property.

V8 5.1 also brings preliminary support for WebAssembly (WASM). As briefly mentioned, WebAssembly is a low-level, portable bytecode that aims to enable execution at near-native speed by relying on common hardware capabilities that are available on many platforms. Additionally, WASM AST is designed to enable a compact and efficient binary format and meant to be executed in a sandboxed environment.

Finally, V8 5.1 improves performance of a number of JavaScript features, including executing loops like for-in, promise and RegExp instantiation, Math operations, and more.

Rate this Article

Adoption Stage
Style

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
Community comments

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

Discuss

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


Recover your password...

Follow

Follow your favorite topics and editors

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

Like

More signal, less noise

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

Notifications

Stay up-to-date

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

BT