1200pxoldsmobile400cuinbigblockengine1100658013orig

Google's V8 JavaScript engine now backs WebAssembly

Version 5.1 of Google's open source V8 JavaScript engine accommodates the WebAssembly portable code format and improves standards support, performance, and garbage collection.

Offered in a beta release this past weekend, Version 5.1 has preliminary support for WebAssembly, a much-heralded attempt to improve Web performance via a bytecode format in browsers. "You can enable it via the flag --expose_wasm in d8. Alternatively, you can try out the WASM demos with Chrome 51, Beta Channel," the Google V8 team said. Google's backing for WebAssembly follows Mozilla's support via its SpiderMonkey JavaScript engine.

V8 has served as a critical cog in the Node.js server-side JavaScript platform, and V8 5.1 works toward compliance with the ECMAScript 2017 draft specification. Capabilities include iterator closing, in which iterators created as part of a for-of loop or other built-in iteration are checked for "close" method, which is called if a loop terminates early. "This can be used for clean-up duty after the iteration has finished," the V8 team said.

Also, constructors can implement a "Symbol.hasInstance" method to override the default behavior. "Function names inferred for function expressions are now typically made available in the name property of functions, following the ES2015 formalization of these rules," said the team. This may change existing stack traces and provide different names from previous V8 versions. "It also gives useful names to properties and methods with computed property names."

Version 5.1 improves performance in JavaScript features, including Object.assign, for copying values of enumerable own properties from source objects to a target object; Array.prototype.join, for joining elements in an array into a string; and Array.prototype.toString, which returns a string representing an array and its elements.

For garbage collection, V8 5.1 implements more of the Orinoco garbage collector, including parallel young generation evacuation, scalable remembered sets, and black allocation, which is an improvement to the object marking phase of the garbage collector. Orinoco is based on the notion that implementing a mostly parallel and concurrent garbage collector without strict generational boundaries reduces garbage collection junk and memory usage while providing high throughput.

IDG Insider

PREVIOUS ARTICLE

« Google, carmakers join forces to speed self-driving car adoption

NEXT ARTICLE

Skype for Business finally makes its way to the Mac »
author_image
IDG News Service

The IDG News Service is the world's leading daily source of global IT news, commentary and editorial resources. The News Service distributes content to IDG's more than 300 IT publications in more than 60 countries.

  • Mail

Recommended for You

Trump hits partial pause on Huawei ban, but 5G concerns persist

Phil Muncaster reports on China and beyond

FinancialForce profits from PSA investment

Martin Veitch's inside track on today’s tech trends

Future-proofing the Middle East

Keri Allan looks at the latest trends and technologies

Poll

Do you think your smartphone is making you a workaholic?