summaryrefslogtreecommitdiffstats
path: root/js/src/gc/Zone.cpp
diff options
context:
space:
mode:
authorwin7-7 <win7-7@users.noreply.github.com>2019-04-29 12:02:24 +0300
committerGitHub <noreply@github.com>2019-04-29 12:02:24 +0300
commit2cb4d2ee571b91ec2480d2fba17e600a3843ddba (patch)
tree2106b80863a090b37076542c1894eca076c2dd70 /js/src/gc/Zone.cpp
parent5a65d8739d0ad6ef446b278a25fd955f0c734fb1 (diff)
downloadUXP-2cb4d2ee571b91ec2480d2fba17e600a3843ddba.tar
UXP-2cb4d2ee571b91ec2480d2fba17e600a3843ddba.tar.gz
UXP-2cb4d2ee571b91ec2480d2fba17e600a3843ddba.tar.lz
UXP-2cb4d2ee571b91ec2480d2fba17e600a3843ddba.tar.xz
UXP-2cb4d2ee571b91ec2480d2fba17e600a3843ddba.zip
Improve dead compartment collection js/src/gc
Diffstat (limited to 'js/src/gc/Zone.cpp')
-rw-r--r--js/src/gc/Zone.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/js/src/gc/Zone.cpp b/js/src/gc/Zone.cpp
index ed099341c..ecfb9a38c 100644
--- a/js/src/gc/Zone.cpp
+++ b/js/src/gc/Zone.cpp
@@ -370,6 +370,21 @@ Zone::fixupAfterMovingGC()
fixupInitialShapeTable();
}
+bool
+Zone::addTypeDescrObject(JSContext* cx, HandleObject obj)
+{
+ // Type descriptor objects are always tenured so we don't need post barriers
+ // on the set.
+ MOZ_ASSERT(!IsInsideNursery(obj));
+
+ if (!typeDescrObjects.put(obj)) {
+ ReportOutOfMemory(cx);
+ return false;
+ }
+
+ return true;
+}
+
ZoneList::ZoneList()
: head(nullptr), tail(nullptr)
{}
@@ -468,4 +483,4 @@ JS_PUBLIC_API(void)
JS::shadow::RegisterWeakCache(JS::Zone* zone, WeakCache<void*>* cachep)
{
zone->registerWeakCache(cachep);
-}
+} \ No newline at end of file