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.
Add AtomicIfConcurrentGC for array lengths
Summary: In Hades, any variable-sized object that can change its length after construction must make sure to do so in a way that the GC doesn't become corrupted. There are two cases: * The length is being shortened. The conservative thing to do here is have the GC keep marking the now-unreachable objects as if they were live. Semantically this is equivalent to writing "empty" into each slot between `[newLength, oldLength)` (with a corresponding write barrier) before shortening the length * The length is being increased. In this case the memory must be initialized before increasing the length, so that the GC doesn't read garbage memory. After an initial empty init, then the length increase, real elements can be placed and a normal write barrier must be done. There are some minor consequences for perf in `ArrayStorage` and `SegmentedArray`, but I tried to limit it to only when Hades is enabled. Reviewed By: davedets Differential Revision: D21485757 fbshipit-source-id: f0a39cb8ef001bf428858b7241eb3b9bd0597604
- Loading branch information
1 parent
0ee7f50
commit 95c7715
Showing
13 changed files
with
219 additions
and
102 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
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.