forked from facebook/hermes
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use references for vm::Runtime and its base classes
Summary: References are immutable and non-nullable, which is useful for readability, and more importantly, as a hint to the compiler. `vm::Runtime` has two non-empty base classes, `PointerBase` and `HandleRootOwner`, which we frequently cast to from `Runtime*`. When casting to a base class that is at an offset from the start of an object (in this case `PointerBase`), C++ requires that a nullptr remain a nullptr, so the compiler needs to emit an extra test + cmov to check for nullptrs each time we cast. The compiler is not very good at optimising these away, so instead, we should just pass `Runtime` by reference. Reviewed By: kodafb Differential Revision: D34501831 fbshipit-source-id: 658f4d2ebe2803ff02915b30448da54ed84922d0
- Loading branch information
1 parent
7151287
commit 6cf9084
Showing
214 changed files
with
5,261 additions
and
5,334 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.