Commit 60c46384 authored by Marja Hölttä's avatar Marja Hölttä Committed by Commit Bot

[in-place weak refs] Remove overzealous check.

We can allow right-trimming new space WeakFixedArrays at the end of mark
compact collection.

BUG=v8:7308

Change-Id: I1aa716b467952520f152c338f2042e023f6330ff
Reviewed-on: https://chromium-review.googlesource.com/1082198Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53471}
parent 7bd8b1c0
......@@ -2875,12 +2875,10 @@ void Heap::RightTrimFixedArray(FixedArrayBase* object, int elements_to_trim) {
void Heap::RightTrimWeakFixedArray(WeakFixedArray* object,
int elements_to_trim) {
// This function is safe to use only 1) during GC and 2) for old space
// WeakFixedArrays: 1) When marking, we record the weak slots, and shrinking
// invalidates them. 2) Scavenger might move new space WeakFixedArrays around,
// making the recorded slots collide with other objects.
// This function is safe to use only at the end of the mark compact
// collection: When marking, we record the weak slots, and shrinking
// invalidates them.
DCHECK_EQ(gc_state(), MARK_COMPACT);
DCHECK(InOldSpace(object));
CreateFillerForArray<WeakFixedArray>(object, elements_to_trim,
elements_to_trim * kPointerSize);
}
......
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