Commit 4a33fd79 authored by Michael Lippautz's avatar Michael Lippautz Committed by V8 LUCI CQ

[api] Remove heap layout verification on setting embedder fields

- No slots are invalidated as all slots are always treated as tagged
  or aligned pointers.
- The map is not updated.

Change-Id: Ifb8ffddfa3b626de3233f17f67b46fec36146f2e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3795378Reviewed-by: 's avatarDominik Inführ <dinfuehr@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82104}
parent 3e7a7556
......@@ -6036,21 +6036,11 @@ void v8::Object::SetAlignedPointerInInternalField(int index, void* value) {
if (!InternalFieldOK(obj, index, location)) return;
i::DisallowGarbageCollection no_gc;
// There's no need to invalidate slots as embedder fields are always
// tagged.
obj->GetHeap()->NotifyObjectLayoutChange(*obj, no_gc,
i::InvalidateRecordedSlots::kNo);
Utils::ApiCheck(i::EmbedderDataSlot(i::JSObject::cast(*obj), index)
.store_aligned_pointer(obj->GetIsolate(), value),
location, "Unaligned pointer");
DCHECK_EQ(value, GetAlignedPointerFromInternalField(index));
internal::WriteBarrier::MarkingFromInternalFields(i::JSObject::cast(*obj));
#ifdef VERIFY_HEAP
obj->GetHeap()->VerifyObjectLayoutChange(*obj, obj->map());
#endif // VERIFY_HEAP
}
void v8::Object::SetAlignedPointerInInternalFields(int argc, int indices[],
......@@ -6058,11 +6048,6 @@ void v8::Object::SetAlignedPointerInInternalFields(int argc, int indices[],
i::Handle<i::JSReceiver> obj = Utils::OpenHandle(this);
i::DisallowGarbageCollection no_gc;
// There's no need to invalidate slots as embedder fields are always
// tagged.
obj->GetHeap()->NotifyObjectLayoutChange(*obj, no_gc,
i::InvalidateRecordedSlots::kNo);
const char* location = "v8::Object::SetAlignedPointerInInternalFields()";
i::JSObject js_obj = i::JSObject::cast(*obj);
int nof_embedder_fields = js_obj.GetEmbedderFieldCount();
......@@ -6079,10 +6064,6 @@ void v8::Object::SetAlignedPointerInInternalFields(int argc, int indices[],
DCHECK_EQ(value, GetAlignedPointerFromInternalField(index));
}
internal::WriteBarrier::MarkingFromInternalFields(js_obj);
#ifdef VERIFY_HEAP
obj->GetHeap()->VerifyObjectLayoutChange(*obj, obj->map());
#endif // VERIFY_HEAP
}
// --- E n v i r o n m e n t ---
......
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