Commit 0d66b129 authored by Dominik Inführ's avatar Dominik Inführ Committed by Commit Bot

[heap] EphemeronHashTable in Incremental Marking

Mark values if their corresponding key was already marked. Also
take into account the size for backing store.

Bug: chromium:844008
Change-Id: I58570f935c69fb39b686fd22dc93caba309f83b2
Reviewed-on: https://chromium-review.googlesource.com/1097400Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@google.com>
Cr-Commit-Position: refs/heads/master@{#53690}
parent 3f84955b
......@@ -16,6 +16,7 @@
#include "src/heap/objects-visiting-inl.h"
#include "src/heap/objects-visiting.h"
#include "src/heap/sweeper.h"
#include "src/objects/hash-table-inl.h"
#include "src/tracing/trace-event.h"
#include "src/v8.h"
#include "src/visitors.h"
......
......@@ -92,8 +92,16 @@ int MarkingVisitor<fixed_array_mode, retaining_path_mode, MarkingState>::
VisitEphemeronHashTable(Map* map, EphemeronHashTable* table) {
collector_->AddEphemeronHashTable(table);
// TODO(dinfuehr): Account size of the backing store.
return 0;
for (int i = 0; i < table->Capacity(); i++) {
HeapObject* key = HeapObject::cast(table->KeyAt(i));
if (marking_state()->IsBlackOrGrey(key)) {
Object** value_slot =
table->RawFieldOfElementAt(EphemeronHashTable::EntryToValueIndex(i));
VisitPointer(table, value_slot);
}
}
return table->SizeFromMap(map);
}
template <FixedArrayVisitationMode fixed_array_mode,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment