[heap] Add a TEAR_DOWN state to heap states which is set when the heap is tearing down.

Bug: chromium:818585
Change-Id: I31032ba230ee2eb9f0bbcab0af720e23c3d6ae11
Reviewed-on: https://chromium-review.googlesource.com/962428
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Hannes Payer <hpayer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51955}
This commit is contained in:
Hannes Payer 2018-03-14 15:11:33 +01:00 committed by Commit Bot
parent 56d7986f39
commit ab0565af06
2 changed files with 8 additions and 1 deletions

View File

@ -5917,6 +5917,7 @@ void Heap::RegisterExternallyReferencedObject(Object** object) {
}
void Heap::TearDown() {
SetGCState(TEAR_DOWN);
DCHECK(!use_tasks_);
#ifdef VERIFY_HEAP
if (FLAG_verify_heap) {

View File

@ -599,7 +599,13 @@ class Heap {
enum FindMementoMode { kForRuntime, kForGC };
enum HeapState { NOT_IN_GC, SCAVENGE, MARK_COMPACT, MINOR_MARK_COMPACT };
enum HeapState {
NOT_IN_GC,
SCAVENGE,
MARK_COMPACT,
MINOR_MARK_COMPACT,
TEAR_DOWN
};
using PretenuringFeedbackMap = std::unordered_map<AllocationSite*, size_t>;