BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News WebKit Now Has Full Support for WebAssembly

WebKit Now Has Full Support for WebAssembly

This item in japanese

Bookmarks

Apple Safari has full support for WebAssembly including preparation for future integration with ECMAScript Modules and threads.

Apple has added full support for WebAssembly to WebKit, enhancing the Safari browser to be able to run code written in other languages. WebKit supports WebAssembly on  x86, x64 and ARM 64 platforms.

Since WebAssembly is accessible in the browser as a JavaScript object, WebKit is reusing existing JavaScript functionality to make it work. For example, the WebAssembly.Instance API is implemented using the ECMAScript modules already supported by the browser, preparing the way for integration with JavaScript modules when it becomes a requested feature. Also, WebKit’s implementation of WebAssembly is thread safe preparing it for when it will add support for threads, a feature that Chrome has on the roadmap too.

When a tool compiles some code to WebAssembly, it can already include various performance optimizations. But WebKit adds two more tiers of optimizations, Build Bytecode Quickly (BBQ) and the Optimized Machine-code Generator (OMG), both based on B3 JIT used by WebKit to tune up JavaScript code. BBQ is four times faster than OMG, but the resulted code is twice as slower, according to Apple engineers. BBQ is used to run code quickly, while OMG is used for hot code, performing deeper optimizations for sections of the code where speed is important.

WebAssembly is available in Safari Technology Preview Release 32. Chrome and Firefox have added full support for WebAssembly in March, while Microsoft Edge has it in preview mode for all their platforms: desktop, mobile, Xbox, and mixed reality.

Rate this Article

Adoption
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.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

BT