Bug 1541810 part 2 - Rename *CompartmentMerge to *RealmMerge in a few places. r=jonco
authorJan de Mooij <jdemooij@mozilla.com>
Mon, 08 Apr 2019 08:56:31 +0000
changeset 468338 1e3fc1d21f8a813e0c7db3d76a48fdb499ba2ea8
parent 468337 1eaf2a656e3f8a88ad5f4536bcf05f8ad6c9d07d
child 468339 272a1013a0eb742fd7bf6283bff130cbcfc9cf1a
push id35833
push userdvarga@mozilla.com
push dateMon, 08 Apr 2019 16:16:26 +0000
treeherdermozilla-central@50ce9167f1ce [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjonco
bugs1541810
milestone68.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 1541810 part 2 - Rename *CompartmentMerge to *RealmMerge in a few places. r=jonco Differential Revision: https://phabricator.services.mozilla.com/D26084
js/src/builtin/ModuleObject.cpp
js/src/builtin/ModuleObject.h
js/src/vm/EnvironmentObject.cpp
js/src/vm/EnvironmentObject.h
js/src/vm/HelperThreads.cpp
--- a/js/src/builtin/ModuleObject.cpp
+++ b/js/src/builtin/ModuleObject.cpp
@@ -323,17 +323,17 @@ void IndirectBindingMap::trace(JSTracer*
   }
 }
 
 bool IndirectBindingMap::put(JSContext* cx, HandleId name,
                              HandleModuleEnvironmentObject environment,
                              HandleId localName) {
   // This object might have been allocated on the background parsing thread in
   // different zone to the final module. Lazily allocate the map so we don't
-  // have to switch its zone when merging compartments.
+  // have to switch its zone when merging realms.
   if (!map_) {
     MOZ_ASSERT(!cx->zone()->createdForHelperThread());
     map_.emplace(cx->zone());
   }
 
   RootedShape shape(cx, environment->lookup(cx, localName));
   MOZ_ASSERT(shape);
   if (!map_->put(name, Binding(environment, shape))) {
@@ -900,19 +900,19 @@ static inline bool CheckObjectPropertyFr
 #endif
 
 inline static void AssertModuleScopesMatch(ModuleObject* module) {
   MOZ_ASSERT(module->enclosingScope()->is<GlobalScope>());
   MOZ_ASSERT(IsGlobalLexicalEnvironment(
       &module->initialEnvironment().enclosingEnvironment()));
 }
 
-void ModuleObject::fixEnvironmentsAfterCompartmentMerge() {
+void ModuleObject::fixEnvironmentsAfterRealmMerge() {
   AssertModuleScopesMatch(this);
-  initialEnvironment().fixEnclosingEnvironmentAfterCompartmentMerge(
+  initialEnvironment().fixEnclosingEnvironmentAfterRealmMerge(
       script()->global());
   AssertModuleScopesMatch(this);
 }
 
 JSScript* ModuleObject::maybeScript() const {
   Value value = getReservedSlot(ScriptSlot);
   if (value.isUndefined()) return nullptr;
 
--- a/js/src/builtin/ModuleObject.h
+++ b/js/src/builtin/ModuleObject.h
@@ -271,17 +271,17 @@ class ModuleObject : public NativeObject
                             HandleArrayObject importEntries,
                             HandleArrayObject localExportEntries,
                             HandleArrayObject indiretExportEntries,
                             HandleArrayObject starExportEntries);
   static bool Freeze(JSContext* cx, HandleModuleObject self);
 #ifdef DEBUG
   static bool AssertFrozen(JSContext* cx, HandleModuleObject self);
 #endif
-  void fixEnvironmentsAfterCompartmentMerge();
+  void fixEnvironmentsAfterRealmMerge();
 
   JSScript* maybeScript() const;
   JSScript* script() const;
   Scope* enclosingScope() const;
   ModuleEnvironmentObject& initialEnvironment() const;
   ModuleEnvironmentObject* environment() const;
   ModuleNamespaceObject* namespace_();
   ModuleStatus status() const;
--- a/js/src/vm/EnvironmentObject.cpp
+++ b/js/src/vm/EnvironmentObject.cpp
@@ -442,17 +442,17 @@ bool ModuleEnvironmentObject::hasImportB
 }
 
 bool ModuleEnvironmentObject::lookupImport(jsid name,
                                            ModuleEnvironmentObject** envOut,
                                            Shape** shapeOut) {
   return importBindings().lookup(name, envOut, shapeOut);
 }
 
-void ModuleEnvironmentObject::fixEnclosingEnvironmentAfterCompartmentMerge(
+void ModuleEnvironmentObject::fixEnclosingEnvironmentAfterRealmMerge(
     GlobalObject& global) {
   setEnclosingEnvironment(&global.lexicalEnvironment());
 }
 
 /* static */
 bool ModuleEnvironmentObject::lookupProperty(
     JSContext* cx, HandleObject obj, HandleId id, MutableHandleObject objp,
     MutableHandle<PropertyResult> propp) {
--- a/js/src/vm/EnvironmentObject.h
+++ b/js/src/vm/EnvironmentObject.h
@@ -158,19 +158,18 @@ extern PropertyName* EnvironmentCoordina
  *    this object is itself the holder of 'var' bindings.
  *
  *    Does not hold 'let' or 'const' bindings.
  *
  * 3. LexicalEnvironmentObject
  *
  *    Each non-syntactic object used as a qualified variables object needs to
  *    enclose a non-syntactic LexicalEnvironmentObject to hold 'let' and
- *    'const' bindings. There is a bijection per compartment between the
- *    non-syntactic variables objects and their non-syntactic
- *    LexicalEnvironmentObjects.
+ *    'const' bindings. There is a bijection per realm between the non-syntactic
+ *    variables objects and their non-syntactic LexicalEnvironmentObjects.
  *
  *    Does not hold 'var' bindings.
  *
  * The embedding (Gecko) uses non-syntactic envs for various things, some of
  * which are detailed below. All env chain listings below are, from top to
  * bottom, outermost to innermost.
  *
  * A. Component loading
@@ -415,17 +414,17 @@ class ModuleEnvironmentObject : public E
   bool createImportBinding(JSContext* cx, HandleAtom importName,
                            HandleModuleObject module, HandleAtom exportName);
 
   bool hasImportBinding(HandlePropertyName name);
 
   bool lookupImport(jsid name, ModuleEnvironmentObject** envOut,
                     Shape** shapeOut);
 
-  void fixEnclosingEnvironmentAfterCompartmentMerge(GlobalObject& global);
+  void fixEnclosingEnvironmentAfterRealmMerge(GlobalObject& global);
 
  private:
   static bool lookupProperty(JSContext* cx, HandleObject obj, HandleId id,
                              MutableHandleObject objp,
                              MutableHandle<PropertyResult> propp);
   static bool hasProperty(JSContext* cx, HandleObject obj, HandleId id,
                           bool* foundp);
   static bool getProperty(JSContext* cx, HandleObject obj, HandleValue receiver,
--- a/js/src/vm/HelperThreads.cpp
+++ b/js/src/vm/HelperThreads.cpp
@@ -1843,17 +1843,17 @@ JSObject* GlobalHelperThreadState::finis
   JSScript* script = finishSingleParseTask(cx, ParseTaskKind::Module, token);
   if (!script) {
     return nullptr;
   }
 
   MOZ_ASSERT(script->module());
 
   RootedModuleObject module(cx, script->module());
-  module->fixEnvironmentsAfterCompartmentMerge();
+  module->fixEnvironmentsAfterRealmMerge();
   if (!ModuleObject::Freeze(cx, module)) {
     return nullptr;
   }
 
   return module;
 }
 
 void GlobalHelperThreadState::cancelParseTask(JSRuntime* rt, ParseTaskKind kind,