[heap, baseline] Implement shared write barrier for baseline compiler

Baseline write barrier needs to use different page flag mask to also
call into the slow path of the barrier for old-to-shared pointers.

Bug: v8:11708
Change-Id: I955f30376f3de912b418298cdcf1e38dd2adda2e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3834254
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82538}
This commit is contained in:
Dominik Inführ 2022-08-17 16:05:15 +02:00 committed by V8 LUCI CQ
parent 208bda4824
commit 805df68f56
4 changed files with 10 additions and 8 deletions

View File

@ -815,8 +815,9 @@ void MacroAssembler::RecordWrite(Register object, Operand offset,
JumpIfSmi(value, &done);
}
CheckPageFlag(value, MemoryChunk::kPointersToHereAreInterestingMask, eq,
&done);
CheckPageFlag(value,
MemoryChunk::kPointersToHereAreInterestingOrInSharedHeapMask,
eq, &done);
CheckPageFlag(object, MemoryChunk::kPointersFromHereAreInterestingMask, eq,
&done);

View File

@ -3501,8 +3501,9 @@ void MacroAssembler::RecordWrite(Register object, Operand offset,
DCHECK_EQ(0, kSmiTag);
JumpIfSmi(value, &done);
}
CheckPageFlag(value, MemoryChunk::kPointersToHereAreInterestingMask, ne,
&done);
CheckPageFlag(value,
MemoryChunk::kPointersToHereAreInterestingOrInSharedHeapMask,
ne, &done);
CheckPageFlag(object, MemoryChunk::kPointersFromHereAreInterestingMask, ne,
&done);

View File

@ -526,8 +526,8 @@ void MacroAssembler::RecordWrite(Register object, Register slot_address,
CheckPageFlag(value,
value, // Used as scratch.
MemoryChunk::kPointersToHereAreInterestingMask, zero, &done,
Label::kNear);
MemoryChunk::kPointersToHereAreInterestingOrInSharedHeapMask,
zero, &done, Label::kNear);
CheckPageFlag(object,
value, // Used as scratch.
MemoryChunk::kPointersFromHereAreInterestingMask, zero, &done,

View File

@ -655,8 +655,8 @@ void MacroAssembler::RecordWrite(Register object, Register slot_address,
CheckPageFlag(value,
value, // Used as scratch.
MemoryChunk::kPointersToHereAreInterestingMask, zero, &done,
Label::kNear);
MemoryChunk::kPointersToHereAreInterestingOrInSharedHeapMask,
zero, &done, Label::kNear);
CheckPageFlag(object,
value, // Used as scratch.