Bug 1352430 - Add barrier to CPOWs table to remove dying objects r=billm
This commit is contained in:
@@ -500,6 +500,30 @@ JavaScriptShared::ConvertID(const JSIID& from, nsID* to)
|
||||
to->m3[7] = from.m3_7();
|
||||
}
|
||||
|
||||
JSObject*
|
||||
JavaScriptShared::findCPOWById(const ObjectId& objId)
|
||||
{
|
||||
JSObject* obj = findCPOWByIdPreserveColor(objId);
|
||||
if (obj)
|
||||
JS::ExposeObjectToActiveJS(obj);
|
||||
return obj;
|
||||
}
|
||||
|
||||
JSObject*
|
||||
JavaScriptShared::findCPOWByIdPreserveColor(const ObjectId& objId)
|
||||
{
|
||||
JSObject* obj = cpows_.findPreserveColor(objId);
|
||||
if (!obj)
|
||||
return nullptr;
|
||||
|
||||
if (js::gc::EdgeNeedsSweepUnbarriered(&obj)) {
|
||||
cpows_.remove(objId);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
JSObject*
|
||||
JavaScriptShared::findObjectById(JSContext* cx, const ObjectId& objId)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user