From 2cb4d2ee571b91ec2480d2fba17e600a3843ddba Mon Sep 17 00:00:00 2001 From: win7-7 Date: Mon, 29 Apr 2019 12:02:24 +0300 Subject: Improve dead compartment collection js/src/gc --- js/src/gc/Zone.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'js/src/gc/Zone.cpp') 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* cachep) { zone->registerWeakCache(cachep); -} +} \ No newline at end of file -- cgit v1.2.3 From 22116f9a70e23e69d0830265901736f6d6dcf6f6 Mon Sep 17 00:00:00 2001 From: win7-7 Date: Mon, 29 Apr 2019 15:33:52 +0300 Subject: add newline at end of files js/src/gc --- js/src/gc/Zone.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/src/gc/Zone.cpp') diff --git a/js/src/gc/Zone.cpp b/js/src/gc/Zone.cpp index ecfb9a38c..7681f15c5 100644 --- a/js/src/gc/Zone.cpp +++ b/js/src/gc/Zone.cpp @@ -483,4 +483,4 @@ JS_PUBLIC_API(void) JS::shadow::RegisterWeakCache(JS::Zone* zone, WeakCache* cachep) { zone->registerWeakCache(cachep); -} \ No newline at end of file +} -- cgit v1.2.3 From 9fb6b925fb249d3dd9f467142410a2e605736784 Mon Sep 17 00:00:00 2001 From: win7-7 Date: Tue, 30 Apr 2019 02:20:36 +0300 Subject: tab to spaces js/src/gc --- js/src/gc/Zone.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'js/src/gc/Zone.cpp') diff --git a/js/src/gc/Zone.cpp b/js/src/gc/Zone.cpp index 7681f15c5..f0cdde012 100644 --- a/js/src/gc/Zone.cpp +++ b/js/src/gc/Zone.cpp @@ -373,18 +373,18 @@ Zone::fixupAfterMovingGC() 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; -} - + // 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) {} -- cgit v1.2.3