Bug 1304672: Renamings outside asmjs/ and jit/; r=luke
authorBenjamin Bouvier <benj@benj.me>
Wed, 02 Nov 2016 18:22:37 +0100
changeset 321050 b135b519487e216e1841e787f2084527fe2ed0dc
parent 321049 520c46902b450411405d509365db6aa020a5cf52
child 321051 f37699322f20dbf4e6f25ccf6ab8405cf83352d2
push id33920
push userphilringnalda@gmail.com
push dateSat, 05 Nov 2016 02:06:19 +0000
treeherderautoland@3d200aa1872f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersluke
bugs1304672
milestone52.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 1304672: Renamings outside asmjs/ and jit/; r=luke MozReview-Commit-ID: 1LGFJMlHaz2
js/public/ProfilingFrameIterator.h
js/src/asmjs/AsmJS.cpp
js/src/asmjs/WasmJS.cpp
js/src/builtin/TestingFunctions.cpp
js/src/jsapi.cpp
js/src/jscompartment.cpp
js/src/jscompartment.h
js/src/jsfun.cpp
js/src/jsfun.h
js/src/jsopcode.cpp
js/src/jsscript.cpp
js/src/vm/Debugger.cpp
js/src/vm/HelperThreads.cpp
js/src/vm/HelperThreads.h
js/src/vm/Runtime.cpp
js/src/vm/Runtime.h
js/src/vm/SPSProfiler.h
js/src/vm/SavedStacks.cpp
js/src/vm/SavedStacks.h
js/src/vm/Stack.cpp
js/src/vm/Stack.h
tools/profiler/core/GeckoSampler.cpp
--- a/js/public/ProfilingFrameIterator.h
+++ b/js/public/ProfilingFrameIterator.h
@@ -54,24 +54,24 @@ class JS_PUBLIC_API(ProfilingFrameIterat
     // from it to use as the exit-frame pointer when the next caller jit
     // activation (if any) comes around.
     void* savedPrevJitTop_;
 
     JS::AutoCheckCannotGC nogc_;
 
     static const unsigned StorageSpace = 8 * sizeof(void*);
     mozilla::AlignedStorage<StorageSpace> storage_;
-    js::wasm::ProfilingFrameIterator& asmJSIter() {
+    js::wasm::ProfilingFrameIterator& wasmIter() {
         MOZ_ASSERT(!done());
-        MOZ_ASSERT(isAsmJS());
+        MOZ_ASSERT(isWasm());
         return *reinterpret_cast<js::wasm::ProfilingFrameIterator*>(storage_.addr());
     }
-    const js::wasm::ProfilingFrameIterator& asmJSIter() const {
+    const js::wasm::ProfilingFrameIterator& wasmIter() const {
         MOZ_ASSERT(!done());
-        MOZ_ASSERT(isAsmJS());
+        MOZ_ASSERT(isWasm());
         return *reinterpret_cast<const js::wasm::ProfilingFrameIterator*>(storage_.addr());
     }
 
     js::jit::JitProfilingFrameIterator& jitIter() {
         MOZ_ASSERT(!done());
         MOZ_ASSERT(isJit());
         return *reinterpret_cast<js::jit::JitProfilingFrameIterator*>(storage_.addr());
     }
@@ -109,29 +109,29 @@ class JS_PUBLIC_API(ProfilingFrameIterat
     //  - will compare greater than newer native and psuedo-stack frame addresses
     //    and less than older native and psuedo-stack frame addresses
     void* stackAddress() const;
 
     enum FrameKind
     {
       Frame_Baseline,
       Frame_Ion,
-      Frame_AsmJS
+      Frame_Wasm
     };
 
     struct Frame
     {
         FrameKind kind;
         void* stackAddress;
         void* returnAddress;
         void* activation;
         UniqueChars label;
     };
 
-    bool isAsmJS() const;
+    bool isWasm() const;
     bool isJit() const;
 
     uint32_t extractStack(Frame* frames, uint32_t offset, uint32_t end) const;
 
     mozilla::Maybe<Frame> getPhysicalFrameWithoutLabel() const;
 
   private:
     mozilla::Maybe<Frame> getPhysicalFrameAndEntry(js::jit::JitcodeGlobalEntry* entry) const;
--- a/js/src/asmjs/AsmJS.cpp
+++ b/js/src/asmjs/AsmJS.cpp
@@ -8147,17 +8147,17 @@ InstantiateAsmJS(JSContext* cx, unsigned
 }
 
 static JSFunction*
 NewAsmJSModuleFunction(ExclusiveContext* cx, JSFunction* origFun, HandleObject moduleObj)
 {
     RootedAtom name(cx, origFun->name());
 
     JSFunction::Flags flags = origFun->isLambda() ? JSFunction::ASMJS_LAMBDA_CTOR
-                                                  : JSFunction::ASMJS_CTOR;
+                                                  : JSFunction::WASM_CTOR;
     JSFunction* moduleFun =
         NewNativeConstructor(cx, InstantiateAsmJS, origFun->nargs(), name,
                              gc::AllocKind::FUNCTION_EXTENDED, TenuredObject,
                              flags);
     if (!moduleFun)
         return nullptr;
 
     moduleFun->setExtendedSlot(FunctionExtended::ASMJS_MODULE_SLOT, ObjectValue(*moduleObj));
--- a/js/src/asmjs/WasmJS.cpp
+++ b/js/src/asmjs/WasmJS.cpp
@@ -768,17 +768,17 @@ WasmInstanceObject::getExportedFunction(
 
     const Instance& instance = instanceObj->instance();
     RootedAtom name(cx, instance.code().getFuncDefAtom(cx, funcDefIndex));
     if (!name)
         return false;
 
     unsigned numArgs = instance.metadata().lookupFuncDefExport(funcDefIndex).sig().args().length();
     fun.set(NewNativeConstructor(cx, WasmCall, numArgs, name, gc::AllocKind::FUNCTION_EXTENDED,
-                                 SingletonObject, JSFunction::ASMJS_CTOR));
+                                 SingletonObject, JSFunction::WASM_CTOR));
     if (!fun)
         return false;
 
     fun->setExtendedSlot(FunctionExtended::WASM_INSTANCE_SLOT, ObjectValue(*instanceObj));
     fun->setExtendedSlot(FunctionExtended::WASM_FUNC_DEF_INDEX_SLOT, Int32Value(funcDefIndex));
 
     if (!instanceObj->exports().putNew(funcDefIndex, fun)) {
         ReportOutOfMemory(cx);
--- a/js/src/builtin/TestingFunctions.cpp
+++ b/js/src/builtin/TestingFunctions.cpp
@@ -1763,18 +1763,18 @@ ReadSPSProfilingStack(JSContext* cx, uns
             const char* frameKindStr = nullptr;
             switch (frames[i].kind) {
               case JS::ProfilingFrameIterator::Frame_Baseline:
                 frameKindStr = "baseline";
                 break;
               case JS::ProfilingFrameIterator::Frame_Ion:
                 frameKindStr = "ion";
                 break;
-              case JS::ProfilingFrameIterator::Frame_AsmJS:
-                frameKindStr = "asmjs";
+              case JS::ProfilingFrameIterator::Frame_Wasm:
+                frameKindStr = "wasm";
                 break;
               default:
                 frameKindStr = "unknown";
             }
 
             if (!frameInfo.back().emplaceBack(frameKindStr, mozilla::Move(frames[i].label)))
                 return false;
         }
@@ -4422,17 +4422,17 @@ gc::ZealModeHelpText),
     JS_FN_HELP("setJitCompilerOption", SetJitCompilerOption, 2, 0,
 "setCompilerOption(<option>, <number>)",
 "  Set a compiler option indexed in JSCompileOption enum to a number.\n"),
 
     JS_FN_HELP("setIonCheckGraphCoherency", SetIonCheckGraphCoherency, 1, 0,
 "setIonCheckGraphCoherency(bool)",
 "  Set whether Ion should perform graph consistency (DEBUG-only) assertions. These assertions\n"
 "  are valuable and should be generally enabled, however they can be very expensive for large\n"
-"  (asm.js) programs."),
+"  (wasm) programs."),
 
     JS_FN_HELP("serialize", Serialize, 1, 0,
 "serialize(data, [transferables, [policy]])",
 "  Serialize 'data' using JS_WriteStructuredClone. Returns a structured\n"
 "  clone buffer object. 'policy' must be an object. The following keys'\n"
 "  string values will be used to determine whether the corresponding types\n"
 "  may be serialized (value 'allow', the default) or not (value 'deny').\n"
 "  If denied types are encountered a TypeError will be thrown during cloning.\n"
--- a/js/src/jsapi.cpp
+++ b/js/src/jsapi.cpp
@@ -3871,17 +3871,17 @@ JS::CompileOptions::CompileOptions(JSCon
 {
     this->version = (version != JSVERSION_UNKNOWN) ? version : cx->findVersion();
 
     strictOption = cx->options().strictMode();
     extraWarningsOption = cx->compartment()->behaviors().extraWarnings(cx);
     werrorOption = cx->options().werror();
     if (!cx->options().asmJS())
         asmJSOption = AsmJSOption::Disabled;
-    else if (cx->compartment()->debuggerObservesAsmJS())
+    else if (cx->compartment()->debuggerObservesWasm())
         asmJSOption = AsmJSOption::DisabledByDebugger;
     else
         asmJSOption = AsmJSOption::Enabled;
     throwOnAsmJSValidationFailureOption = cx->options().throwOnAsmJSValidationFailure();
 }
 
 static bool
 Compile(JSContext* cx, const ReadOnlyCompileOptions& options, ScopeKind scopeKind,
--- a/js/src/jscompartment.cpp
+++ b/js/src/jscompartment.cpp
@@ -1083,17 +1083,17 @@ JSCompartment::ensureDelazifyScriptsForD
 }
 
 void
 JSCompartment::updateDebuggerObservesFlag(unsigned flag)
 {
     MOZ_ASSERT(isDebuggee());
     MOZ_ASSERT(flag == DebuggerObservesAllExecution ||
                flag == DebuggerObservesCoverage ||
-               flag == DebuggerObservesAsmJS);
+               flag == DebuggerObservesWasm);
 
     GlobalObject* global = zone()->runtimeFromMainThread()->gc.isForegroundSweeping()
                            ? unsafeUnbarrieredMaybeGlobal()
                            : maybeGlobal();
     const GlobalObject::DebuggerVector* v = global->getDebuggers();
     for (auto p = v->begin(); p != v->end(); p++) {
         Debugger* dbg = *p;
         if (flag == DebuggerObservesAllExecution ? dbg->observesAllExecution() :
--- a/js/src/jscompartment.h
+++ b/js/src/jscompartment.h
@@ -551,28 +551,28 @@ struct JSCompartment
      * slot for the former, or a special slot for the latter.
      */
     JSObject*                    gcIncomingGrayPointers;
 
   private:
     enum {
         IsDebuggee = 1 << 0,
         DebuggerObservesAllExecution = 1 << 1,
-        DebuggerObservesAsmJS = 1 << 2,
+        DebuggerObservesWasm = 1 << 2,
         DebuggerObservesCoverage = 1 << 3,
         DebuggerNeedsDelazification = 1 << 4
     };
 
     unsigned debugModeBits;
     friend class AutoRestoreCompartmentDebugMode;
 
     static const unsigned DebuggerObservesMask = IsDebuggee |
                                                  DebuggerObservesAllExecution |
                                                  DebuggerObservesCoverage |
-                                                 DebuggerObservesAsmJS;
+                                                 DebuggerObservesWasm;
 
     void updateDebuggerObservesFlag(unsigned flag);
 
     bool getNonWrapperObjectForCurrentCompartment(JSContext* cx, js::MutableHandleObject obj);
     bool getOrCreateWrapper(JSContext* cx, js::HandleObject existing, js::MutableHandleObject obj);
 
   public:
     JSCompartment(JS::Zone* zone, const JS::CompartmentOptions& options);
@@ -703,18 +703,18 @@ struct JSCompartment
     // The Debugger observes execution on a frame-by-frame basis. The
     // invariants of JSCompartment's debug mode bits, JSScript::isDebuggee,
     // InterpreterFrame::isDebuggee, and BaselineFrame::isDebuggee are
     // enumerated below.
     //
     // 1. When a compartment's isDebuggee() == true, relazification and lazy
     //    parsing are disabled.
     //
-    //    Whether AOT asm.js is disabled is togglable by the Debugger API. By
-    //    default it is disabled. See debuggerObservesAsmJS below.
+    //    Whether AOT wasm is disabled is togglable by the Debugger API. By
+    //    default it is disabled. See debuggerObservesWasm below.
     //
     // 2. When a compartment's debuggerObservesAllExecution() == true, all of
     //    the compartment's scripts are considered debuggee scripts.
     //
     // 3. A script is considered a debuggee script either when, per above, its
     //    compartment is observing all execution, or if it has breakpoints set.
     //
     // 4. A debuggee script always pushes a debuggee frame.
@@ -750,25 +750,25 @@ struct JSCompartment
     }
     void updateDebuggerObservesAllExecution() {
         updateDebuggerObservesFlag(DebuggerObservesAllExecution);
     }
 
     // True if this compartment's global is a debuggee of some Debugger object
     // whose allowUnobservedAsmJS flag is false.
     //
-    // Note that since AOT asm.js functions cannot bail out, this flag really
-    // means "observe asm.js from this point forward". We cannot make
-    // already-compiled asm.js code observable to Debugger.
-    bool debuggerObservesAsmJS() const {
-        static const unsigned Mask = IsDebuggee | DebuggerObservesAsmJS;
+    // Note that since AOT wasm functions cannot bail out, this flag really
+    // means "observe wasm from this point forward". We cannot make
+    // already-compiled wasm code observable to Debugger.
+    bool debuggerObservesWasm() const {
+        static const unsigned Mask = IsDebuggee | DebuggerObservesWasm;
         return (debugModeBits & Mask) == Mask;
     }
-    void updateDebuggerObservesAsmJS() {
-        updateDebuggerObservesFlag(DebuggerObservesAsmJS);
+    void updateDebuggerObservesWasm() {
+        updateDebuggerObservesFlag(DebuggerObservesWasm);
     }
 
     // True if this compartment's global is a debuggee of some Debugger object
     // whose collectCoverageInfo flag is true.
     bool debuggerObservesCoverage() const {
         static const unsigned Mask = DebuggerObservesCoverage;
         return (debugModeBits & Mask) == Mask;
     }
--- a/js/src/jsfun.cpp
+++ b/js/src/jsfun.cpp
@@ -373,17 +373,17 @@ static const JSPropertySpec function_pro
     JS_PSGS("arguments", ArgumentsGetter, ArgumentsSetter, 0),
     JS_PSGS("caller", CallerGetter, CallerSetter, 0),
     JS_PS_END
 };
 
 static bool
 ResolveInterpretedFunctionPrototype(JSContext* cx, HandleFunction fun, HandleId id)
 {
-    MOZ_ASSERT(fun->isInterpreted() || fun->isAsmJSNative());
+    MOZ_ASSERT(fun->isInterpreted() || fun->isWasmNative());
     MOZ_ASSERT(id == NameToId(cx->names().prototype));
 
     // Assert that fun is not a compiler-created function object, which
     // must never leak to script or embedding code and then be mutated.
     // Also assert that fun is not bound, per the ES5 15.3.4.5 ref above.
     MOZ_ASSERT(!IsInternalFunctionObject(*fun));
     MOZ_ASSERT(!fun->isBoundFunction());
 
@@ -914,17 +914,17 @@ const Class* const js::FunctionClassPtr 
 bool
 js::FindBody(JSContext* cx, HandleFunction fun, HandleLinearString src, size_t* bodyStart,
              size_t* bodyEnd)
 {
     // We don't need principals, since those are only used for error reporting.
     CompileOptions options(cx);
     options.setFileAndLine("internal-findBody", 0);
 
-    // For asm.js modules, there's no script.
+    // For asm.js/wasm modules, there's no script.
     if (fun->hasScript())
         options.setVersion(fun->nonLazyScript()->getVersion());
 
     AutoKeepAtoms keepAtoms(cx->perThreadData);
 
     AutoStableStringChars stableChars(cx);
     if (!stableChars.initTwoByte(cx, src))
         return false;
--- a/js/src/jsfun.h
+++ b/js/src/jsfun.h
@@ -35,17 +35,17 @@ class JSFunction : public js::NativeObje
 
     enum FunctionKind {
         NormalFunction = 0,
         Arrow,                      /* ES6 '(args) => body' syntax */
         Method,                     /* ES6 MethodDefinition */
         ClassConstructor,
         Getter,
         Setter,
-        AsmJS,                      /* function is an asm.js module or exported function */
+        Wasm,                       /* function is wasm module or exported function */
         FunctionKindLimit
     };
 
     enum Flags {
         INTERPRETED      = 0x0001,  /* function has a JSScript and environment. */
         CONSTRUCTOR      = 0x0002,  /* function that can be called as a constructor */
         EXTENDED         = 0x0004,  /* structure is FunctionExtended */
         BOUND_FUN        = 0x0008,  /* function was created with Function.prototype.bind. */
@@ -61,29 +61,29 @@ class JSFunction : public js::NativeObje
         HAS_REST         = 0x0100,  /* function has a rest (...) parameter */
         INTERPRETED_LAZY = 0x0200,  /* function is interpreted but doesn't have a script yet */
         RESOLVED_LENGTH  = 0x0400,  /* f.length has been resolved (see fun_resolve). */
         RESOLVED_NAME    = 0x0800,  /* f.name has been resolved (see fun_resolve). */
 
         FUNCTION_KIND_SHIFT = 13,
         FUNCTION_KIND_MASK  = 0x7 << FUNCTION_KIND_SHIFT,
 
-        ASMJS_KIND = AsmJS << FUNCTION_KIND_SHIFT,
+        WASM_KIND = Wasm << FUNCTION_KIND_SHIFT,
         ARROW_KIND = Arrow << FUNCTION_KIND_SHIFT,
         METHOD_KIND = Method << FUNCTION_KIND_SHIFT,
         CLASSCONSTRUCTOR_KIND = ClassConstructor << FUNCTION_KIND_SHIFT,
         GETTER_KIND = Getter << FUNCTION_KIND_SHIFT,
         SETTER_KIND = Setter << FUNCTION_KIND_SHIFT,
 
         /* Derived Flags values for convenience: */
         NATIVE_FUN = 0,
         NATIVE_CTOR = NATIVE_FUN | CONSTRUCTOR,
         NATIVE_CLASS_CTOR = NATIVE_FUN | CONSTRUCTOR | CLASSCONSTRUCTOR_KIND,
-        ASMJS_CTOR = ASMJS_KIND | NATIVE_CTOR,
-        ASMJS_LAMBDA_CTOR = ASMJS_KIND | NATIVE_CTOR | LAMBDA,
+        WASM_CTOR = WASM_KIND | NATIVE_CTOR,
+        ASMJS_LAMBDA_CTOR = WASM_KIND | NATIVE_CTOR | LAMBDA,
         INTERPRETED_METHOD = INTERPRETED | METHOD_KIND,
         INTERPRETED_METHOD_GENERATOR = INTERPRETED | METHOD_KIND,
         INTERPRETED_CLASS_CONSTRUCTOR = INTERPRETED | CLASSCONSTRUCTOR_KIND | CONSTRUCTOR,
         INTERPRETED_GETTER = INTERPRETED | GETTER_KIND,
         INTERPRETED_SETTER = INTERPRETED | SETTER_KIND,
         INTERPRETED_LAMBDA = INTERPRETED | LAMBDA | CONSTRUCTOR,
         INTERPRETED_LAMBDA_ARROW = INTERPRETED | LAMBDA | ARROW_KIND,
         INTERPRETED_LAMBDA_GENERATOR = INTERPRETED | LAMBDA,
@@ -168,17 +168,17 @@ class JSFunction : public js::NativeObje
 
     /* A function can be classified as either native (C++) or interpreted (JS): */
     bool isInterpreted()            const { return flags() & (INTERPRETED | INTERPRETED_LAZY); }
     bool isNative()                 const { return !isInterpreted(); }
 
     bool isConstructor()            const { return flags() & CONSTRUCTOR; }
 
     /* Possible attributes of a native function: */
-    bool isAsmJSNative()            const { return kind() == AsmJS; }
+    bool isWasmNative()            const { return kind() == Wasm; }
 
     /* Possible attributes of an interpreted function: */
     bool isExprBody()               const { return flags() & EXPR_BODY; }
     bool hasGuessedAtom()           const { return flags() & HAS_GUESSED_ATOM; }
     bool isLambda()                 const { return flags() & LAMBDA; }
     bool isBoundFunction()          const { return flags() & BOUND_FUN; }
     bool hasRest()                  const { return flags() & HAS_REST; }
     bool isInterpretedLazy()        const { return flags() & INTERPRETED_LAZY; }
@@ -210,17 +210,17 @@ class JSFunction : public js::NativeObje
         if (!hasScript())
             return false;
 
         return nonLazyScript()->hasBaselineScript() || nonLazyScript()->hasIonScript();
     }
 
     /* Compound attributes: */
     bool isBuiltin() const {
-        return (isNative() && !isAsmJSNative()) || isSelfHostedBuiltin();
+        return (isNative() && !isWasmNative()) || isSelfHostedBuiltin();
     }
 
     bool isNamedLambda() const {
         return isLambda() && displayAtom() && !hasGuessedAtom();
     }
 
     bool hasLexicalThis() const {
         return isArrow() || nonLazyScript()->isGeneratorExp();
--- a/js/src/jsopcode.cpp
+++ b/js/src/jsopcode.cpp
@@ -2155,17 +2155,17 @@ GenerateLcovInfo(JSContext* cx, JSCompar
             while (idx--) {
                 JSObject* obj = script->getObject(idx);
 
                 // Only continue on JSFunction objects.
                 if (!obj->is<JSFunction>())
                     continue;
                 JSFunction& fun = obj->as<JSFunction>();
 
-                // Let's skip asm.js for now.
+                // Let's skip wasm for now.
                 if (!fun.isInterpreted())
                     continue;
 
                 // Queue the script in the list of script associated to the
                 // current source.
                 JSScript* childScript = fun.getOrCreateScript(cx);
                 if (!childScript || !queue.append(childScript))
                     return false;
--- a/js/src/jsscript.cpp
+++ b/js/src/jsscript.cpp
@@ -786,17 +786,17 @@ js::XDRScript(XDRState<mode>* xdr, Handl
             if (mode == XDR_ENCODE) {
                 RootedFunction function(cx, &(*objp)->as<JSFunction>());
 
                 if (function->isInterpretedLazy()) {
                     funEnclosingScope = function->lazyScript()->enclosingScope();
                 } else if (function->isInterpreted()) {
                     funEnclosingScope = function->nonLazyScript()->enclosingScope();
                 } else {
-                    MOZ_ASSERT(function->isAsmJSNative());
+                    MOZ_ASSERT(function->isWasmNative());
                     return xdr->fail(JS::TranscodeResult_Failure_AsmJSNotSupported);
                 }
 
                 funEnclosingScopeIndex = FindScopeIndex(script, *funEnclosingScope);
             }
 
             if (!xdr->codeUint32(&funEnclosingScopeIndex))
                 return false;
@@ -3079,17 +3079,17 @@ js::DescribeScriptedCallerForCompilation
         return;
     }
 
     *file = iter.filename();
     *linenop = iter.computeLine();
     *mutedErrors = iter.mutedErrors();
 
     // These values are only used for introducer fields which are debugging
-    // information and can be safely left null for asm.js frames.
+    // information and can be safely left null for wasm frames.
     if (iter.hasScript()) {
         maybeScript.set(iter.script());
         *pcOffset = iter.pc() - maybeScript->code();
     } else {
         maybeScript.set(nullptr);
         *pcOffset = 0;
     }
 }
@@ -3205,17 +3205,17 @@ js::detail::CopyScript(JSContext* cx, Ha
             obj = vector[i];
             clone = nullptr;
             if (obj->is<RegExpObject>()) {
                 clone = CloneScriptRegExpObject(cx, obj->as<RegExpObject>());
             } else if (obj->is<JSFunction>()) {
                 RootedFunction innerFun(cx, &obj->as<JSFunction>());
                 if (innerFun->isNative()) {
                     if (cx->compartment() != innerFun->compartment()) {
-                        MOZ_ASSERT(innerFun->isAsmJSNative());
+                        MOZ_ASSERT(innerFun->isWasmNative());
                         JS_ReportErrorASCII(cx, "AsmJS modules do not yet support cloning.");
                         return false;
                     }
                     clone = innerFun;
                 } else {
                     if (innerFun->isInterpretedLazy()) {
                         AutoCompartment ac(cx, innerFun);
                         if (!innerFun->getOrCreateScript(cx))
--- a/js/src/vm/Debugger.cpp
+++ b/js/src/vm/Debugger.cpp
@@ -2778,20 +2778,20 @@ Debugger::updateObservesCoverageOnDebugg
 
 void
 Debugger::updateObservesAsmJSOnDebuggees(IsObserving observing)
 {
     for (WeakGlobalObjectSet::Range r = debuggees.all(); !r.empty(); r.popFront()) {
         GlobalObject* global = r.front();
         JSCompartment* comp = global->compartment();
 
-        if (comp->debuggerObservesAsmJS() == observing)
+        if (comp->debuggerObservesWasm() == observing)
             continue;
 
-        comp->updateDebuggerObservesAsmJS();
+        comp->updateDebuggerObservesWasm();
     }
 }
 
 
 /*** Allocations Tracking *************************************************************************/
 
 /* static */ bool
 Debugger::cannotTrackAllocations(const GlobalObject& global)
@@ -3474,17 +3474,17 @@ Debugger::setAllowUnobservedAsmJS(JSCont
     THIS_DEBUGGER(cx, argc, vp, "set allowUnobservedAsmJS", args, dbg);
     if (!args.requireAtLeast(cx, "Debugger.set allowUnobservedAsmJS", 1))
         return false;
     dbg->allowUnobservedAsmJS = ToBoolean(args[0]);
 
     for (WeakGlobalObjectSet::Range r = dbg->debuggees.all(); !r.empty(); r.popFront()) {
         GlobalObject* global = r.front();
         JSCompartment* comp = global->compartment();
-        comp->updateDebuggerObservesAsmJS();
+        comp->updateDebuggerObservesWasm();
     }
 
     args.rval().setUndefined();
     return true;
 }
 
 /* static */ bool
 Debugger::getCollectCoverageInfo(JSContext* cx, unsigned argc, Value* vp)
@@ -3926,17 +3926,17 @@ Debugger::addDebuggeeGlobal(JSContext* c
     auto allocationsTrackingGuard = MakeScopeExit([&] {
         if (trackingAllocationSites && enabled)
             Debugger::removeAllocationsTracking(*global);
     });
 
     // (6)
     AutoRestoreCompartmentDebugMode debugModeGuard(debuggeeCompartment);
     debuggeeCompartment->setIsDebuggee();
-    debuggeeCompartment->updateDebuggerObservesAsmJS();
+    debuggeeCompartment->updateDebuggerObservesWasm();
     debuggeeCompartment->updateDebuggerObservesCoverage();
     if (observesAllExecution() && !ensureExecutionObservabilityOfCompartment(cx, debuggeeCompartment))
         return false;
 
     globalDebuggersGuard.release();
     debuggeesGuard.release();
     zoneDebuggersGuard.release();
     debuggeeZonesGuard.release();
@@ -4042,17 +4042,17 @@ Debugger::removeDebuggeeGlobal(FreeOp* f
      */
     if (trackingAllocationSites)
         Debugger::removeAllocationsTracking(*global);
 
     if (global->getDebuggers()->empty()) {
         global->compartment()->unsetIsDebuggee();
     } else {
         global->compartment()->updateDebuggerObservesAllExecution();
-        global->compartment()->updateDebuggerObservesAsmJS();
+        global->compartment()->updateDebuggerObservesWasm();
         global->compartment()->updateDebuggerObservesCoverage();
     }
 }
 
 
 static inline DebuggerSourceReferent GetSourceReferent(JSObject* obj);
 
 /*
@@ -5621,17 +5621,17 @@ DebuggerScript_getChildScripts(JSContext
         ObjectArray* objects = script->objects();
         RootedFunction fun(cx);
         RootedScript funScript(cx);
         RootedObject obj(cx), s(cx);
         for (uint32_t i = 0; i < objects->length; i++) {
             obj = objects->vector[i];
             if (obj->is<JSFunction>()) {
                 fun = &obj->as<JSFunction>();
-                // The inner function could be an asm.js native.
+                // The inner function could be a wasm native.
                 if (fun->isNative())
                     continue;
                 funScript = GetOrCreateFunctionScript(cx, fun);
                 if (!funScript)
                     return false;
                 s = dbg->wrapScript(cx, funScript);
                 if (!s || !NewbornArrayPush(cx, result, ObjectValue(*s)))
                     return false;
--- a/js/src/vm/HelperThreads.cpp
+++ b/js/src/vm/HelperThreads.cpp
@@ -876,19 +876,19 @@ GlobalHelperThreadState::maxWasmCompilat
 
 size_t
 GlobalHelperThreadState::maxParseThreads() const
 {
     if (IsHelperThreadSimulatingOOM(js::oom::THREAD_TYPE_PARSE))
         return 1;
 
     // Don't allow simultaneous off thread parses, to reduce contention on the
-    // atoms table. Note that asm.js compilation depends on this to avoid
+    // atoms table. Note that wasm compilation depends on this to avoid
     // stalling the helper thread, as off thread parse tasks can trigger and
-    // block on other off thread asm.js compilation tasks.
+    // block on other off thread wasm compilation tasks.
     return 1;
 }
 
 size_t
 GlobalHelperThreadState::maxCompressionThreads() const
 {
     if (IsHelperThreadSimulatingOOM(js::oom::THREAD_TYPE_COMPRESS))
         return 1;
--- a/js/src/vm/HelperThreads.h
+++ b/js/src/vm/HelperThreads.h
@@ -82,17 +82,17 @@ class GlobalHelperThreadState
 
     // Ion compilation worklist and finished jobs.
     IonBuilderVector ionWorklist_, ionFinishedList_;
 
     // wasm worklist and finished jobs.
     wasm::IonCompileTaskPtrVector wasmWorklist_, wasmFinishedList_;
 
   public:
-    // For now, only allow a single parallel asm.js compilation to happen at a
+    // For now, only allow a single parallel wasm compilation to happen at a
     // time. This avoids race conditions on wasmWorklist/wasmFinishedList/etc.
     mozilla::Atomic<bool> wasmCompilationInProgress;
 
   private:
     // Async tasks that, upon completion, are dispatched back to the JSContext's
     // owner thread via embedding callbacks instead of a finished list.
     PromiseTaskVector promiseTasks_;
 
--- a/js/src/vm/Runtime.cpp
+++ b/js/src/vm/Runtime.cpp
@@ -378,17 +378,17 @@ JSRuntime::destroyRuntime()
         if (JS::IsIncrementalGCInProgress(cx))
             FinishGC(cx);
 
         /* Free source hook early, as its destructor may want to delete roots. */
         sourceHook = nullptr;
 
         /*
          * Cancel any pending, in progress or completed Ion compilations and
-         * parse tasks. Waiting for AsmJS and compression tasks is done
+         * parse tasks. Waiting for wasm and compression tasks is done
          * synchronously (on the main thread or during parse tasks), so no
          * explicit canceling is needed for these.
          */
         CancelOffThreadIonCompile(this);
         CancelOffThreadParses(this);
 
         /* Remove persistent GC roots. */
         gc.finishRoots();
--- a/js/src/vm/Runtime.h
+++ b/js/src/vm/Runtime.h
@@ -611,21 +611,21 @@ struct JSRuntime : public JS::shadow::Ru
     }
 
     // For read-only JIT use:
     void* addressOfInterruptUint32() {
         static_assert(sizeof(interrupt_) == sizeof(uint32_t), "Assumed by JIT callers");
         return &interrupt_;
     }
 
-    // Set when handling a segfault in the asm.js signal handler.
+    // Set when handling a segfault in the wasm signal handler.
     bool handlingSegFault;
 
   private:
-    // Set when we're handling an interrupt of JIT/asm.js code in
+    // Set when we're handling an interrupt of JIT/wasm code in
     // InterruptRunningJitCode.
     mozilla::Atomic<bool> handlingJitInterrupt_;
 
   public:
     bool startHandlingJitInterrupt() {
         // Return true if we changed handlingJitInterrupt_ from
         // false to true.
         return handlingJitInterrupt_.compareExchange(false, true);
--- a/js/src/vm/SPSProfiler.h
+++ b/js/src/vm/SPSProfiler.h
@@ -182,17 +182,17 @@ class SPSProfiler
     void updatePC(JSScript* script, jsbytecode* pc) {
         if (enabled() && *size_ - 1 < max_) {
             MOZ_ASSERT(*size_ > 0);
             MOZ_ASSERT(stack_[*size_ - 1].rawScript() == script);
             stack_[*size_ - 1].setPC(pc);
         }
     }
 
-    /* Enter asm.js code */
+    /* Enter wasm code */
     void beginPseudoJS(const char* string, void* sp);
     void endPseudoJS() { pop(); }
 
     jsbytecode* ipToPC(JSScript* script, size_t ip) { return nullptr; }
 
     void setProfilingStack(ProfileEntry* stack, uint32_t* size, uint32_t max);
     void setEventMarker(void (*fn)(const char*));
     const char* profileString(JSScript* script, JSFunction* maybeFun);
--- a/js/src/vm/SavedStacks.cpp
+++ b/js/src/vm/SavedStacks.cpp
@@ -1507,17 +1507,17 @@ SavedStacks::getLocation(JSContext* cx, 
     // We should only ever be caching location values for scripts in this
     // compartment. Otherwise, we would get dead cross-compartment scripts in
     // the cache because our compartment's sweep method isn't called when their
     // compartment gets collected.
     assertSameCompartment(cx, this, iter.compartment());
 
     // When we have a |JSScript| for this frame, use a potentially memoized
     // location from our PCLocationMap and copy it into |locationp|. When we do
-    // not have a |JSScript| for this frame (asm.js frames), we take a slow path
+    // not have a |JSScript| for this frame (wasm frames), we take a slow path
     // that doesn't employ memoization, and update |locationp|'s slots directly.
 
     if (!iter.hasScript()) {
         if (const char16_t* displayURL = iter.displayURL()) {
             locationp.setSource(AtomizeChars(cx, displayURL, js_strlen(displayURL)));
         } else {
             const char* filename = iter.filename() ? iter.filename() : "";
             locationp.setSource(Atomize(cx, filename, strlen(filename)));
--- a/js/src/vm/SavedStacks.h
+++ b/js/src/vm/SavedStacks.h
@@ -296,17 +296,17 @@ class SavedStacks {
 
         static bool match(const PCKey& l, const PCKey& k) {
             return ScriptPtrHasher::match(l.script, k.script) &&
                    BytecodePtrHasher::match(l.pc, k.pc);
         }
     };
 
     // We eagerly Atomize the script source stored in LocationValue because
-    // asm.js does not always have a JSScript and the source might not be
+    // wasm does not always have a JSScript and the source might not be
     // available when we need it later. However, since the JSScript does not
     // actually hold this atom, we have to trace it strongly to keep it alive.
     // Thus, it takes two GC passes to fully clean up this table: the first GC
     // removes the dead script; the second will clear out the source atom since
     // it is no longer held by the table.
     using PCLocationMap = GCHashMap<PCKey, LocationValue, PCLocationHasher, SystemAllocPolicy>;
     PCLocationMap pcLocationMap;
 
--- a/js/src/vm/Stack.cpp
+++ b/js/src/vm/Stack.cpp
@@ -1758,17 +1758,17 @@ JS::ProfilingFrameIterator::~ProfilingFr
 
 void
 JS::ProfilingFrameIterator::operator++()
 {
     MOZ_ASSERT(!done());
     MOZ_ASSERT(activation_->isWasm() || activation_->isJit());
 
     if (activation_->isWasm()) {
-        ++asmJSIter();
+        ++wasmIter();
         settle();
         return;
     }
 
     ++jitIter();
     settle();
 }
 
@@ -1824,57 +1824,57 @@ JS::ProfilingFrameIterator::iteratorCons
 
 void
 JS::ProfilingFrameIterator::iteratorDestroy()
 {
     MOZ_ASSERT(!done());
     MOZ_ASSERT(activation_->isWasm() || activation_->isJit());
 
     if (activation_->isWasm()) {
-        asmJSIter().~ProfilingFrameIterator();
+        wasmIter().~ProfilingFrameIterator();
         return;
     }
 
     // Save prevjitTop for later use
     savedPrevJitTop_ = activation_->asJit()->prevJitTop();
     jitIter().~JitProfilingFrameIterator();
 }
 
 bool
 JS::ProfilingFrameIterator::iteratorDone()
 {
     MOZ_ASSERT(!done());
     MOZ_ASSERT(activation_->isWasm() || activation_->isJit());
 
     if (activation_->isWasm())
-        return asmJSIter().done();
+        return wasmIter().done();
 
     return jitIter().done();
 }
 
 void*
 JS::ProfilingFrameIterator::stackAddress() const
 {
     MOZ_ASSERT(!done());
     MOZ_ASSERT(activation_->isWasm() || activation_->isJit());
 
     if (activation_->isWasm())
-        return asmJSIter().stackAddress();
+        return wasmIter().stackAddress();
 
     return jitIter().stackAddress();
 }
 
 Maybe<JS::ProfilingFrameIterator::Frame>
 JS::ProfilingFrameIterator::getPhysicalFrameAndEntry(jit::JitcodeGlobalEntry* entry) const
 {
     void* stackAddr = stackAddress();
 
-    if (isAsmJS()) {
+    if (isWasm()) {
         Frame frame;
-        frame.kind = Frame_AsmJS;
+        frame.kind = Frame_Wasm;
         frame.stackAddress = stackAddr;
         frame.returnAddress = nullptr;
         frame.activation = activation_;
         return mozilla::Some(mozilla::Move(frame));
     }
 
     MOZ_ASSERT(isJit());
 
@@ -1908,19 +1908,19 @@ JS::ProfilingFrameIterator::extractStack
 
     jit::JitcodeGlobalEntry entry;
     Maybe<Frame> physicalFrame = getPhysicalFrameAndEntry(&entry);
 
     // Dummy frames produce no stack frames.
     if (physicalFrame.isNothing())
         return 0;
 
-    if (isAsmJS()) {
+    if (isWasm()) {
         frames[offset] = mozilla::Move(physicalFrame.ref());
-        frames[offset].label = DuplicateString(asmJSIter().label());
+        frames[offset].label = DuplicateString(wasmIter().label());
         if (!frames[offset].label)
             return 0; // Drop stack frames silently on OOM.
         return 1;
     }
 
     // Extract the stack for the entry.  Assume maximum inlining depth is <64
     const char* labels[64];
     uint32_t depth = entry.callStackAtAddr(rt_, jitIter().returnAddressToFp(), labels, 64);
@@ -1941,17 +1941,17 @@ JS::ProfilingFrameIterator::extractStack
 Maybe<JS::ProfilingFrameIterator::Frame>
 JS::ProfilingFrameIterator::getPhysicalFrameWithoutLabel() const
 {
     jit::JitcodeGlobalEntry unused;
     return getPhysicalFrameAndEntry(&unused);
 }
 
 bool
-JS::ProfilingFrameIterator::isAsmJS() const
+JS::ProfilingFrameIterator::isWasm() const
 {
     MOZ_ASSERT(!done());
     return activation_->isWasm();
 }
 
 bool
 JS::ProfilingFrameIterator::isJit() const
 {
--- a/js/src/vm/Stack.h
+++ b/js/src/vm/Stack.h
@@ -1672,21 +1672,21 @@ class WasmActivation : public Activation
     ~WasmActivation();
 
     WasmActivation* prevWasm() const { return prevWasm_; }
 
     bool isProfiling() const {
         return true;
     }
 
-    // Returns a pointer to the base of the innermost stack frame of asm.js code
+    // Returns a pointer to the base of the innermost stack frame of wasm code
     // in this activation.
     uint8_t* fp() const { return fp_; }
 
-    // Returns the reason why asm.js code called out of asm.js code.
+    // Returns the reason why wasm code called out of wasm code.
     wasm::ExitReason exitReason() const { return exitReason_; }
 
     // Read by JIT code:
     static unsigned offsetOfContext() { return offsetof(WasmActivation, cx_); }
     static unsigned offsetOfResumePC() { return offsetof(WasmActivation, resumePC_); }
 
     // Written by JIT code:
     static unsigned offsetOfEntrySP() { return offsetof(WasmActivation, entrySP_); }
@@ -1705,17 +1705,17 @@ class WasmActivation : public Activation
 // FrameIter is parameterized by what it includes in the stack iteration:
 //  - When provided, the optional JSPrincipal argument will cause FrameIter to
 //    only show frames in globals whose JSPrincipals are subsumed (via
 //    JSSecurityCallbacks::subsume) by the given JSPrincipal.
 //
 // Additionally, there are derived FrameIter types that automatically skip
 // certain frames:
 //  - ScriptFrameIter only shows frames that have an associated JSScript
-//    (currently everything other than asm.js stack frames). When !hasScript(),
+//    (currently everything other than wasm stack frames). When !hasScript(),
 //    clients must stick to the portion of the
 //    interface marked below.
 //  - NonBuiltinScriptFrameIter additionally filters out builtin (self-hosted)
 //    scripts.
 class FrameIter
 {
   public:
     enum DebuggerEvalOption { FOLLOW_DEBUGGER_EVAL_PREV_LINK,
--- a/tools/profiler/core/GeckoSampler.cpp
+++ b/tools/profiler/core/GeckoSampler.cpp
@@ -777,17 +777,17 @@ void mergeStacksIntoProfile(ThreadProfil
       registerState.lr = aSample->lr;
 #endif
 
       JS::ProfilingFrameIterator jsIter(pseudoStack->mContext,
                                         registerState,
                                         startBufferGen);
       for (; jsCount < maxFrames && !jsIter.done(); ++jsIter) {
         // See note below regarding 'J' entries.
-        if (aSample->isSamplingCurrentThread || jsIter.isAsmJS()) {
+        if (aSample->isSamplingCurrentThread || jsIter.isWasm()) {
           uint32_t extracted = jsIter.extractStack(jsFrames, jsCount, maxFrames);
           jsCount += extracted;
           if (jsCount == maxFrames)
             break;
         } else {
           mozilla::Maybe<JS::ProfilingFrameIterator::Frame> frame =
             jsIter.getPhysicalFrameWithoutLabel();
           if (frame.isSome())
@@ -881,31 +881,31 @@ void mergeStacksIntoProfile(ThreadProfil
     }
 
 #ifndef SPS_STANDALONE
     // Check to see if JS jit stack frame is top-most
     if (jsStackAddr > nativeStackAddr) {
       MOZ_ASSERT(jsIndex >= 0);
       const JS::ProfilingFrameIterator::Frame& jsFrame = jsFrames[jsIndex];
 
-      // Stringifying non-asm.js JIT frames is delayed until streaming
+      // Stringifying non-wasm JIT frames is delayed until streaming
       // time. To re-lookup the entry in the JitcodeGlobalTable, we need to
       // store the JIT code address ('J') in the circular buffer.
       //
       // Note that we cannot do this when we are sychronously sampling the
       // current thread; that is, when called from profiler_get_backtrace. The
       // captured backtrace is usually externally stored for an indeterminate
       // amount of time, such as in nsRefreshDriver. Problematically, the
       // stored backtrace may be alive across a GC during which the profiler
       // itself is disabled. In that case, the JS engine is free to discard
       // its JIT code. This means that if we inserted such 'J' entries into
       // the buffer, nsRefreshDriver would now be holding on to a backtrace
       // with stale JIT code return addresses.
       if (aSample->isSamplingCurrentThread ||
-          jsFrame.kind == JS::ProfilingFrameIterator::Frame_AsmJS) {
+          jsFrame.kind == JS::ProfilingFrameIterator::Frame_Wasm) {
         addDynamicTag(aProfile, 'c', jsFrame.label.get());
       } else {
         MOZ_ASSERT(jsFrame.kind == JS::ProfilingFrameIterator::Frame_Ion ||
                    jsFrame.kind == JS::ProfilingFrameIterator::Frame_Baseline);
         aProfile.addTag(ProfileEntry('J', jsFrames[jsIndex].returnAddress));
       }
 
       jsIndex--;