mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-05 23:38:38 +09:00
Improve dead compartment collection js/src/builtin
This commit is contained in:
parent
c1b4fc1442
commit
68a36fe36f
1 changed files with 5 additions and 7 deletions
|
|
@ -652,7 +652,7 @@ ArrayMetaTypeDescr::create(JSContext* cx,
|
|||
if (!CreateTraceList(cx, obj))
|
||||
return nullptr;
|
||||
|
||||
if (!cx->zone()->typeDescrObjects.put(obj)) {
|
||||
if (!cx->zone()->addTypeDescrObject(cx, obj)) {
|
||||
ReportOutOfMemory(cx);
|
||||
return nullptr;
|
||||
}
|
||||
|
|
@ -993,8 +993,8 @@ StructMetaTypeDescr::create(JSContext* cx,
|
|||
if (!CreateTraceList(cx, descr))
|
||||
return nullptr;
|
||||
|
||||
if (!cx->zone()->typeDescrObjects.put(descr) ||
|
||||
!cx->zone()->typeDescrObjects.put(fieldTypeVec))
|
||||
if (!cx->zone()->addTypeDescrObject(cx, descr) ||
|
||||
!cx->zone()->addTypeDescrObject(cx, fieldTypeVec))
|
||||
{
|
||||
ReportOutOfMemory(cx);
|
||||
return nullptr;
|
||||
|
|
@ -1165,10 +1165,8 @@ DefineSimpleTypeDescr(JSContext* cx,
|
|||
if (!CreateTraceList(cx, descr))
|
||||
return false;
|
||||
|
||||
if (!cx->zone()->typeDescrObjects.put(descr)) {
|
||||
ReportOutOfMemory(cx);
|
||||
if (!cx->zone()->addTypeDescrObject(cx, descr))
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -3005,4 +3003,4 @@ TypeDescr::finalize(FreeOp* fop, JSObject* obj)
|
|||
TypeDescr& descr = obj->as<TypeDescr>();
|
||||
if (descr.hasTraceList())
|
||||
js_free(const_cast<int32_t*>(descr.traceList()));
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue