mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 716027 - Add write barrier to SetReservedSlot in jsfriendapi.h (r=bhackett)
This commit is contained in:
parent
5e946f0618
commit
c849a7a139
@ -323,6 +323,12 @@ js::SetFunctionNativeReserved(JSObject *fun, size_t which, const Value &val)
|
||||
fun->toFunction()->setExtendedSlot(which, val);
|
||||
}
|
||||
|
||||
JS_FRIEND_API(void)
|
||||
js::SetReservedSlotWithBarrier(JSObject *obj, size_t slot, const js::Value &value)
|
||||
{
|
||||
obj->setSlot(slot, value);
|
||||
}
|
||||
|
||||
void
|
||||
js::SetPreserveWrapperCallback(JSRuntime *rt, PreserveWrapperCallback callback)
|
||||
{
|
||||
|
@ -378,11 +378,18 @@ GetReservedSlot(const JSObject *obj, size_t slot)
|
||||
return reinterpret_cast<const shadow::Object *>(obj)->slotRef(slot);
|
||||
}
|
||||
|
||||
JS_FRIEND_API(void)
|
||||
SetReservedSlotWithBarrier(JSObject *obj, size_t slot, const Value &value);
|
||||
|
||||
inline void
|
||||
SetReservedSlot(JSObject *obj, size_t slot, const Value &value)
|
||||
{
|
||||
JS_ASSERT(slot < JSCLASS_RESERVED_SLOTS(GetObjectClass(obj)));
|
||||
reinterpret_cast<shadow::Object *>(obj)->slotRef(slot) = value;
|
||||
shadow::Object *sobj = reinterpret_cast<shadow::Object *>(obj);
|
||||
if (sobj->slotRef(slot).isMarkable())
|
||||
SetReservedSlotWithBarrier(obj, slot, value);
|
||||
else
|
||||
sobj->slotRef(slot) = value;
|
||||
}
|
||||
|
||||
JS_FRIEND_API(uint32_t)
|
||||
|
Loading…
Reference in New Issue
Block a user