V8 version 7.4 beta is out: WebAssembly Threads/Atomics, faster calls with arguments mismatch & more

Share
  • March 25, 2019

In case you are not familiar with V8, let’s have a short introduction.

V8 is an open source JavaScript engine created by Google and written in C++. It allows for WebAssembly to run fast and meet high-performance goals. Ahead of time, code is compiled in V8, so high-performance goals can be reached.

“V8 implements ECMAScript as specified in ECMA-262, 5th edition, and runs on Windows (XP or newer), Mac OS X (10.5 or newer), and Linux systems that use IA-32, x64, or ARM processors. 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.”

Today, we are taking a look at V8’s latest release, version 7.4, and all the improvements and new features it brings to the table.

You should keep in mind, however, that this release will remain in beta until Chrome 74 Stable comes out in a few weeks.

The new features

JIT-less V8 – Now supports JavaScript execution without allocating executable memory at runtime.

WebAssembly Threads/Atomics shipped – Enabled on non-Android operating systems. This concludes the origin trial/preview that was enabled in V8 v7.0. This unlocks the usage of multiple cores on a user’s machine via WebAssembly, enabling new, computation-heavy use cases on the web.

Faster calls with arguments mismatch – There are scenarios where the engine knows that arguments’ adaption is not necessary since the actual parameters cannot be observed, namely when the callee is a strict mode function, and uses neither arguments nor rest parameters. In these cases, V8 now completely skips arguments adaption, reducing call overhead by up to 60%.

Improved native accessor performance – Improved performance of calling into native accessors, making it significantly faster than the megamorphic property access.

SEE ALSO: Liftoff: Speedy new compiler for the V8 JavaScript engine

Bytecode flushing – The V8 team’s experiments with bytecode flushing show that it provides significant memory savings for users of Chrome, reducing the amount of memory in V8’s heap by between 5–15% while not regressing performance or significantly increasing the amount of CPU time spent compiling JavaScript code.

Bytecode dead basic block elimination – Allows entire basic blocks to become dead, if no Jump bytecode (Ignition’s main control flow primitive) refers to them. Although this change is not expected to have a large impact on user code, it is particularly useful for simplifying various desugarings, such as generators, for-of and try-catch, and in particular removes a class of bugs where basic blocks could “resurrect” complex statements part-way through their implementation.

Private class fields – Added support for the public class fields syntax. Class fields simplify class syntax by avoiding the need for constructor functions just to define instance properties. Starting in V8 v7.4, you can mark a field as private by prepending it with a # prefix.

Intl.Locale Offers a more powerful mechanism to deal with locales, and enables easily extracting locale-specific preferences such as the language, the calendar, the numbering system, the hour cycle, and so on.

Check out the official release notes for the detailed information on all the new features.

The post V8 version 7.4 beta is out: WebAssembly Threads/Atomics, faster calls with arguments mismatch & more appeared first on JAXenter.

Source : JAXenter