[strings] Support shared LO space in externalization

We have a shared large object space now. This CL supports
externalization of strings in shared LO space.

Bug: v8:12957
Change-Id: Ic540aed4d3e99248ef27bdccb525a0bc8ff7b28b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4217416
Auto-Submit: Patrick Thier <pthier@chromium.org>
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85620}
This commit is contained in:
pthier 2023-02-02 12:39:42 +01:00 committed by V8 LUCI CQ
parent 135b63038d
commit 4001e14901

View File

@ -388,13 +388,14 @@ void String::MakeExternalDuringGC(Isolate* isolate, T* resource) {
// Byte size of the external String object.
int new_size = this->SizeFromMap(new_map);
// Shared strings are never indirect or large.
DCHECK(!isolate->heap()->IsLargeObject(*this));
// Shared strings are never indirect.
DCHECK(!StringShape(*this).IsIndirect());
isolate->heap()->NotifyObjectSizeChange(*this, size, new_size,
ClearRecordedSlots::kNo,
UpdateInvalidatedObjectSize::kNo);
if (!isolate->heap()->IsLargeObject(*this)) {
isolate->heap()->NotifyObjectSizeChange(*this, size, new_size,
ClearRecordedSlots::kNo,
UpdateInvalidatedObjectSize::kNo);
}
// The external pointer slots must be initialized before the new map is
// installed. Otherwise, a GC marking thread may see the new map before the