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.
Make all reserved heap snapshot IDs odd
Summary: v8 uses odd IDs to mean JS objects, and uses even IDs to mean native objects that don't live on the JS heap. v8 also chooses to use only odd IDs for its "synthetic" nodes that show sections of GC roots. I don't think anything relies on this, but I've found matching v8's behavior as close as possible is the best way to ensure that no bugs occur. Do this by having all reserved IDs get accessed through a function, `IDTracker::reserved`, that changes the simple 0-based integer sequence into a sequence that only uses odd numbers. Changing all the node IDs to be odd and ascend by 2's doesn't seem to be possible in the immediate declaration without having to explicitly list all of them, which defeats part of the usefulness of an enum. Reviewed By: rshest Differential Revision: D25044648 fbshipit-source-id: 5da60a33e9ea12493ea5159d0fecb3e9d9dd1e31
- Loading branch information
1 parent
146dea2
commit 198549e
Showing
4 changed files
with
74 additions
and
84 deletions.
There are no files selected for viewing
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