Commit 28f303df authored by Dominik Inführ's avatar Dominik Inführ Committed by Commit Bot

[heap] Do not invalidate object on MakeThin

No invalidation of slots necessary for String::MakeThin. ThinString
only stores tagged value, so it can't store an untagged value in a
recorded slot. CreateFillerObjectAt takes care of slots in case of
right-trimming objects.

Bug: v8:9454
Change-Id: Id16e8ebceb334a845bdbf77282fbeb2069efce7d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1794682Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#63637}
parent ab0f9710
......@@ -113,7 +113,10 @@ void String::MakeThin(Isolate* isolate, String internalized) {
bool has_pointers = StringShape(*this).IsIndirect();
int old_size = this->Size();
isolate->heap()->NotifyObjectLayoutChange(*this, no_gc);
// Slot invalidation is not necessary here: ThinString only stores tagged
// value, so it can't store an untagged value in a recorded slot.
isolate->heap()->NotifyObjectLayoutChange(*this, no_gc,
InvalidateRecordedSlots::kNo);
bool one_byte = internalized.IsOneByteRepresentation();
Handle<Map> map = one_byte ? isolate->factory()->thin_one_byte_string_map()
: isolate->factory()->thin_string_map();
......
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