Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expose a way to retrieve the underlying VM Runtime instance from JSI …
…HermesRuntime (#1430) Summary: I understand this change might be a bit contentious, but please hear me out. Our Hermes integration does not use the JSI API, we integrate with the Hermes Runtime C++ API directly. There are a few reasons for this: - We already have an API that is similar to JSI for which we have 4 different JS engines integrated with it. If we were integrating Hermes through JSI we would be implementing an abstraction on top of an abstraction, which adds performance and memory overhead. We want our Hermes integration to be as fast as it can be, and for that we need our bridge layer to have minimal overhead so that it can compete on a performance level against our other JS engine integrations that are also based on lower level JS engine primitives. - There are APIs we need to integrate that can't be implemented with JSI. - We don't have C++ exceptions enabled, and the JSI Hermes integration makes heavy use of them and forces its consumers to handle errors through exceptions. The Hermes Debugger implementation is however based on the JSI API, so in order for us to leverage the Hermes Debugger, this change exposes a new method that returns the underlying VM Runtime instance from the JSI API. This makes it possible for us to keep our integration which is based on the VM Runtime API directly instead of JSI, and use the debugger API. Pull Request resolved: #1430 Test Plan: <!-- Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes the user interface. --> Reviewed By: avp Differential Revision: D61212063 Pulled By: neildhar fbshipit-source-id: dea983dab57c0e8eaa35d0d8a3bb776c6ce55b22
- Loading branch information