Backport fix of Wasm on arm64 (M1) to Node 16

Version

16.3

Platform

Darwin SurmBook.local 20.5.0 Darwin Kernel Version 20.5.0: Sat May 8 05:10:31 PDT 2021; root:xnu-7195.121.3~9/RELEASE_ARM64_T8101 arm64

Subsystem

No response

What steps will reproduce the bug?

Detailled reproduction can be found in this crbug: https://crbug.com/1224882

How often does it reproduce? Is there a required condition?

100%

What is the expected behavior?

Should execute the Wasm successfully.

What do you see instead?

E_BAD_ACCESS

Additional information

There are two CLs that landed in V8 that fix this problem:

They will be part of the next v8 release, but it might be worth back-porting them to Node 16 as it is the first release that support arm64 natively (as far as I know?)