Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: If compaction is completed before sweeping, there may be dead objects in the heap that refer into the now evacuated compactee. To deal with this, we maintain a `shared_ptr` to the compactee to keep it alive until sweeping is completed, in case something attempts to read one of those dangling references. The only such case is card marking, which can visit unmarked objects in some cases. The current system is complicated and difficult to follow, and is only correct by accident. This is because `compacteeHandleForSweep_` can currently be freed by the background thread, which is unsafe, because an `AlignedStorage` should in theory only be destroyed on the mutator. But it happens to be correct because the relevant data is incidentally synchronised by `gcMutex_`. To simplify this, get rid of `compacteeHandleForSweep_`, and always skip dead objects in card marking. Reviewed By: lavenzg Differential Revision: D44585769 fbshipit-source-id: 8904d21f06772462ca63d6b7215a988f3094754d
- Loading branch information