Paul Krill
Editor at Large

Google’s V8 JavaScript engine now backs WebAssembly

news
Apr 26, 20162 mins

Version 5.1 also boosts performance and standardization, and it implements more of the Orinoco garbage collector

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.

Paul Krill

Paul Krill is editor at large at InfoWorld. Paul has been covering computer technology as a news and feature reporter for more than 35 years, including 30 years at InfoWorld. He has specialized in coverage of software development tools and technologies since the 1990s, and he continues to lead InfoWorld’s news coverage of software development platforms including Java and .NET and programming languages including JavaScript, TypeScript, PHP, Python, Ruby, Rust, and Go. Long trusted as a reporter who prioritizes accuracy, integrity, and the best interests of readers, Paul is sought out by technology companies and industry organizations who want to reach InfoWorld’s audience of software developers and other information technology professionals. Paul has won a “Best Technology News Coverage” award from IDG.

More from this author