Commit 15f46fbc authored by Michael Lippautz's avatar Michael Lippautz Committed by V8 LUCI CQ

[heap] Annotate write barrier branches with likely/unlikely

Change-Id: Idc2a9019f5b0e67860edd8620a6cb0ed7002b1df
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3910029Reviewed-by: 's avatarDominik Inführ <dinfuehr@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Auto-Submit: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83369}
parent 8598d770
......@@ -115,7 +115,7 @@ inline void CombinedWriteBarrierInternal(HeapObject host, HeapObjectSlot slot,
}
// Marking barrier: mark value & record slots when marking is on.
if (is_marking) {
if (V8_UNLIKELY(is_marking)) {
#ifdef V8_EXTERNAL_CODE_SPACE
// CodePageHeaderModificationScope is not required because the only case
// when a Code value is stored somewhere is during creation of a new Code
......@@ -259,7 +259,7 @@ base::Optional<Heap*> WriteBarrier::GetHeapIfMarking(HeapObject object) {
if (V8_ENABLE_THIRD_PARTY_HEAP_BOOL) return {};
heap_internals::MemoryChunk* chunk =
heap_internals::MemoryChunk::FromHeapObject(object);
if (!chunk->IsMarking()) return {};
if (V8_LIKELY(!chunk->IsMarking())) return {};
return chunk->GetHeap();
}
......
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