microsoft / hermes-windows

Hermes is a small and lightweight JavaScript engine optimized for running React Native apps..
https://hermesengine.dev
MIT License
52 stars 33 forks source link

Build arm64ec version of hermes.dll #185

Closed rasaha91 closed 4 months ago

rasaha91 commented 4 months ago

Summary

Office on Windows on Arm64 uses the Arm64EC ABI, an ABI that is compatible with x64 allowing it to interop with x64 binaries. Arm64EC is NOT compatible with Arm64 native. Currently, Office is running the x64 version of hermes.dll, which leads to paying the cost of emulation. If instead, we produce an Arm64EC version, we can get near native performance with minimal overhead. This change adds the build logic needed to produce the Arm64EC version of hermes.dll.

Test Plan

I ran link /dump /headers <path to Arm64EC hermes.dll> | grep "machine" and verified that the dll is "8664 machine (x64) (ARM64X)", or Arm64EC.

I will be locally testing the Arm64EC version of hermes.dll in Office on Windows, Arm64 to ensure that everything still works and will measure the performance impact in executing a scenario.

Microsoft Reviewers: Open in CodeFlow