Bug 1899339 - Part 2: Tighten up assertions when setting proxy private r=sfink

Something else I noticed while investigating this was the conditional assertion
about not creating black to gray edges here.

The contract is that we never pass gray GC things into the JS engine so this
assertion can be tightened up. I tested with this change and didn't see any
failures.

Differential Revision: https://phabricator.services.mozilla.com/D212539
This commit is contained in:
Jon Coppeard 2024-06-11 11:35:55 +00:00
parent d6dc1ea230
commit d3fda1245a

View File

@ -554,9 +554,8 @@ inline void SetProxyReservedSlot(JSObject* obj, size_t n,
inline void SetProxyPrivate(JSObject* obj, const JS::Value& value) {
#ifdef DEBUG
if (gc::detail::ObjectIsMarkedBlack(obj)) {
JS::AssertValueIsNotGray(value);
}
JS::AssertObjectIsNotGray(obj);
JS::AssertValueIsNotGray(value);
#endif
JS::Value* vp = &detail::GetProxyDataLayout(obj)->values()->privateSlot;