Commit ce1ce547 authored by Mike Stanton's avatar Mike Stanton Committed by Commit Bot

Correct semantics of memmove on a pointer array for concurrent marking

Yesterday I added a call to memmove in CSA for pointer arrays when they
are in new space and the concurrent marker isn't running (protected by
mask kPointersFromHereAreInteresting, CL here:
https://chromium-review.googlesource.com/c/v8/v8/+/1243104/12). The bug
was that I didn't emit the check if dealing with a SMI array. However,
the GC subsystem at that point doesn't distinguish between SMI and
OBJECT FixedArrays. This fix brings the CSA code in line with that.

R=ulan@chromium.org

Bug: v8:8294
Change-Id: I9eb033c358911e8337562dbc91af8f0e6fbd2ed3
Reviewed-on: https://chromium-review.googlesource.com/c/1278386Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Commit-Queue: Michael Stanton <mvstanton@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56598}
parent ede7df9c
......@@ -4564,7 +4564,7 @@ void CodeStubAssembler::MoveElements(ElementsKind kind,
TNode<IntPtrT> length) {
Label finished(this);
Label needs_barrier(this);
const bool needs_barrier_check = IsObjectElementsKind(kind);
const bool needs_barrier_check = !IsDoubleElementsKind(kind);
DCHECK(IsFastElementsKind(kind));
CSA_ASSERT(this, IsFixedArrayWithKind(elements, kind));
......@@ -4575,8 +4575,8 @@ void CodeStubAssembler::MoveElements(ElementsKind kind,
IntPtrLessThanOrEqual(IntPtrAdd(src_index, length),
LoadAndUntagFixedArrayBaseLength(elements)));
// The write barrier can be ignored if {elements} is in new space, or if
// we have a SMI or double ElementsKind.
// The write barrier can be ignored if {dst_elements} is in new space, or if
// the elements pointer is FixedDoubleArray.
if (needs_barrier_check) {
JumpIfPointersFromHereAreInteresting(elements, &needs_barrier);
}
......@@ -4651,7 +4651,7 @@ void CodeStubAssembler::CopyElements(ElementsKind kind,
TNode<IntPtrT> length) {
Label finished(this);
Label needs_barrier(this);
const bool needs_barrier_check = IsObjectElementsKind(kind);
const bool needs_barrier_check = !IsDoubleElementsKind(kind);
DCHECK(IsFastElementsKind(kind));
CSA_ASSERT(this, IsFixedArrayWithKind(dst_elements, kind));
......@@ -4665,7 +4665,7 @@ void CodeStubAssembler::CopyElements(ElementsKind kind,
CSA_ASSERT(this, WordNotEqual(dst_elements, src_elements));
// The write barrier can be ignored if {dst_elements} is in new space, or if
// we have a SMI or double ElementsKind.
// the elements pointer is FixedDoubleArray.
if (needs_barrier_check) {
JumpIfPointersFromHereAreInteresting(dst_elements, &needs_barrier);
}
......
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