[heap] Avoid invoking write barrier when aging compilation cache

We can skip write barriers when storing read only objects. This should
fix the linked bug where no v8::Isolate::Scope is set up during GC.

Bug: v8:13257, chromium:1386096
Change-Id: I2be9a38895e34bc7f6582c26d3c236dd23cf1f2b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4036570
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84358}
This commit is contained in:
Dominik Inführ 2022-11-18 14:07:36 +01:00 committed by V8 LUCI CQ
parent 506fb93ebe
commit 88f80797b6

View File

@ -10,6 +10,7 @@
#include "src/logging/log.h"
#include "src/objects/compilation-cache-table-inl.h"
#include "src/objects/objects-inl.h"
#include "src/objects/objects.h"
#include "src/objects/slots.h"
#include "src/objects/visitors.h"
#include "src/utils/ostreams.h"
@ -78,7 +79,8 @@ void CompilationCacheScript::Age() {
if (!info.HasBytecodeArray() ||
info.GetBytecodeArray(isolate()).IsOld()) {
table.SetPrimaryValueAt(entry,
ReadOnlyRoots(isolate()).undefined_value());
ReadOnlyRoots(isolate()).undefined_value(),
SKIP_WRITE_BARRIER);
}
}
}