Bug 1551796 part 1 - Rename TypeScript to JitScript. r=tcampbell
authorJan de Mooij <jdemooij@mozilla.com>
Thu, 23 May 2019 07:28:00 +0000
changeset 475181 2ac16f08196aeff1bd91533c75803b79e7e2d211
parent 475180 9b58a3bb222a2aa50789bcf87627de1c8ead9fc0
child 475182 330f42984cf4eee38d12a87bb960984aef20e8e9
push id36057
push useraciure@mozilla.com
push dateThu, 23 May 2019 21:52:03 +0000
treeherdermozilla-central@d551d37b9ad0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstcampbell
bugs1551796
milestone69.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 1551796 part 1 - Rename TypeScript to JitScript. r=tcampbell Also JSScript::makeTypes => JSScript::createJitScript for consistency with code elsewhere. Differential Revision: https://phabricator.services.mozilla.com/D31755
js/public/MemoryMetrics.h
js/src/gc/GC.cpp
js/src/gc/Zone.cpp
js/src/jit/BaselineCompiler.cpp
js/src/jit/BaselineDebugModeOSR.cpp
js/src/jit/BaselineIC.cpp
js/src/jit/BaselineIC.h
js/src/jit/BaselineJIT.cpp
js/src/jit/BaselineJIT.h
js/src/jit/IonAnalysis.cpp
js/src/jit/IonBuilder.cpp
js/src/jit/IonIC.cpp
js/src/jit/Jit.cpp
js/src/jit/VMFunctions.cpp
js/src/vm/ArgumentsObject.cpp
js/src/vm/BytecodeUtil.cpp
js/src/vm/Debugger.cpp
js/src/vm/EnvironmentObject.cpp
js/src/vm/Interpreter.cpp
js/src/vm/JSObject.cpp
js/src/vm/JSScript-inl.h
js/src/vm/JSScript.cpp
js/src/vm/JSScript.h
js/src/vm/MemoryMetrics.cpp
js/src/vm/ObjectGroup.cpp
js/src/vm/TypeInference-inl.h
js/src/vm/TypeInference.cpp
js/src/vm/TypeInference.h
js/src/vm/TypeSet.h
js/src/wasm/WasmInstance.cpp
js/xpconnect/src/XPCJSRuntime.cpp
--- a/js/public/MemoryMetrics.h
+++ b/js/public/MemoryMetrics.h
@@ -766,17 +766,17 @@ struct RealmStats {
   // zero.
 #define FOR_EACH_SIZE(MACRO)                                  \
   MACRO(Private, MallocHeap, objectsPrivate)                  \
   MACRO(Other, GCHeapUsed, scriptsGCHeap)                     \
   MACRO(Other, MallocHeap, scriptsMallocHeapData)             \
   MACRO(Other, MallocHeap, baselineData)                      \
   MACRO(Other, MallocHeap, baselineStubsFallback)             \
   MACRO(Other, MallocHeap, ionData)                           \
-  MACRO(Other, MallocHeap, typeInferenceTypeScripts)          \
+  MACRO(Other, MallocHeap, jitScripts)                        \
   MACRO(Other, MallocHeap, typeInferenceAllocationSiteTables) \
   MACRO(Other, MallocHeap, typeInferenceArrayTypeTables)      \
   MACRO(Other, MallocHeap, typeInferenceObjectTypeTables)     \
   MACRO(Other, MallocHeap, realmObject)                       \
   MACRO(Other, MallocHeap, realmTables)                       \
   MACRO(Other, MallocHeap, innerViewsTable)                   \
   MACRO(Other, MallocHeap, lazyArrayBuffersTable)             \
   MACRO(Other, MallocHeap, objectMetadataTable)               \
--- a/js/src/gc/GC.cpp
+++ b/js/src/gc/GC.cpp
@@ -2526,17 +2526,17 @@ void Zone::prepareForCompacting() {
 
 void GCRuntime::sweepTypesAfterCompacting(Zone* zone) {
   zone->beginSweepTypes();
 
   AutoClearTypeInferenceStateOnOOM oom(zone);
 
   for (auto script = zone->cellIterUnsafe<JSScript>(); !script.done();
        script.next()) {
-    AutoSweepTypeScript sweep(script);
+    AutoSweepJitScript sweep(script);
   }
   for (auto group = zone->cellIterUnsafe<ObjectGroup>(); !group.done();
        group.next()) {
     AutoSweepObjectGroup sweep(group);
   }
 
   zone->types.endSweep(rt);
 }
@@ -5911,17 +5911,17 @@ void GCRuntime::drainMarkStack() {
 }
 
 static void SweepThing(Shape* shape) {
   if (!shape->isMarkedAny()) {
     shape->sweep();
   }
 }
 
-static void SweepThing(JSScript* script) { AutoSweepTypeScript sweep(script); }
+static void SweepThing(JSScript* script) { AutoSweepJitScript sweep(script); }
 
 static void SweepThing(ObjectGroup* group) {
   AutoSweepObjectGroup sweep(group);
 }
 
 template <typename T>
 static bool SweepArenaList(Arena** arenasToSweep, SliceBudget& sliceBudget) {
   while (Arena* arena = *arenasToSweep) {
@@ -8097,17 +8097,17 @@ void GCRuntime::mergeRealms(Realm* sourc
 
   // Fixup realm pointers in source to refer to target, and make sure
   // type information generations are in sync.
 
   for (auto script = source->zone()->cellIterUnsafe<JSScript>(); !script.done();
        script.next()) {
     MOZ_ASSERT(script->realm() == source);
     script->realm_ = target;
-    MOZ_ASSERT(!script->types());
+    MOZ_ASSERT(!script->jitScript());
   }
 
   GlobalObject* global = target->maybeGlobal();
   MOZ_ASSERT(global);
 
   for (auto group = source->zone()->cellIterUnsafe<ObjectGroup>();
        !group.done(); group.next()) {
     // Replace placeholder object prototypes with the correct prototype in
--- a/js/src/gc/Zone.cpp
+++ b/js/src/gc/Zone.cpp
@@ -202,38 +202,38 @@ void Zone::discardJitCode(FreeOp* fop,
   }
 
   if (isPreservingCode()) {
     return;
   }
 
   if (discardBaselineCode || releaseTypes) {
 #ifdef DEBUG
-    // Assert no TypeScripts are marked as active.
+    // Assert no JitScripts are marked as active.
     for (auto script = cellIter<JSScript>(); !script.done(); script.next()) {
-      if (TypeScript* types = script.unbarrieredGet()->types()) {
-        MOZ_ASSERT(!types->active());
+      if (JitScript* jitScript = script.unbarrieredGet()->jitScript()) {
+        MOZ_ASSERT(!jitScript->active());
       }
     }
 #endif
 
-    // Mark TypeScripts on the stack as active.
-    jit::MarkActiveTypeScripts(this);
+    // Mark JitScripts on the stack as active.
+    jit::MarkActiveJitScripts(this);
   }
 
   // Invalidate all Ion code in this zone.
   jit::InvalidateAll(fop, this);
 
   for (auto script = cellIterUnsafe<JSScript>(); !script.done();
        script.next()) {
     jit::FinishInvalidation(fop, script);
 
     // Discard baseline script if it's not marked as active.
     if (discardBaselineCode && script->hasBaselineScript()) {
-      if (script->types()->active()) {
+      if (script->jitScript()->active()) {
         // ICs will be purged so the script will need to warm back up before it
         // can be inlined during Ion compilation.
         script->baselineScript()->clearIonCompiledOrInlined();
       } else {
         jit::FinishDiscardBaselineScript(fop, script);
       }
     }
 
@@ -243,34 +243,34 @@ void Zone::discardJitCode(FreeOp* fop,
     script->resetWarmUpCounterForGC();
 
     // Clear the BaselineScript's control flow graph. The LifoAlloc is purged
     // below.
     if (script->hasBaselineScript()) {
       script->baselineScript()->setControlFlowGraph(nullptr);
     }
 
-    // Try to release the script's TypeScript. This should happen after
+    // Try to release the script's JitScript. This should happen after
     // releasing JIT code because we can't do this when the script still has
     // JIT code.
     if (releaseTypes) {
-      script->maybeReleaseTypes();
+      script->maybeReleaseJitScript();
     }
 
     // The optimizedStubSpace will be purged below so make sure ICScript
     // doesn't point into it. We do this after (potentially) releasing types
-    // because TypeScript contains the ICScript* and there's no need to
+    // because JitScript contains the ICScript* and there's no need to
     // purge stubs if we just destroyed the Typescript.
     if (discardBaselineCode && script->hasICScript()) {
       script->icScript()->purgeOptimizedStubs(script);
     }
 
     // Finally, reset the active flag.
-    if (TypeScript* types = script->types()) {
-      types->resetActive();
+    if (JitScript* jitScript = script->jitScript()) {
+      jitScript->resetActive();
     }
   }
 
   /*
    * When scripts contains pointers to nursery things, the store buffer
    * can contain entries that point into the optimized stub space. Since
    * this method can be called outside the context of a GC, this situation
    * could result in us trying to mark invalid store buffer entries.
--- a/js/src/jit/BaselineCompiler.cpp
+++ b/js/src/jit/BaselineCompiler.cpp
@@ -157,18 +157,18 @@ MethodStatus BaselineCompiler::compile()
   JitSpew(JitSpew_Codegen, "# Emitting baseline code for script %s:%u:%u",
           script->filename(), script->lineno(), script->column());
 
   TraceLoggerThread* logger = TraceLoggerForCurrentThread(cx);
   TraceLoggerEvent scriptEvent(TraceLogger_AnnotateScripts, script);
   AutoTraceLog logScript(logger, scriptEvent);
   AutoTraceLog logCompile(logger, TraceLogger_BaselineCompilation);
 
-  AutoKeepTypeScripts keepTypes(cx);
-  if (!script->ensureHasTypes(cx, keepTypes)) {
+  AutoKeepJitScripts keepJitScript(cx);
+  if (!script->ensureHasJitScript(cx, keepJitScript)) {
     return Method_Error;
   }
 
   // When code coverage is only enabled for optimizations, or when a Debugger
   // set the collectCoverageInfo flag, we have to create the ScriptCounts if
   // they do not exist.
   if (!script->hasScriptCounts() && cx->realm()->collectCoverage()) {
     if (!script->initScriptCounts(cx)) {
@@ -1106,18 +1106,18 @@ void BaselineInterpreterCodeGen::emitIni
   {
     // CalleeToken_Script.
     masm.andPtr(Imm32(uint32_t(CalleeTokenMask)), scratch1);
   }
   masm.bind(&done);
   masm.storePtr(scratch1, frame.addressOfInterpreterScript());
 
   // Initialize interpreterICEntry.
-  masm.loadPtr(Address(scratch1, JSScript::offsetOfTypes()), scratch2);
-  masm.loadPtr(Address(scratch2, TypeScript::offsetOfICScript()), scratch2);
+  masm.loadPtr(Address(scratch1, JSScript::offsetOfJitScript()), scratch2);
+  masm.loadPtr(Address(scratch2, JitScript::offsetOfICScript()), scratch2);
   masm.computeEffectiveAddress(Address(scratch2, ICScript::offsetOfICEntries()),
                                scratch2);
   masm.storePtr(scratch2, frame.addressOfInterpreterICEntry());
 
   // Initialize interpreterPC.
   masm.loadPtr(Address(scratch1, JSScript::offsetOfScriptData()), scratch1);
   masm.load32(Address(scratch1, SharedScriptData::offsetOfCodeOffset()),
               scratch2);
@@ -5892,27 +5892,28 @@ bool BaselineCodeGen<Handler>::emitGener
   Register callee = regs.takeAny();
   masm.unboxObject(
       Address(genObj, AbstractGeneratorObject::offsetOfCalleeSlot()), callee);
 
   // Load the return value.
   ValueOperand retVal = regs.takeAnyValue();
   masm.loadValue(frame.addressOfStackValue(-1), retVal);
 
-  // Branch to interpret if the script does not have a TypeScript or
+  // Branch to interpret if the script does not have a JitScript or
   // BaselineScript (depending on whether the Baseline Interpreter is enabled).
   // Note that we don't relazify generator scripts, so the function is
   // guaranteed to be non-lazy.
   Label interpret;
   Register scratch1 = regs.takeAny();
   masm.loadPtr(Address(callee, JSFunction::offsetOfScript()), scratch1);
   Address baselineAddr(scratch1, JSScript::offsetOfBaselineScript());
   if (JitOptions.baselineInterpreter) {
-    Address typesAddr(scratch1, JSScript::offsetOfTypes());
-    masm.branchPtr(Assembler::Equal, typesAddr, ImmPtr(nullptr), &interpret);
+    Address jitScriptAddr(scratch1, JSScript::offsetOfJitScript());
+    masm.branchPtr(Assembler::Equal, jitScriptAddr, ImmPtr(nullptr),
+                   &interpret);
   } else {
     masm.branchPtr(Assembler::BelowOrEqual, baselineAddr,
                    ImmPtr(BASELINE_DISABLED_SCRIPT), &interpret);
   }
 
 #ifdef JS_TRACE_LOGGING
   if (JS::TraceLoggerSupported()) {
     masm.loadPtr(baselineAddr, scratch1);
@@ -6121,17 +6122,17 @@ bool BaselineCodeGen<Handler>::emitGener
 #endif
     masm.jump(code);
 
     // Pop arguments and frame pointer (pushed by prepareVMCall) from
     // framePushed.
     masm.implicitPop((fun.explicitStackSlots() + 1) * sizeof(void*));
   }
 
-  // Call into the VM to run in the C++ interpreter if there's no TypeScript or
+  // Call into the VM to run in the C++ interpreter if there's no JitScript or
   // BaselineScript.
   masm.bind(&interpret);
 
   prepareVMCall();
   if (resumeKind == GeneratorResumeKind::Next) {
     pushArg(ImmGCPtr(cx->names().next));
   } else if (resumeKind == GeneratorResumeKind::Throw) {
     pushArg(ImmGCPtr(cx->names().throw_));
@@ -6259,18 +6260,18 @@ bool BaselineInterpreterCodeGen::emit_JS
   // scratch1 := scratch1 * sizeof(ICEntry)
   static_assert(sizeof(ICEntry) == 8 || sizeof(ICEntry) == 16,
                 "shift below depends on ICEntry size");
   uint32_t shift = (sizeof(ICEntry) == 16) ? 4 : 3;
   masm.lshiftPtr(Imm32(shift), scratch1);
 
   // Compute ICEntry* and store to frame->interpreterICEntry.
   loadScript(scratch2);
-  masm.loadPtr(Address(scratch2, JSScript::offsetOfTypes()), scratch2);
-  masm.loadPtr(Address(scratch2, TypeScript::offsetOfICScript()), scratch2);
+  masm.loadPtr(Address(scratch2, JSScript::offsetOfJitScript()), scratch2);
+  masm.loadPtr(Address(scratch2, JitScript::offsetOfICScript()), scratch2);
   masm.computeEffectiveAddress(
       BaseIndex(scratch2, scratch1, TimesOne, ICScript::offsetOfICEntries()),
       scratch2);
   masm.storePtr(scratch2, frame.addressOfInterpreterICEntry());
   return true;
 }
 
 template <typename Handler>
--- a/js/src/jit/BaselineDebugModeOSR.cpp
+++ b/js/src/jit/BaselineDebugModeOSR.cpp
@@ -610,17 +610,17 @@ static bool RecompileBaselineScriptForDe
   if (oldBaselineScript->hasDebugInstrumentation() == observing) {
     return true;
   }
 
   JitSpew(JitSpew_BaselineDebugModeOSR, "Recompiling (%s:%u:%u) for %s",
           script->filename(), script->lineno(), script->column(),
           observing ? "DEBUGGING" : "NORMAL EXECUTION");
 
-  AutoKeepTypeScripts keepTypes(cx);
+  AutoKeepJitScripts keepJitScripts(cx);
   script->setBaselineScript(cx->runtime(), nullptr);
 
   MethodStatus status =
       BaselineCompile(cx, script, /* forceDebugMode = */ observing);
   if (status != Method_Compiled) {
     // We will only fail to recompile for debug mode due to OOM. Restore
     // the old baseline script in case something doesn't properly
     // propagate OOM.
--- a/js/src/jit/BaselineIC.cpp
+++ b/js/src/jit/BaselineIC.cpp
@@ -1122,19 +1122,19 @@ bool ICMonitoredFallbackStub::addMonitor
   return typeMonitorFallback->addMonitorStubForValue(cx, frame, types, val);
 }
 
 static MOZ_MUST_USE bool TypeMonitorResult(JSContext* cx,
                                            ICMonitoredFallbackStub* stub,
                                            BaselineFrame* frame,
                                            HandleScript script, jsbytecode* pc,
                                            HandleValue val) {
-  AutoSweepTypeScript sweep(script);
-  StackTypeSet* types = script->types()->bytecodeTypes(sweep, script, pc);
-  TypeScript::MonitorBytecodeType(cx, script, pc, types, val);
+  AutoSweepJitScript sweep(script);
+  StackTypeSet* types = script->jitScript()->bytecodeTypes(sweep, script, pc);
+  JitScript::MonitorBytecodeType(cx, script, pc, types, val);
 
   return stub->addMonitorStubForValue(cx, frame, types, val);
 }
 
 bool ICCacheIR_Updated::initUpdatingChain(JSContext* cx, ICStubSpace* space) {
   MOZ_ASSERT(firstUpdateStub_ == nullptr);
 
   FallbackStubAllocator alloc(cx, *space);
@@ -1509,39 +1509,39 @@ bool DoTypeMonitorFallback(JSContext* cx
     // In derived class constructors (including nested arrows/eval), the
     // |this| argument or GETALIASEDVAR can return the magic TDZ value.
     MOZ_ASSERT(value.isMagic(JS_UNINITIALIZED_LEXICAL));
     MOZ_ASSERT(frame->isFunctionFrame() || frame->isEvalFrame());
     MOZ_ASSERT(stub->monitorsThis() || *GetNextPc(pc) == JSOP_CHECKTHIS ||
                *GetNextPc(pc) == JSOP_CHECKTHISREINIT ||
                *GetNextPc(pc) == JSOP_CHECKRETURN);
     if (stub->monitorsThis()) {
-      TypeScript::MonitorThisType(cx, script, TypeSet::UnknownType());
+      JitScript::MonitorThisType(cx, script, TypeSet::UnknownType());
     } else {
-      TypeScript::MonitorBytecodeType(cx, script, pc, TypeSet::UnknownType());
+      JitScript::MonitorBytecodeType(cx, script, pc, TypeSet::UnknownType());
     }
     return true;
   }
 
-  TypeScript* typeScript = script->types();
-  AutoSweepTypeScript sweep(script);
+  JitScript* jitScript = script->jitScript();
+  AutoSweepJitScript sweep(script);
 
   StackTypeSet* types;
   uint32_t argument;
   if (stub->monitorsArgument(&argument)) {
     MOZ_ASSERT(pc == script->code());
-    types = typeScript->argTypes(sweep, script, argument);
-    TypeScript::MonitorArgType(cx, script, argument, value);
+    types = jitScript->argTypes(sweep, script, argument);
+    JitScript::MonitorArgType(cx, script, argument, value);
   } else if (stub->monitorsThis()) {
     MOZ_ASSERT(pc == script->code());
-    types = typeScript->thisTypes(sweep, script);
-    TypeScript::MonitorThisType(cx, script, value);
+    types = jitScript->thisTypes(sweep, script);
+    JitScript::MonitorThisType(cx, script, value);
   } else {
-    types = typeScript->bytecodeTypes(sweep, script, pc);
-    TypeScript::MonitorBytecodeType(cx, script, pc, types, value);
+    types = jitScript->bytecodeTypes(sweep, script, pc);
+    JitScript::MonitorBytecodeType(cx, script, pc, types, value);
   }
 
   return stub->addMonitorStubForValue(cx, frame, types, value);
 }
 
 bool FallbackICCodeCompiler::emit_TypeMonitor() {
   MOZ_ASSERT(R0 == JSReturnOperand);
 
@@ -2774,17 +2774,17 @@ bool DoGetIntrinsicFallback(JSContext* c
   if (!GetIntrinsicOperation(cx, script, pc, res)) {
     return false;
   }
 
   // An intrinsic operation will always produce the same result, so only
   // needs to be monitored once. Attach a stub to load the resulting constant
   // directly.
 
-  TypeScript::MonitorBytecodeType(cx, script, pc, res);
+  JitScript::MonitorBytecodeType(cx, script, pc, res);
 
   TryAttachStub<GetIntrinsicIRGenerator>("GetIntrinsic", cx, frame, stub,
                                          BaselineCacheIRStubKind::Regular, res);
 
   return true;
 }
 
 bool FallbackICCodeCompiler::emit_GetIntrinsic() {
--- a/js/src/jit/BaselineIC.h
+++ b/js/src/jit/BaselineIC.h
@@ -292,17 +292,17 @@ class ICEntry {
 //   discarded more eagerly. See ICScript::purgeOptimizedStubs.)
 //
 // * List of IC entries, in the following order:
 //
 //   - Type monitor IC for |this|.
 //   - Type monitor IC for each formal argument.
 //   - IC for each JOF_IC bytecode op.
 //
-// ICScript is stored in TypeScript and allocated/destroyed at the same time.
+// ICScript is stored in JitScript and allocated/destroyed at the same time.
 class ICScript {
   // Allocated space for fallback stubs.
   FallbackICStubSpace fallbackStubSpace_ = {};
 
   uint32_t numICEntries_;
 
   explicit ICScript(uint32_t numICEntries) : numICEntries_(numICEntries) {}
 
--- a/js/src/jit/BaselineJIT.cpp
+++ b/js/src/jit/BaselineJIT.cpp
@@ -315,17 +315,17 @@ static MethodStatus CanEnterBaselineJIT(
   return BaselineCompile(cx, script, forceDebugInstrumentation);
 }
 
 static MethodStatus CanEnterBaselineInterpreter(JSContext* cx,
                                                 HandleScript script) {
   MOZ_ASSERT(jit::IsBaselineEnabled(cx));
   MOZ_ASSERT(JitOptions.baselineInterpreter);
 
-  if (script->types()) {
+  if (script->jitScript()) {
     return Method_Compiled;
   }
 
   if (script->hasForceInterpreterOp()) {
     return Method_CantCompile;
   }
 
   // Check script warm-up counter.
@@ -333,18 +333,18 @@ static MethodStatus CanEnterBaselineInte
       JitOptions.baselineInterpreterWarmUpThreshold) {
     return Method_Skipped;
   }
 
   if (!cx->realm()->ensureJitRealmExists(cx)) {
     return Method_Error;
   }
 
-  AutoKeepTypeScripts keepTypes(cx);
-  if (!script->ensureHasTypes(cx, keepTypes)) {
+  AutoKeepJitScripts keepJitScript(cx);
+  if (!script->ensureHasJitScript(cx, keepJitScript)) {
     return Method_Error;
   }
 
   return Method_Compiled;
 }
 
 template <BaselineTier Tier>
 MethodStatus jit::CanEnterBaselineAtBranch(JSContext* cx,
@@ -1338,29 +1338,29 @@ void jit::JitSpewBaselineICStats(JSScrip
     spew->endObject();
   }
   spew->endList();
 }
 #endif
 
 void jit::FinishDiscardBaselineScript(FreeOp* fop, JSScript* script) {
   MOZ_ASSERT(script->hasBaselineScript());
-  MOZ_ASSERT(!script->types()->active());
+  MOZ_ASSERT(!script->jitScript()->active());
 
   BaselineScript* baseline = script->baselineScript();
   script->setBaselineScript(fop->runtime(), nullptr);
   BaselineScript::Destroy(fop, baseline);
 }
 
 void jit::AddSizeOfBaselineData(JSScript* script,
                                 mozilla::MallocSizeOf mallocSizeOf,
                                 size_t* data, size_t* fallbackStubs) {
   if (script->hasICScript()) {
-    // ICScript is stored in TypeScript but we report its size here and not
-    // in TypeScript::sizeOfIncludingThis.
+    // ICScript is stored in JitScript but we report its size here and not
+    // in JitScript::sizeOfIncludingThis.
     script->icScript()->addSizeOfIncludingThis(mallocSizeOf, data,
                                                fallbackStubs);
   }
   if (script->hasBaselineScript()) {
     script->baselineScript()->addSizeOfIncludingThis(mallocSizeOf, data);
   }
 }
 
@@ -1411,57 +1411,57 @@ void jit::ToggleBaselineTraceLoggerEngin
         continue;
       }
       script->baselineScript()->toggleTraceLoggerEngine(enable);
     }
   }
 }
 #endif
 
-static void MarkActiveTypeScripts(JSContext* cx,
-                                  const JitActivationIterator& activation) {
+static void MarkActiveJitScripts(JSContext* cx,
+                                 const JitActivationIterator& activation) {
   for (OnlyJSJitFrameIter iter(activation); !iter.done(); ++iter) {
     const JSJitFrameIter& frame = iter.frame();
     switch (frame.type()) {
       case FrameType::BaselineJS:
-        frame.script()->types()->setActive();
+        frame.script()->jitScript()->setActive();
         break;
       case FrameType::Exit:
         if (frame.exitFrame()->is<LazyLinkExitFrameLayout>()) {
           LazyLinkExitFrameLayout* ll =
               frame.exitFrame()->as<LazyLinkExitFrameLayout>();
           JSScript* script =
               ScriptFromCalleeToken(ll->jsFrame()->calleeToken());
-          script->types()->setActive();
+          script->jitScript()->setActive();
         }
         break;
       case FrameType::Bailout:
       case FrameType::IonJS: {
-        // Keep the TypeScript and BaselineScript around, since bailouts from
+        // Keep the JitScript and BaselineScript around, since bailouts from
         // the ion jitcode need to re-enter into the Baseline code.
-        frame.script()->types()->setActive();
+        frame.script()->jitScript()->setActive();
         for (InlineFrameIterator inlineIter(cx, &frame); inlineIter.more();
              ++inlineIter) {
-          inlineIter.script()->types()->setActive();
+          inlineIter.script()->jitScript()->setActive();
         }
         break;
       }
       default:;
     }
   }
 }
 
-void jit::MarkActiveTypeScripts(Zone* zone) {
+void jit::MarkActiveJitScripts(Zone* zone) {
   if (zone->isAtomsZone()) {
     return;
   }
   JSContext* cx = TlsContext.get();
   for (JitActivationIterator iter(cx); !iter.done(); ++iter) {
     if (iter->compartment()->zone() == zone) {
-      MarkActiveTypeScripts(cx, iter);
+      MarkActiveJitScripts(cx, iter);
     }
   }
 }
 
 void BaselineInterpreter::init(JitCode* code, uint32_t interpretOpOffset,
                                uint32_t profilerEnterToggleOffset,
                                uint32_t profilerExitToggleOffset,
                                uint32_t debuggeeCheckOffset,
--- a/js/src/jit/BaselineJIT.h
+++ b/js/src/jit/BaselineJIT.h
@@ -633,19 +633,19 @@ struct BaselineBailoutInfo {
   BailoutKind bailoutKind;
 };
 
 MOZ_MUST_USE bool BailoutIonToBaseline(
     JSContext* cx, JitActivation* activation, const JSJitFrameIter& iter,
     bool invalidate, BaselineBailoutInfo** bailoutInfo,
     const ExceptionBailoutInfo* exceptionInfo);
 
-// Mark TypeScripts on the stack as active, so that they are not discarded
+// Mark JitScripts on the stack as active, so that they are not discarded
 // during GC.
-void MarkActiveTypeScripts(Zone* zone);
+void MarkActiveJitScripts(Zone* zone);
 
 MethodStatus BaselineCompile(JSContext* cx, JSScript* script,
                              bool forceDebugInstrumentation = false);
 
 #ifdef JS_STRUCTURED_SPEW
 void JitSpewBaselineICStats(JSScript* script, const char* dumpReason);
 #endif
 
--- a/js/src/jit/IonAnalysis.cpp
+++ b/js/src/jit/IonAnalysis.cpp
@@ -4549,17 +4549,17 @@ bool jit::AnalyzeNewScriptDefiniteProper
     if (status == Method_Error) {
       return false;
     }
     if (status != Method_Compiled) {
       return true;
     }
   }
 
-  TypeScript::MonitorThisType(cx, script, TypeSet::ObjectType(group));
+  JitScript::MonitorThisType(cx, script, TypeSet::ObjectType(group));
 
   MIRGraph graph(&temp);
   InlineScriptTree* inlineScriptTree =
       InlineScriptTree::New(&temp, nullptr, nullptr, script);
   if (!inlineScriptTree) {
     return false;
   }
 
@@ -4795,18 +4795,18 @@ bool jit::AnalyzeArgumentsUsage(JSContex
   if (!jit::CanLikelyAllocateMoreExecutableMemory()) {
     return true;
   }
 
   if (!cx->realm()->ensureJitRealmExists(cx)) {
     return false;
   }
 
-  AutoKeepTypeScripts keepTypes(cx);
-  if (!script->ensureHasTypes(cx, keepTypes)) {
+  AutoKeepJitScripts keepJitScript(cx);
+  if (!script->ensureHasJitScript(cx, keepJitScript)) {
     return false;
   }
 
   TraceLoggerThread* logger = TraceLoggerForCurrentThread(cx);
   TraceLoggerEvent event(TraceLogger_AnnotateScripts, script);
   AutoTraceLog logScript(logger, event);
   AutoTraceLog logCompile(logger, TraceLogger_IonAnalysis);
 
--- a/js/src/jit/IonBuilder.cpp
+++ b/js/src/jit/IonBuilder.cpp
@@ -750,35 +750,35 @@ AbortReasonOr<Ok> IonBuilder::analyzeNew
     }
   }
   return Ok();
 }
 
 AbortReasonOr<Ok> IonBuilder::init() {
   {
     LifoAlloc::AutoFallibleScope fallibleAllocator(alloc().lifoAlloc());
-    if (!TypeScript::FreezeTypeSets(constraints(), script(), &thisTypes,
-                                    &argTypes, &typeArray)) {
+    if (!JitScript::FreezeTypeSets(constraints(), script(), &thisTypes,
+                                   &argTypes, &typeArray)) {
       return abort(AbortReason::Alloc);
     }
   }
 
   if (!alloc().ensureBallast()) {
     return abort(AbortReason::Alloc);
   }
 
   if (inlineCallInfo_) {
     // If we're inlining, the actual this/argument types are not necessarily
     // a subset of the script's observed types. |argTypes| is never accessed
     // for inlined scripts, so we just null it.
     thisTypes = inlineCallInfo_->thisArg()->resultTypeSet();
     argTypes = nullptr;
   }
 
-  bytecodeTypeMap = script()->types()->bytecodeTypeMap();
+  bytecodeTypeMap = script()->jitScript()->bytecodeTypeMap();
 
   return Ok();
 }
 
 AbortReasonOr<Ok> IonBuilder::build() {
   // Spew IC info for inlined script, but only when actually compiling,
   // not when analyzing it.
 #ifdef JS_STRUCTURED_SPEW
@@ -4045,18 +4045,19 @@ IonBuilder::InliningResult IonBuilder::i
   callInfo.popCallStack(current);
   current->push(callInfo.fun());
 
   JSScript* calleeScript = target->nonLazyScript();
   BaselineInspector inspector(calleeScript);
 
   // Improve type information of |this| when not set.
   if (callInfo.constructing() && !callInfo.thisArg()->resultTypeSet()) {
-    AutoSweepTypeScript sweep(calleeScript);
-    StackTypeSet* types = calleeScript->types()->thisTypes(sweep, calleeScript);
+    AutoSweepJitScript sweep(calleeScript);
+    StackTypeSet* types =
+        calleeScript->jitScript()->thisTypes(sweep, calleeScript);
     if (!types->unknown()) {
       TemporaryTypeSet* clonedTypes = types->clone(alloc_->lifoAlloc());
       if (!clonedTypes) {
         return abort(AbortReason::Alloc);
       }
       MTypeBarrier* barrier =
           MTypeBarrier::New(alloc(), callInfo.thisArg(), clonedTypes);
       current->add(barrier);
@@ -5327,23 +5328,23 @@ MDefinition* IonBuilder::createThisScrip
   TypeSet::ObjectKey* templateObjectKey =
       TypeSet::ObjectKey::get(templateObject->group());
   if (templateObjectKey->hasFlags(constraints(),
                                   OBJECT_FLAG_NEW_SCRIPT_CLEARED)) {
     return nullptr;
   }
 
   JSScript* targetScript = target->nonLazyScript();
-  TypeScript* typeScript = targetScript->types();
-  if (!typeScript) {
+  JitScript* jitScript = targetScript->jitScript();
+  if (!jitScript) {
     return nullptr;
   }
 
-  AutoSweepTypeScript sweep(targetScript);
-  StackTypeSet* thisTypes = typeScript->thisTypes(sweep, targetScript);
+  AutoSweepJitScript sweep(targetScript);
+  StackTypeSet* thisTypes = jitScript->thisTypes(sweep, targetScript);
   if (!thisTypes->hasType(TypeSet::ObjectType(templateObject))) {
     return nullptr;
   }
 
   // Generate an inline path to create a new |this| object with
   // the given singleton prototype.
   MConstant* templateConst =
       MConstant::NewConstraintlessObject(alloc(), templateObject);
@@ -5397,23 +5398,23 @@ MDefinition* IonBuilder::createThisScrip
   TypeSet::ObjectKey* templateObjectKey =
       TypeSet::ObjectKey::get(templateObject->group());
   if (templateObjectKey->hasFlags(constraints(),
                                   OBJECT_FLAG_NEW_SCRIPT_CLEARED)) {
     return nullptr;
   }
 
   JSScript* targetScript = target->nonLazyScript();
-  TypeScript* typeScript = targetScript->types();
-  if (!typeScript) {
+  JitScript* jitScript = targetScript->jitScript();
+  if (!jitScript) {
     return nullptr;
   }
 
-  AutoSweepTypeScript sweep(targetScript);
-  StackTypeSet* thisTypes = typeScript->thisTypes(sweep, targetScript);
+  AutoSweepJitScript sweep(targetScript);
+  StackTypeSet* thisTypes = jitScript->thisTypes(sweep, targetScript);
   if (!thisTypes->hasType(TypeSet::ObjectType(templateObject))) {
     return nullptr;
   }
 
   // Shape guard.
   callee = addShapeGuard(callee, target->lastProperty(), Bailout_ShapeGuard);
 
   // Guard callee.prototype == proto.
@@ -6090,35 +6091,35 @@ bool IonBuilder::testNeedsArgumentCheck(
     return false;
   }
 
   if (!target->hasScript()) {
     return true;
   }
 
   JSScript* targetScript = target->nonLazyScript();
-  TypeScript* typeScript = targetScript->types();
-  if (!typeScript) {
+  JitScript* jitScript = targetScript->jitScript();
+  if (!jitScript) {
     return true;
   }
 
-  AutoSweepTypeScript sweep(targetScript);
+  AutoSweepJitScript sweep(targetScript);
   if (!ArgumentTypesMatch(callInfo.thisArg(),
-                          typeScript->thisTypes(sweep, targetScript))) {
+                          jitScript->thisTypes(sweep, targetScript))) {
     return true;
   }
   uint32_t expected_args = Min<uint32_t>(callInfo.argc(), target->nargs());
   for (size_t i = 0; i < expected_args; i++) {
     if (!ArgumentTypesMatch(callInfo.getArg(i),
-                            typeScript->argTypes(sweep, targetScript, i))) {
+                            jitScript->argTypes(sweep, targetScript, i))) {
       return true;
     }
   }
   for (size_t i = callInfo.argc(); i < target->nargs(); i++) {
-    StackTypeSet* types = typeScript->argTypes(sweep, targetScript, i);
+    StackTypeSet* types = jitScript->argTypes(sweep, targetScript, i);
     if (!types->mightBeMIRType(MIRType::Undefined)) {
       return true;
     }
   }
 
   return false;
 }
 
@@ -13580,18 +13581,18 @@ MInstruction* IonBuilder::addGuardReceiv
 
 MInstruction* IonBuilder::addSharedTypedArrayGuard(MDefinition* obj) {
   MGuardSharedTypedArray* guard = MGuardSharedTypedArray::New(alloc(), obj);
   current->add(guard);
   return guard;
 }
 
 TemporaryTypeSet* IonBuilder::bytecodeTypes(jsbytecode* pc) {
-  return TypeScript::BytecodeTypes(script(), pc, bytecodeTypeMap,
-                                   &typeArrayHint, typeArray);
+  return JitScript::BytecodeTypes(script(), pc, bytecodeTypeMap, &typeArrayHint,
+                                  typeArray);
 }
 
 TypedObjectPrediction IonBuilder::typedObjectPrediction(MDefinition* typedObj) {
   // Extract TypedObjectPrediction directly if we can
   if (typedObj->isNewDerivedTypedObject()) {
     return typedObj->toNewDerivedTypedObject()->prediction();
   }
 
--- a/js/src/jit/IonIC.cpp
+++ b/js/src/jit/IonIC.cpp
@@ -223,17 +223,17 @@ bool IonGetPropertyIC::update(JSContext*
     if (!GetElementOperation(cx, JSOp(*ic->pc()), val, idVal, res)) {
       return false;
     }
   }
 
   if (!ic->idempotent()) {
     // Monitor changes to cache entry.
     if (!ic->monitoredResult()) {
-      TypeScript::MonitorBytecodeType(cx, ic->script(), ic->pc(), res);
+      JitScript::MonitorBytecodeType(cx, ic->script(), ic->pc(), res);
     }
   }
 
   return true;
 }
 
 /* static */
 bool IonGetPropSuperIC::update(JSContext* cx, HandleScript outerScript,
@@ -258,17 +258,17 @@ bool IonGetPropSuperIC::update(JSContext
     return false;
   }
 
   if (!GetProperty(cx, obj, receiver, id, res)) {
     return false;
   }
 
   // Monitor changes to cache entry.
-  TypeScript::MonitorBytecodeType(cx, ic->script(), ic->pc(), res);
+  JitScript::MonitorBytecodeType(cx, ic->script(), ic->pc(), res);
   return true;
 }
 
 /* static */
 bool IonSetPropertyIC::update(JSContext* cx, HandleScript outerScript,
                               IonSetPropertyIC* ic, HandleObject obj,
                               HandleValue idVal, HandleValue rhs) {
   using DeferType = SetPropIRGenerator::DeferType;
@@ -420,17 +420,17 @@ bool IonGetNameIC::update(JSContext* cx,
       return false;
     }
   } else {
     if (!FetchName<GetNameMode::Normal>(cx, obj, holder, name, prop, res)) {
       return false;
     }
   }
 
-  // No need to call TypeScript::Monitor, IonBuilder always inserts a type
+  // No need to call JitScript::Monitor, IonBuilder always inserts a type
   // barrier after GetName ICs.
 
   return true;
 }
 
 /* static */
 JSObject* IonBindNameIC::update(JSContext* cx, HandleScript outerScript,
                                 IonBindNameIC* ic, HandleObject envChain) {
--- a/js/src/jit/Jit.cpp
+++ b/js/src/jit/Jit.cpp
@@ -136,17 +136,17 @@ static EnterJitStatus JS_HAZ_JSNATIVE_CA
 EnterJitStatus js::jit::MaybeEnterJit(JSContext* cx, RunState& state) {
   JSScript* script = state.script();
 
   uint8_t* code = script->jitCodeRaw();
   do {
     // Make sure we can enter Baseline Interpreter or JIT code. Note that
     // the prologue has warm-up checks to tier up if needed.
     if (JitOptions.baselineInterpreter) {
-      if (script->types()) {
+      if (script->jitScript()) {
         break;
       }
     } else {
       if (script->hasBaselineScript()) {
         break;
       }
     }
 
--- a/js/src/jit/VMFunctions.cpp
+++ b/js/src/jit/VMFunctions.cpp
@@ -459,17 +459,17 @@ bool ArrayPopDense(JSContext* cx, Handle
   }
 
   // If the result is |undefined|, the array was probably empty and we
   // have to monitor the return value.
   rval.set(argv[0]);
   if (rval.isUndefined()) {
     jsbytecode* pc;
     JSScript* script = cx->currentScript(&pc);
-    TypeScript::MonitorBytecodeType(cx, script, pc, rval);
+    JitScript::MonitorBytecodeType(cx, script, pc, rval);
   }
   return true;
 }
 
 bool ArrayPushDense(JSContext* cx, HandleArrayObject arr, HandleValue v,
                     uint32_t* length) {
   *length = arr->length();
   DenseElementResult result = arr->setOrExtendDenseElements(
@@ -525,17 +525,17 @@ bool ArrayShiftDense(JSContext* cx, Hand
   }
 
   // If the result is |undefined|, the array was probably empty and we
   // have to monitor the return value.
   rval.set(argv[0]);
   if (rval.isUndefined()) {
     jsbytecode* pc;
     JSScript* script = cx->currentScript(&pc);
-    TypeScript::MonitorBytecodeType(cx, script, pc, rval);
+    JitScript::MonitorBytecodeType(cx, script, pc, rval);
   }
   return true;
 }
 
 JSString* ArrayJoin(JSContext* cx, HandleObject array, HandleString sep) {
   JS::AutoValueArray<3> argv(cx);
   argv[0].setUndefined();
   argv[1].setObject(*array);
@@ -686,17 +686,17 @@ bool GetIntrinsicValue(JSContext* cx, Ha
 
   // This function is called when we try to compile a cold getintrinsic
   // op. MCallGetIntrinsicValue has an AliasSet of None for optimization
   // purposes, as its side effect is not observable from JS. We are
   // guaranteed to bail out after this function, but because of its AliasSet,
   // type info will not be reflowed. Manually monitor here.
   jsbytecode* pc;
   JSScript* script = cx->currentScript(&pc);
-  TypeScript::MonitorBytecodeType(cx, script, pc, rval);
+  JitScript::MonitorBytecodeType(cx, script, pc, rval);
 
   return true;
 }
 
 bool CreateThis(JSContext* cx, HandleObject callee, HandleObject newTarget,
                 MutableHandleValue rval) {
   rval.set(MagicValue(JS_IS_CONSTRUCTING));
 
@@ -2003,18 +2003,18 @@ bool DoConcatStringObject(JSContext* cx,
   if (!str) {
     RootedString nlstr(cx, lstr), nrstr(cx, rstr);
     str = ConcatStrings<CanGC>(cx, nlstr, nrstr);
     if (!str) {
       return false;
     }
   }
 
-  // Technically, we need to call TypeScript::MonitorString for this PC, however
-  // it was called when this stub was attached so it's OK.
+  // Note: we don't have to call JitScript::MonitorBytecodeType because we
+  // monitored the string-type when attaching the IC stub.
 
   res.setString(str);
   return true;
 }
 
 MOZ_MUST_USE bool TrySkipAwait(JSContext* cx, HandleValue val,
                                MutableHandleValue resolved) {
   bool canSkip;
--- a/js/src/vm/ArgumentsObject.cpp
+++ b/js/src/vm/ArgumentsObject.cpp
@@ -509,17 +509,17 @@ static bool MappedArgSetter(JSContext* c
     return false;
   }
 
   if (JSID_IS_INT(id)) {
     unsigned arg = unsigned(JSID_TO_INT(id));
     if (arg < argsobj->initialLength() && !argsobj->isElementDeleted(arg)) {
       argsobj->setElement(cx, arg, v);
       if (arg < script->functionNonDelazifying()->nargs()) {
-        TypeScript::MonitorArgType(cx, script, arg, v);
+        JitScript::MonitorArgType(cx, script, arg, v);
       }
       return result.succeed();
     }
   } else {
     MOZ_ASSERT(JSID_IS_ATOM(id, cx->names().length) ||
                JSID_IS_ATOM(id, cx->names().callee));
   }
 
@@ -725,17 +725,17 @@ bool MappedArgumentsObject::obj_definePr
       if (desc.hasValue()) {
         RootedFunction callee(cx, &argsobj->callee());
         RootedScript script(cx, JSFunction::getOrCreateScript(cx, callee));
         if (!script) {
           return false;
         }
         argsobj->setElement(cx, arg, desc.value());
         if (arg < script->functionNonDelazifying()->nargs()) {
-          TypeScript::MonitorArgType(cx, script, arg, desc.value());
+          JitScript::MonitorArgType(cx, script, arg, desc.value());
         }
       }
       if (desc.hasWritable() && !desc.writable()) {
         if (!argsobj->markElementDeleted(cx, arg)) {
           return false;
         }
       }
     }
--- a/js/src/vm/BytecodeUtil.cpp
+++ b/js/src/vm/BytecodeUtil.cpp
@@ -2569,17 +2569,17 @@ JS_FRIEND_API void js::StopPCCountProfil
       cx, ScriptAndCountsVector(SystemAllocPolicy()));
   if (!vec) {
     return;
   }
 
   for (ZonesIter zone(rt, SkipAtoms); !zone.done(); zone.next()) {
     for (auto script = zone->cellIter<JSScript>(); !script.done();
          script.next()) {
-      if (script->hasScriptCounts() && script->types()) {
+      if (script->hasScriptCounts() && script->jitScript()) {
         if (!vec->append(script)) {
           return;
         }
       }
     }
   }
 
   rt->profilingScripts = false;
--- a/js/src/vm/Debugger.cpp
+++ b/js/src/vm/Debugger.cpp
@@ -2917,20 +2917,20 @@ bool Debugger::updateExecutionObservabil
   if (oldestEnabledFrame) {
     AutoRealm ar(cx, oldestEnabledFrame.environmentChain());
     DebugEnvironments::unsetPrevUpToDateUntil(cx, oldestEnabledFrame);
   }
 
   return true;
 }
 
-static inline void MarkTypeScriptActiveIfObservable(
+static inline void MarkJitScriptActiveIfObservable(
     JSScript* script, const Debugger::ExecutionObservableSet& obs) {
   if (obs.shouldRecompileOrInvalidate(script)) {
-    script->types()->setActive();
+    script->jitScript()->setActive();
   }
 }
 
 static bool AppendAndInvalidateScript(JSContext* cx, Zone* zone,
                                       JSScript* script,
                                       Vector<JSScript*>& scripts) {
   // Enter the script's realm as addPendingRecompile attempts to
   // cancel off-thread compilations, whose books are kept on the
@@ -2983,39 +2983,39 @@ static bool UpdateExecutionObservability
     if (actIter->compartment()->zone() != zone) {
       continue;
     }
 
     for (OnlyJSJitFrameIter iter(actIter); !iter.done(); ++iter) {
       const JSJitFrameIter& frame = iter.frame();
       switch (frame.type()) {
         case FrameType::BaselineJS:
-          MarkTypeScriptActiveIfObservable(frame.script(), obs);
+          MarkJitScriptActiveIfObservable(frame.script(), obs);
           break;
         case FrameType::IonJS:
-          MarkTypeScriptActiveIfObservable(frame.script(), obs);
+          MarkJitScriptActiveIfObservable(frame.script(), obs);
           for (InlineFrameIterator inlineIter(cx, &frame); inlineIter.more();
                ++inlineIter) {
-            MarkTypeScriptActiveIfObservable(inlineIter.script(), obs);
+            MarkJitScriptActiveIfObservable(inlineIter.script(), obs);
           }
           break;
         default:;
       }
     }
   }
 
   // Iterate through the scripts again and finish discarding
   // BaselineScripts. This must be done as a separate phase as we can only
   // discard the BaselineScript on scripts that have no IonScript.
   for (size_t i = 0; i < scripts.length(); i++) {
     MOZ_ASSERT_IF(scripts[i]->isDebuggee(), observing);
-    if (!scripts[i]->types()->active()) {
+    if (!scripts[i]->jitScript()->active()) {
       FinishDiscardBaselineScript(fop, scripts[i]);
     }
-    scripts[i]->types()->resetActive();
+    scripts[i]->jitScript()->resetActive();
   }
 
   // Iterate through all wasm instances to find ones that need to be updated.
   for (RealmsInZoneIter r(zone); !r.done(); r.next()) {
     for (wasm::Instance* instance : r->wasm.instances()) {
       if (!instance->debugEnabled()) {
         continue;
       }
--- a/js/src/vm/EnvironmentObject.cpp
+++ b/js/src/vm/EnvironmentObject.cpp
@@ -1569,17 +1569,17 @@ class DebugEnvironmentProxyHandler : pub
           /* The unaliased value has been lost to the debugger. */
           if (action == GET) {
             *accessResult = ACCESS_LOST;
             return true;
           }
         }
 
         if (action == SET) {
-          TypeScript::MonitorArgType(cx, script, i, vp);
+          JitScript::MonitorArgType(cx, script, i, vp);
         }
       }
 
       // It is possible that an optimized out value flows to this
       // location due to Debugger.Frame.prototype.eval operating on a
       // live bailed-out Baseline frame. In that case, treat the access
       // as lost.
       if (vp.isMagic() && vp.whyMagic() == JS_OPTIMIZED_OUT) {
--- a/js/src/vm/Interpreter.cpp
+++ b/js/src/vm/Interpreter.cpp
@@ -1541,17 +1541,17 @@ static MOZ_ALWAYS_INLINE bool PowOperati
 
 static MOZ_ALWAYS_INLINE bool SetObjectElementOperation(
     JSContext* cx, HandleObject obj, HandleId id, HandleValue value,
     HandleValue receiver, bool strict, JSScript* script = nullptr,
     jsbytecode* pc = nullptr) {
   // receiver != obj happens only at super[expr], where we expect to find the
   // property. People probably aren't building hashtables with |super|
   // anyway.
-  TypeScript::MonitorAssign(cx, obj, id);
+  JitScript::MonitorAssign(cx, obj, id);
 
   if (obj->isNative() && JSID_IS_INT(id)) {
     uint32_t length = obj->as<NativeObject>().getDenseInitializedLength();
     int32_t i = JSID_TO_INT(id);
     if ((uint32_t)i >= length) {
       // Annotate script if provided with information (e.g. baseline)
       if (script && script->hasICScript() && IsSetElemPC(pc)) {
         script->icScript()->noteHasDenseAdd(script->pcToOffset(pc));
@@ -2118,17 +2118,17 @@ static MOZ_NEVER_INLINE JS_HAZ_JSNATIVE_
         MOZ_ASSERT(cx->realm() == script->realm());
 
         /* Resume execution in the calling frame. */
         if (MOZ_LIKELY(interpReturnOK)) {
           if (JSOp(*REGS.pc) == JSOP_RESUME) {
             ADVANCE_AND_DISPATCH(JSOP_RESUME_LENGTH);
           }
 
-          TypeScript::MonitorBytecodeType(cx, script, REGS.pc, REGS.sp[-1]);
+          JitScript::MonitorBytecodeType(cx, script, REGS.pc, REGS.sp[-1]);
           MOZ_ASSERT(CodeSpec[*REGS.pc].length == JSOP_CALL_LENGTH);
           ADVANCE_AND_DISPATCH(JSOP_CALL_LENGTH);
         }
 
         goto error;
       } else {
         // Stack should be empty for the outer frame, unless we executed the
         // first |await| expression in an async function.
@@ -2768,46 +2768,46 @@ static MOZ_NEVER_INLINE JS_HAZ_JSNATIVE_
     CASE(JSOP_GETPROP)
     CASE(JSOP_LENGTH)
     CASE(JSOP_CALLPROP) {
       MutableHandleValue lval = REGS.stackHandleAt(-1);
       if (!GetPropertyOperation(cx, REGS.fp(), script, REGS.pc, lval, lval)) {
         goto error;
       }
 
-      TypeScript::MonitorBytecodeType(cx, script, REGS.pc, lval);
+      JitScript::MonitorBytecodeType(cx, script, REGS.pc, lval);
       cx->debugOnlyCheck(lval);
     }
     END_CASE(JSOP_GETPROP)
 
     CASE(JSOP_GETPROP_SUPER) {
       ReservedRooted<Value> receiver(&rootValue0, REGS.sp[-2]);
       ReservedRooted<JSObject*> obj(&rootObject1, &REGS.sp[-1].toObject());
       MutableHandleValue rref = REGS.stackHandleAt(-2);
 
       if (!GetProperty(cx, obj, receiver, script->getName(REGS.pc), rref)) {
         goto error;
       }
 
-      TypeScript::MonitorBytecodeType(cx, script, REGS.pc, rref);
+      JitScript::MonitorBytecodeType(cx, script, REGS.pc, rref);
       cx->debugOnlyCheck(rref);
 
       REGS.sp--;
     }
     END_CASE(JSOP_GETPROP_SUPER)
 
     CASE(JSOP_GETBOUNDNAME) {
       ReservedRooted<JSObject*> env(&rootObject0, &REGS.sp[-1].toObject());
       ReservedRooted<jsid> id(&rootId0, NameToId(script->getName(REGS.pc)));
       MutableHandleValue rval = REGS.stackHandleAt(-1);
       if (!GetNameBoundInEnvironment(cx, env, id, rval)) {
         goto error;
       }
 
-      TypeScript::MonitorBytecodeType(cx, script, REGS.pc, rval);
+      JitScript::MonitorBytecodeType(cx, script, REGS.pc, rval);
       cx->debugOnlyCheck(rval);
     }
     END_CASE(JSOP_GETBOUNDNAME)
 
     CASE(JSOP_SETINTRINSIC) {
       HandleValue value = REGS.stackHandleAt(-1);
 
       if (!SetIntrinsicOperation(cx, script, REGS.pc, value)) {
@@ -2890,17 +2890,17 @@ static MOZ_NEVER_INLINE JS_HAZ_JSNATIVE_
       }
 
       if (!done) {
         if (!GetElementOperation(cx, JSOp(*REGS.pc), lval, rval, res)) {
           goto error;
         }
       }
 
-      TypeScript::MonitorBytecodeType(cx, script, REGS.pc, res);
+      JitScript::MonitorBytecodeType(cx, script, REGS.pc, res);
       REGS.sp--;
     }
     END_CASE(JSOP_GETELEM)
 
     CASE(JSOP_GETELEM_SUPER) {
       ReservedRooted<Value> receiver(&rootValue1, REGS.sp[-3]);
       ReservedRooted<Value> rval(&rootValue0, REGS.sp[-2]);
       ReservedRooted<JSObject*> obj(&rootObject1, &REGS.sp[-1].toObject());
@@ -2910,17 +2910,17 @@ static MOZ_NEVER_INLINE JS_HAZ_JSNATIVE_
       // Since we have asserted that obj has to be an object, it cannot be
       // either optimized arguments, or indeed any primitive. This simplifies
       // our task some.
       if (!GetObjectElementOperation(cx, JSOp(*REGS.pc), obj, receiver, rval,
                                      res)) {
         goto error;
       }
 
-      TypeScript::MonitorBytecodeType(cx, script, REGS.pc, res);
+      JitScript::MonitorBytecodeType(cx, script, REGS.pc, res);
       REGS.sp -= 2;
     }
     END_CASE(JSOP_GETELEM_SUPER)
 
     CASE(JSOP_SETELEM)
     CASE(JSOP_STRICTSETELEM) {
       static_assert(JSOP_SETELEM_LENGTH == JSOP_STRICTSETELEM_LENGTH,
                     "setelem and strictsetelem must be the same size");
@@ -2975,17 +2975,17 @@ static MOZ_NEVER_INLINE JS_HAZ_JSNATIVE_
         }
       } else {
         if (!CallFromStack(cx, args)) {
           goto error;
         }
       }
 
       REGS.sp = args.spAfterCall();
-      TypeScript::MonitorBytecodeType(cx, script, REGS.pc, REGS.sp[-1]);
+      JitScript::MonitorBytecodeType(cx, script, REGS.pc, REGS.sp[-1]);
     }
     END_CASE(JSOP_EVAL)
 
     CASE(JSOP_SPREADNEW)
     CASE(JSOP_SPREADCALL)
     CASE(JSOP_SPREADSUPERCALL) {
       if (REGS.fp()->hasPushedGeckoProfilerFrame()) {
         cx->geckoProfiler().updatePC(cx, script, REGS.pc);
@@ -3082,17 +3082,17 @@ static MOZ_NEVER_INLINE JS_HAZ_JSNATIVE_
             ReportValueError(cx, JSMSG_NOT_ITERABLE, -1, args.thisv(), nullptr);
             goto error;
           }
           if (!CallFromStack(cx, args)) {
             goto error;
           }
         }
         Value* newsp = args.spAfterCall();
-        TypeScript::MonitorBytecodeType(cx, script, REGS.pc, newsp[-1]);
+        JitScript::MonitorBytecodeType(cx, script, REGS.pc, newsp[-1]);
         REGS.sp = newsp;
         ADVANCE_AND_DISPATCH(JSOP_CALL_LENGTH);
       }
 
       {
         MOZ_ASSERT(maybeFun);
         ReservedRooted<JSFunction*> fun(&rootFunction0, maybeFun);
         ReservedRooted<JSScript*> funScript(
@@ -3232,42 +3232,42 @@ static MOZ_NEVER_INLINE JS_HAZ_JSNATIVE_
     CASE(JSOP_GETGNAME)
     CASE(JSOP_GETNAME) {
       ReservedRooted<Value> rval(&rootValue0);
       if (!GetNameOperation(cx, REGS.fp(), REGS.pc, &rval)) {
         goto error;
       }
 
       PUSH_COPY(rval);
-      TypeScript::MonitorBytecodeType(cx, script, REGS.pc, rval);
+      JitScript::MonitorBytecodeType(cx, script, REGS.pc, rval);
       static_assert(JSOP_GETNAME_LENGTH == JSOP_GETGNAME_LENGTH,
                     "We're sharing the END_CASE so the lengths better match");
     }
     END_CASE(JSOP_GETNAME)
 
     CASE(JSOP_GETIMPORT) {
       PUSH_NULL();
       MutableHandleValue rval = REGS.stackHandleAt(-1);
       HandleObject envChain = REGS.fp()->environmentChain();
       if (!GetImportOperation(cx, envChain, script, REGS.pc, rval)) {
         goto error;
       }
 
-      TypeScript::MonitorBytecodeType(cx, script, REGS.pc, rval);
+      JitScript::MonitorBytecodeType(cx, script, REGS.pc, rval);
     }
     END_CASE(JSOP_GETIMPORT)
 
     CASE(JSOP_GETINTRINSIC) {
       ReservedRooted<Value> rval(&rootValue0);
       if (!GetIntrinsicOperation(cx, script, REGS.pc, &rval)) {
         goto error;
       }
 
       PUSH_COPY(rval);
-      TypeScript::MonitorBytecodeType(cx, script, REGS.pc, rval);
+      JitScript::MonitorBytecodeType(cx, script, REGS.pc, rval);
     }
     END_CASE(JSOP_GETINTRINSIC)
 
     CASE(JSOP_UINT16) { PUSH_INT32((int32_t)GET_UINT16(REGS.pc)); }
     END_CASE(JSOP_UINT16)
 
     CASE(JSOP_UINT24)
     CASE(JSOP_RESUMEINDEX) { PUSH_INT32((int32_t)GET_UINT24(REGS.pc)); }
@@ -3419,17 +3419,17 @@ static MOZ_NEVER_INLINE JS_HAZ_JSNATIVE_
         PropertyName* name = EnvironmentCoordinateNameSlow(script, REGS.pc);
         MOZ_ASSERT(name == cx->names().dotThis);
         JSOp next = JSOp(*GetNextPc(REGS.pc));
         MOZ_ASSERT(next == JSOP_CHECKTHIS || next == JSOP_CHECKRETURN ||
                    next == JSOP_CHECKTHISREINIT);
       }
 #endif
       PUSH_COPY(val);
-      TypeScript::MonitorBytecodeType(cx, script, REGS.pc, REGS.sp[-1]);
+      JitScript::MonitorBytecodeType(cx, script, REGS.pc, REGS.sp[-1]);
     }
     END_CASE(JSOP_GETALIASEDVAR)
 
     CASE(JSOP_SETALIASEDVAR) {
       EnvironmentCoordinate ec = EnvironmentCoordinate(REGS.pc);
       EnvironmentObject& obj = REGS.fp()->aliasedEnvironment(ec);
       SetAliasedVarOperation(cx, script, REGS.pc, obj, ec, REGS.sp[-1],
                              CheckTDZ);
@@ -5100,17 +5100,17 @@ bool js::SpreadCallOperation(JSContext* 
                  "bad spread opcode");
 
       if (!Call(cx, callee, thisv, args, res)) {
         return false;
       }
     }
   }
 
-  TypeScript::MonitorBytecodeType(cx, script, pc, res);
+  JitScript::MonitorBytecodeType(cx, script, pc, res);
   return true;
 }
 
 bool js::OptimizeSpreadCall(JSContext* cx, HandleValue arg, bool* optimized) {
   // Optimize spread call by skipping spread operation when following
   // conditions are met:
   //   * the argument is an array
   //   * the array has no hole
--- a/js/src/vm/JSObject.cpp
+++ b/js/src/vm/JSObject.cpp
@@ -1151,17 +1151,17 @@ JSObject* js::CreateThisForFunctionWithP
   }
 
   if (res) {
     MOZ_ASSERT(res->nonCCWRealm() == callee->realm());
     JSScript* script = JSFunction::getOrCreateScript(cx, callee);
     if (!script) {
       return nullptr;
     }
-    TypeScript::MonitorThisType(cx, script, TypeSet::ObjectType(res));
+    JitScript::MonitorThisType(cx, script, TypeSet::ObjectType(res));
   }
 
   return res;
 }
 
 bool js::GetPrototypeFromConstructor(JSContext* cx, HandleObject newTarget,
                                      JSProtoKey intrinsicDefaultProto,
                                      MutableHandleObject proto) {
@@ -1220,17 +1220,17 @@ JSObject* js::CreateThisForFunction(JSCo
 
   if (obj && newKind == SingletonObject) {
     RootedPlainObject nobj(cx, &obj->as<PlainObject>());
 
     /* Reshape the singleton before passing it as the 'this' value. */
     NativeObject::clear(cx, nobj);
 
     JSScript* calleeScript = callee->nonLazyScript();
-    TypeScript::MonitorThisType(cx, calleeScript, TypeSet::ObjectType(nobj));
+    JitScript::MonitorThisType(cx, calleeScript, TypeSet::ObjectType(nobj));
 
     return nobj;
   }
 
   return obj;
 }
 
 /* static */
--- a/js/src/vm/JSScript-inl.h
+++ b/js/src/vm/JSScript-inl.h
@@ -178,12 +178,12 @@ inline bool JSScript::ensureHasAnalyzedA
 }
 
 inline bool JSScript::isDebuggee() const {
   return realm_->debuggerObservesAllExecution() || hasDebugScript();
 }
 
 inline js::jit::ICScript* JSScript::icScript() const {
   MOZ_ASSERT(hasICScript());
-  return types_->icScript();
+  return jitScript_->icScript();
 }
 
 #endif /* vm_JSScript_inl_h */
--- a/js/src/vm/JSScript.cpp
+++ b/js/src/vm/JSScript.cpp
@@ -4034,18 +4034,18 @@ void JSScript::assertValidJumpTargets() 
 #endif
 
 size_t JSScript::computedSizeOfData() const { return dataSize(); }
 
 size_t JSScript::sizeOfData(mozilla::MallocSizeOf mallocSizeOf) const {
   return mallocSizeOf(data_);
 }
 
-size_t JSScript::sizeOfTypeScript(mozilla::MallocSizeOf mallocSizeOf) const {
-  return types_ ? types_->sizeOfIncludingThis(mallocSizeOf) : 0;
+size_t JSScript::sizeOfJitScript(mozilla::MallocSizeOf mallocSizeOf) const {
+  return jitScript_ ? jitScript_->sizeOfIncludingThis(mallocSizeOf) : 0;
 }
 
 js::GlobalObject& JSScript::uninlinedGlobal() const { return global(); }
 
 void JSScript::finalize(FreeOp* fop) {
   // NOTE: this JSScript may be partially initialized at this point.  E.g. we
   // may have created it and partially initialized it with
   // JSScript::Create(), but not yet finished initializing it with
@@ -4056,18 +4056,18 @@ void JSScript::finalize(FreeOp* fop) {
   MOZ_ASSERT_IF(hasScriptName(), coverage::IsLCovEnabled());
   if (coverage::IsLCovEnabled() && hasScriptName()) {
     realm()->lcovOutput.collectCodeCoverageInfo(realm(), this, getScriptName());
     destroyScriptName();
   }
 
   fop->runtime()->geckoProfiler().onScriptFinalized(this);
 
-  if (types_) {
-    types_->destroy(zone());
+  if (jitScript_) {
+    jitScript_->destroy(zone());
   }
 
   jit::DestroyJitScripts(fop, this);
 
   destroyScriptCounts();
   destroyDebugScript(fop);
 
 #ifdef MOZ_VTUNE
@@ -5423,17 +5423,17 @@ void JSScript::updateJitCodeRaw(JSRuntim
     jitCodeRaw_ = rt->jitRuntime()->lazyLinkStub().value;
     jitCodeSkipArgCheck_ = jitCodeRaw_;
   } else if (hasIonScript()) {
     jitCodeRaw_ = ion->method()->raw();
     jitCodeSkipArgCheck_ = jitCodeRaw_ + ion->getSkipArgCheckEntryOffset();
   } else if (hasBaselineScript()) {
     jitCodeRaw_ = baseline->method()->raw();
     jitCodeSkipArgCheck_ = jitCodeRaw_;
-  } else if (types() && js::jit::JitOptions.baselineInterpreter) {
+  } else if (jitScript() && js::jit::JitOptions.baselineInterpreter) {
     jitCodeRaw_ = rt->jitRuntime()->baselineInterpreter().codeRaw();
     jitCodeSkipArgCheck_ = jitCodeRaw_;
   } else {
     jitCodeRaw_ = rt->jitRuntime()->interpreterStub().value;
     jitCodeSkipArgCheck_ = jitCodeRaw_;
   }
   MOZ_ASSERT(jitCodeRaw_);
   MOZ_ASSERT(jitCodeSkipArgCheck_);
@@ -5506,17 +5506,17 @@ void JSScript::AutoDelazify::dropScript(
   script_ = nullptr;
 }
 
 JS::ubi::Base::Size JS::ubi::Concrete<JSScript>::size(
     mozilla::MallocSizeOf mallocSizeOf) const {
   Size size = gc::Arena::thingSize(get().asTenured().getAllocKind());
 
   size += get().sizeOfData(mallocSizeOf);
-  size += get().sizeOfTypeScript(mallocSizeOf);
+  size += get().sizeOfJitScript(mallocSizeOf);
 
   size_t baselineSize = 0;
   size_t baselineStubsSize = 0;
   jit::AddSizeOfBaselineData(&get(), mallocSizeOf, &baselineSize,
                              &baselineStubsSize);
   size += baselineSize;
   size += baselineStubsSize;
 
--- a/js/src/vm/JSScript.h
+++ b/js/src/vm/JSScript.h
@@ -60,27 +60,27 @@ struct IonScriptCounts;
 }  // namespace jit
 
 #define ION_DISABLED_SCRIPT ((js::jit::IonScript*)0x1)
 #define ION_COMPILING_SCRIPT ((js::jit::IonScript*)0x2)
 #define ION_PENDING_SCRIPT ((js::jit::IonScript*)0x3)
 
 #define BASELINE_DISABLED_SCRIPT ((js::jit::BaselineScript*)0x1)
 
-class AutoKeepTypeScripts;
-class AutoSweepTypeScript;
+class AutoKeepJitScripts;
+class AutoSweepJitScript;
 class BreakpointSite;
 class Debugger;
 class GCParallelTask;
 class LazyScript;
 class ModuleObject;
 class RegExpObject;
 class SourceCompressionTask;
 class Shape;
-class TypeScript;
+class JitScript;
 
 namespace frontend {
 struct BytecodeEmitter;
 class FunctionBox;
 class ModuleSharedContext;
 }  // namespace frontend
 
 namespace gc {
@@ -1736,18 +1736,18 @@ class JSScript : public js::gc::TenuredC
 
   // Unshared variable-length data
   js::PrivateScriptData* data_ = nullptr;
 
  public:
   JS::Realm* realm_ = nullptr;
 
  private:
-  /* Persistent type information retained across GCs. */
-  js::TypeScript* types_ = nullptr;
+  // JIT and type inference data for this script. May be purged on GC.
+  js::JitScript* jitScript_ = nullptr;
 
   // This script's ScriptSourceObject.
   js::GCPtr<js::ScriptSourceObject*> sourceObject_ = {};
 
   /*
    * Information attached by Ion. Nexto a valid IonScript this could be
    * ION_DISABLED_SCRIPT, ION_COMPILING_SCRIPT or ION_PENDING_SCRIPT.
    * The later is a ion compilation that is ready, but hasn't been linked
@@ -2424,17 +2424,19 @@ class JSScript : public js::gc::TenuredC
     return offsetof(JSScript, mutableFlags_);
   }
   static size_t offsetOfImmutableFlags() {
     return offsetof(JSScript, immutableFlags_);
   }
   static constexpr size_t offsetOfScriptData() {
     return offsetof(JSScript, scriptData_);
   }
-  static constexpr size_t offsetOfTypes() { return offsetof(JSScript, types_); }
+  static constexpr size_t offsetOfJitScript() {
+    return offsetof(JSScript, jitScript_);
+  }
 
   bool hasAnyIonScript() const { return hasIonScript(); }
 
   bool hasIonScript() const {
     bool res = ion && ion != ION_DISABLED_SCRIPT &&
                ion != ION_COMPILING_SCRIPT && ion != ION_PENDING_SCRIPT;
     MOZ_ASSERT_IF(res, baseline);
     return res;
@@ -2463,46 +2465,46 @@ class JSScript : public js::gc::TenuredC
     return baseline;
   }
   inline void setBaselineScript(JSRuntime* rt,
                                 js::jit::BaselineScript* baselineScript);
 
   inline js::jit::ICScript* icScript() const;
 
   bool hasICScript() const {
-    // ICScript is stored in TypeScript so we have an ICScript iff we have a
-    // TypeScript.
-    return !!types_;
+    // ICScript is stored in JitScript so we have an ICScript iff we have a
+    // JitScript.
+    return !!jitScript_;
   }
 
   void updateJitCodeRaw(JSRuntime* rt);
 
   static size_t offsetOfBaselineScript() {
     return offsetof(JSScript, baseline);
   }
   static size_t offsetOfIonScript() { return offsetof(JSScript, ion); }
   static constexpr size_t offsetOfJitCodeRaw() {
     return offsetof(JSScript, jitCodeRaw_);
   }
   static constexpr size_t offsetOfJitCodeSkipArgCheck() {
     return offsetof(JSScript, jitCodeSkipArgCheck_);
   }
   uint8_t* jitCodeRaw() const { return jitCodeRaw_; }
 
-  // We don't relazify functions with a TypeScript or JIT code, but some
+  // We don't relazify functions with a JitScript or JIT code, but some
   // callers (XDR, testing functions) want to know whether this script is
   // relazifiable ignoring (or after) discarding JIT code.
   bool isRelazifiableIgnoringJitCode() const {
     return (selfHosted() || lazyScript) && !hasInnerFunctions() &&
            !isGenerator() && !isAsync() && !isDefaultClassConstructor() &&
            !hasFlag(MutableFlags::DoNotRelazify);
   }
   bool isRelazifiable() const {
-    MOZ_ASSERT_IF(hasBaselineScript() || hasIonScript(), types_);
-    return isRelazifiableIgnoringJitCode() && !types_;
+    MOZ_ASSERT_IF(hasBaselineScript() || hasIonScript(), jitScript_);
+    return isRelazifiableIgnoringJitCode() && !jitScript_;
   }
   void setLazyScript(js::LazyScript* lazy) { lazyScript = lazy; }
   js::LazyScript* maybeLazyScript() { return lazyScript; }
 
   /*
    * Original compiled function for the script, if it has a function.
    * nullptr for global and eval scripts.
    * The delazifying variant ensures that the function isn't lazy. The
@@ -2594,22 +2596,22 @@ class JSScript : public js::gc::TenuredC
    * produce a JSScript which has no associated bytecode. Testing with
    * |code()| filters out this kind of scripts.
    *
    * If this script has a function associated to it, then it is not the
    * top-level of a file.
    */
   bool isTopLevel() { return code() && !functionNonDelazifying(); }
 
-  /* Ensure the script has a TypeScript. */
-  inline bool ensureHasTypes(JSContext* cx, js::AutoKeepTypeScripts&);
-
-  js::TypeScript* types() { return types_; }
-
-  void maybeReleaseTypes();
+  /* Ensure the script has a JitScript. */
+  inline bool ensureHasJitScript(JSContext* cx, js::AutoKeepJitScripts&);
+
+  js::JitScript* jitScript() { return jitScript_; }
+
+  void maybeReleaseJitScript();
 
   inline js::GlobalObject& global() const;
   inline bool hasGlobal(const js::GlobalObject* global) const;
   js::GlobalObject& uninlinedGlobal() const;
 
   uint32_t bodyScopeIndex() const { return scriptData_->bodyScopeIndex; }
 
   js::Scope* bodyScope() const { return getScope(bodyScopeIndex()); }
@@ -2650,17 +2652,17 @@ class JSScript : public js::gc::TenuredC
     return false;
   }
 
   inline js::LexicalScope* maybeNamedLambdaScope() const;
 
   js::Scope* enclosingScope() const { return outermostScope()->enclosing(); }
 
  private:
-  bool makeTypes(JSContext* cx);
+  bool createJitScript(JSContext* cx);
 
   bool createSharedScriptData(JSContext* cx, uint32_t codeLength,
                               uint32_t noteLength, uint32_t natoms);
   bool shareScriptData(JSContext* cx);
   void freeScriptData();
 
  public:
   uint32_t getWarmUpCount() const { return warmUpCount; }
@@ -2727,17 +2729,17 @@ class JSScript : public js::gc::TenuredC
 
   /*
    * computedSizeOfData() is the in-use size of all the data sections.
    * sizeOfData() is the size of the block allocated to hold all the data
    * sections (which can be larger than the in-use size).
    */
   size_t computedSizeOfData() const;
   size_t sizeOfData(mozilla::MallocSizeOf mallocSizeOf) const;
-  size_t sizeOfTypeScript(mozilla::MallocSizeOf mallocSizeOf) const;
+  size_t sizeOfJitScript(mozilla::MallocSizeOf mallocSizeOf) const;
 
   size_t dataSize() const { return dataSize_; }
 
   bool hasConsts() const { return data_->hasConsts(); }
   bool hasObjects() const { return data_->hasObjects(); }
   bool hasTrynotes() const { return data_->hasTryNotes(); }
   bool hasScopeNotes() const { return data_->hasScopeNotes(); }
   bool hasResumeOffsets() const { return data_->hasResumeOffsets(); }
--- a/js/src/vm/MemoryMetrics.cpp
+++ b/js/src/vm/MemoryMetrics.cpp
@@ -440,18 +440,17 @@ static void StatsCellCallback(JSRuntime*
     }
 
     case JS::TraceKind::Script: {
       JSScript* script = static_cast<JSScript*>(thing);
       RealmStats& realmStats = script->realm()->realmStats();
       realmStats.scriptsGCHeap += thingSize;
       realmStats.scriptsMallocHeapData +=
           script->sizeOfData(rtStats->mallocSizeOf_);
-      realmStats.typeInferenceTypeScripts +=
-          script->sizeOfTypeScript(rtStats->mallocSizeOf_);
+      realmStats.jitScripts += script->sizeOfJitScript(rtStats->mallocSizeOf_);
       jit::AddSizeOfBaselineData(script, rtStats->mallocSizeOf_,
                                  &realmStats.baselineData,
                                  &realmStats.baselineStubsFallback);
       realmStats.ionData += jit::SizeOfIonData(script, rtStats->mallocSizeOf_);
       CollectScriptSourceStats<granularity>(closure, script->scriptSource());
       break;
     }
 
--- a/js/src/vm/ObjectGroup.cpp
+++ b/js/src/vm/ObjectGroup.cpp
@@ -1518,17 +1518,17 @@ bool ObjectGroup::setAllocationSiteObjec
   if (singleton) {
     MOZ_ASSERT(obj->isSingleton());
 
     /*
      * Inference does not account for types of run-once initializer
      * objects, as these may not be created until after the script
      * has been analyzed.
      */
-    TypeScript::MonitorBytecodeType(cx, script, pc, ObjectValue(*obj));
+    JitScript::MonitorBytecodeType(cx, script, pc, ObjectValue(*obj));
   } else {
     ObjectGroup* group = allocationSiteGroup(cx, script, pc, key);
     if (!group) {
       return false;
     }
     obj->setGroup(group);
   }
 
--- a/js/src/vm/TypeInference-inl.h
+++ b/js/src/vm/TypeInference-inl.h
@@ -438,17 +438,17 @@ void TypeMonitorCallSlow(JSContext* cx, 
 /*
  * Monitor a javascript call, either on entry to the interpreter or made
  * from within the interpreter.
  */
 inline void TypeMonitorCall(JSContext* cx, const js::CallArgs& args,
                             bool constructing) {
   if (args.callee().is<JSFunction>()) {
     JSFunction* fun = &args.callee().as<JSFunction>();
-    if (fun->isInterpreted() && fun->nonLazyScript()->types()) {
+    if (fun->isInterpreted() && fun->nonLazyScript()->jitScript()) {
       TypeMonitorCallSlow(cx, &args.callee(), args, constructing);
     }
   }
 }
 
 MOZ_ALWAYS_INLINE bool TrackPropertyTypes(JSObject* obj, jsid id) {
   if (obj->hasLazyGroup() ||
       obj->group()->unknownPropertiesDontCheckGeneration()) {
@@ -585,39 +585,39 @@ inline void MarkObjectStateChange(JSCont
     obj->group()->markStateChange(sweep, cx);
   }
 }
 
 /////////////////////////////////////////////////////////////////////
 // Script interface functions
 /////////////////////////////////////////////////////////////////////
 
-inline StackTypeSet* TypeScript::thisTypes(const AutoSweepTypeScript& sweep,
-                                           JSScript* script) {
+inline StackTypeSet* JitScript::thisTypes(const AutoSweepJitScript& sweep,
+                                          JSScript* script) {
   return typeArray(sweep) + script->numBytecodeTypeSets();
 }
 
 /*
  * Note: for non-escaping arguments, argTypes reflect only the initial type of
  * the variable (e.g. passed values for argTypes, or undefined for localTypes)
  * and not types from subsequent assignments.
  */
 
-inline StackTypeSet* TypeScript::argTypes(const AutoSweepTypeScript& sweep,
-                                          JSScript* script, unsigned i) {
+inline StackTypeSet* JitScript::argTypes(const AutoSweepJitScript& sweep,
+                                         JSScript* script, unsigned i) {
   MOZ_ASSERT(i < script->functionNonDelazifying()->nargs());
   return typeArray(sweep) + script->numBytecodeTypeSets() + 1 /* this */ + i;
 }
 
 template <typename TYPESET>
-/* static */ inline TYPESET* TypeScript::BytecodeTypes(JSScript* script,
-                                                       jsbytecode* pc,
-                                                       uint32_t* bytecodeMap,
-                                                       uint32_t* hint,
-                                                       TYPESET* typeArray) {
+/* static */ inline TYPESET* JitScript::BytecodeTypes(JSScript* script,
+                                                      jsbytecode* pc,
+                                                      uint32_t* bytecodeMap,
+                                                      uint32_t* hint,
+                                                      TYPESET* typeArray) {
   MOZ_ASSERT(CodeSpec[*pc].format & JOF_TYPESET);
   uint32_t offset = script->pcToOffset(pc);
 
   // See if this pc is the next typeset opcode after the last one looked up.
   size_t numBytecodeTypeSets = script->numBytecodeTypeSets();
   if ((*hint + 1) < numBytecodeTypeSets && bytecodeMap[*hint + 1] == offset) {
     (*hint)++;
     return typeArray + *hint;
@@ -640,35 +640,37 @@ template <typename TYPESET>
     MOZ_ASSERT(numBytecodeTypeSets == JSScript::MaxBytecodeTypeSets);
     loc = numBytecodeTypeSets - 1;
   }
 
   *hint = mozilla::AssertedCast<uint32_t>(loc);
   return typeArray + *hint;
 }
 
-inline StackTypeSet* TypeScript::bytecodeTypes(const AutoSweepTypeScript& sweep,
-                                               JSScript* script,
-                                               jsbytecode* pc) {
+inline StackTypeSet* JitScript::bytecodeTypes(const AutoSweepJitScript& sweep,
+                                              JSScript* script,
+                                              jsbytecode* pc) {
   MOZ_ASSERT(CurrentThreadCanAccessZone(script->zone()));
   return BytecodeTypes(script, pc, bytecodeTypeMap(), bytecodeTypeMapHint(),
                        typeArray(sweep));
 }
 
-/* static */ inline void TypeScript::MonitorBytecodeType(
-    JSContext* cx, JSScript* script, jsbytecode* pc, StackTypeSet* types,
-    const js::Value& rval) {
+/* static */ inline void JitScript::MonitorBytecodeType(JSContext* cx,
+                                                        JSScript* script,
+                                                        jsbytecode* pc,
+                                                        StackTypeSet* types,
+                                                        const js::Value& rval) {
   TypeSet::Type type = TypeSet::GetValueType(rval);
   if (!types->hasType(type)) {
     MonitorBytecodeTypeSlow(cx, script, pc, types, type);
   }
 }
 
-/* static */ inline void TypeScript::MonitorAssign(JSContext* cx,
-                                                   HandleObject obj, jsid id) {
+/* static */ inline void JitScript::MonitorAssign(JSContext* cx,
+                                                  HandleObject obj, jsid id) {
   if (!obj->isSingleton()) {
     /*
      * Mark as unknown any object which has had dynamic assignments to
      * non-integer properties at SETELEM opcodes. This avoids making large
      * numbers of type properties for hashmap-style objects. We don't need
      * to do this for objects with singleton type, because type properties
      * are only constructed for them when analyzed scripts depend on those
      * specific properties.
@@ -684,82 +686,82 @@ inline StackTypeSet* TypeScript::bytecod
     ObjectGroup* group = obj->group();
     if (group->basePropertyCountDontCheckGeneration() < 128) {
       return;
     }
     MarkObjectGroupUnknownProperties(cx, group);
   }
 }
 
-/* static */ inline void TypeScript::MonitorThisType(JSContext* cx,
-                                                     JSScript* script,
-                                                     TypeSet::Type type) {
+/* static */ inline void JitScript::MonitorThisType(JSContext* cx,
+                                                    JSScript* script,
+                                                    TypeSet::Type type) {
   cx->check(script, type);
 
-  TypeScript* typeScript = script->types();
-  if (!typeScript) {
+  JitScript* jitScript = script->jitScript();
+  if (!jitScript) {
     return;
   }
 
-  AutoSweepTypeScript sweep(script);
-  StackTypeSet* types = typeScript->thisTypes(sweep, script);
+  AutoSweepJitScript sweep(script);
+  StackTypeSet* types = jitScript->thisTypes(sweep, script);
 
   if (!types->hasType(type)) {
     AutoEnterAnalysis enter(cx);
 
     InferSpew(ISpewOps, "externalType: setThis %p: %s", script,
               TypeSet::TypeString(type).get());
     types->addType(sweep, cx, type);
   }
 }
 
-/* static */ inline void TypeScript::MonitorThisType(JSContext* cx,
-                                                     JSScript* script,
-                                                     const js::Value& value) {
+/* static */ inline void JitScript::MonitorThisType(JSContext* cx,
+                                                    JSScript* script,
+                                                    const js::Value& value) {
   MonitorThisType(cx, script, TypeSet::GetValueType(value));
 }
 
-/* static */ inline void TypeScript::MonitorArgType(JSContext* cx,
-                                                    JSScript* script,
-                                                    unsigned arg,
-                                                    TypeSet::Type type) {
+/* static */ inline void JitScript::MonitorArgType(JSContext* cx,
+                                                   JSScript* script,
+                                                   unsigned arg,
+                                                   TypeSet::Type type) {
   cx->check(script->compartment(), type);
 
-  TypeScript* typeScript = script->types();
-  if (!typeScript) {
+  JitScript* jitScript = script->jitScript();
+  if (!jitScript) {
     return;
   }
 
-  AutoSweepTypeScript sweep(script);
-  StackTypeSet* types = typeScript->argTypes(sweep, script, arg);
+  AutoSweepJitScript sweep(script);
+  StackTypeSet* types = jitScript->argTypes(sweep, script, arg);
 
   if (!types->hasType(type)) {
     AutoEnterAnalysis enter(cx);
 
     InferSpew(ISpewOps, "externalType: setArg %p %u: %s", script, arg,
               TypeSet::TypeString(type).get());
     types->addType(sweep, cx, type);
   }
 }
 
-/* static */ inline void TypeScript::MonitorArgType(JSContext* cx,
-                                                    JSScript* script,
-                                                    unsigned arg,
-                                                    const js::Value& value) {
+/* static */ inline void JitScript::MonitorArgType(JSContext* cx,
+                                                   JSScript* script,
+                                                   unsigned arg,
+                                                   const js::Value& value) {
   MonitorArgType(cx, script, arg, TypeSet::GetValueType(value));
 }
 
-inline AutoKeepTypeScripts::AutoKeepTypeScripts(JSContext* cx)
-    : zone_(cx->zone()->types), prev_(zone_.keepTypeScripts) {
-  zone_.keepTypeScripts = true;
+inline AutoKeepJitScripts::AutoKeepJitScripts(JSContext* cx)
+    : zone_(cx->zone()->types), prev_(zone_.keepJitScripts) {
+  zone_.keepJitScripts = true;
 }
 
-inline AutoKeepTypeScripts::~AutoKeepTypeScripts() {
-  MOZ_ASSERT(zone_.keepTypeScripts);
-  zone_.keepTypeScripts = prev_;
+inline AutoKeepJitScripts::~AutoKeepJitScripts() {
+  MOZ_ASSERT(zone_.keepJitScripts);
+  zone_.keepJitScripts = prev_;
 }
 
 /////////////////////////////////////////////////////////////////////
 // TypeHashSet
 /////////////////////////////////////////////////////////////////////
 
 // Hashing code shared by objects in TypeSets and properties in ObjectGroups.
 struct TypeHashSet {
@@ -1358,41 +1360,42 @@ inline AutoSweepObjectGroup::AutoSweepOb
 
 #ifdef DEBUG
 inline AutoSweepObjectGroup::~AutoSweepObjectGroup() {
   // This should still hold.
   MOZ_ASSERT(!group_->needsSweep());
 }
 #endif
 
-inline AutoSweepTypeScript::AutoSweepTypeScript(JSScript* script)
+inline AutoSweepJitScript::AutoSweepJitScript(JSScript* script)
 #ifdef DEBUG
     : zone_(script->zone()),
-      typeScript_(script->types())
+      jitScript_(script->jitScript())
 #endif
 {
-  if (TypeScript* types = script->types()) {
+  if (JitScript* jitScript = script->jitScript()) {
     Zone* zone = script->zone();
-    if (types->typesNeedsSweep(zone)) {
-      types->sweepTypes(*this, zone);
+    if (jitScript->typesNeedsSweep(zone)) {
+      jitScript->sweepTypes(*this, zone);
     }
   }
 }
 
 #ifdef DEBUG
-inline AutoSweepTypeScript::~AutoSweepTypeScript() {
+inline AutoSweepJitScript::~AutoSweepJitScript() {
   // This should still hold.
-  MOZ_ASSERT_IF(typeScript_, !typeScript_->typesNeedsSweep(zone_));
+  MOZ_ASSERT_IF(jitScript_, !jitScript_->typesNeedsSweep(zone_));
 }
 #endif
 
-inline bool TypeScript::typesNeedsSweep(Zone* zone) const {
+inline bool JitScript::typesNeedsSweep(Zone* zone) const {
   MOZ_ASSERT(!js::TlsContext.get()->inUnsafeCallWithABI);
   return typesGeneration() != zone->types.generation;
 }
 
 }  // namespace js
 
-inline bool JSScript::ensureHasTypes(JSContext* cx, js::AutoKeepTypeScripts&) {
-  return types() || makeTypes(cx);
+inline bool JSScript::ensureHasJitScript(JSContext* cx,
+                                         js::AutoKeepJitScripts&) {
+  return jitScript() || createJitScript(cx);
 }
 
 #endif /* vm_TypeInference_inl_h */
--- a/js/src/vm/TypeInference.cpp
+++ b/js/src/vm/TypeInference.cpp
@@ -1181,44 +1181,44 @@ class js::CompilerConstraintList {
 };
 
 CompilerConstraintList* js::NewCompilerConstraintList(
     jit::TempAllocator& alloc) {
   return alloc.lifoAlloc()->new_<CompilerConstraintList>(alloc);
 }
 
 /* static */
-bool TypeScript::FreezeTypeSets(CompilerConstraintList* constraints,
-                                JSScript* script, TemporaryTypeSet** pThisTypes,
-                                TemporaryTypeSet** pArgTypes,
-                                TemporaryTypeSet** pBytecodeTypes) {
+bool JitScript::FreezeTypeSets(CompilerConstraintList* constraints,
+                               JSScript* script, TemporaryTypeSet** pThisTypes,
+                               TemporaryTypeSet** pArgTypes,
+                               TemporaryTypeSet** pBytecodeTypes) {
   LifoAlloc* alloc = constraints->alloc();
-  AutoSweepTypeScript sweep(script);
-  TypeScript* typeScript = script->types();
-  StackTypeSet* existing = typeScript->typeArray(sweep);
-
-  size_t count = typeScript->numTypeSets();
+  AutoSweepJitScript sweep(script);
+  JitScript* jitScript = script->jitScript();
+  StackTypeSet* existing = jitScript->typeArray(sweep);
+
+  size_t count = jitScript->numTypeSets();
   TemporaryTypeSet* types =
       alloc->newArrayUninitialized<TemporaryTypeSet>(count);
   if (!types) {
     return false;
   }
 
   for (size_t i = 0; i < count; i++) {
     if (!existing[i].cloneIntoUninitialized(alloc, &types[i])) {
       return false;
     }
   }
 
-  size_t thisTypesIndex = typeScript->thisTypes(sweep, script) - existing;
+  size_t thisTypesIndex = jitScript->thisTypes(sweep, script) - existing;
   *pThisTypes = types + thisTypesIndex;
 
   if (script->functionNonDelazifying() &&
       script->functionNonDelazifying()->nargs() > 0) {
-    size_t firstArgIndex = typeScript->argTypes(sweep, script, 0) - existing;
+    size_t firstArgIndex = jitScript->argTypes(sweep, script, 0) - existing;
     *pArgTypes = types + firstArgIndex;
   } else {
     *pArgTypes = nullptr;
   }
 
   *pBytecodeTypes = types;
 
   constraints->freezeScript(script, *pThisTypes, *pArgTypes, *pBytecodeTypes);
@@ -1421,17 +1421,17 @@ bool HeapTypeSetKey::instantiate(JSConte
     }
   }
   JSObject* obj = object()->isSingleton() ? object()->singleton() : nullptr;
   AutoSweepObjectGroup sweep(object()->maybeGroup());
   maybeTypes_ = object()->maybeGroup()->getProperty(sweep, cx, obj, id());
   return maybeTypes_ != nullptr;
 }
 
-static bool CheckFrozenTypeSet(const AutoSweepTypeScript& sweep, JSContext* cx,
+static bool CheckFrozenTypeSet(const AutoSweepJitScript& sweep, JSContext* cx,
                                TemporaryTypeSet* frozen, StackTypeSet* actual) {
   // Return whether the types frozen for a script during compilation are
   // still valid. Also check for any new types added to the frozen set during
   // compilation, and add them to the actual stack type sets. These new types
   // indicate places where the compiler relaxed its possible inputs to be
   // more tolerant of potential new types.
 
   if (!actual->isSubset(frozen)) {
@@ -1504,93 +1504,92 @@ bool js::FinishCompilation(JSContext* cx
     if (!constraint->generateTypeConstraint(cx, recompileInfo)) {
       succeeded = false;
     }
   }
 
   for (size_t i = 0; i < constraints->numFrozenScripts(); i++) {
     const CompilerConstraintList::FrozenScript& entry =
         constraints->frozenScript(i);
-    TypeScript* types = entry.script->types();
-    if (!types) {
+    JitScript* jitScript = entry.script->jitScript();
+    if (!jitScript) {
       succeeded = false;
       break;
     }
 
     // It could happen that one of the compiled scripts was made a
     // debuggee mid-compilation (e.g., via setting a breakpoint). If so,
     // throw away the compilation.
     if (entry.script->isDebuggee()) {
       succeeded = false;
       break;
     }
 
-    AutoSweepTypeScript sweep(entry.script);
-    TypeScript* typeScript = entry.script->types();
+    AutoSweepJitScript sweep(entry.script);
     if (!CheckFrozenTypeSet(sweep, cx, entry.thisTypes,
-                            typeScript->thisTypes(sweep, entry.script))) {
+                            jitScript->thisTypes(sweep, entry.script))) {
       succeeded = false;
     }
     unsigned nargs = entry.script->functionNonDelazifying()
                          ? entry.script->functionNonDelazifying()->nargs()
                          : 0;
     for (size_t i = 0; i < nargs; i++) {
       if (!CheckFrozenTypeSet(sweep, cx, &entry.argTypes[i],
-                              typeScript->argTypes(sweep, entry.script, i))) {
+                              jitScript->argTypes(sweep, entry.script, i))) {
         succeeded = false;
       }
     }
     for (size_t i = 0; i < entry.script->numBytecodeTypeSets(); i++) {
       if (!CheckFrozenTypeSet(sweep, cx, &entry.bytecodeTypes[i],
-                              &types->typeArray(sweep)[i])) {
+                              &jitScript->typeArray(sweep)[i])) {
         succeeded = false;
       }
     }
 
     // Add this compilation to the inlinedCompilations list of each inlined
     // script, so we can invalidate it on changes to stack type sets.
     if (entry.script != script) {
-      if (!types->addInlinedCompilation(sweep, recompileInfo)) {
+      if (!jitScript->addInlinedCompilation(sweep, recompileInfo)) {
         succeeded = false;
       }
     }
 
     // If necessary, add constraints to trigger invalidation on the script
     // after any future changes to the stack type sets.
-    if (types->hasFreezeConstraints(sweep)) {
+    if (jitScript->hasFreezeConstraints(sweep)) {
       continue;
     }
 
-    size_t count = types->numTypeSets();
-    StackTypeSet* array = types->typeArray(sweep);
+    size_t count = jitScript->numTypeSets();
+    StackTypeSet* array = jitScript->typeArray(sweep);
     for (size_t i = 0; i < count; i++) {
       if (!array[i].addConstraint(
               cx,
               cx->typeLifoAlloc().new_<TypeConstraintFreezeStack>(entry.script),
               false)) {
         succeeded = false;
       }
     }
 
     if (succeeded) {
-      types->setHasFreezeConstraints(sweep);
+      jitScript->setHasFreezeConstraints(sweep);
     }
   }
 
   if (!succeeded) {
     script->resetWarmUpCounterToDelayIonCompilation();
     *isValidOut = false;
     return true;
   }
 
   *isValidOut = true;
   return true;
 }
 
-static void CheckDefinitePropertiesTypeSet(const AutoSweepTypeScript& sweep,
+static void CheckDefinitePropertiesTypeSet(const AutoSweepJitScript& sweep,
                                            JSContext* cx,
                                            TemporaryTypeSet* frozen,
                                            StackTypeSet* actual) {
   // The definite properties analysis happens on the main thread, so no new
   // types can have been added to actual. The analysis may have updated the
   // contents of |frozen| though with new speculative types, and these need
   // to be reflected in |actual| for AddClearDefiniteFunctionUsesInScript
   // to work.
@@ -1610,61 +1609,61 @@ void js::FinishDefinitePropertiesAnalysi
   // Assert no new types have been added to the StackTypeSets. Do this before
   // calling CheckDefinitePropertiesTypeSet, as it may add new types to the
   // StackTypeSets and break these invariants if a script is inlined more
   // than once. See also CheckDefinitePropertiesTypeSet.
   for (size_t i = 0; i < constraints->numFrozenScripts(); i++) {
     const CompilerConstraintList::FrozenScript& entry =
         constraints->frozenScript(i);
     JSScript* script = entry.script;
-    TypeScript* typeScript = script->types();
-    MOZ_ASSERT(typeScript);
-
-    AutoSweepTypeScript sweep(script);
-    MOZ_ASSERT(typeScript->thisTypes(sweep, script)->isSubset(entry.thisTypes));
+    JitScript* jitScript = script->jitScript();
+    MOZ_ASSERT(jitScript);
+
+    AutoSweepJitScript sweep(script);
+    MOZ_ASSERT(jitScript->thisTypes(sweep, script)->isSubset(entry.thisTypes));
 
     unsigned nargs = entry.script->functionNonDelazifying()
                          ? entry.script->functionNonDelazifying()->nargs()
                          : 0;
     for (size_t j = 0; j < nargs; j++) {
-      StackTypeSet* argTypes = typeScript->argTypes(sweep, script, j);
+      StackTypeSet* argTypes = jitScript->argTypes(sweep, script, j);
       MOZ_ASSERT(argTypes->isSubset(&entry.argTypes[j]));
     }
 
     for (size_t j = 0; j < script->numBytecodeTypeSets(); j++) {
-      MOZ_ASSERT(script->types()->typeArray(sweep)[j].isSubset(
+      MOZ_ASSERT(script->jitScript()->typeArray(sweep)[j].isSubset(
           &entry.bytecodeTypes[j]));
     }
   }
 #endif
 
   for (size_t i = 0; i < constraints->numFrozenScripts(); i++) {
     const CompilerConstraintList::FrozenScript& entry =
         constraints->frozenScript(i);
     JSScript* script = entry.script;
-    TypeScript* types = script->types();
-    if (!types) {
+    JitScript* jitScript = script->jitScript();
+    if (!jitScript) {
       MOZ_CRASH();
     }
 
-    AutoSweepTypeScript sweep(script);
+    AutoSweepJitScript sweep(script);
     CheckDefinitePropertiesTypeSet(sweep, cx, entry.thisTypes,
-                                   types->thisTypes(sweep, script));
+                                   jitScript->thisTypes(sweep, script));
 
     unsigned nargs = script->functionNonDelazifying()
                          ? script->functionNonDelazifying()->nargs()
                          : 0;
     for (size_t j = 0; j < nargs; j++) {
-      StackTypeSet* argTypes = types->argTypes(sweep, script, j);
+      StackTypeSet* argTypes = jitScript->argTypes(sweep, script, j);
       CheckDefinitePropertiesTypeSet(sweep, cx, &entry.argTypes[j], argTypes);
     }
 
     for (size_t j = 0; j < script->numBytecodeTypeSets(); j++) {
       CheckDefinitePropertiesTypeSet(sweep, cx, &entry.bytecodeTypes[j],
-                                     &types->typeArray(sweep)[j]);
+                                     &jitScript->typeArray(sweep)[j]);
     }
   }
 }
 
 namespace {
 
 // Constraint which triggers recompilation of a script if any type is added to a
 // type set. */
@@ -2691,22 +2690,22 @@ void TypeZone::addPendingRecompile(JSCon
   script->resetWarmUpCounterToDelayIonCompilation();
 
   if (script->hasIonScript()) {
     addPendingRecompile(
         cx, RecompileInfo(script, script->ionScript()->compilationId()));
   }
 
   // Trigger recompilation of any callers inlining this script.
-  if (TypeScript* types = script->types()) {
-    AutoSweepTypeScript sweep(script);
-    for (const RecompileInfo& info : types->inlinedCompilations(sweep)) {
+  if (JitScript* jitScript = script->jitScript()) {
+    AutoSweepJitScript sweep(script);
+    for (const RecompileInfo& info : jitScript->inlinedCompilations(sweep)) {
       addPendingRecompile(cx, info);
     }
-    types->inlinedCompilations(sweep).clearAndFree();
+    jitScript->inlinedCompilations(sweep).clearAndFree();
   }
 }
 
 #ifdef JS_CRASH_DIAGNOSTICS
 void js::ReportMagicWordFailure(uintptr_t actual, uintptr_t expected) {
   MOZ_CRASH_UNSAFE_PRINTF("Got 0x%" PRIxPTR " expected magic word 0x%" PRIxPTR,
                           actual, expected);
 }
@@ -2728,18 +2727,18 @@ void js::PrintTypes(JSContext* cx, Compa
 
   if (!force && !InferSpewActive(ISpewResult)) {
     return;
   }
 
   RootedScript script(cx);
   for (auto iter = zone->cellIter<JSScript>(); !iter.done(); iter.next()) {
     script = iter;
-    if (TypeScript* types = script->types()) {
-      types->printTypes(cx, script);
+    if (JitScript* jitScript = script->jitScript()) {
+      jitScript->printTypes(cx, script);
     }
   }
 
   for (auto group = zone->cellIter<ObjectGroup>(); !group.done();
        group.next()) {
     AutoSweepObjectGroup sweep(group);
     group->print(sweep);
   }
@@ -3329,20 +3328,20 @@ bool js::AddClearDefiniteFunctionUsesInS
   // This ensures that the inlining performed when the definite properties
   // analysis was done is stable. We only need to look at type sets which
   // contain a single object, as IonBuilder does not inline polymorphic sites
   // during the definite properties analysis.
 
   TypeSet::ObjectKey* calleeKey =
       TypeSet::ObjectType(calleeScript->functionNonDelazifying()).objectKey();
 
-  AutoSweepTypeScript sweep(script);
-  TypeScript* typeScript = script->types();
-  unsigned count = typeScript->numTypeSets();
-  StackTypeSet* typeArray = typeScript->typeArray(sweep);
+  AutoSweepJitScript sweep(script);
+  JitScript* jitScript = script->jitScript();
+  unsigned count = jitScript->numTypeSets();
+  StackTypeSet* typeArray = jitScript->typeArray(sweep);
 
   for (unsigned i = 0; i < count; i++) {
     StackTypeSet* types = &typeArray[i];
     if (!types->unknownObject() && types->getObjectCount() == 1) {
       if (calleeKey != types->getObject(0)) {
         // Also check if the object is the Function.call or
         // Function.apply native. IonBuilder uses the presence of these
         // functions during inlining.
@@ -3376,32 +3375,32 @@ bool js::AddClearDefiniteFunctionUsesInS
 /////////////////////////////////////////////////////////////////////
 
 void js::TypeMonitorCallSlow(JSContext* cx, JSObject* callee,
                              const CallArgs& args, bool constructing) {
   unsigned nargs = callee->as<JSFunction>().nargs();
   JSScript* script = callee->as<JSFunction>().nonLazyScript();
 
   if (!constructing) {
-    TypeScript::MonitorThisType(cx, script, args.thisv());
+    JitScript::MonitorThisType(cx, script, args.thisv());
   }
 
   /*
    * Add constraints going up to the minimum of the actual and formal count.
    * If there are more actuals than formals the later values can only be
    * accessed through the arguments object, which is monitored.
    */
   unsigned arg = 0;
   for (; arg < args.length() && arg < nargs; arg++) {
-    TypeScript::MonitorArgType(cx, script, arg, args[arg]);
+    JitScript::MonitorArgType(cx, script, arg, args[arg]);
   }
 
   /* Watch for fewer actuals than formals to the call. */
   for (; arg < nargs; arg++) {
-    TypeScript::MonitorArgType(cx, script, arg, UndefinedValue());
+    JitScript::MonitorArgType(cx, script, arg, UndefinedValue());
   }
 }
 
 static void FillBytecodeTypeMap(JSScript* script, uint32_t* bytecodeMap) {
   uint32_t added = 0;
   for (jsbytecode* pc = script->code(); pc < script->codeEnd();
        pc += GetBytecodeLength(pc)) {
     JSOp op = JSOp(*pc);
@@ -3411,114 +3410,114 @@ static void FillBytecodeTypeMap(JSScript
         break;
       }
     }
   }
   MOZ_ASSERT(added == script->numBytecodeTypeSets());
 }
 
 /* static */
-void TypeScript::MonitorBytecodeType(JSContext* cx, JSScript* script,
-                                     jsbytecode* pc, TypeSet::Type type) {
+void JitScript::MonitorBytecodeType(JSContext* cx, JSScript* script,
+                                    jsbytecode* pc, TypeSet::Type type) {
   cx->check(script, type);
 
   AutoEnterAnalysis enter(cx);
 
-  AutoSweepTypeScript sweep(script);
-  StackTypeSet* types = script->types()->bytecodeTypes(sweep, script, pc);
+  AutoSweepJitScript sweep(script);
+  StackTypeSet* types = script->jitScript()->bytecodeTypes(sweep, script, pc);
   if (types->hasType(type)) {
     return;
   }
 
   InferSpew(ISpewOps, "bytecodeType: %p %05zu: %s", script,
             script->pcToOffset(pc), TypeSet::TypeString(type).get());
   types->addType(sweep, cx, type);
 }
 
 /* static */
-void TypeScript::MonitorBytecodeTypeSlow(JSContext* cx, JSScript* script,
-                                         jsbytecode* pc, StackTypeSet* types,
-                                         TypeSet::Type type) {
+void JitScript::MonitorBytecodeTypeSlow(JSContext* cx, JSScript* script,
+                                        jsbytecode* pc, StackTypeSet* types,
+                                        TypeSet::Type type) {
   cx->check(script, type);
 
   AutoEnterAnalysis enter(cx);
 
-  AutoSweepTypeScript sweep(script);
-
-  MOZ_ASSERT(types == script->types()->bytecodeTypes(sweep, script, pc));
+  AutoSweepJitScript sweep(script);
+
+  MOZ_ASSERT(types == script->jitScript()->bytecodeTypes(sweep, script, pc));
   MOZ_ASSERT(!types->hasType(type));
 
   InferSpew(ISpewOps, "bytecodeType: %p %05zu: %s", script,
             script->pcToOffset(pc), TypeSet::TypeString(type).get());
   types->addType(sweep, cx, type);
 }
 
 /* static */
-void TypeScript::MonitorBytecodeType(JSContext* cx, JSScript* script,
-                                     jsbytecode* pc, const js::Value& rval) {
+void JitScript::MonitorBytecodeType(JSContext* cx, JSScript* script,
+                                    jsbytecode* pc, const js::Value& rval) {
   MOZ_ASSERT(CodeSpec[*pc].format & JOF_TYPESET);
 
-  if (!script->types()) {
+  if (!script->jitScript()) {
     return;
   }
 
   MonitorBytecodeType(cx, script, pc, TypeSet::GetValueType(rval));
 }
 
 /////////////////////////////////////////////////////////////////////
-// TypeScript
+// JitScript
 /////////////////////////////////////////////////////////////////////
 
 static size_t NumTypeSets(JSScript* script) {
   size_t num = script->numBytecodeTypeSets() + 1 /* this */;
   if (JSFunction* fun = script->functionNonDelazifying()) {
     num += fun->nargs();
   }
 
   // We rely on |num| being in a safe range to prevent overflow when allocating
-  // TypeScript.
+  // JitScript.
   static_assert(JSScript::MaxBytecodeTypeSets == UINT16_MAX,
                 "JSScript typesets should have safe range to avoid overflow");
   static_assert(JSFunction::NArgsBits == 16,
                 "JSFunction nargs should have safe range to avoid overflow");
 
   return num;
 }
 
-TypeScript::TypeScript(JSScript* script, ICScriptPtr&& icScript,
-                       uint32_t numTypeSets)
+JitScript::JitScript(JSScript* script, ICScriptPtr&& icScript,
+                     uint32_t numTypeSets)
     : icScript_(std::move(icScript)), numTypeSets_(numTypeSets) {
   setTypesGeneration(script->zone()->types.generation);
 
   StackTypeSet* array = typeArrayDontCheckGeneration();
   for (unsigned i = 0; i < numTypeSets; i++) {
     new (&array[i]) StackTypeSet();
   }
 
   FillBytecodeTypeMap(script, bytecodeTypeMap());
 }
 
-bool JSScript::makeTypes(JSContext* cx) {
-  MOZ_ASSERT(!types_);
+bool JSScript::createJitScript(JSContext* cx) {
+  MOZ_ASSERT(!jitScript_);
   cx->check(this);
 
   // Scripts that will never run in the Baseline Interpreter or the JITs don't
-  // need a TypeScript.
+  // need a JitScript.
   MOZ_ASSERT(!hasForceInterpreterOp());
 
   AutoEnterAnalysis enter(cx);
 
   // Run the arguments-analysis if needed. Both the Baseline Interpreter and
   // Compiler rely on this.
   if (!ensureHasAnalyzedArgsUsage(cx)) {
     return false;
   }
 
-  // If ensureHasAnalyzedArgsUsage allocated the TypeScript we're done.
-  if (types_) {
+  // If ensureHasAnalyzedArgsUsage allocated the JitScript we're done.
+  if (jitScript_) {
     return true;
   }
 
   UniquePtr<jit::ICScript> icScript(jit::ICScript::create(cx, this));
   if (!icScript) {
     return false;
   }
 
@@ -3526,53 +3525,54 @@ bool JSScript::makeTypes(JSContext* cx) 
   auto prepareForDestruction = mozilla::MakeScopeExit(
       [&] { icScript->prepareForDestruction(cx->zone()); });
 
   size_t numTypeSets = NumTypeSets(this);
   size_t bytecodeTypeMapEntries = numBytecodeTypeSets();
 
   // Calculate allocation size. This cannot overflow, see comment in
   // NumTypeSets.
-  static_assert(sizeof(TypeScript) ==
-                    sizeof(StackTypeSet) + offsetof(TypeScript, typeArray_),
-                "typeArray_ must be last member of TypeScript");
+  static_assert(sizeof(JitScript) ==
+                    sizeof(StackTypeSet) + offsetof(JitScript, typeArray_),
+                "typeArray_ must be last member of JitScript");
   size_t allocSize =
-      (offsetof(TypeScript, typeArray_) + numTypeSets * sizeof(StackTypeSet) +
+      (offsetof(JitScript, typeArray_) + numTypeSets * sizeof(StackTypeSet) +
        bytecodeTypeMapEntries * sizeof(uint32_t));
 
-  auto typeScript =
-      reinterpret_cast<TypeScript*>(cx->pod_malloc<uint8_t>(allocSize));
-  if (!typeScript) {
+  auto jitScript =
+      reinterpret_cast<JitScript*>(cx->pod_malloc<uint8_t>(allocSize));
+  if (!jitScript) {
     return false;
   }
 
   prepareForDestruction.release();
 
-  MOZ_ASSERT(!types_);
-  types_ = new (typeScript) TypeScript(this, std::move(icScript), numTypeSets);
-
-  // We have a TypeScript so we can set the script's jitCodeRaw_ pointer to the
+  MOZ_ASSERT(!jitScript_);
+  jitScript_ =
+      new (jitScript) JitScript(this, std::move(icScript), numTypeSets);
+
+  // We have a JitScript so we can set the script's jitCodeRaw_ pointer to the
   // Baseline Interpreter code.
   updateJitCodeRaw(cx->runtime());
 
 #ifdef DEBUG
-  AutoSweepTypeScript sweep(this);
-  StackTypeSet* typeArray = typeScript->typeArrayDontCheckGeneration();
+  AutoSweepJitScript sweep(this);
+  StackTypeSet* typeArray = jitScript->typeArrayDontCheckGeneration();
   for (unsigned i = 0; i < numBytecodeTypeSets(); i++) {
     InferSpew(ISpewOps, "typeSet: %sT%p%s bytecode%u %p",
               InferSpewColor(&typeArray[i]), &typeArray[i],
               InferSpewColorReset(), i, this);
   }
-  StackTypeSet* thisTypes = typeScript->thisTypes(sweep, this);
+  StackTypeSet* thisTypes = jitScript->thisTypes(sweep, this);
   InferSpew(ISpewOps, "typeSet: %sT%p%s this %p", InferSpewColor(thisTypes),
             thisTypes, InferSpewColorReset(), this);
   unsigned nargs =
       functionNonDelazifying() ? functionNonDelazifying()->nargs() : 0;
   for (unsigned i = 0; i < nargs; i++) {
-    StackTypeSet* types = typeScript->argTypes(sweep, this, i);
+    StackTypeSet* types = jitScript->argTypes(sweep, this, i);
     InferSpew(ISpewOps, "typeSet: %sT%p%s arg%u %p", InferSpewColor(types),
               types, InferSpewColorReset(), i, this);
   }
 #endif
 
   return true;
 }
 
@@ -4493,17 +4493,17 @@ void ObjectGroup::sweep(const AutoSweepO
       }
     }
   } else {
     MOZ_RELEASE_ASSERT(!propertySet);
   }
 }
 
 /* static */
-void TypeScript::sweepTypes(const js::AutoSweepTypeScript& sweep, Zone* zone) {
+void JitScript::sweepTypes(const js::AutoSweepJitScript& sweep, Zone* zone) {
   MOZ_ASSERT(typesGeneration() != zone->types.generation);
   setTypesGeneration(zone->types.generation);
 
   AssertGCStateForSweep(zone);
 
   Maybe<AutoClearTypeInferenceStateOnOOM> clearStateOnOOM;
   if (!zone->types.isSweepingTypes()) {
     clearStateOnOOM.emplace(zone);
@@ -4534,30 +4534,30 @@ void TypeScript::sweepTypes(const js::Au
 
   if (types.hadOOMSweepingTypes()) {
     // It's possible we OOM'd while copying freeze constraints, so they
     // need to be regenerated.
     flags_.hasFreezeConstraints = false;
   }
 }
 
-void JSScript::maybeReleaseTypes() {
-  if (!types_ || zone()->types.keepTypeScripts || hasBaselineScript() ||
-      types_->active()) {
+void JSScript::maybeReleaseJitScript() {
+  if (!jitScript_ || zone()->types.keepJitScripts || hasBaselineScript() ||
+      jitScript_->active()) {
     return;
   }
 
   MOZ_ASSERT(!hasIonScript());
 
-  types_->destroy(zone());
-  types_ = nullptr;
+  jitScript_->destroy(zone());
+  jitScript_ = nullptr;
   updateJitCodeRaw(runtimeFromMainThread());
 }
 
-void TypeScript::destroy(Zone* zone) {
+void JitScript::destroy(Zone* zone) {
   icScript_->prepareForDestruction(zone);
 
   js_delete(this);
 }
 
 void Zone::addSizeOfIncludingThis(
     mozilla::MallocSizeOf mallocSizeOf, size_t* typePool, size_t* regexpZone,
     size_t* jitZone, size_t* baselineStubsOptimized, size_t* cachedCFG,
@@ -4585,22 +4585,22 @@ void Zone::addSizeOfIncludingThis(
 TypeZone::TypeZone(Zone* zone)
     : zone_(zone),
       typeLifoAlloc_(zone, (size_t)TYPE_LIFO_ALLOC_PRIMARY_CHUNK_SIZE),
       currentCompilationId_(zone),
       generation(zone, 0),
       sweepTypeLifoAlloc(zone, (size_t)TYPE_LIFO_ALLOC_PRIMARY_CHUNK_SIZE),
       sweepingTypes(zone, false),
       oomSweepingTypes(zone, false),
-      keepTypeScripts(zone, false),
+      keepJitScripts(zone, false),
       activeAnalysis(zone, nullptr) {}
 
 TypeZone::~TypeZone() {
   MOZ_RELEASE_ASSERT(!sweepingTypes);
-  MOZ_ASSERT(!keepTypeScripts);
+  MOZ_ASSERT(!keepJitScripts);
 }
 
 void TypeZone::beginSweep() {
   MOZ_ASSERT(zone()->isGCSweepingOrCompacting());
 
   // Clear the analysis pool, but don't release its data yet. While sweeping
   // types any live data will be allocated into the pool.
   sweepTypeLifoAlloc.ref().steal(&typeLifoAlloc());
@@ -4634,19 +4634,19 @@ AutoClearTypeInferenceStateOnOOM::~AutoC
     zone->discardJitCode(rt->defaultFreeOp(), Zone::KeepBaselineCode);
     zone->types.clearAllNewScriptsOnOOM();
   }
 
   zone->types.setSweepingTypes(false);
 }
 
 #ifdef DEBUG
-void TypeScript::printTypes(JSContext* cx, HandleScript script) {
-  AutoSweepTypeScript sweep(script);
-  MOZ_ASSERT(script->types() == this);
+void JitScript::printTypes(JSContext* cx, HandleScript script) {
+  AutoSweepJitScript sweep(script);
+  MOZ_ASSERT(script->jitScript() == this);
 
   AutoEnterAnalysis enter(nullptr, script->zone());
   Fprinter out(stderr);
 
   if (script->functionNonDelazifying()) {
     fprintf(stderr, "Function");
   } else if (script->isForEval()) {
     fprintf(stderr, "Eval");
--- a/js/src/vm/TypeInference.h
+++ b/js/src/vm/TypeInference.h
@@ -26,17 +26,17 @@
 #include "js/Vector.h"
 #include "threading/ProtectedData.h"  // js::ZoneData
 #include "vm/Shape.h"
 #include "vm/TypeSet.h"
 
 namespace js {
 
 class TypeConstraint;
-class TypeScript;
+class JitScript;
 class TypeZone;
 class CompilerConstraintList;
 class HeapTypeSetKey;
 
 namespace jit {
 
 class ICScript;
 struct IonScript;
@@ -79,30 +79,30 @@ class MOZ_RAII AutoSweepObjectGroup : pu
   inline explicit AutoSweepObjectGroup(ObjectGroup* group);
 #ifdef DEBUG
   inline ~AutoSweepObjectGroup();
 
   ObjectGroup* group() const { return group_; }
 #endif
 };
 
-// Sweep a TypeScript. Functions that expect a swept script should take a
-// reference to this class.
-class MOZ_RAII AutoSweepTypeScript : public AutoSweepBase {
+// Sweep the type inference data in a JitScript. Functions that expect a swept
+// script should take a reference to this class.
+class MOZ_RAII AutoSweepJitScript : public AutoSweepBase {
 #ifdef DEBUG
   Zone* zone_;
-  TypeScript* typeScript_;
+  JitScript* jitScript_;
 #endif
 
  public:
-  inline explicit AutoSweepTypeScript(JSScript* script);
+  inline explicit AutoSweepJitScript(JSScript* script);
 #ifdef DEBUG
-  inline ~AutoSweepTypeScript();
+  inline ~AutoSweepJitScript();
 
-  TypeScript* typeScript() const { return typeScript_; }
+  JitScript* jitScript() const { return jitScript_; }
   Zone* zone() const { return zone_; }
 #endif
 };
 
 CompilerConstraintList* NewCompilerConstraintList(jit::TempAllocator& alloc);
 
 bool AddClearDefiniteGetterSetterForPrototypeChain(JSContext* cx,
                                                    ObjectGroup* group,
@@ -196,27 +196,28 @@ class RecompileInfo {
     return script_ == other.script_ && id_ == other.id_;
   }
 };
 
 // The RecompileInfoVector has a MinInlineCapacity of one so that invalidating a
 // single IonScript doesn't require an allocation.
 typedef Vector<RecompileInfo, 1, SystemAllocPolicy> RecompileInfoVector;
 
-/* Persistent type information for a script, retained across GCs. */
-class TypeScript {
+// JitScript stores type inference and JIT data for a script. Scripts with a
+// JitScript can run in the Baseline Interpreter.
+class JitScript {
   friend class ::JSScript;
 
   // The freeze constraints added to stack type sets will only directly
   // invalidate the script containing those stack type sets. This Vector
   // contains compilations that inlined this script, so we can invalidate
   // them as well.
   RecompileInfoVector inlinedCompilations_;
 
-  // ICScript and TypeScript have the same lifetimes, so we store a pointer to
+  // ICScript and JitScript have the same lifetimes, so we store a pointer to
   // ICScript here to not increase sizeof(JSScript).
   using ICScriptPtr = js::UniquePtr<js::jit::ICScript>;
   ICScriptPtr icScript_;
 
   // Number of TypeSets in typeArray_.
   uint32_t numTypeSets_;
 
   // This field is used to avoid binary searches for the sought entry when
@@ -224,64 +225,64 @@ class TypeScript {
   uint32_t bytecodeTypeMapHint_ = 0;
 
   struct Flags {
     // Flag set when discarding JIT code to indicate this script is on the stack
     // and type information and JIT code should not be discarded.
     bool active : 1;
 
     // Generation for type sweeping. If out of sync with the TypeZone's
-    // generation, this TypeScript needs to be swept.
+    // generation, this JitScript needs to be swept.
     bool typesGeneration : 1;
 
     // Whether freeze constraints for stack type sets have been generated.
     bool hasFreezeConstraints : 1;
   };
   Flags flags_ = {};  // Zero-initialize flags.
 
   // Variable-size array. This is followed by the bytecode type map.
   StackTypeSet typeArray_[1];
 
   StackTypeSet* typeArrayDontCheckGeneration() {
-    // Ensure typeArray_ is the last data member of TypeScript.
-    static_assert(sizeof(TypeScript) ==
-                      sizeof(typeArray_) + offsetof(TypeScript, typeArray_),
-                  "typeArray_ must be the last member of TypeScript");
+    // Ensure typeArray_ is the last data member of JitScript.
+    static_assert(sizeof(JitScript) ==
+                      sizeof(typeArray_) + offsetof(JitScript, typeArray_),
+                  "typeArray_ must be the last member of JitScript");
     return const_cast<StackTypeSet*>(typeArray_);
   }
 
   uint32_t typesGeneration() const { return uint32_t(flags_.typesGeneration); }
   void setTypesGeneration(uint32_t generation) {
     MOZ_ASSERT(generation <= 1);
     flags_.typesGeneration = generation;
   }
 
  public:
-  TypeScript(JSScript* script, ICScriptPtr&& icScript, uint32_t numTypeSets);
+  JitScript(JSScript* script, ICScriptPtr&& icScript, uint32_t numTypeSets);
 
-  bool hasFreezeConstraints(const js::AutoSweepTypeScript& sweep) const {
-    MOZ_ASSERT(sweep.typeScript() == this);
+  bool hasFreezeConstraints(const js::AutoSweepJitScript& sweep) const {
+    MOZ_ASSERT(sweep.jitScript() == this);
     return flags_.hasFreezeConstraints;
   }
-  void setHasFreezeConstraints(const js::AutoSweepTypeScript& sweep) {
-    MOZ_ASSERT(sweep.typeScript() == this);
+  void setHasFreezeConstraints(const js::AutoSweepJitScript& sweep) {
+    MOZ_ASSERT(sweep.jitScript() == this);
     flags_.hasFreezeConstraints = true;
   }
 
   inline bool typesNeedsSweep(Zone* zone) const;
-  void sweepTypes(const js::AutoSweepTypeScript& sweep, Zone* zone);
+  void sweepTypes(const js::AutoSweepJitScript& sweep, Zone* zone);
 
   RecompileInfoVector& inlinedCompilations(
-      const js::AutoSweepTypeScript& sweep) {
-    MOZ_ASSERT(sweep.typeScript() == this);
+      const js::AutoSweepJitScript& sweep) {
+    MOZ_ASSERT(sweep.jitScript() == this);
     return inlinedCompilations_;
   }
-  MOZ_MUST_USE bool addInlinedCompilation(const js::AutoSweepTypeScript& sweep,
+  MOZ_MUST_USE bool addInlinedCompilation(const js::AutoSweepJitScript& sweep,
                                           RecompileInfo info) {
-    MOZ_ASSERT(sweep.typeScript() == this);
+    MOZ_ASSERT(sweep.jitScript() == this);
     if (!inlinedCompilations_.empty() && inlinedCompilations_.back() == info) {
       return true;
     }
     return inlinedCompilations_.append(info);
   }
 
   uint32_t numTypeSets() const { return numTypeSets_; }
 
@@ -292,33 +293,33 @@ class TypeScript {
   void resetActive() { flags_.active = false; }
 
   jit::ICScript* icScript() const {
     MOZ_ASSERT(icScript_);
     return icScript_.get();
   }
 
   /* Array of type sets for variables and JOF_TYPESET ops. */
-  StackTypeSet* typeArray(const js::AutoSweepTypeScript& sweep) {
-    MOZ_ASSERT(sweep.typeScript() == this);
+  StackTypeSet* typeArray(const js::AutoSweepJitScript& sweep) {
+    MOZ_ASSERT(sweep.jitScript() == this);
     return typeArrayDontCheckGeneration();
   }
 
   uint32_t* bytecodeTypeMap() {
     MOZ_ASSERT(numTypeSets_ > 0);
     return reinterpret_cast<uint32_t*>(typeArray_ + numTypeSets_);
   }
 
-  inline StackTypeSet* thisTypes(const AutoSweepTypeScript& sweep,
+  inline StackTypeSet* thisTypes(const AutoSweepJitScript& sweep,
                                  JSScript* script);
-  inline StackTypeSet* argTypes(const AutoSweepTypeScript& sweep,
+  inline StackTypeSet* argTypes(const AutoSweepJitScript& sweep,
                                 JSScript* script, unsigned i);
 
   /* Get the type set for values observed at an opcode. */
-  inline StackTypeSet* bytecodeTypes(const AutoSweepTypeScript& sweep,
+  inline StackTypeSet* bytecodeTypes(const AutoSweepJitScript& sweep,
                                      JSScript* script, jsbytecode* pc);
 
   template <typename TYPESET>
   static inline TYPESET* BytecodeTypes(JSScript* script, jsbytecode* pc,
                                        uint32_t* bytecodeMap, uint32_t* hint,
                                        TYPESET* typeArray);
 
   /*
@@ -373,35 +374,35 @@ class TypeScript {
     return mallocSizeOf(this);
   }
 
   static constexpr size_t offsetOfICScript() {
     // Note: icScript_ is a UniquePtr that stores the raw pointer. If that ever
     // changes and this assertion fails, we should stop using UniquePtr.
     static_assert(sizeof(icScript_) == sizeof(uintptr_t),
                   "JIT code assumes icScript_ is pointer-sized");
-    return offsetof(TypeScript, icScript_);
+    return offsetof(JitScript, icScript_);
   }
 
 #ifdef DEBUG
   void printTypes(JSContext* cx, HandleScript script);
 #endif
 };
 
-// Ensures no TypeScripts are purged in the current zone.
-class MOZ_RAII AutoKeepTypeScripts {
+// Ensures no JitScripts are purged in the current zone.
+class MOZ_RAII AutoKeepJitScripts {
   TypeZone& zone_;
   bool prev_;
 
-  AutoKeepTypeScripts(const AutoKeepTypeScripts&) = delete;
-  void operator=(const AutoKeepTypeScripts&) = delete;
+  AutoKeepJitScripts(const AutoKeepJitScripts&) = delete;
+  void operator=(const AutoKeepJitScripts&) = delete;
 
  public:
-  explicit inline AutoKeepTypeScripts(JSContext* cx);
-  inline ~AutoKeepTypeScripts();
+  explicit inline AutoKeepJitScripts(JSContext* cx);
+  inline ~AutoKeepJitScripts();
 };
 
 class RecompileInfo;
 
 // Generate the type constraints for the compilation. Sets |isValidOut| based on
 // whether the type constraints still hold.
 bool FinishCompilation(JSContext* cx, HandleScript script,
                        CompilerConstraintList* constraints,
@@ -433,17 +434,17 @@ class TypeZone {
 
   // During incremental sweeping, allocator holding the old type information
   // for the zone.
   ZoneData<LifoAlloc> sweepTypeLifoAlloc;
 
   ZoneData<bool> sweepingTypes;
   ZoneData<bool> oomSweepingTypes;
 
-  ZoneData<bool> keepTypeScripts;
+  ZoneData<bool> keepJitScripts;
 
   // The topmost AutoEnterAnalysis on the stack, if there is one.
   ZoneData<AutoEnterAnalysis*> activeAnalysis;
 
   explicit TypeZone(JS::Zone* zone);
   ~TypeZone();
 
   JS::Zone* zone() const { return zone_; }
--- a/js/src/vm/TypeSet.h
+++ b/js/src/vm/TypeSet.h
@@ -230,17 +230,17 @@ class HeapTypeSet;
 class TemporaryTypeSet;
 
 /*
  * [SMDOC] Type-Inference TypeSet
  *
  * Information about the set of types associated with an lvalue. There are
  * three kinds of type sets:
  *
- * - StackTypeSet are associated with TypeScripts, for arguments and values
+ * - StackTypeSet are associated with JitScripts, for arguments and values
  *   observed at property reads. These are implicitly frozen on compilation
  *   and only have constraints added to them which can trigger invalidation of
  *   TypeNewScript information.
  *
  * - HeapTypeSet are associated with the properties of ObjectGroups. These
  *   may have constraints added to them to trigger invalidation of either
  *   compiled code or TypeNewScript information.
  *
@@ -667,17 +667,17 @@ class ConstraintTypeSet : public TypeSet
     if (MOZ_UNLIKELY(magic_ != ConstraintTypeSetMagic)) {
       ReportMagicWordFailure(magic_, ConstraintTypeSetMagic, uintptr_t(flags),
                              uintptr_t(objectSet));
     }
 #endif
   }
 
   // This takes a reference to AutoSweepBase to ensure we swept the owning
-  // ObjectGroup or TypeScript.
+  // ObjectGroup or JitScript.
   TypeConstraint* constraintList(const AutoSweepBase& sweep) const {
     checkMagic();
     if (constraintList_) {
       constraintList_->checkMagic();
     }
     return constraintList_;
   }
   void setConstraintList(TypeConstraint* constraint) {
--- a/js/src/wasm/WasmInstance.cpp
+++ b/js/src/wasm/WasmInstance.cpp
@@ -183,27 +183,27 @@ bool Instance::callImport(JSContext* cx,
   // Don't enable jit entry when we have a pending ion builder.
   // Take the interpreter path which will link it and enable
   // the fast path on the next call.
   if (script->baselineScript()->hasPendingIonBuilder()) {
     return true;
   }
 
   // Ensure the argument types are included in the argument TypeSets stored in
-  // the TypeScript. This is necessary for Ion, because the import will use
+  // the JitScript. This is necessary for Ion, because the import will use
   // the skip-arg-checks entry point.
   //
-  // Note that the TypeScript is never discarded while the script has a
+  // Note that the JitScript is never discarded while the script has a
   // BaselineScript, so if those checks hold now they must hold at least until
   // the BaselineScript is discarded and when that happens the import is
   // patched back.
-  AutoSweepTypeScript sweep(script);
-  TypeScript* typeScript = script->types();
+  AutoSweepJitScript sweep(script);
+  JitScript* jitScript = script->jitScript();
 
-  StackTypeSet* thisTypes = typeScript->thisTypes(sweep, script);
+  StackTypeSet* thisTypes = jitScript->thisTypes(sweep, script);
   if (!thisTypes->hasType(TypeSet::UndefinedType())) {
     return true;
   }
 
   // Functions with anyref in signature don't have a jit exit at the moment.
   if (fi.funcType().temporarilyUnsupportedAnyRef()) {
     return true;
   }
@@ -228,27 +228,27 @@ bool Instance::callImport(JSContext* cx,
       case ValType::AnyRef:
         MOZ_CRASH("case guarded above");
       case ValType::I64:
         MOZ_CRASH("NYI");
       case ValType::NullRef:
         MOZ_CRASH("NullRef not expressible");
     }
 
-    StackTypeSet* argTypes = typeScript->argTypes(sweep, script, i);
+    StackTypeSet* argTypes = jitScript->argTypes(sweep, script, i);
     if (!argTypes->hasType(type)) {
       return true;
     }
   }
 
   // These arguments will be filled with undefined at runtime by the
   // arguments rectifier: check that the imported function can handle
   // undefined there.
   for (uint32_t i = importArgs.length(); i < importFun->nargs(); i++) {
-    StackTypeSet* argTypes = typeScript->argTypes(sweep, script, i);
+    StackTypeSet* argTypes = jitScript->argTypes(sweep, script, i);
     if (!argTypes->hasType(TypeSet::UndefinedType())) {
       return true;
     }
   }
 
   // Let's optimize it!
   if (!script->baselineScript()->addDependentWasmImport(cx, *this,
                                                         funcImportIndex)) {
--- a/js/xpconnect/src/XPCJSRuntime.cpp
+++ b/js/xpconnect/src/XPCJSRuntime.cpp
@@ -1823,19 +1823,19 @@ static void ReportRealmStats(const JS::R
       realmStats.baselineStubsFallback,
       "The Baseline JIT's fallback IC stubs (excluding code).");
 
   ZRREPORT_BYTES(realmJSPathPrefix + NS_LITERAL_CSTRING("ion-data"),
                  realmStats.ionData,
                  "The IonMonkey JIT's compilation data (IonScripts).");
 
   ZRREPORT_BYTES(
-      realmJSPathPrefix + NS_LITERAL_CSTRING("type-inference/type-scripts"),
-      realmStats.typeInferenceTypeScripts,
-      "Type sets associated with scripts.");
+      realmJSPathPrefix + NS_LITERAL_CSTRING("jit-scripts"),
+      realmStats.jitScripts,
+      "JIT and Type Inference data associated with scripts.");
 
   ZRREPORT_BYTES(
       realmJSPathPrefix +
           NS_LITERAL_CSTRING("type-inference/allocation-site-tables"),
       realmStats.typeInferenceAllocationSiteTables,
       "Tables of type objects associated with allocation sites.");
 
   ZRREPORT_BYTES(realmJSPathPrefix +