summaryrefslogtreecommitdiffstats
path: root/js/src/jsapi.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jsapi.cpp')
-rw-r--r--js/src/jsapi.cpp31
1 files changed, 11 insertions, 20 deletions
diff --git a/js/src/jsapi.cpp b/js/src/jsapi.cpp
index a99d08951..ee9c61059 100644
--- a/js/src/jsapi.cpp
+++ b/js/src/jsapi.cpp
@@ -1410,6 +1410,17 @@ JS_SetGCParameter(JSContext* cx, JSGCParamKey key, uint32_t value)
MOZ_ALWAYS_TRUE(cx->gc.setParameter(key, value, lock));
}
+JS_PUBLIC_API(void)
+JS_SetGGCMode(JSContext* cx, bool enabled)
+{
+ // Control GGC
+ if (enabled && !cx->gc.isGenerationalGCEnabled()) {
+ cx->gc.enableGenerationalGC();
+ } else if (!enabled && cx->gc.isGenerationalGCEnabled()) {
+ cx->gc.disableGenerationalGC();
+ }
+}
+
JS_PUBLIC_API(uint32_t)
JS_GetGCParameter(JSContext* cx, JSGCParamKey key)
{
@@ -6252,26 +6263,6 @@ JS_AbortIfWrongThread(JSContext* cx)
MOZ_CRASH();
}
-#ifdef JS_GC_ZEAL
-JS_PUBLIC_API(void)
-JS_GetGCZealBits(JSContext* cx, uint32_t* zealBits, uint32_t* frequency, uint32_t* nextScheduled)
-{
- cx->runtime()->gc.getZealBits(zealBits, frequency, nextScheduled);
-}
-
-JS_PUBLIC_API(void)
-JS_SetGCZeal(JSContext* cx, uint8_t zeal, uint32_t frequency)
-{
- cx->gc.setZeal(zeal, frequency);
-}
-
-JS_PUBLIC_API(void)
-JS_ScheduleGC(JSContext* cx, uint32_t count)
-{
- cx->runtime()->gc.setNextScheduled(count);
-}
-#endif
-
JS_PUBLIC_API(void)
JS_SetParallelParsingEnabled(JSContext* cx, bool enabled)
{