Bug 1297026 - Replace outdated references to 'compartment GC' with 'zone GC' r=terrence
authorJon Coppeard <jcoppeard@mozilla.com>
Thu, 25 Aug 2016 12:00:56 +0100
changeset 354688 361c0ddbcef03797e737cd676ea43521ab3c0fde
parent 354687 9be45967d42c71f0afbedb5c99dc2c052db09b0c
child 354689 b7850a18f39df01feff34f75507eb938b14a0f7a
push id1324
push usermtabara@mozilla.com
push dateMon, 16 Jan 2017 13:07:44 +0000
treeherdermozilla-release@a01c49833940 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersterrence
bugs1297026
milestone51.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1297026 - Replace outdated references to 'compartment GC' with 'zone GC' r=terrence
dom/base/nsJSEnvironment.cpp
js/public/GCAPI.h
js/src/builtin/TestingFunctions.cpp
js/src/gc/GCRuntime.h
js/src/gc/Marking.cpp
js/src/gc/Statistics.cpp
js/src/jit-test/tests/gc/multi-01.js
js/src/jsapi-tests/testGCFinalizeCallback.cpp
js/src/jsapi-tests/testGCHooks.cpp
js/src/jsapi-tests/testIntern.cpp
js/src/jsapi.cpp
js/src/jsapi.h
js/src/jsfriendapi.h
js/src/jsgc.cpp
js/xpconnect/src/XPCJSRuntime.cpp
js/xpconnect/src/xpcprivate.h
modules/libpref/init/all.js
toolkit/components/telemetry/Histograms.json
--- a/dom/base/nsJSEnvironment.cpp
+++ b/dom/base/nsJSEnvironment.cpp
@@ -2144,17 +2144,17 @@ DOMGCSliceCallback(JSContext* aCx, JS::G
       sCCollectedWaitingForGC = 0;
       sCCollectedZonesWaitingForGC = 0;
       sLikelyShortLivingObjectsNeedingGC = 0;
       sCleanupsSinceLastGC = 0;
       sNeedsFullCC = true;
       sHasRunGC = true;
       nsJSContext::MaybePokeCC();
 
-      if (aDesc.isCompartment_) {
+      if (aDesc.isZone_) {
         if (!sFullGCTimer && !sShuttingDown) {
           CallCreateInstance("@mozilla.org/timer;1", &sFullGCTimer);
           sFullGCTimer->InitWithNamedFuncCallback(FullGCTimerFired,
                                                   nullptr,
                                                   NS_FULL_GC_DELAY,
                                                   nsITimer::TYPE_ONE_SHOT,
                                                   "FullGCTimerFired");
         }
@@ -2284,23 +2284,23 @@ SetMemoryMaxPrefChangedCallback(const ch
   // handle overflow and negative pref values
   uint32_t max = (pref <= 0 || pref >= 0x1000) ? -1 : (uint32_t)pref * 1024 * 1024;
   JS_SetGCParameter(sContext, JSGC_MAX_BYTES, max);
 }
 
 static void
 SetMemoryGCModePrefChangedCallback(const char* aPrefName, void* aClosure)
 {
-  bool enableCompartmentGC = Preferences::GetBool("javascript.options.mem.gc_per_compartment");
+  bool enableZoneGC = Preferences::GetBool("javascript.options.mem.gc_per_zone");
   bool enableIncrementalGC = Preferences::GetBool("javascript.options.mem.gc_incremental");
   JSGCMode mode;
   if (enableIncrementalGC) {
     mode = JSGC_MODE_INCREMENTAL;
-  } else if (enableCompartmentGC) {
-    mode = JSGC_MODE_COMPARTMENT;
+  } else if (enableZoneGC) {
+    mode = JSGC_MODE_ZONE;
   } else {
     mode = JSGC_MODE_GLOBAL;
   }
   JS_SetGCParameter(sContext, JSGC_MODE, mode);
 }
 
 static void
 SetMemoryGCSliceTimePrefChangedCallback(const char* aPrefName, void* aClosure)
@@ -2481,17 +2481,17 @@ nsJSContext::EnsureStatics()
   // Set these global xpconnect options...
   Preferences::RegisterCallbackAndCall(SetMemoryHighWaterMarkPrefChangedCallback,
                                        "javascript.options.mem.high_water_mark");
 
   Preferences::RegisterCallbackAndCall(SetMemoryMaxPrefChangedCallback,
                                        "javascript.options.mem.max");
 
   Preferences::RegisterCallbackAndCall(SetMemoryGCModePrefChangedCallback,
-                                       "javascript.options.mem.gc_per_compartment");
+                                       "javascript.options.mem.gc_per_zone");
 
   Preferences::RegisterCallbackAndCall(SetMemoryGCModePrefChangedCallback,
                                        "javascript.options.mem.gc_incremental");
 
   Preferences::RegisterCallbackAndCall(SetMemoryGCSliceTimePrefChangedCallback,
                                        "javascript.options.mem.gc_incremental_slice_ms");
 
   Preferences::RegisterCallbackAndCall(SetMemoryGCCompactingPrefChangedCallback,
--- a/js/public/GCAPI.h
+++ b/js/public/GCAPI.h
@@ -21,22 +21,22 @@ namespace gcstats {
 struct Statistics;
 } // namespace gcstats
 } // namespace js
 
 typedef enum JSGCMode {
     /** Perform only global GCs. */
     JSGC_MODE_GLOBAL = 0,
 
-    /** Perform per-compartment GCs until too much garbage has accumulated. */
-    JSGC_MODE_COMPARTMENT = 1,
+    /** Perform per-zone GCs until too much garbage has accumulated. */
+    JSGC_MODE_ZONE = 1,
 
     /**
      * Collect in short time slices rather than all at once. Implies
-     * JSGC_MODE_COMPARTMENT.
+     * JSGC_MODE_ZONE.
      */
     JSGC_MODE_INCREMENTAL = 2
 } JSGCMode;
 
 /**
  * Kinds of js_GC invocation.
  */
 typedef enum JSGCInvocationKind {
@@ -328,22 +328,22 @@ enum GCProgress {
 
     GC_CYCLE_BEGIN,
     GC_SLICE_BEGIN,
     GC_SLICE_END,
     GC_CYCLE_END
 };
 
 struct JS_PUBLIC_API(GCDescription) {
-    bool isCompartment_;
+    bool isZone_;
     JSGCInvocationKind invocationKind_;
     gcreason::Reason reason_;
 
-    GCDescription(bool isCompartment, JSGCInvocationKind kind, gcreason::Reason reason)
-      : isCompartment_(isCompartment), invocationKind_(kind), reason_(reason) {}
+    GCDescription(bool isZone, JSGCInvocationKind kind, gcreason::Reason reason)
+      : isZone_(isZone), invocationKind_(kind), reason_(reason) {}
 
     char16_t* formatSliceMessage(JSContext* cx) const;
     char16_t* formatSummaryMessage(JSContext* cx) const;
     char16_t* formatJSON(JSContext* cx, uint64_t timestamp) const;
 
     JS::dbg::GarbageCollectionEvent::Ptr toGCEvent(JSContext* cx) const;
 };
 
--- a/js/src/builtin/TestingFunctions.cpp
+++ b/js/src/builtin/TestingFunctions.cpp
@@ -274,47 +274,47 @@ GetBuildConfiguration(JSContext* cx, uns
 }
 
 static bool
 GC(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
 
     /*
-     * If the first argument is 'compartment', we collect any compartments
-     * previously scheduled for GC via schedulegc. If the first argument is an
-     * object, we collect the object's compartment (and any other compartments
-     * scheduled for GC). Otherwise, we collect all compartments.
+     * If the first argument is 'zone', we collect any zones previously
+     * scheduled for GC via schedulegc. If the first argument is an object, we
+     * collect the object's zone (and any other zones scheduled for
+     * GC). Otherwise, we collect all zones.
      */
-    bool compartment = false;
+    bool zone = false;
     if (args.length() >= 1) {
         Value arg = args[0];
         if (arg.isString()) {
-            if (!JS_StringEqualsAscii(cx, arg.toString(), "compartment", &compartment))
+            if (!JS_StringEqualsAscii(cx, arg.toString(), "zone", &zone))
                 return false;
         } else if (arg.isObject()) {
             PrepareZoneForGC(UncheckedUnwrap(&arg.toObject())->zone());
-            compartment = true;
+            zone = true;
         }
     }
 
     bool shrinking = false;
     if (args.length() >= 2) {
         Value arg = args[1];
         if (arg.isString()) {
             if (!JS_StringEqualsAscii(cx, arg.toString(), "shrinking", &shrinking))
                 return false;
         }
     }
 
 #ifndef JS_MORE_DETERMINISTIC
     size_t preBytes = cx->runtime()->gc.usage.gcBytes();
 #endif
 
-    if (compartment)
+    if (zone)
         PrepareForDebugGC(cx->runtime());
     else
         JS::PrepareForFullGC(cx);
 
     JSGCInvocationKind gckind = shrinking ? GC_SHRINK : GC_NORMAL;
     JS::GCForReason(cx, gckind, JS::gcreason::API);
 
     char buf[256] = { '\0' };
@@ -782,17 +782,17 @@ ScheduleGC(JSContext* cx, unsigned argc,
     } else if (args[0].isInt32()) {
         /* Schedule a GC to happen after |arg| allocations. */
         JS_ScheduleGC(cx, args[0].toInt32());
     } else if (args[0].isObject()) {
         /* Ensure that |zone| is collected during the next GC. */
         Zone* zone = UncheckedUnwrap(&args[0].toObject())->zone();
         PrepareZoneForGC(zone);
     } else if (args[0].isString()) {
-        /* This allows us to schedule atomsCompartment for GC. */
+        /* This allows us to schedule the atoms zone for GC. */
         PrepareZoneForGC(args[0].toString()->zone());
     }
 
     uint32_t zealBits;
     uint32_t freq;
     uint32_t next;
     JS_GetGCZealBits(cx, &zealBits, &freq, &next);
     args.rval().setInt32(next);
@@ -3559,19 +3559,19 @@ GetModuleEnvironmentValue(JSContext* cx,
     if (!JS_StringToId(cx, name, &id))
         return false;
 
     return GetProperty(cx, env, env, id, args.rval());
 }
 
 static const JSFunctionSpecWithHelp TestingFunctions[] = {
     JS_FN_HELP("gc", ::GC, 0, 0,
-"gc([obj] | 'compartment' [, 'shrinking'])",
-"  Run the garbage collector. When obj is given, GC only its compartment.\n"
-"  If 'compartment' is given, GC any compartments that were scheduled for\n"
+"gc([obj] | 'zone' [, 'shrinking'])",
+"  Run the garbage collector. When obj is given, GC only its zone.\n"
+"  If 'zone' is given, GC any zones that were scheduled for\n"
 "  GC via schedulegc.\n"
 "  If 'shrinking' is passed as the optional second argument, perform a\n"
 "  shrinking GC rather than a normal GC."),
 
     JS_FN_HELP("minorgc", ::MinorGC, 0, 0,
 "minorgc([aboutToOverflow])",
 "  Run a minor collector on the Nursery. When aboutToOverflow is true, marks\n"
 "  the store buffer as about-to-overflow before collecting."),
@@ -3714,17 +3714,17 @@ static const JSFunctionSpecWithHelp Test
 #ifdef JS_GC_ZEAL
     JS_FN_HELP("gczeal", GCZeal, 2, 0,
 "gczeal(level, [N])",
 gc::ZealModeHelpText),
 
     JS_FN_HELP("schedulegc", ScheduleGC, 1, 0,
 "schedulegc([num | obj])",
 "  If num is given, schedule a GC after num allocations.\n"
-"  If obj is given, schedule a GC of obj's compartment.\n"
+"  If obj is given, schedule a GC of obj's zone.\n"
 "  Returns the number of allocations before the next trigger."),
 
     JS_FN_HELP("selectforgc", SelectForGC, 0, 0,
 "selectforgc(obj1, obj2, ...)",
 "  Schedule the given objects to be marked in the next GC slice."),
 
     JS_FN_HELP("verifyprebarriers", VerifyPreBarriers, 0, 0,
 "verifyprebarriers()",
--- a/js/src/gc/GCRuntime.h
+++ b/js/src/gc/GCRuntime.h
@@ -1121,17 +1121,17 @@ class GCRuntime
     uint64_t number;
 
     /* The number at the time of the most recent GC's first slice. */
     uint64_t startNumber;
 
     /* Whether the currently running GC can finish in multiple slices. */
     bool isIncremental;
 
-    /* Whether all compartments are being collected in first GC slice. */
+    /* Whether all zones are being collected in first GC slice. */
     bool isFull;
 
     /* Whether the heap will be compacted at the end of GC. */
     bool isCompacting;
 
     /* The invocation kind of the current GC, taken from the first slice. */
     JSGCInvocationKind invocationKind;
 
@@ -1264,20 +1264,18 @@ class GCRuntime
      * run an immediate, non-incremental GC to clean up the dead
      * zones. This should happen very rarely.
      */
     unsigned objectsMarkedInDeadZones;
 
     bool poked;
 
     /*
-     * These options control the zealousness of the GC. The fundamental values
-     * are nextScheduled and gcDebugCompartmentGC. At every allocation,
-     * nextScheduled is decremented. When it reaches zero, we do either a full
-     * or a compartmental GC, based on debugCompartmentGC.
+     * These options control the zealousness of the GC. At every allocation,
+     * nextScheduled is decremented. When it reaches zero we do a full GC.
      *
      * At this point, if zeal_ is one of the types that trigger periodic
      * collection, then nextScheduled is reset to the value of zealFrequency.
      * Otherwise, no additional GCs take place.
      *
      * You can control these values in several ways:
      *   - Set the JS_GC_ZEAL environment variable
      *   - Call gczeal() or schedulegc() from inside shell-executed JS code
--- a/js/src/gc/Marking.cpp
+++ b/js/src/gc/Marking.cpp
@@ -1893,17 +1893,17 @@ MarkStack::init(JSGCMode gcMode)
     return true;
 }
 
 void
 MarkStack::setBaseCapacity(JSGCMode mode)
 {
     switch (mode) {
       case JSGC_MODE_GLOBAL:
-      case JSGC_MODE_COMPARTMENT:
+      case JSGC_MODE_ZONE:
         baseCapacity_ = NON_INCREMENTAL_MARK_STACK_BASE_CAPACITY;
         break;
       case JSGC_MODE_INCREMENTAL:
         baseCapacity_ = INCREMENTAL_MARK_STACK_BASE_CAPACITY;
         break;
       default:
         MOZ_CRASH("bad gc mode");
     }
--- a/js/src/gc/Statistics.cpp
+++ b/js/src/gc/Statistics.cpp
@@ -943,17 +943,17 @@ Statistics::endGC()
             phaseTotals[j][i] += phaseTimes[j][i];
 
     int64_t total, longest;
     gcDuration(&total, &longest);
 
     int64_t sccTotal, sccLongest;
     sccDurations(&sccTotal, &sccLongest);
 
-    runtime->addTelemetry(JS_TELEMETRY_GC_IS_COMPARTMENTAL, !zoneStats.isCollectingAllZones());
+    runtime->addTelemetry(JS_TELEMETRY_GC_IS_ZONE_GC, !zoneStats.isCollectingAllZones());
     runtime->addTelemetry(JS_TELEMETRY_GC_MS, t(total));
     runtime->addTelemetry(JS_TELEMETRY_GC_MAX_PAUSE_MS, t(longest));
     int64_t markTotal = SumPhase(PHASE_MARK, phaseTimes);
     int64_t markRootsTotal = SumPhase(PHASE_MARK_ROOTS, phaseTimes);
     runtime->addTelemetry(JS_TELEMETRY_GC_MARK_MS, t(markTotal));
     runtime->addTelemetry(JS_TELEMETRY_GC_SWEEP_MS, t(phaseTimes[PHASE_DAG_NONE][PHASE_SWEEP]));
     if (runtime->gc.isCompactingGc()) {
         runtime->addTelemetry(JS_TELEMETRY_GC_COMPACT_MS,
--- a/js/src/jit-test/tests/gc/multi-01.js
+++ b/js/src/jit-test/tests/gc/multi-01.js
@@ -1,9 +1,9 @@
 /* Make sure we don't collect the atoms compartment unless every compartment is marked. */
 
 var g = newGlobal();
 g.eval("var x = 'some-atom';");
 
 schedulegc(this);
 schedulegc('atoms');
-gc('compartment');
+gc('zone');
 print(g.x);
--- a/js/src/jsapi-tests/testGCFinalizeCallback.cpp
+++ b/js/src/jsapi-tests/testGCFinalizeCallback.cpp
@@ -2,106 +2,106 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "jsapi-tests/tests.h"
 
 static const unsigned BufferSize = 20;
 static unsigned FinalizeCalls = 0;
 static JSFinalizeStatus StatusBuffer[BufferSize];
-static bool IsCompartmentGCBuffer[BufferSize];
+static bool IsZoneGCBuffer[BufferSize];
 
 BEGIN_TEST(testGCFinalizeCallback)
 {
     JS_SetGCParameter(cx, JSGC_MODE, JSGC_MODE_INCREMENTAL);
 
     /* Full GC, non-incremental. */
     FinalizeCalls = 0;
     JS_GC(cx);
     CHECK(cx->gc.isFullGc());
     CHECK(checkSingleGroup());
     CHECK(checkFinalizeStatus());
-    CHECK(checkFinalizeIsCompartmentGC(false));
+    CHECK(checkFinalizeIsZoneGC(false));
 
     /* Full GC, incremental. */
     FinalizeCalls = 0;
     JS::PrepareForFullGC(cx);
     JS::StartIncrementalGC(cx, GC_NORMAL, JS::gcreason::API, 1000000);
     while (cx->gc.isIncrementalGCInProgress()) {
         JS::PrepareForFullGC(cx);
         JS::IncrementalGCSlice(cx, JS::gcreason::API, 1000000);
     }
     CHECK(!cx->gc.isIncrementalGCInProgress());
     CHECK(cx->gc.isFullGc());
     CHECK(checkMultipleGroups());
     CHECK(checkFinalizeStatus());
-    CHECK(checkFinalizeIsCompartmentGC(false));
+    CHECK(checkFinalizeIsZoneGC(false));
 
     JS::RootedObject global1(cx, createTestGlobal());
     JS::RootedObject global2(cx, createTestGlobal());
     JS::RootedObject global3(cx, createTestGlobal());
     CHECK(global1);
     CHECK(global2);
     CHECK(global3);
 
-    /* Compartment GC, non-incremental, single compartment. */
+    /* Zone GC, non-incremental, single zone. */
     FinalizeCalls = 0;
     JS::PrepareZoneForGC(global1->zone());
     JS::GCForReason(cx, GC_NORMAL, JS::gcreason::API);
     CHECK(!cx->gc.isFullGc());
     CHECK(checkSingleGroup());
     CHECK(checkFinalizeStatus());
-    CHECK(checkFinalizeIsCompartmentGC(true));
+    CHECK(checkFinalizeIsZoneGC(true));
 
-    /* Compartment GC, non-incremental, multiple compartments. */
+    /* Zone GC, non-incremental, multiple zones. */
     FinalizeCalls = 0;
     JS::PrepareZoneForGC(global1->zone());
     JS::PrepareZoneForGC(global2->zone());
     JS::PrepareZoneForGC(global3->zone());
     JS::GCForReason(cx, GC_NORMAL, JS::gcreason::API);
     CHECK(!cx->gc.isFullGc());
     CHECK(checkSingleGroup());
     CHECK(checkFinalizeStatus());
-    CHECK(checkFinalizeIsCompartmentGC(true));
+    CHECK(checkFinalizeIsZoneGC(true));
 
-    /* Compartment GC, incremental, single compartment. */
+    /* Zone GC, incremental, single zone. */
     FinalizeCalls = 0;
     JS::PrepareZoneForGC(global1->zone());
     JS::StartIncrementalGC(cx, GC_NORMAL, JS::gcreason::API, 1000000);
     while (cx->gc.isIncrementalGCInProgress()) {
         JS::PrepareZoneForGC(global1->zone());
         JS::IncrementalGCSlice(cx, JS::gcreason::API, 1000000);
     }
     CHECK(!cx->gc.isIncrementalGCInProgress());
     CHECK(!cx->gc.isFullGc());
     CHECK(checkSingleGroup());
     CHECK(checkFinalizeStatus());
-    CHECK(checkFinalizeIsCompartmentGC(true));
+    CHECK(checkFinalizeIsZoneGC(true));
 
-    /* Compartment GC, incremental, multiple compartments. */
+    /* Zone GC, incremental, multiple zones. */
     FinalizeCalls = 0;
     JS::PrepareZoneForGC(global1->zone());
     JS::PrepareZoneForGC(global2->zone());
     JS::PrepareZoneForGC(global3->zone());
     JS::StartIncrementalGC(cx, GC_NORMAL, JS::gcreason::API, 1000000);
     while (cx->gc.isIncrementalGCInProgress()) {
         JS::PrepareZoneForGC(global1->zone());
         JS::PrepareZoneForGC(global2->zone());
         JS::PrepareZoneForGC(global3->zone());
         JS::IncrementalGCSlice(cx, JS::gcreason::API, 1000000);
     }
     CHECK(!cx->gc.isIncrementalGCInProgress());
     CHECK(!cx->gc.isFullGc());
     CHECK(checkMultipleGroups());
     CHECK(checkFinalizeStatus());
-    CHECK(checkFinalizeIsCompartmentGC(true));
+    CHECK(checkFinalizeIsZoneGC(true));
 
 #ifdef JS_GC_ZEAL
 
-    /* Full GC with reset due to new compartment, becoming compartment GC. */
+    /* Full GC with reset due to new zone, becoming zone GC. */
 
     FinalizeCalls = 0;
     JS_SetGCZeal(cx, 9, 1000000);
     JS::PrepareForFullGC(cx);
     js::SliceBudget budget(js::WorkBudget(1));
     cx->gc.startDebugGC(GC_NORMAL, budget);
     CHECK(cx->gc.state() == js::gc::State::Mark);
     CHECK(cx->gc.isFullGc());
@@ -112,26 +112,26 @@ BEGIN_TEST(testGCFinalizeCallback)
     while (cx->gc.isIncrementalGCInProgress())
         cx->gc.debugGCSlice(budget);
     CHECK(!cx->gc.isIncrementalGCInProgress());
     CHECK(!cx->gc.isFullGc());
     CHECK(checkMultipleGroups());
     CHECK(checkFinalizeStatus());
 
     for (unsigned i = 0; i < FinalizeCalls - 1; ++i)
-        CHECK(!IsCompartmentGCBuffer[i]);
-    CHECK(IsCompartmentGCBuffer[FinalizeCalls - 1]);
+        CHECK(!IsZoneGCBuffer[i]);
+    CHECK(IsZoneGCBuffer[FinalizeCalls - 1]);
 
     JS_SetGCZeal(cx, 0, 0);
 
 #endif
 
     /*
      * Make some use of the globals here to ensure the compiler doesn't optimize
-     * them away in release builds, causing the compartments to be collected and
+     * them away in release builds, causing the zones to be collected and
      * the test to fail.
      */
     CHECK(JS_IsGlobalObject(global1));
     CHECK(JS_IsGlobalObject(global2));
     CHECK(JS_IsGlobalObject(global3));
 
     return true;
 }
@@ -170,41 +170,41 @@ bool checkMultipleGroups()
     CHECK(FinalizeCalls % 2 == 1);
     CHECK((FinalizeCalls - 1) / 2 > 1);
     return true;
 }
 
 bool checkFinalizeStatus()
 {
     /*
-     * The finalize callback should be called twice for each compartment group
+     * The finalize callback should be called twice for each zone group
      * finalized, with status JSFINALIZE_GROUP_START and JSFINALIZE_GROUP_END,
      * and then once more with JSFINALIZE_COLLECTION_END.
      */
 
     for (unsigned i = 0; i < FinalizeCalls - 1; i += 2) {
         CHECK(StatusBuffer[i] == JSFINALIZE_GROUP_START);
         CHECK(StatusBuffer[i + 1] == JSFINALIZE_GROUP_END);
     }
 
     CHECK(StatusBuffer[FinalizeCalls - 1] == JSFINALIZE_COLLECTION_END);
 
     return true;
 }
 
-bool checkFinalizeIsCompartmentGC(bool isCompartmentGC)
+bool checkFinalizeIsZoneGC(bool isZoneGC)
 {
     for (unsigned i = 0; i < FinalizeCalls; ++i)
-        CHECK(IsCompartmentGCBuffer[i] == isCompartmentGC);
+        CHECK(IsZoneGCBuffer[i] == isZoneGC);
 
     return true;
 }
 
 static void
-FinalizeCallback(JSFreeOp* fop, JSFinalizeStatus status, bool isCompartmentGC, void* data)
+FinalizeCallback(JSFreeOp* fop, JSFinalizeStatus status, bool isZoneGC, void* data)
 {
     if (FinalizeCalls < BufferSize) {
         StatusBuffer[FinalizeCalls] = status;
-        IsCompartmentGCBuffer[FinalizeCalls] = isCompartmentGC;
+        IsZoneGCBuffer[FinalizeCalls] = isZoneGC;
     }
     ++FinalizeCalls;
 }
 END_TEST(testGCFinalizeCallback)
--- a/js/src/jsapi-tests/testGCHooks.cpp
+++ b/js/src/jsapi-tests/testGCHooks.cpp
@@ -10,17 +10,17 @@
 
 static unsigned gSliceCallbackCount = 0;
 
 static void
 NonIncrementalGCSliceCallback(JSContext* cx, JS::GCProgress progress, const JS::GCDescription& desc)
 {
     ++gSliceCallbackCount;
     MOZ_RELEASE_ASSERT(progress == JS::GC_CYCLE_BEGIN || progress == JS::GC_CYCLE_END);
-    MOZ_RELEASE_ASSERT(desc.isCompartment_ == false);
+    MOZ_RELEASE_ASSERT(desc.isZone_ == false);
     MOZ_RELEASE_ASSERT(desc.invocationKind_ == GC_NORMAL);
     MOZ_RELEASE_ASSERT(desc.reason_ == JS::gcreason::API);
     if (progress == JS::GC_CYCLE_END) {
         mozilla::UniquePtr<char16_t> summary(desc.formatSummaryMessage(cx));
         mozilla::UniquePtr<char16_t> message(desc.formatSliceMessage(cx));
         mozilla::UniquePtr<char16_t> json(desc.formatJSON(cx, 0));
     }
 }
--- a/js/src/jsapi-tests/testIntern.cpp
+++ b/js/src/jsapi-tests/testIntern.cpp
@@ -35,14 +35,14 @@ BEGIN_TEST(testPinAcrossGC)
     CHECK(sw.str);
     JS_AddFinalizeCallback(cx, FinalizeCallback, nullptr);
     JS_GC(cx);
     CHECK(sw.strOk);
     return true;
 }
 
 static void
-FinalizeCallback(JSFreeOp* fop, JSFinalizeStatus status, bool isCompartmentGC, void* data)
+FinalizeCallback(JSFreeOp* fop, JSFinalizeStatus status, bool isZoneGC, void* data)
 {
     if (status == JSFINALIZE_GROUP_START)
         sw.strOk = js::gc::IsMarkedUnbarriered(&sw.str);
 }
 END_TEST(testPinAcrossGC)
--- a/js/src/jsapi.cpp
+++ b/js/src/jsapi.cpp
@@ -1458,17 +1458,17 @@ JS_SetGCParametersBasedOnAvailableMemory
             {JSGC_HIGH_FREQUENCY_LOW_LIMIT, 100},
             {JSGC_HIGH_FREQUENCY_HEAP_GROWTH_MAX, 300},
             {JSGC_HIGH_FREQUENCY_HEAP_GROWTH_MIN, 150},
             {JSGC_LOW_FREQUENCY_HEAP_GROWTH, 150},
             {JSGC_HIGH_FREQUENCY_TIME_LIMIT, 1500},
             {JSGC_HIGH_FREQUENCY_TIME_LIMIT, 1500},
             {JSGC_HIGH_FREQUENCY_TIME_LIMIT, 1500},
             {JSGC_ALLOCATION_THRESHOLD, 30},
-            {JSGC_MODE, JSGC_MODE_COMPARTMENT}
+            {JSGC_MODE, JSGC_MODE_ZONE}
         };
 
         config = nominal;
     }
 
     for (size_t i = 0; i < NumGCConfigs; i++)
         JS_SetGCParameter(cx, config[i].key, config[i].value);
 }
--- a/js/src/jsapi.h
+++ b/js/src/jsapi.h
@@ -549,38 +549,38 @@ typedef enum JSGCStatus {
 typedef void
 (* JSGCCallback)(JSContext* cx, JSGCStatus status, void* data);
 
 typedef void
 (* JSObjectsTenuredCallback)(JSContext* cx, void* data);
 
 typedef enum JSFinalizeStatus {
     /**
-     * Called when preparing to sweep a group of compartments, before anything
-     * has been swept.  The collector will not yield to the mutator before
-     * calling the callback with JSFINALIZE_GROUP_END status.
+     * Called when preparing to sweep a group of zones, before anything has been
+     * swept.  The collector will not yield to the mutator before calling the
+     * callback with JSFINALIZE_GROUP_END status.
      */
     JSFINALIZE_GROUP_START,
 
     /**
-     * Called when preparing to sweep a group of compartments. Weak references
-     * to unmarked things have been removed and things that are not swept
+     * Called when preparing to sweep a group of zones. Weak references to
+     * unmarked things have been removed and things that are not swept
      * incrementally have been finalized at this point.  The collector may yield
      * to the mutator after this point.
      */
     JSFINALIZE_GROUP_END,
 
     /**
      * Called at the end of collection when everything has been swept.
      */
     JSFINALIZE_COLLECTION_END
 } JSFinalizeStatus;
 
 typedef void
-(* JSFinalizeCallback)(JSFreeOp* fop, JSFinalizeStatus status, bool isCompartment, void* data);
+(* JSFinalizeCallback)(JSFreeOp* fop, JSFinalizeStatus status, bool isZoneGC, void* data);
 
 typedef void
 (* JSWeakPointerZoneGroupCallback)(JSContext* cx, void* data);
 
 typedef void
 (* JSWeakPointerCompartmentCallback)(JSContext* cx, JSCompartment* comp, void* data);
 
 typedef bool
--- a/js/src/jsfriendapi.h
+++ b/js/src/jsfriendapi.h
@@ -105,17 +105,17 @@ JS_IsDeadWrapper(JSObject* obj);
  */
 extern JS_FRIEND_API(void)
 JS_TraceShapeCycleCollectorChildren(JS::CallbackTracer* trc, JS::GCCellPtr shape);
 extern JS_FRIEND_API(void)
 JS_TraceObjectGroupCycleCollectorChildren(JS::CallbackTracer* trc, JS::GCCellPtr group);
 
 enum {
     JS_TELEMETRY_GC_REASON,
-    JS_TELEMETRY_GC_IS_COMPARTMENTAL,
+    JS_TELEMETRY_GC_IS_ZONE_GC,
     JS_TELEMETRY_GC_MS,
     JS_TELEMETRY_GC_BUDGET_MS,
     JS_TELEMETRY_GC_ANIMATION_MS,
     JS_TELEMETRY_GC_MAX_PAUSE_MS,
     JS_TELEMETRY_GC_MARK_MS,
     JS_TELEMETRY_GC_SWEEP_MS,
     JS_TELEMETRY_GC_COMPACT_MS,
     JS_TELEMETRY_GC_MARK_ROOTS_MS,
--- a/js/src/jsgc.cpp
+++ b/js/src/jsgc.cpp
@@ -1132,17 +1132,17 @@ GCRuntime::setParameter(JSGCParamKey key
         break;
       case JSGC_MARK_STACK_LIMIT:
         if (value == 0)
             return false;
         setMarkStackLimit(value, lock);
         break;
       case JSGC_MODE:
         if (mode != JSGC_MODE_GLOBAL &&
-            mode != JSGC_MODE_COMPARTMENT &&
+            mode != JSGC_MODE_ZONE &&
             mode != JSGC_MODE_INCREMENTAL)
         {
             return false;
         }
         mode = JSGCMode(value);
         break;
       case JSGC_COMPACTING_ENABLED:
         compactingEnabled = value != 0;
--- a/js/xpconnect/src/XPCJSRuntime.cpp
+++ b/js/xpconnect/src/XPCJSRuntime.cpp
@@ -726,17 +726,17 @@ XPCJSRuntime::CustomGCCallback(JSGCStatu
     nsTArray<xpcGCCallback> callbacks(extraGCCallbacks);
     for (uint32_t i = 0; i < callbacks.Length(); ++i)
         callbacks[i](status);
 }
 
 /* static */ void
 XPCJSRuntime::FinalizeCallback(JSFreeOp* fop,
                                JSFinalizeStatus status,
-                               bool isCompartmentGC,
+                               bool isZoneGC,
                                void* data)
 {
     XPCJSRuntime* self = nsXPConnect::GetRuntimeInstance();
     if (!self)
         return;
 
     switch (status) {
         case JSFINALIZE_GROUP_START:
@@ -803,28 +803,27 @@ XPCJSRuntime::FinalizeCallback(JSFreeOp*
                         XPCNativeSet* set = ccxp->GetSet();
                         if (set)
                             set->Mark();
                     }
                     ccxp = ccxp->GetPrevCallContext();
                 }
             }
 
-            // Do the sweeping. During a compartment GC, only
-            // WrappedNativeProtos in collected compartments will be
-            // marked. Therefore, some reachable NativeInterfaces will not be
-            // marked, so it is not safe to sweep them. We still need to unmark
-            // them, since the ones pointed to by WrappedNativeProtos in a
-            // compartment being collected will be marked.
+            // Do the sweeping. During a zone GC, only WrappedNativeProtos in
+            // collected zones will be marked. Therefore, some reachable
+            // NativeInterfaces will not be marked, so it is not safe to sweep
+            // them. We still need to unmark them, since the ones pointed to by
+            // WrappedNativeProtos in a zone being collected will be marked.
             //
-            // Ideally, if NativeInterfaces from different compartments were
-            // kept separate, we could sweep only the ones belonging to
-            // compartments being collected. Currently, though, NativeInterfaces
-            // are shared between compartments. This ought to be fixed.
-            bool doSweep = !isCompartmentGC;
+            // Ideally, if NativeInterfaces from different zones were kept
+            // separate, we could sweep only the ones belonging to zones being
+            // collected. Currently, though, NativeInterfaces are shared between
+            // zones. This ought to be fixed.
+            bool doSweep = !isZoneGC;
 
             if (doSweep) {
                 for (auto i = self->mClassInfo2NativeSetMap->Iter(); !i.Done(); i.Next()) {
                     auto entry = static_cast<ClassInfo2NativeSetMap::Entry*>(i.Get());
                     if (!entry->value->IsMarked())
                         i.Remove();
                 }
             }
@@ -3081,17 +3080,17 @@ JSSizeOfTab(JSObject* objArg, size_t* js
 
 static void
 AccumulateTelemetryCallback(int id, uint32_t sample, const char* key)
 {
     switch (id) {
       case JS_TELEMETRY_GC_REASON:
         Telemetry::Accumulate(Telemetry::GC_REASON_2, sample);
         break;
-      case JS_TELEMETRY_GC_IS_COMPARTMENTAL:
+      case JS_TELEMETRY_GC_IS_ZONE_GC:
         Telemetry::Accumulate(Telemetry::GC_IS_COMPARTMENTAL, sample);
         break;
       case JS_TELEMETRY_GC_MS:
         Telemetry::Accumulate(Telemetry::GC_MS, sample);
         break;
       case JS_TELEMETRY_GC_BUDGET_MS:
         Telemetry::Accumulate(Telemetry::GC_BUDGET_MS, sample);
         break;
--- a/js/xpconnect/src/xpcprivate.h
+++ b/js/xpconnect/src/xpcprivate.h
@@ -548,17 +548,17 @@ public:
     void CustomGCCallback(JSGCStatus status) override;
     void CustomOutOfMemoryCallback() override;
     void CustomLargeAllocationFailureCallback() override;
     static void GCSliceCallback(JSContext* cx,
                                 JS::GCProgress progress,
                                 const JS::GCDescription& desc);
     static void FinalizeCallback(JSFreeOp* fop,
                                  JSFinalizeStatus status,
-                                 bool isCompartmentGC,
+                                 bool isZoneGC,
                                  void* data);
     static void WeakPointerZoneGroupCallback(JSContext* cx, void* data);
     static void WeakPointerCompartmentCallback(JSContext* cx, JSCompartment* comp, void* data);
 
     inline void AddVariantRoot(XPCTraceableVariant* variant);
     inline void AddWrappedJSRoot(nsXPCWrappedJS* wrappedJS);
     inline void AddObjectHolderRoot(XPCJSObjectHolder* holder);
 
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -1226,17 +1226,17 @@ pref("javascript.options.ion.offthread_c
 // fail.
 pref("javascript.options.discardSystemSource", false);
 // This preference limits the memory usage of javascript.
 // If you want to change these values for your device,
 // please find Bug 417052 comment 17 and Bug 456721
 // Comment 32 and Bug 613551.
 pref("javascript.options.mem.high_water_mark", 128);
 pref("javascript.options.mem.max", -1);
-pref("javascript.options.mem.gc_per_compartment", true);
+pref("javascript.options.mem.gc_per_zone", true);
 pref("javascript.options.mem.gc_incremental", true);
 pref("javascript.options.mem.gc_incremental_slice_ms", 10);
 pref("javascript.options.mem.gc_compacting", true);
 pref("javascript.options.mem.log", false);
 pref("javascript.options.mem.notify", false);
 pref("javascript.options.gc_on_memory_pressure", true);
 pref("javascript.options.compact_on_user_inactive", true);
 #ifdef NIGHTLY_BUILD
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -698,17 +698,17 @@
     "kind": "enumerated",
     "n_values": 100,
     "description": "Reason (enum value) for initiating a GC"
   },
   "GC_IS_COMPARTMENTAL": {
     "alert_emails": ["dev-telemetry-gc-alerts@mozilla.org"],
     "expires_in_version": "never",
     "kind": "boolean",
-    "description": "Is it a compartmental GC?"
+    "description": "Is it a zone GC?"
   },
   "GC_MS": {
     "alert_emails": ["dev-telemetry-gc-alerts@mozilla.org"],
     "expires_in_version": "never",
     "kind": "exponential",
     "high": 10000,
     "n_buckets": 50,
     "description": "Time spent running JS GC (ms)"