Bug 947782 - Use accessor methods for JSScript uint32/uint16 fields, r=jandem.
authorBrian Hackett <bhackett1024@gmail.com>
Mon, 09 Dec 2013 11:26:09 -0800
changeset 159586 9073baccd0948d1f789a94fd19d889d072e290e3
parent 159535 682c905ee68dfe530c37ecf8945d862547dcbe30
child 159587 90d64e42de1df0ac8afc086564e0dbe42cb2367f
push id25806
push userkwierso@gmail.com
push dateTue, 10 Dec 2013 04:40:00 +0000
treeherdermozilla-central@038269f529a2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs947782
milestone28.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 947782 - Use accessor methods for JSScript uint32/uint16 fields, r=jandem.
js/src/builtin/Eval.cpp
js/src/frontend/BytecodeEmitter.cpp
js/src/gc/Tracer.cpp
js/src/jit/BaselineBailouts.cpp
js/src/jit/BaselineCompiler.cpp
js/src/jit/BaselineCompiler.h
js/src/jit/BaselineFrame.cpp
js/src/jit/BaselineFrame.h
js/src/jit/BaselineFrameInfo.cpp
js/src/jit/BaselineFrameInfo.h
js/src/jit/BaselineIC.cpp
js/src/jit/BaselineJIT.cpp
js/src/jit/BytecodeAnalysis.cpp
js/src/jit/C1Spewer.cpp
js/src/jit/CodeGenerator.cpp
js/src/jit/CompileInfo.h
js/src/jit/Ion.cpp
js/src/jit/IonBuilder.cpp
js/src/jit/IonCaches.cpp
js/src/jit/IonFrames.cpp
js/src/jit/IonSpewer.cpp
js/src/jit/JSONSpewer.cpp
js/src/jit/MIR.cpp
js/src/jit/ParallelFunctions.cpp
js/src/jit/Snapshots.cpp
js/src/jsanalyze.cpp
js/src/jsanalyze.h
js/src/jsfun.cpp
js/src/jsinfer.cpp
js/src/jsinferinlines.h
js/src/jsiter.cpp
js/src/jsobj.cpp
js/src/jsopcode.cpp
js/src/jsscript.cpp
js/src/jsscript.h
js/src/shell/js.cpp
js/src/vm/Debugger.cpp
js/src/vm/ForkJoin.cpp
js/src/vm/Interpreter.cpp
js/src/vm/OldDebugAPI.cpp
js/src/vm/Probes-inl.h
js/src/vm/SPSProfiler.cpp
js/src/vm/ScopeObject.cpp
js/src/vm/Stack-inl.h
js/src/vm/Stack.cpp
js/src/vm/Stack.h
--- a/js/src/builtin/Eval.cpp
+++ b/js/src/builtin/Eval.cpp
@@ -258,17 +258,17 @@ EvalKernel(JSContext *cx, const CallArgs
 
     // Per ES5, indirect eval runs in the global scope. (eval is specified this
     // way so that the compiler can make assumptions about what bindings may or
     // may not exist in the current frame if it doesn't see 'eval'.)
     unsigned staticLevel;
     RootedValue thisv(cx);
     if (evalType == DIRECT_EVAL) {
         JS_ASSERT_IF(caller.isStackFrame(), !caller.asStackFrame()->runningInJit());
-        staticLevel = caller.script()->staticLevel + 1;
+        staticLevel = caller.script()->staticLevel() + 1;
 
         // Direct calls to eval are supposed to see the caller's |this|. If we
         // haven't wrapped that yet, do so now, before we make a copy of it for
         // the eval code to use.
         if (!ComputeThis(cx, caller))
             return false;
         thisv = caller.thisValue();
     } else {
@@ -342,17 +342,17 @@ js::DirectEvalStringFromIon(JSContext *c
     Rooted<GlobalObject*> scopeObjGlobal(cx, &scopeobj->global());
     if (!GlobalObject::isRuntimeCodeGenEnabled(cx, scopeObjGlobal)) {
         JS_ReportErrorNumber(cx, js_GetErrorMessage, nullptr, JSMSG_CSP_BLOCKED_EVAL);
         return false;
     }
 
     // ES5 15.1.2.1 steps 2-8.
 
-    unsigned staticLevel = callerScript->staticLevel + 1;
+    unsigned staticLevel = callerScript->staticLevel() + 1;
 
     Rooted<JSStableString*> stableStr(cx, str->ensureStable(cx));
     if (!stableStr)
         return false;
 
     StableCharPtr chars = stableStr->chars();
     size_t length = stableStr->length();
 
--- a/js/src/frontend/BytecodeEmitter.cpp
+++ b/js/src/frontend/BytecodeEmitter.cpp
@@ -887,17 +887,17 @@ EmitAliasedVarOp(ExclusiveContext *cx, J
                 skippedScopes++;
                 if (funbox->function()->isNamedLambda())
                     skippedScopes++;
             }
             bceOfDef = bceOfDef->parent;
         }
     } else {
         JS_ASSERT(pn->isDefn());
-        JS_ASSERT(pn->pn_cookie.level() == bce->script->staticLevel);
+        JS_ASSERT(pn->pn_cookie.level() == bce->script->staticLevel());
     }
 
     ScopeCoordinate sc;
     if (IsArgOp(pn->getOp())) {
         sc.hops = skippedScopes + ClonedBlockDepth(bceOfDef);
         JS_ALWAYS_TRUE(LookupAliasedName(bceOfDef->script, pn->name(), &sc.slot));
     } else {
         JS_ASSERT(IsLocalOp(pn->getOp()) || pn->isKind(PNK_FUNCTION));
@@ -934,17 +934,17 @@ EmitVarOp(ExclusiveContext *cx, ParseNod
         return EmitAliasedVarOp(cx, op, sc, bce);
     }
 
     JS_ASSERT_IF(pn->isKind(PNK_NAME), IsArgOp(op) || IsLocalOp(op));
 
     if (!bce->isAliasedName(pn)) {
         JS_ASSERT(pn->isUsed() || pn->isDefn());
         JS_ASSERT_IF(pn->isUsed(), pn->pn_cookie.level() == 0);
-        JS_ASSERT_IF(pn->isDefn(), pn->pn_cookie.level() == bce->script->staticLevel);
+        JS_ASSERT_IF(pn->isDefn(), pn->pn_cookie.level() == bce->script->staticLevel());
         return EmitUnaliasedVarOp(cx, op, pn->pn_cookie.slot(), bce);
     }
 
     switch (op) {
       case JSOP_GETARG: case JSOP_GETLOCAL: op = JSOP_GETALIASEDVAR; break;
       case JSOP_SETARG: case JSOP_SETLOCAL: op = JSOP_SETALIASEDVAR; break;
       case JSOP_CALLARG: case JSOP_CALLLOCAL: op = JSOP_CALLALIASEDVAR; break;
       default: MOZ_ASSUME_UNREACHABLE("unexpected var op");
@@ -1007,17 +1007,17 @@ bool
 BytecodeEmitter::isAliasedName(ParseNode *pn)
 {
     Definition *dn = pn->resolve();
     JS_ASSERT(dn->isDefn());
     JS_ASSERT(!dn->isPlaceholder());
     JS_ASSERT(dn->isBound());
 
     /* If dn is in an enclosing function, it is definitely aliased. */
-    if (dn->pn_cookie.level() != script->staticLevel)
+    if (dn->pn_cookie.level() != script->staticLevel())
         return true;
 
     switch (dn->kind()) {
       case Definition::LET:
         /*
          * There are two ways to alias a let variable: nested functions and
          * dynamic scope operations. (This is overly conservative since the
          * bindingsAccessedDynamically flag is function-wide.)
@@ -1423,17 +1423,17 @@ BindNameToSlotHelper(ExclusiveContext *c
       case Definition::NAMED_LAMBDA: {
         JS_ASSERT(dn->isOp(JSOP_CALLEE));
         JS_ASSERT(op != JSOP_CALLEE);
 
         /*
          * Currently, the ALIASEDVAR ops do not support accessing the
          * callee of a DeclEnvObject, so use NAME.
          */
-        if (dn->pn_cookie.level() != bce->script->staticLevel)
+        if (dn->pn_cookie.level() != bce->script->staticLevel())
             return true;
 
         DebugOnly<JSFunction *> fun = bce->sc->asFunctionBox()->function();
         JS_ASSERT(fun->isLambda());
         JS_ASSERT(pn->pn_atom == fun->atom());
 
         /*
          * Leave pn->isOp(JSOP_NAME) if bce->fun is heavyweight to
@@ -1476,17 +1476,17 @@ BindNameToSlotHelper(ExclusiveContext *c
         MOZ_ASSUME_UNREACHABLE("missing");
     }
 
     /*
      * The difference between the current static level and the static level of
      * the definition is the number of function scopes between the current
      * scope and dn's scope.
      */
-    unsigned skip = bce->script->staticLevel - dn->pn_cookie.level();
+    unsigned skip = bce->script->staticLevel() - dn->pn_cookie.level();
     JS_ASSERT_IF(skip, dn->isClosed());
 
     /*
      * Explicitly disallow accessing var/let bindings in global scope from
      * nested functions. The reason for this limitation is that, since the
      * global script is not included in the static scope chain (1. because it
      * has no object to stand in the static scope chain, 2. to minimize memory
      * bloat where a single live function keeps its whole global script
@@ -4812,17 +4812,17 @@ EmitFunc(ExclusiveContext *cx, BytecodeE
                    .setSelfHostingMode(parent->selfHosted)
                    .setNoScriptRval(false)
                    .setForEval(false)
                    .setVersion(parent->getVersion());
 
             Rooted<JSObject*> enclosingScope(cx, EnclosingStaticScope(bce));
             Rooted<JSObject*> sourceObject(cx, bce->script->sourceObject());
             Rooted<JSScript*> script(cx, JSScript::Create(cx, enclosingScope, false, options,
-                                                          parent->staticLevel + 1,
+                                                          parent->staticLevel() + 1,
                                                           sourceObject,
                                                           funbox->bufStart, funbox->bufEnd));
             if (!script)
                 return false;
 
             script->bindings = funbox->bindings;
 
             uint32_t lineNum = bce->parser->tokenStream.srcCoords.lineNum(pn->pn_pos.begin);
--- a/js/src/gc/Tracer.cpp
+++ b/js/src/gc/Tracer.cpp
@@ -219,17 +219,17 @@ JS_GetTraceThingInfo(char *buf, size_t b
             else
                 JS_snprintf(buf, bufsize, "<rope: length %d>", (int)str->length());
             break;
           }
 
           case JSTRACE_SCRIPT:
           {
             JSScript *script = static_cast<JSScript *>(thing);
-            JS_snprintf(buf, bufsize, " %s:%u", script->filename(), unsigned(script->lineno));
+            JS_snprintf(buf, bufsize, " %s:%u", script->filename(), unsigned(script->lineno()));
             break;
           }
 
           case JSTRACE_LAZY_SCRIPT:
           case JSTRACE_IONCODE:
           case JSTRACE_SHAPE:
           case JSTRACE_BASE_SHAPE:
           case JSTRACE_TYPE_OBJECT:
--- a/js/src/jit/BaselineBailouts.cpp
+++ b/js/src/jit/BaselineBailouts.cpp
@@ -469,17 +469,17 @@ InitFromBailout(JSContext *cx, HandleScr
 {
     // If excInfo is non-nullptr, we are bailing out to a catch or finally block
     // and this is the frame where we will resume. Usually the expression stack
     // should be empty in this case but there can be iterators on the stack.
     uint32_t exprStackSlots;
     if (excInfo)
         exprStackSlots = excInfo->numExprSlots;
     else
-        exprStackSlots = iter.slots() - (script->nfixed + CountArgSlots(script, fun));
+        exprStackSlots = iter.slots() - (script->nfixed() + CountArgSlots(script, fun));
 
     builder.resetFramePushed();
 
     // Build first baseline frame:
     // +===============+
     // | PrevFramePtr  |
     // +---------------+
     // |   Baseline    |
@@ -497,17 +497,17 @@ InitFromBailout(JSContext *cx, HandleScr
     // +---------------+
     // |    StackS     |
     // +---------------+  --- IF NOT LAST INLINE FRAME,
     // |  Descr(BLJS)  |  --- CALLING INFO STARTS HERE
     // +---------------+
     // |  ReturnAddr   | <-- return into main jitcode after IC
     // +===============+
 
-    IonSpew(IonSpew_BaselineBailouts, "      Unpacking %s:%d", script->filename(), script->lineno);
+    IonSpew(IonSpew_BaselineBailouts, "      Unpacking %s:%d", script->filename(), script->lineno());
     IonSpew(IonSpew_BaselineBailouts, "      [BASELINE-JS FRAME]");
 
     // Calculate and write the previous frame pointer value.
     // Record the virtual stack offset at this location.  Later on, if we end up
     // writing out a BaselineStub frame for the next callee, we'll need to save the
     // address.
     void *prevFramePtr = builder.calculatePrevFramePtr();
     if (!builder.writePtr(prevFramePtr, "PrevFramePtr"))
@@ -516,17 +516,17 @@ InitFromBailout(JSContext *cx, HandleScr
 
     // Write struct BaselineFrame.
     if (!builder.subtract(BaselineFrame::Size(), "BaselineFrame"))
         return false;
     BufferPointer<BaselineFrame> blFrame = builder.pointerAtStackOffset<BaselineFrame>(0);
 
     // Initialize BaselineFrame::frameSize
     uint32_t frameSize = BaselineFrame::Size() + BaselineFrame::FramePointerOffset +
-                         (sizeof(Value) * (script->nfixed + exprStackSlots));
+                         (sizeof(Value) * (script->nfixed() + exprStackSlots));
     IonSpew(IonSpew_BaselineBailouts, "      FrameSize=%d", (int) frameSize);
     blFrame->setFrameSize(frameSize);
 
     uint32_t flags = 0;
 
     // If SPS Profiler is enabled, mark the frame as having pushed an SPS entry.
     // This may be wrong for the last frame of ArgumentCheck bailout, but
     // that will be fixed later.
@@ -622,17 +622,17 @@ InitFromBailout(JSContext *cx, HandleScr
         IonSpew(IonSpew_BaselineBailouts, "      Is function!");
         IonSpew(IonSpew_BaselineBailouts, "      thisv=%016llx", *((uint64_t *) &thisv));
 
         size_t thisvOffset = builder.framePushed() + IonJSFrameLayout::offsetOfThis();
         *builder.valuePointerAtStackOffset(thisvOffset) = thisv;
 
         JS_ASSERT(iter.slots() >= CountArgSlots(script, fun));
         IonSpew(IonSpew_BaselineBailouts, "      frame slots %u, nargs %u, nfixed %u",
-                iter.slots(), fun->nargs, script->nfixed);
+                iter.slots(), fun->nargs, script->nfixed());
 
         if (!callerPC) {
             // This is the first frame. Store the formals in a Vector until we
             // are done. Due to UCE and phi elimination, we could store an
             // UndefinedValue() here for formals we think are unused, but
             // locals may still reference the original argument slot
             // (MParameter/LArgument) and expect the original Value.
             JS_ASSERT(startFrameFormals.empty());
@@ -648,17 +648,17 @@ InitFromBailout(JSContext *cx, HandleScr
                 size_t argOffset = builder.framePushed() + IonJSFrameLayout::offsetOfActualArg(i);
                 *builder.valuePointerAtStackOffset(argOffset) = arg;
             } else {
                 startFrameFormals[i] = arg;
             }
         }
     }
 
-    for (uint32_t i = 0; i < script->nfixed; i++) {
+    for (uint32_t i = 0; i < script->nfixed(); i++) {
         Value slot = iter.read();
         if (!builder.writeValue(slot, "FixedValue"))
             return false;
     }
 
     // Get the pc. If we are handling an exception, resume at the pc of the
     // catch or finally block.
     jsbytecode *pc = excInfo ? excInfo->resumePC : script->offsetToPC(iter.pcOffset());
@@ -820,17 +820,17 @@ InitFromBailout(JSContext *cx, HandleScr
                 // arguments in the slots and not be 4.
                 JS_ASSERT(exprStackSlots == expectedDepth);
             }
         }
     }
 
     IonSpew(IonSpew_BaselineBailouts, "      Resuming %s pc offset %d (op %s) (line %d) of %s:%d",
                 resumeAfter ? "after" : "at", (int) pcOff, js_CodeName[op],
-                PCToLineNumber(script, pc), script->filename(), (int) script->lineno);
+                PCToLineNumber(script, pc), script->filename(), (int) script->lineno());
     IonSpew(IonSpew_BaselineBailouts, "      Bailout kind: %s",
             BailoutKindString(bailoutKind));
 #endif
 
     // If this was the last inline frame, or we are bailing out to a catch or
     // finally block in this frame, then unpacking is almost done.
     if (!iter.moreFrames() || excInfo) {
         // Last frame, so PC for call to next frame is set to nullptr.
@@ -954,17 +954,17 @@ InitFromBailout(JSContext *cx, HandleScr
                 //          Top SPS profiler entry would be for callee frame.
                 //          Ion would already have pushed an SPS entry for this frame.
                 //          The pc for this entry would be set to nullptr.
                 //          Make sure it's set to script->pc.
                 if (cx->runtime()->spsProfiler.enabled()) {
                     if (caller && bailoutKind == Bailout_ArgumentCheck) {
                         IonSpew(IonSpew_BaselineBailouts, "      Setting PCidx on innermost "
                                 "inlined frame's parent's SPS entry (%s:%d) (pcIdx=%d)!",
-                                caller->filename(), caller->lineno, caller->pcToOffset(callerPC));
+                                caller->filename(), caller->lineno(), caller->pcToOffset(callerPC));
                         cx->runtime()->spsProfiler.updatePC(caller, callerPC);
                     } else if (bailoutKind != Bailout_ArgumentCheck) {
                         IonSpew(IonSpew_BaselineBailouts,
                                 "      Popping SPS entry for innermost inlined frame's SPS entry");
                         cx->runtime()->spsProfiler.exit(cx, script, fun);
                     }
                 }
             } else {
@@ -1052,17 +1052,17 @@ InitFromBailout(JSContext *cx, HandleScr
         actualArgc = GET_ARGC(pc);
         if (op == JSOP_FUNCALL) {
             JS_ASSERT(actualArgc > 0);
             actualArgc--;
         }
 
         JS_ASSERT(actualArgc + 2 <= exprStackSlots);
         for (unsigned i = 0; i < actualArgc + 1; i++) {
-            size_t argSlot = (script->nfixed + exprStackSlots) - (i + 1);
+            size_t argSlot = (script->nfixed() + exprStackSlots) - (i + 1);
             if (!builder.writeValue(*blFrame->valueSlot(argSlot), "ArgVal"))
                 return false;
         }
     }
 
     // In case these arguments need to be copied on the stack again for a rectifier frame,
     // save the framePushed values here for later use.
     size_t endOfBaselineStubArgs = builder.framePushed();
@@ -1231,17 +1231,17 @@ jit::BailoutIonToBaseline(JSContext *cx,
     //      |  ReturnAddr   |
     //      +---------------+
     //      |    |||||      | <---- Overwrite starting here.
     //      |    |||||      |
     //      |    |||||      |
     //      +---------------+
 
     IonSpew(IonSpew_BaselineBailouts, "Bailing to baseline %s:%u (IonScript=%p) (FrameType=%d)",
-            iter.script()->filename(), iter.script()->lineno, (void *) iter.ionScript(),
+            iter.script()->filename(), iter.script()->lineno(), (void *) iter.ionScript(),
             (int) prevFrameType);
 
     if (excInfo)
         IonSpew(IonSpew_BaselineBailouts, "Resuming in catch or finally block");
 
     IonSpew(IonSpew_BaselineBailouts, "  Reading from snapshot offset %u size %u",
             iter.snapshotOffset(), iter.ionScript()->snapshotsSize());
 
@@ -1255,17 +1255,17 @@ jit::BailoutIonToBaseline(JSContext *cx,
         return BAILOUT_RETURN_FATAL_ERROR;
     IonSpew(IonSpew_BaselineBailouts, "  Incoming frame ptr = %p", builder.startFrame());
 
     SnapshotIterator snapIter(iter);
 
     RootedFunction callee(cx, iter.maybeCallee());
     if (callee) {
         IonSpew(IonSpew_BaselineBailouts, "  Callee function (%s:%u)",
-                callee->existingScript()->filename(), callee->existingScript()->lineno);
+                callee->existingScript()->filename(), callee->existingScript()->lineno());
     } else {
         IonSpew(IonSpew_BaselineBailouts, "  No callee!");
     }
 
     if (iter.isConstructing())
         IonSpew(IonSpew_BaselineBailouts, "  Constructing!");
     else
         IonSpew(IonSpew_BaselineBailouts, "  Not constructing!");
@@ -1346,18 +1346,18 @@ jit::BailoutIonToBaseline(JSContext *cx,
     *bailoutInfo = info;
     return BAILOUT_RETURN_OK;
 }
 
 static bool
 HandleBoundsCheckFailure(JSContext *cx, HandleScript outerScript, HandleScript innerScript)
 {
     IonSpew(IonSpew_Bailouts, "Bounds check failure %s:%d, inlined into %s:%d",
-            innerScript->filename(), innerScript->lineno,
-            outerScript->filename(), outerScript->lineno);
+            innerScript->filename(), innerScript->lineno(),
+            outerScript->filename(), outerScript->lineno());
 
     JS_ASSERT(!outerScript->ionScript()->invalidated());
 
     // TODO: Currently this mimic's Ion's handling of this case.  Investigate setting
     // the flag on innerScript as opposed to outerScript, and maybe invalidating both
     // inner and outer scripts, instead of just the outer one.
     if (!outerScript->failedBoundsCheck) {
         outerScript->failedBoundsCheck = true;
@@ -1365,35 +1365,35 @@ HandleBoundsCheckFailure(JSContext *cx, 
     IonSpew(IonSpew_BaselineBailouts, "Invalidating due to bounds check failure");
     return Invalidate(cx, outerScript);
 }
 
 static bool
 HandleShapeGuardFailure(JSContext *cx, HandleScript outerScript, HandleScript innerScript)
 {
     IonSpew(IonSpew_Bailouts, "Shape guard failure %s:%d, inlined into %s:%d",
-            innerScript->filename(), innerScript->lineno,
-            outerScript->filename(), outerScript->lineno);
+            innerScript->filename(), innerScript->lineno(),
+            outerScript->filename(), outerScript->lineno());
 
     JS_ASSERT(!outerScript->ionScript()->invalidated());
 
     // TODO: Currently this mimic's Ion's handling of this case.  Investigate setting
     // the flag on innerScript as opposed to outerScript, and maybe invalidating both
     // inner and outer scripts, instead of just the outer one.
     outerScript->failedShapeGuard = true;
     IonSpew(IonSpew_BaselineBailouts, "Invalidating due to shape guard failure");
     return Invalidate(cx, outerScript);
 }
 
 static bool
 HandleBaselineInfoBailout(JSContext *cx, JSScript *outerScript, JSScript *innerScript)
 {
     IonSpew(IonSpew_Bailouts, "Baseline info failure %s:%d, inlined into %s:%d",
-            innerScript->filename(), innerScript->lineno,
-            outerScript->filename(), outerScript->lineno);
+            innerScript->filename(), innerScript->lineno(),
+            outerScript->filename(), outerScript->lineno());
 
     JS_ASSERT(!outerScript->ionScript()->invalidated());
 
     IonSpew(IonSpew_BaselineBailouts, "Invalidating due to invalid baseline info");
     return Invalidate(cx, outerScript);
 }
 
 uint32_t
@@ -1475,18 +1475,18 @@ jit::FinishBailoutToBaseline(BaselineBai
 
         ++iter;
     }
 
     JS_ASSERT(innerScript);
     JS_ASSERT(outerScript);
     IonSpew(IonSpew_BaselineBailouts,
             "  Restored outerScript=(%s:%u,%u) innerScript=(%s:%u,%u) (bailoutKind=%u)",
-            outerScript->filename(), outerScript->lineno, outerScript->getUseCount(),
-            innerScript->filename(), innerScript->lineno, innerScript->getUseCount(),
+            outerScript->filename(), outerScript->lineno(), outerScript->getUseCount(),
+            innerScript->filename(), innerScript->lineno(), innerScript->getUseCount(),
             (unsigned) bailoutKind);
 
     switch (bailoutKind) {
       case Bailout_Normal:
         // Do nothing.
         break;
       case Bailout_ArgumentCheck:
         // Do nothing, bailout will resume before the argument monitor ICs.
--- a/js/src/jit/BaselineCompiler.cpp
+++ b/js/src/jit/BaselineCompiler.cpp
@@ -64,20 +64,20 @@ BaselineCompiler::addPCMappingEntry(bool
 
     return pcMappingEntries_.append(entry);
 }
 
 MethodStatus
 BaselineCompiler::compile()
 {
     IonSpew(IonSpew_BaselineScripts, "Baseline compiling script %s:%d (%p)",
-            script->filename(), script->lineno, script.get());
+            script->filename(), script->lineno(), script.get());
 
     IonSpew(IonSpew_Codegen, "# Emitting baseline code for script %s:%d",
-            script->filename(), script->lineno);
+            script->filename(), script->lineno());
 
     if (cx->typeInferenceEnabled() && !script->ensureHasTypes(cx))
         return Method_Error;
 
     // Only need to analyze scripts which are marked |argumensHasVarBinding|, to
     // compute |needsArgsObj| flag.
     if (script->argumentsHasVarBinding()) {
         if (!script->ensureRanAnalysis(cx))
@@ -167,17 +167,17 @@ BaselineCompiler::compile()
 
     if (pcEntries.oom())
         return Method_Error;
 
     prologueOffset_.fixup(&masm);
     spsPushToggleOffset_.fixup(&masm);
 
     // Note: There is an extra entry in the bytecode type map for the search hint, see below.
-    size_t bytecodeTypeMapEntries = cx->typeInferenceEnabled() ? script->nTypeSets + 1 : 0;
+    size_t bytecodeTypeMapEntries = cx->typeInferenceEnabled() ? script->nTypeSets() + 1 : 0;
 
     BaselineScript *baselineScript = BaselineScript::New(cx, prologueOffset_.offset(),
                                                          spsPushToggleOffset_.offset(),
                                                          icEntries_.length(),
                                                          pcMappingIndexEntries.length(),
                                                          pcEntries.length(),
                                                          bytecodeTypeMapEntries);
     if (!baselineScript)
@@ -185,17 +185,17 @@ BaselineCompiler::compile()
 
     baselineScript->setMethod(code);
     baselineScript->setTemplateScope(templateScope);
 
     script->setBaselineScript(baselineScript);
 
     IonSpew(IonSpew_BaselineScripts, "Created BaselineScript %p (raw %p) for %s:%d",
             (void *) script->baselineScript(), (void *) code->raw(),
-            script->filename(), script->lineno);
+            script->filename(), script->lineno());
 
 #ifdef JS_ION_PERF
     writePerfSpewerBaselineProfile(script, code);
 #endif
 
     JS_ASSERT(pcMappingIndexEntries.length() > 0);
     baselineScript->copyPCMappingIndexEntries(&pcMappingIndexEntries[0]);
 
@@ -234,26 +234,26 @@ BaselineCompiler::compile()
     if (cx->typeInferenceEnabled()) {
         uint32_t *bytecodeMap = baselineScript->bytecodeTypeMap();
 
         uint32_t added = 0;
         for (jsbytecode *pc = script->code(); pc < script->codeEnd(); pc += GetBytecodeLength(pc)) {
             JSOp op = JSOp(*pc);
             if (js_CodeSpec[op].format & JOF_TYPESET) {
                 bytecodeMap[added++] = script->pcToOffset(pc);
-                if (added == script->nTypeSets)
+                if (added == script->nTypeSets())
                     break;
             }
         }
 
-        JS_ASSERT(added == script->nTypeSets);
+        JS_ASSERT(added == script->nTypeSets());
 
         // The last entry in the last index found, and is used to avoid binary
         // searches for the sought entry when queries are in linear order.
-        bytecodeMap[script->nTypeSets] = 0;
+        bytecodeMap[script->nTypeSets()] = 0;
     }
 
     if (script->compartment()->debugMode())
         baselineScript->setDebugMode();
 
     return Method_Compiled;
 }
 
@@ -451,17 +451,17 @@ typedef bool (*CheckOverRecursedWithExtr
 static const VMFunction CheckOverRecursedWithExtraInfo =
     FunctionInfo<CheckOverRecursedWithExtraFn>(CheckOverRecursedWithExtra);
 
 bool
 BaselineCompiler::emitStackCheck(bool earlyCheck)
 {
     Label skipCall;
     uintptr_t *limitAddr = &cx->runtime()->mainThread.ionStackLimit;
-    uint32_t slotsSize = script->nslots * sizeof(Value);
+    uint32_t slotsSize = script->nslots() * sizeof(Value);
     uint32_t tolerance = earlyCheck ? slotsSize : 0;
 
     masm.movePtr(BaselineStackReg, R1.scratchReg());
 
     // If this is the early stack check, locals haven't been pushed yet.  Adjust the
     // stack pointer to account for the locals that would be pushed before performing
     // the guard around the vmcall to the stack check.
     if (earlyCheck)
--- a/js/src/jit/BaselineCompiler.h
+++ b/js/src/jit/BaselineCompiler.h
@@ -185,17 +185,17 @@ class BaselineCompiler : public Baseline
     Label *labelOf(jsbytecode *pc) {
         return &labels_[script->pcToOffset(pc)];
     }
 
     // If a script has more |nslots| than this, then emit code to do an
     // early stack check.
     static const unsigned EARLY_STACK_CHECK_SLOT_COUNT = 128;
     bool needsEarlyStackCheck() const {
-        return script->nslots > EARLY_STACK_CHECK_SLOT_COUNT;
+        return script->nslots() > EARLY_STACK_CHECK_SLOT_COUNT;
     }
 
   public:
     BaselineCompiler(JSContext *cx, TempAllocator &alloc, HandleScript script);
     bool init();
 
     MethodStatus compile();
 
--- a/js/src/jit/BaselineFrame.cpp
+++ b/js/src/jit/BaselineFrame.cpp
@@ -51,17 +51,17 @@ BaselineFrame::trace(JSTracer *trc)
         Value *last = valueSlot(nvalues - 1);
         gc::MarkValueRootRange(trc, nvalues, last, "baseline-stack");
     }
 }
 
 bool
 BaselineFrame::copyRawFrameSlots(AutoValueVector *vec) const
 {
-    unsigned nfixed = script()->nfixed;
+    unsigned nfixed = script()->nfixed();
     unsigned nformals = numFormalArgs();
 
     if (!vec->resize(nformals + nfixed))
         return false;
 
     mozilla::PodCopy(vec->begin(), argv(), nformals);
     for (unsigned i = 0; i < nfixed; i++)
         (*vec)[nformals + i] = *valueSlot(i);
--- a/js/src/jit/BaselineFrame.h
+++ b/js/src/jit/BaselineFrame.h
@@ -147,17 +147,17 @@ class BaselineFrame
     }
     Value *valueSlot(size_t slot) const {
         JS_ASSERT(slot < numValueSlots());
         return (Value *)this - (slot + 1);
     }
 
     Value &unaliasedVar(unsigned i, MaybeCheckAliasing checkAliasing = CHECK_ALIASING) const {
         JS_ASSERT_IF(checkAliasing, !script()->varIsAliased(i));
-        JS_ASSERT(i < script()->nfixed);
+        JS_ASSERT(i < script()->nfixed());
         return *valueSlot(i);
     }
 
     Value &unaliasedFormal(unsigned i, MaybeCheckAliasing checkAliasing = CHECK_ALIASING) const {
         JS_ASSERT(i < numFormalArgs());
         JS_ASSERT_IF(checkAliasing, !script()->argsObjAliasesFormals() &&
                                     !script()->formalIsAliased(i));
         return argv()[i];
@@ -329,17 +329,17 @@ class BaselineFrame
     }
     bool isStrictEvalFrame() const {
         return isEvalFrame() && script()->strict;
     }
     bool isNonStrictEvalFrame() const {
         return isEvalFrame() && !script()->strict;
     }
     bool isDirectEvalFrame() const {
-        return isEvalFrame() && script()->staticLevel > 0;
+        return isEvalFrame() && script()->staticLevel() > 0;
     }
     bool isNonStrictDirectEvalFrame() const {
         return isNonStrictEvalFrame() && isDirectEvalFrame();
     }
     bool isNonEvalFunctionFrame() const {
         return isFunctionFrame() && !isEvalFrame();
     }
     bool isDebuggerFrame() const {
--- a/js/src/jit/BaselineFrameInfo.cpp
+++ b/js/src/jit/BaselineFrameInfo.cpp
@@ -12,17 +12,17 @@
 
 using namespace js;
 using namespace js::jit;
 
 bool
 FrameInfo::init(TempAllocator &alloc)
 {
     // One slot is always needed for this/arguments type checks.
-    size_t nstack = Max(script->nslots - script->nfixed, 1);
+    size_t nstack = Max(script->nslots() - script->nfixed(), size_t(1));
     if (!stack.init(alloc, nstack))
         return false;
 
     return true;
 }
 
 void
 FrameInfo::sync(StackValue *val)
--- a/js/src/jit/BaselineFrameInfo.h
+++ b/js/src/jit/BaselineFrameInfo.h
@@ -174,17 +174,17 @@ class FrameInfo
         masm(masm),
         stack(),
         spIndex(0)
     { }
 
     bool init(TempAllocator &alloc);
 
     uint32_t nlocals() const {
-        return script->nfixed;
+        return script->nfixed();
     }
     uint32_t nargs() const {
         return script->function()->nargs;
     }
 
   private:
     inline StackValue *rawPush() {
         StackValue *val = &stack[spIndex++];
--- a/js/src/jit/BaselineIC.cpp
+++ b/js/src/jit/BaselineIC.cpp
@@ -49,17 +49,17 @@ FallbackICSpew(JSContext *cx, ICFallback
         va_list args;
         va_start(args, fmt);
         vsnprintf(fmtbuf, 100, fmt, args);
         va_end(args);
 
         IonSpew(IonSpew_BaselineICFallback,
                 "Fallback hit for (%s:%d) (pc=%d,line=%d,uses=%d,stubs=%d): %s",
                 script->filename(),
-                script->lineno,
+                script->lineno(),
                 (int) script->pcToOffset(pc),
                 PCToLineNumber(script, pc),
                 script->getUseCount(),
                 (int) stub->numOptimizedStubs(),
                 fmtbuf);
     }
 }
 
@@ -74,17 +74,17 @@ TypeFallbackICSpew(JSContext *cx, ICType
         va_list args;
         va_start(args, fmt);
         vsnprintf(fmtbuf, 100, fmt, args);
         va_end(args);
 
         IonSpew(IonSpew_BaselineICFallback,
                 "Type monitor fallback hit for (%s:%d) (pc=%d,line=%d,uses=%d,stubs=%d): %s",
                 script->filename(),
-                script->lineno,
+                script->lineno(),
                 (int) script->pcToOffset(pc),
                 PCToLineNumber(script, pc),
                 script->getUseCount(),
                 (int) stub->numOptimizedMonitorStubs(),
                 fmtbuf);
     }
 }
 
@@ -921,17 +921,17 @@ DoUseCountFallback(JSContext *cx, ICUseC
         // TODO: Clear all optimized stubs.
         // TODO: Add a ion-script-already-exists checker stub.
         return true;
     }
 
     // Ensure that Ion-compiled code is available.
     IonSpew(IonSpew_BaselineOSR,
             "UseCount for %s:%d reached %d at pc %p, trying to switch to Ion!",
-            script->filename(), script->lineno, (int) script->getUseCount(), (void *) pc);
+            script->filename(), script->lineno(), (int) script->getUseCount(), (void *) pc);
     void *jitcode = nullptr;
     if (!EnsureCanEnterIon(cx, stub, frame, script, pc, &jitcode))
         return false;
 
     // Jitcode should only be set here if not at loop entry.
     JS_ASSERT_IF(!isLoopEntry, !jitcode);
     if (!jitcode)
         return true;
@@ -1051,17 +1051,17 @@ DoProfilerFallback(JSContext *cx, Baseli
     JS_ASSERT(icEntry->firstStub() == stub);
 
     // Generate the string to use to identify this stack frame.
     const char *string = profiler->profileString(cx, script, func);
     if (string == nullptr)
         return false;
 
     IonSpew(IonSpew_BaselineIC, "  Generating Profiler_PushFunction stub for %s:%d",
-            script->filename(), script->lineno);
+            script->filename(), script->lineno());
 
     // Create a new optimized stub.
     ICProfiler_PushFunction::Compiler compiler(cx, string, script);
     ICStub *optStub = compiler.getStub(compiler.getStubSpace(script));
     if (!optStub)
         return false;
     stub->addNewStub(optStub);
 
@@ -3774,17 +3774,17 @@ static bool TryAttachNativeGetElemStub(J
                                              : ICStub::GetElem_NativePrototypeCallNative;
 
         if (getterIsScripted) {
             IonSpew(IonSpew_BaselineIC,
                     "  Generating GetElem(Native %s%s call scripted %s:%d) stub "
                     "(obj=%p, shape=%p, holder=%p, holderShape=%p)",
                         (obj == holder) ? "direct" : "prototype",
                         needsAtomize ? " atomizing" : "",
-                        getter->nonLazyScript()->filename(), getter->nonLazyScript()->lineno,
+                        getter->nonLazyScript()->filename(), getter->nonLazyScript()->lineno(),
                         obj.get(), obj->lastProperty(), holder.get(), holder->lastProperty());
         } else {
             IonSpew(IonSpew_BaselineIC,
                     "  Generating GetElem(Native %s%s call native) stub "
                     "(obj=%p, shape=%p, holder=%p, holderShape=%p)",
                         (obj == holder) ? "direct" : "prototype",
                         needsAtomize ? " atomizing" : "",
                         obj.get(), obj->lastProperty(), holder.get(), holder->lastProperty());
@@ -6086,17 +6086,17 @@ TryAttachNativeGetPropStub(JSContext *cx
             return true;
 #endif
 
         RootedFunction callee(cx, &shape->getterObject()->as<JSFunction>());
         JS_ASSERT(obj != holder);
         JS_ASSERT(callee->hasScript());
 
         IonSpew(IonSpew_BaselineIC, "  Generating GetProp(NativeObj/ScriptedGetter %s:%d) stub",
-                    callee->nonLazyScript()->filename(), callee->nonLazyScript()->lineno);
+                    callee->nonLazyScript()->filename(), callee->nonLazyScript()->lineno());
 
         ICGetProp_CallScripted::Compiler compiler(cx, monitorStub, obj, holder, callee,
                                                   script->pcToOffset(pc));
         ICStub *newStub = compiler.getStub(compiler.getStubSpace(script));
         if (!newStub)
             return false;
 
         stub->addNewStub(newStub);
@@ -7105,17 +7105,17 @@ TryAttachSetPropStub(JSContext *cx, Hand
 
     // Try handling scripted setters.
     if (cacheableCall && isScripted) {
         RootedFunction callee(cx, &shape->setterObject()->as<JSFunction>());
         JS_ASSERT(obj != holder);
         JS_ASSERT(callee->hasScript());
 
         IonSpew(IonSpew_BaselineIC, "  Generating SetProp(NativeObj/ScriptedSetter %s:%d) stub",
-                    callee->nonLazyScript()->filename(), callee->nonLazyScript()->lineno);
+                    callee->nonLazyScript()->filename(), callee->nonLazyScript()->lineno());
 
         ICSetProp_CallScripted::Compiler compiler(cx, obj, holder, callee, script->pcToOffset(pc));
         ICStub *newStub = compiler.getStub(compiler.getStubSpace(script));
         if (!newStub)
             return false;
 
         stub->addNewStub(newStub);
         *attached = true;
@@ -7895,17 +7895,17 @@ TryAttachCallStub(JSContext *cx, ICCall_
         if (constructing) {
             templateObject = CreateThisForFunction(cx, fun, MaybeSingletonObject);
             if (!templateObject)
                 return false;
         }
 
         IonSpew(IonSpew_BaselineIC,
                 "  Generating Call_Scripted stub (fun=%p, %s:%d, cons=%s)",
-                fun.get(), fun->nonLazyScript()->filename(), fun->nonLazyScript()->lineno,
+                fun.get(), fun->nonLazyScript()->filename(), fun->nonLazyScript()->lineno(),
                 constructing ? "yes" : "no");
         ICCallScriptedCompiler compiler(cx, stub->fallbackMonitorStub()->firstMonitorStub(),
                                         calleeScript, templateObject,
                                         constructing, script->pcToOffset(pc));
         ICStub *newStub = compiler.getStub(compiler.getStubSpace(script));
         if (!newStub)
             return false;
 
--- a/js/src/jit/BaselineJIT.cpp
+++ b/js/src/jit/BaselineJIT.cpp
@@ -169,17 +169,17 @@ jit::EnterBaselineAtBranch(JSContext *cx
     data.jitcode = baseline->nativeCodeForPC(fp->script(), pc);
 
     // Skip debug breakpoint/trap handler, the interpreter already handled it
     // for the current op.
     if (cx->compartment()->debugMode())
         data.jitcode += MacroAssembler::ToggledCallSize();
 
     data.osrFrame = fp;
-    data.osrNumStackValues = fp->script()->nfixed + cx->interpreterRegs().stackDepth();
+    data.osrNumStackValues = fp->script()->nfixed() + cx->interpreterRegs().stackDepth();
 
     RootedValue thisv(cx);
 
     if (fp->isNonEvalFunctionFrame()) {
         data.constructing = fp->isConstructing();
         data.numActualArgs = fp->numActualArgs();
         data.maxArgc = Max(fp->numActualArgs(), fp->numFormalArgs()) + 1; // +1 = include |this|
         data.maxArgv = fp->argv() - 1; // -1 = include |this|
@@ -242,17 +242,17 @@ jit::BaselineCompile(JSContext *cx, Hand
     return status;
 }
 
 static MethodStatus
 CanEnterBaselineJIT(JSContext *cx, HandleScript script, bool osr)
 {
     // Limit the locals on a given script so that stack check on baseline frames        
     // doesn't overflow a uint32_t value.
-    static_assert(sizeof(script->nslots) == sizeof(uint16_t), "script->nslots may get too large!");
+    JS_ASSERT(script->nslots() <= UINT16_MAX);
 
     JS_ASSERT(jit::IsBaselineEnabled(cx));
 
     // Skip if the script has been disabled.
     if (!script->canBaselineCompile())
         return Method_Skipped;
 
     if (script->length() > BaselineScript::MAX_JSSCRIPT_LENGTH)
@@ -742,17 +742,17 @@ void
 BaselineScript::toggleDebugTraps(JSScript *script, jsbytecode *pc)
 {
     JS_ASSERT(script->baselineScript() == this);
 
     // Only scripts compiled for debug mode have toggled calls.
     if (!debugMode())
         return;
 
-    SrcNoteLineScanner scanner(script->notes(), script->lineno);
+    SrcNoteLineScanner scanner(script->notes(), script->lineno());
 
     JSRuntime *rt = script->runtimeFromMainThread();
     IonContext ictx(CompileRuntime::get(rt),
                     CompileCompartment::get(script->compartment()),
                     nullptr);
     AutoFlushCache afc("DebugTraps", rt->jitRuntime());
 
     for (uint32_t i = 0; i < numPCMappingIndexEntries(); i++) {
--- a/js/src/jit/BytecodeAnalysis.cpp
+++ b/js/src/jit/BytecodeAnalysis.cpp
@@ -103,17 +103,17 @@ BytecodeAnalysis::init(TempAllocator &al
             }
             break;
           }
 
           case JSOP_TRY: {
             JSTryNote *tn = script_->trynotes()->vector;
             JSTryNote *tnlimit = tn + script_->trynotes()->length;
             for (; tn < tnlimit; tn++) {
-                unsigned startOffset = script_->mainOffset + tn->start;
+                unsigned startOffset = script_->mainOffset() + tn->start;
                 if (startOffset == offset + 1) {
                     unsigned catchOffset = startOffset + tn->length;
 
                     if (tn->kind != JSTRY_ITER) {
                         infos_[catchOffset].init(stackDepth);
                         infos_[catchOffset].jumpTarget = true;
                     }
                 }
--- a/js/src/jit/C1Spewer.cpp
+++ b/js/src/jit/C1Spewer.cpp
@@ -30,18 +30,18 @@ C1Spewer::beginFunction(MIRGraph *graph,
     if (!spewout_)
         return;
 
     this->graph  = graph;
     this->script.repoint(script);
 
     fprintf(spewout_, "begin_compilation\n");
     if (script) {
-        fprintf(spewout_, "  name \"%s:%d\"\n", script->filename(), script->lineno);
-        fprintf(spewout_, "  method \"%s:%d\"\n", script->filename(), script->lineno);
+        fprintf(spewout_, "  name \"%s:%d\"\n", script->filename(), (int)script->lineno());
+        fprintf(spewout_, "  method \"%s:%d\"\n", script->filename(), (int)script->lineno());
     } else {
         fprintf(spewout_, "  name \"asm.js compilation\"\n");
         fprintf(spewout_, "  method \"asm.js compilation\"\n");
     }
     fprintf(spewout_, "  date %d\n", (int)time(nullptr));
     fprintf(spewout_, "end_compilation\n");
 }
 
--- a/js/src/jit/CodeGenerator.cpp
+++ b/js/src/jit/CodeGenerator.cpp
@@ -5785,17 +5785,17 @@ CodeGenerator::generateAsmJS()
     return true;
 }
 
 bool
 CodeGenerator::generate()
 {
     IonSpew(IonSpew_Codegen, "# Emitting code for script %s:%d",
             gen->info().script()->filename(),
-            gen->info().script()->lineno);
+            gen->info().script()->lineno());
 
     if (!safepoints_.init(gen->alloc(), graph.totalSlotCount()))
         return false;
 
 #if JS_TRACE_LOGGING
     masm.tracelogStart(gen->info().script());
     masm.tracelogLog(TraceLogging::INFO_ENGINE_IONMONKEY);
 #endif
--- a/js/src/jit/CompileInfo.h
+++ b/js/src/jit/CompileInfo.h
@@ -56,18 +56,18 @@ class CompileInfo
         if (fun_) {
             fun_ = fun_->nonLazyScript()->function();
             JS_ASSERT(fun_->isTenured());
         }
 
         nimplicit_ = StartArgSlot(script)                   /* scope chain and argument obj */
                    + (fun ? 1 : 0);                         /* this */
         nargs_ = fun ? fun->nargs : 0;
-        nlocals_ = script->nfixed;
-        nstack_ = script->nslots - script->nfixed;
+        nlocals_ = script->nfixed();
+        nstack_ = script->nslots() - script->nfixed();
         nslots_ = nimplicit_ + nargs_ + nlocals_ + nstack_;
     }
 
     CompileInfo(unsigned nlocals, ExecutionMode executionMode)
       : script_(nullptr), fun_(nullptr), osrPc_(nullptr), constructing_(false),
         executionMode_(executionMode)
     {
         nimplicit_ = 0;
@@ -102,17 +102,17 @@ class CompileInfo
         return script_->codeEnd();
     }
 
     const char *filename() const {
         return script_->filename();
     }
 
     unsigned lineno() const {
-        return script_->lineno;
+        return script_->lineno();
     }
     unsigned lineno(jsbytecode *pc) const {
         return PCToLineNumber(script_, pc);
     }
 
     // Script accessors based on PC.
 
     JSAtom *getAtom(jsbytecode *pc) const {
--- a/js/src/jit/Ion.cpp
+++ b/js/src/jit/Ion.cpp
@@ -1879,23 +1879,23 @@ Compile(JSContext *cx, HandleScript scri
         return Method_Skipped;
 
     if (cx->compartment()->debugMode()) {
         IonSpew(IonSpew_Abort, "debugging");
         return Method_CantCompile;
     }
 
     if (!CheckScript(cx, script, bool(osrPc))) {
-        IonSpew(IonSpew_Abort, "Aborted compilation of %s:%d", script->filename(), script->lineno);
+        IonSpew(IonSpew_Abort, "Aborted compilation of %s:%d", script->filename(), script->lineno());
         return Method_CantCompile;
     }
 
     MethodStatus status = CheckScriptSize(cx, script);
     if (status != Method_Compiled) {
-        IonSpew(IonSpew_Abort, "Aborted compilation of %s:%d", script->filename(), script->lineno);
+        IonSpew(IonSpew_Abort, "Aborted compilation of %s:%d", script->filename(), script->lineno());
         return status;
     }
 
     bool recompile = false;
 
     IonScript *scriptIon = GetIonScript(script, executionMode);
     if (scriptIon) {
         if (!scriptIon->method())
@@ -2142,17 +2142,17 @@ jit::CanEnterInParallel(JSContext *cx, H
     // compilation of one of the invoked functions, which
     // would cause the earlier functions (such as the
     // kernel itself) to be collected.  In this event, we
     // give up and fallback to sequential for now.
     if (!script->hasParallelIonScript()) {
         parallel::Spew(
             parallel::SpewCompile,
             "Script %p:%s:%u was garbage-collected or invalidated",
-            script.get(), script->filename(), script->lineno);
+            script.get(), script->filename(), script->lineno());
         return Method_Skipped;
     }
 
     return Method_Compiled;
 }
 
 MethodStatus
 jit::CanEnterUsingFastInvoke(JSContext *cx, HandleScript script, uint32_t numActualArgs)
@@ -2339,17 +2339,17 @@ InvalidateActivation(FreeOp *fop, uint8_
             IonSpew(IonSpew_Invalidate, "#%d exit frame @ %p", frameno, it.fp());
             break;
           case IonFrame_BaselineJS:
           case IonFrame_OptimizedJS:
           {
             JS_ASSERT(it.isScripted());
             const char *type = it.isOptimizedJS() ? "Optimized" : "Baseline";
             IonSpew(IonSpew_Invalidate, "#%d %s JS frame @ %p, %s:%d (fun: %p, script: %p, pc %p)",
-                    frameno, type, it.fp(), it.script()->filename(), it.script()->lineno,
+                    frameno, type, it.fp(), it.script()->filename(), it.script()->lineno(),
                     it.maybeCallee(), (JSScript *)it.script(), it.returnAddressToFp());
             break;
           }
           case IonFrame_BaselineStub:
             IonSpew(IonSpew_Invalidate, "#%d baseline stub frame @ %p", frameno, it.fp());
             break;
           case IonFrame_Rectifier:
             IonSpew(IonSpew_Invalidate, "#%d rectifier frame @ %p", frameno, it.fp());
@@ -2498,17 +2498,17 @@ jit::Invalidate(types::TypeCompartment &
 
         if (cancelOffThread)
             CancelOffThreadIonCompile(co.script()->compartment(), co.script());
 
         if (!co.ion())
             continue;
 
         IonSpew(IonSpew_Invalidate, " Invalidate %s:%u, IonScript %p",
-                co.script()->filename(), co.script()->lineno, co.ion());
+                co.script()->filename(), co.script()->lineno(), co.ion());
 
         // Keep the ion script alive during the invalidation and flag this
         // ionScript as being invalidated.  This increment is removed by the
         // loop after the calls to InvalidateActivation.
         co.ion()->incref();
         numInvalidations++;
     }
 
@@ -2658,17 +2658,17 @@ jit::ForbidCompilation(JSContext *cx, JS
 {
     ForbidCompilation(cx, script, SequentialExecution);
 }
 
 void
 jit::ForbidCompilation(JSContext *cx, JSScript *script, ExecutionMode mode)
 {
     IonSpew(IonSpew_Abort, "Disabling Ion mode %d compilation of script %s:%d",
-            mode, script->filename(), script->lineno);
+            mode, script->filename(), script->lineno());
 
     CancelOffThreadIonCompile(cx->compartment(), script);
 
     switch (mode) {
       case SequentialExecution:
         if (script->hasIonScript()) {
             // It is only safe to modify script->ion if the script is not currently
             // running, because IonFrameIterator needs to tell what ionScript to
--- a/js/src/jit/IonBuilder.cpp
+++ b/js/src/jit/IonBuilder.cpp
@@ -84,19 +84,19 @@ jit::NewBaselineFrameInspector(TempAlloc
                 inspector->argTypes.infallibleAppend(types::GetValueType(frame->unaliasedFormal(i)));
             else if (frame->hasArgsObj())
                 inspector->argTypes.infallibleAppend(types::GetValueType(frame->argsObj().arg(i)));
             else
                 inspector->argTypes.infallibleAppend(types::Type::UndefinedType());
         }
     }
 
-    if (!inspector->varTypes.reserve(frame->script()->nfixed))
+    if (!inspector->varTypes.reserve(frame->script()->nfixed()))
         return nullptr;
-    for (size_t i = 0; i < frame->script()->nfixed; i++) {
+    for (size_t i = 0; i < frame->script()->nfixed(); i++) {
         if (script->varIsAliased(i))
             inspector->varTypes.infallibleAppend(types::Type::UndefinedType());
         else
             inspector->varTypes.infallibleAppend(types::GetValueType(frame->unaliasedVar(i)));
     }
 
     return inspector;
 }
@@ -311,17 +311,17 @@ IonBuilder::getPolyCallTargets(types::Te
     return true;
 }
 
 IonBuilder::InliningDecision
 IonBuilder::DontInline(JSScript *targetScript, const char *reason)
 {
     if (targetScript) {
         IonSpew(IonSpew_Inlining, "Cannot inline %s:%u: %s",
-                targetScript->filename(), targetScript->lineno, reason);
+                targetScript->filename(), targetScript->lineno(), reason);
     } else {
         IonSpew(IonSpew_Inlining, "Cannot inline: %s", reason);
     }
 
     return InliningDecision_DontInline;
 }
 
 IonBuilder::InliningDecision
@@ -599,17 +599,17 @@ IonBuilder::build()
     if (!init())
         return false;
 
     setCurrentAndSpecializePhis(newBlock(pc));
     if (!current)
         return false;
 
     IonSpew(IonSpew_Scripts, "Analyzing script %s:%d (%p) (usecount=%d)",
-            script()->filename(), script()->lineno, (void *)script(), (int)script()->getUseCount());
+            script()->filename(), script()->lineno(), (void *)script(), (int)script()->getUseCount());
 
     if (!initParameters())
         return false;
 
     // Initialize local variables.
     for (uint32_t i = 0; i < info().nlocals(); i++) {
         MConstant *undef = MConstant::New(alloc(), UndefinedValue());
         current->add(undef);
@@ -744,17 +744,17 @@ IonBuilder::buildInline(IonBuilder *call
                         CallInfo &callInfo)
 {
     if (!init())
         return false;
 
     inlineCallInfo_ = &callInfo;
 
     IonSpew(IonSpew_Scripts, "Inlining script %s:%d (%p)",
-            script()->filename(), script()->lineno, (void *)script());
+            script()->filename(), script()->lineno(), (void *)script());
 
     callerBuilder_ = callerBuilder;
     callerResumePoint_ = callerResumePoint;
 
     if (callerBuilder->failedBoundsCheck_)
         failedBoundsCheck_ = true;
 
     if (callerBuilder->failedShapeGuard_)
@@ -979,17 +979,17 @@ IonBuilder::initScopeChain(MDefinition *
     current->setScopeChain(scope);
     return true;
 }
 
 bool
 IonBuilder::initArgumentsObject()
 {
     IonSpew(IonSpew_MIR, "%s:%d - Emitting code to initialize arguments object! block=%p",
-                              script()->filename(), script()->lineno, current);
+                              script()->filename(), script()->lineno(), current);
     JS_ASSERT(info().needsArgsObj());
     MCreateArgumentsObject *argsObj = MCreateArgumentsObject::New(alloc(), current->scopeChain());
     current->add(argsObj);
     current->setArgumentsObject(argsObj);
     return true;
 }
 
 bool
--- a/js/src/jit/IonCaches.cpp
+++ b/js/src/jit/IonCaches.cpp
@@ -405,17 +405,17 @@ IonCache::linkAndAttachStub(JSContext *c
     LinkStatus status = linkCode(cx, masm, ion, code.address());
     if (status != LINK_GOOD)
         return status != LINK_ERROR;
 
     attachStub(masm, attacher, code);
 
     if (pc_) {
         IonSpew(IonSpew_InlineCaches, "Cache %p(%s:%d/%d) generated %s %s stub at %p",
-                this, script_->filename(), script_->lineno, script_->pcToOffset(pc_),
+                this, script_->filename(), script_->lineno(), script_->pcToOffset(pc_),
                 attachKind, CacheName(kind()), code->raw());
     } else {
         IonSpew(IonSpew_InlineCaches, "Cache %p generated %s %s stub at %p",
                 this, attachKind, CacheName(kind()), code->raw());
     }
 
 #ifdef JS_ION_PERF
     writePerfSpewerIonCodeProfile(code, "IonCache");
@@ -1739,17 +1739,17 @@ GetPropertyIC::update(JSContext *cx, siz
     if (cache.idempotent() && !emitted) {
         // Invalidate the cache if the property was not found, or was found on
         // a non-native object. This ensures:
         // 1) The property read has no observable side-effects.
         // 2) There's no need to dynamically monitor the return type. This would
         //    be complicated since (due to GVN) there can be multiple pc's
         //    associated with a single idempotent cache.
         IonSpew(IonSpew_InlineCaches, "Invalidating from idempotent cache %s:%d",
-                topScript->filename(), topScript->lineno);
+                topScript->filename(), topScript->lineno());
 
         topScript->invalidatedIdempotentCache = true;
 
         // Do not re-invalidate if the lookup already caused invalidation.
         if (!topScript->hasIonScript())
             return true;
 
         return Invalidate(cx, topScript);
--- a/js/src/jit/IonFrames.cpp
+++ b/js/src/jit/IonFrames.cpp
@@ -308,17 +308,17 @@ IonFrameIterator::machineState() const
 }
 
 static void
 CloseLiveIterator(JSContext *cx, const InlineFrameIterator &frame, uint32_t localSlot)
 {
     SnapshotIterator si = frame.snapshotIterator();
 
     // Skip stack slots until we reach the iterator object.
-    uint32_t base = CountArgSlots(frame.script(), frame.maybeCallee()) + frame.script()->nfixed;
+    uint32_t base = CountArgSlots(frame.script(), frame.maybeCallee()) + frame.script()->nfixed();
     uint32_t skipSlots = base + localSlot - 1;
 
     for (unsigned i = 0; i < skipSlots; i++)
         si.skip();
 
     Value v = si.read();
     RootedObject obj(cx, &v.toObject());
 
@@ -460,29 +460,29 @@ HandleExceptionBaseline(JSContext *cx, c
     for (; tn != tnEnd; ++tn) {
         if (pcOffset < tn->start)
             continue;
         if (pcOffset >= tn->start + tn->length)
             continue;
 
         // Skip if the try note's stack depth exceeds the frame's stack depth.
         // See the big comment in TryNoteIter::settle for more info.
-        JS_ASSERT(frame.baselineFrame()->numValueSlots() >= script->nfixed);
-        size_t stackDepth = frame.baselineFrame()->numValueSlots() - script->nfixed;
+        JS_ASSERT(frame.baselineFrame()->numValueSlots() >= script->nfixed());
+        size_t stackDepth = frame.baselineFrame()->numValueSlots() - script->nfixed();
         if (tn->stackDepth > stackDepth)
             continue;
 
         // Unwind scope chain (pop block objects).
         if (cx->isExceptionPending())
             UnwindScope(cx, frame.baselineFrame(), tn->stackDepth);
 
         // Compute base pointer and stack pointer.
         rfe->framePointer = frame.fp() - BaselineFrame::FramePointerOffset;
         rfe->stackPointer = rfe->framePointer - BaselineFrame::Size() -
-            (script->nfixed + tn->stackDepth) * sizeof(Value);
+            (script->nfixed() + tn->stackDepth) * sizeof(Value);
 
         switch (tn->kind) {
           case JSTRY_CATCH:
             if (cx->isExceptionPending()) {
                 // Ion can compile try-catch, but bailing out to catch
                 // exceptions is slow. Reset the use count so that if we
                 // catch many exceptions we won't Ion-compile the script.
                 script->resetUseCount();
@@ -1585,17 +1585,17 @@ IonFrameIterator::dumpBaseline() const
 #else
         fprintf(stderr, "?\n");
 #endif
     } else {
         fprintf(stderr, "  global frame, no callee\n");
     }
 
     fprintf(stderr, "  file %s line %u\n",
-            script()->filename(), (unsigned) script()->lineno);
+            script()->filename(), (unsigned) script()->lineno());
 
     JSContext *cx = GetIonContext()->cx;
     RootedScript script(cx);
     jsbytecode *pc;
     baselineScriptAndPc(script.address(), &pc);
 
     fprintf(stderr, "  script = %p, pc = %p (offset %u)\n", (void *)script, pc, uint32_t(script->pcToOffset(pc)));
     fprintf(stderr, "  current op: %s\n", js_CodeName[*pc]);
@@ -1633,17 +1633,17 @@ InlineFrameIteratorMaybeGC<allowGC>::dum
 #else
         fprintf(stderr, "?\n");
 #endif
     } else {
         fprintf(stderr, "  global frame, no callee\n");
     }
 
     fprintf(stderr, "  file %s line %u\n",
-            script()->filename(), (unsigned) script()->lineno);
+            script()->filename(), (unsigned) script()->lineno());
 
     fprintf(stderr, "  script = %p, pc = %p\n", (void*) script(), pc());
     fprintf(stderr, "  current op: %s\n", js_CodeName[*pc()]);
 
     if (!more()) {
         numActualArgs();
     }
 
--- a/js/src/jit/IonSpewer.cpp
+++ b/js/src/jit/IonSpewer.cpp
@@ -48,17 +48,17 @@ FilterContainsLocation(HandleScript func
     if (!filter || !filter[0])
         return true;
 
     // Disable asm.js output when filter is set.
     if (!function)
         return false;
 
     const char *filename = function->filename();
-    const size_t line = function->lineno;
+    const size_t line = function->lineno();
     const size_t filelen = strlen(filename);
     const char *index = strstr(filter, filename);
     while (index) {
         if (index == filter || index[-1] == ',') {
             if (index[filelen] == 0 || index[filelen] == ',')
                 return true;
             if (index[filelen] == ':' && line != size_t(-1)) {
                 size_t read_line = strtoul(&index[filelen + 1], nullptr, 10);
@@ -88,17 +88,17 @@ jit::IonSpewNewFunction(MIRGraph *graph,
 
     if (!IonSpewEnabled(IonSpew_Logs))
         return;
 
     // Ionspewer isn't threads-safe. Therefore logging is disabled for
     // off-thread spewing. Throw informative message when trying.
     if (func) {
         IonSpew(IonSpew_Logs, "Can't log script %s:%d. (Compiled on background thread.)",
-                              func->filename(), func->lineno);
+                              func->filename(), func->lineno());
     } else {
         IonSpew(IonSpew_Logs, "Can't log asm.js compilation. (Compiled on background thread.)");
     }
 }
 
 void
 jit::IonSpewPass(const char *pass)
 {
--- a/js/src/jit/JSONSpewer.cpp
+++ b/js/src/jit/JSONSpewer.cpp
@@ -180,17 +180,17 @@ JSONSpewer::init(const char *path)
 void
 JSONSpewer::beginFunction(JSScript *script)
 {
     if (inFunction_)
         endFunction();
 
     beginObject();
     if (script)
-        stringProperty("name", "%s:%d", script->filename(), script->lineno);
+        stringProperty("name", "%s:%d", script->filename(), script->lineno());
     else
         stringProperty("name", "asm.js compilation");
     beginListProperty("passes");
 
     inFunction_ = true;
 }
 
 void
--- a/js/src/jit/MIR.cpp
+++ b/js/src/jit/MIR.cpp
@@ -494,18 +494,18 @@ MConstant::printOpcode(FILE *fp) const
             if (fun->displayAtom()) {
                 fputs("function ", fp);
                 FileEscapedString(fp, fun->displayAtom(), 0);
             } else {
                 fputs("unnamed function", fp);
             }
             if (fun->hasScript()) {
                 JSScript *script = fun->nonLazyScript();
-                fprintf(fp, " (%s:%u)",
-                        script->filename() ? script->filename() : "", script->lineno);
+                fprintf(fp, " (%s:%d)",
+                        script->filename() ? script->filename() : "", (int) script->lineno());
             }
             fprintf(fp, " at %p", (void *) fun);
             break;
         }
         fprintf(fp, "object %p (%s)", (void *)&value().toObject(),
                 value().toObject().getClass()->name);
         break;
       case MIRType_String:
--- a/js/src/jit/ParallelFunctions.cpp
+++ b/js/src/jit/ParallelFunctions.cpp
@@ -467,18 +467,18 @@ void
 jit::AbortPar(ParallelBailoutCause cause, JSScript *outermostScript, JSScript *currentScript,
               jsbytecode *bytecode)
 {
     // Spew before asserts to help with diagnosing failures.
     Spew(SpewBailouts,
          "Parallel abort with cause %d in %p:%s:%d "
          "(%p:%s:%d at line %d)",
          cause,
-         outermostScript, outermostScript->filename(), outermostScript->lineno,
-         currentScript, currentScript->filename(), currentScript->lineno,
+         outermostScript, outermostScript->filename(), outermostScript->lineno(),
+         currentScript, currentScript->filename(), currentScript->lineno(),
          (currentScript ? PCToLineNumber(currentScript, bytecode) : 0));
 
     JS_ASSERT(InParallelSection());
     JS_ASSERT(outermostScript != nullptr);
     JS_ASSERT(currentScript != nullptr);
     JS_ASSERT(outermostScript->hasParallelIonScript());
 
     ForkJoinSlice *slice = ForkJoinSlice::Current();
@@ -487,18 +487,18 @@ jit::AbortPar(ParallelBailoutCause cause
     slice->bailoutRecord->setCause(cause, outermostScript, currentScript, bytecode);
 }
 
 void
 jit::PropagateAbortPar(JSScript *outermostScript, JSScript *currentScript)
 {
     Spew(SpewBailouts,
          "Propagate parallel abort via %p:%s:%d (%p:%s:%d)",
-         outermostScript, outermostScript->filename(), outermostScript->lineno,
-         currentScript, currentScript->filename(), currentScript->lineno);
+         outermostScript, outermostScript->filename(), outermostScript->lineno(),
+         currentScript, currentScript->filename(), currentScript->lineno());
 
     JS_ASSERT(InParallelSection());
     JS_ASSERT(outermostScript->hasParallelIonScript());
 
     outermostScript->parallelIonScript()->setHasUncompiledCallTarget();
 
     ForkJoinSlice *slice = ForkJoinSlice::Current();
     if (currentScript)
@@ -517,33 +517,33 @@ jit::CallToUncompiledScriptPar(JSObject 
         Spew(SpewBailouts, "Call to non-function");
         return;
     }
 
     JSFunction *func = &obj->as<JSFunction>();
     if (func->hasScript()) {
         JSScript *script = func->nonLazyScript();
         Spew(SpewBailouts, "Call to uncompiled script: %p:%s:%d",
-             script, script->filename(), script->lineno);
+             script, script->filename(), script->lineno());
     } else if (func->isInterpretedLazy()) {
         Spew(SpewBailouts, "Call to uncompiled lazy script");
     } else if (func->isBoundFunction()) {
         int depth = 0;
         JSFunction *target = &func->getBoundFunctionTarget()->as<JSFunction>();
         while (depth < max_bound_function_unrolling) {
             if (target->hasScript())
                 break;
             if (target->isBoundFunction())
                 target = &target->getBoundFunctionTarget()->as<JSFunction>();
             depth--;
         }
         if (target->hasScript()) {
             JSScript *script = target->nonLazyScript();
             Spew(SpewBailouts, "Call to bound function leading (depth: %d) to script: %p:%s:%d",
-                 depth, script, script->filename(), script->lineno);
+                 depth, script, script->filename(), script->lineno());
         } else {
             Spew(SpewBailouts, "Call to bound function (excessive depth: %d)", depth);
         }
     } else {
         JS_ASSERT(func->isNative());
         Spew(SpewBailouts, "Call to native function");
     }
 #endif
--- a/js/src/jit/Snapshots.cpp
+++ b/js/src/jit/Snapshots.cpp
@@ -304,21 +304,21 @@ SnapshotWriter::startFrame(JSFunction *f
     // Test if we honor the maximum of arguments at all times.
     // This is a sanity check and not an algorithm limit. So check might be a bit too loose.
     // +4 to account for scope chain, return value, this value and maybe arguments_object.
     JS_ASSERT(CountArgSlots(script, fun) < SNAPSHOT_MAX_NARGS + 4);
 
     uint32_t implicit = StartArgSlot(script);
     uint32_t formalArgs = CountArgSlots(script, fun);
 
-    nslots_ = formalArgs + script->nfixed + exprStack;
+    nslots_ = formalArgs + script->nfixed() + exprStack;
     slotsWritten_ = 0;
 
     IonSpew(IonSpew_Snapshots, "Starting frame; implicit %u, formals %u, fixed %u, exprs %u",
-            implicit, formalArgs - implicit, script->nfixed, exprStack);
+            implicit, formalArgs - implicit, script->nfixed(), exprStack);
 
     uint32_t pcoff = script->pcToOffset(pc);
     IonSpew(IonSpew_Snapshots, "Writing pc offset %u, nslots %u", pcoff, nslots_);
     writer_.writeUnsigned(pcoff);
     writer_.writeUnsigned(nslots_);
 }
 
 #ifdef TRACK_SNAPSHOTS
--- a/js/src/jsanalyze.cpp
+++ b/js/src/jsanalyze.cpp
@@ -285,17 +285,17 @@ ScriptAnalysis::analyzeBytecode(JSContex
              * Everything between a try and corresponding catch or finally is conditional.
              * Note that there is no problem with code which is skipped by a thrown
              * exception but is not caught by a later handler in the same function:
              * no more code will execute, and it does not matter what is defined.
              */
             JSTryNote *tn = script_->trynotes()->vector;
             JSTryNote *tnlimit = tn + script_->trynotes()->length;
             for (; tn < tnlimit; tn++) {
-                unsigned startOffset = script_->mainOffset + tn->start;
+                unsigned startOffset = script_->mainOffset() + tn->start;
                 if (startOffset == offset + 1) {
                     unsigned catchOffset = startOffset + tn->length;
 
                     /* This will overestimate try block code, for multiple catch/finally. */
                     if (catchOffset > forwardCatch)
                         forwardCatch = catchOffset;
 
                     if (tn->kind != JSTRY_ITER && tn->kind != JSTRY_LOOP) {
@@ -312,28 +312,28 @@ ScriptAnalysis::analyzeBytecode(JSContex
             /*
              * Watch for uses of variables not known to be defined, and mark
              * them as having possible uses before definitions.  Ignore GETLOCAL
              * followed by a POP, these are generated for, e.g. 'var x;'
              */
             jsbytecode *next = pc + JSOP_GETLOCAL_LENGTH;
             if (JSOp(*next) != JSOP_POP || jumpTarget(next)) {
                 uint32_t local = GET_SLOTNO(pc);
-                if (local >= script_->nfixed) {
+                if (local >= script_->nfixed()) {
                     localsAliasStack_ = true;
                     break;
                 }
             }
             break;
           }
 
           case JSOP_CALLLOCAL:
           case JSOP_SETLOCAL: {
             uint32_t local = GET_SLOTNO(pc);
-            if (local >= script_->nfixed) {
+            if (local >= script_->nfixed()) {
                 localsAliasStack_ = true;
                 break;
             }
             break;
           }
 
           case JSOP_GETPROP:
           case JSOP_CALLPROP:
@@ -473,17 +473,17 @@ ScriptAnalysis::analyzeLifetimes(JSConte
             JS_ASSERT_IF(loop, loop->head < offset);
         }
 
         if (code->exceptionEntry) {
             DebugOnly<bool> found = false;
             JSTryNote *tn = script_->trynotes()->vector;
             JSTryNote *tnlimit = tn + script_->trynotes()->length;
             for (; tn < tnlimit; tn++) {
-                unsigned startOffset = script_->mainOffset + tn->start;
+                unsigned startOffset = script_->mainOffset() + tn->start;
                 if (startOffset + tn->length == offset) {
                     /*
                      * Extend all live variables at exception entry to the start of
                      * the try block.
                      */
                     for (unsigned i = 0; i < numSlots; i++) {
                         if (lifetimes[i].lifetime)
                             ensureVariable(lifetimes[i], startOffset - 1);
@@ -872,17 +872,17 @@ ScriptAnalysis::analyzeSSA(JSContext *cx
 
     if (!ranLifetimes()) {
         analyzeLifetimes(cx);
         if (failed())
             return;
     }
 
     LifoAlloc &alloc = cx->typeLifoAlloc();
-    unsigned maxDepth = script_->nslots - script_->nfixed;
+    unsigned maxDepth = script_->nslots() - script_->nfixed();
 
     /*
      * Current value of each variable and stack value. Empty for missing or
      * untracked entries, i.e. escaping locals and arguments.
      */
     SSAValueInfo *values = cx->pod_calloc<SSAValueInfo>(numSlots + maxDepth);
     if (!values) {
         setOOM(cx);
@@ -1205,17 +1205,17 @@ ScriptAnalysis::analyzeSSA(JSContext *cx
             checkBranchTarget(cx, defaultOffset, branchTargets, values, stackDepth);
             break;
           }
 
           case JSOP_TRY: {
             JSTryNote *tn = script_->trynotes()->vector;
             JSTryNote *tnlimit = tn + script_->trynotes()->length;
             for (; tn < tnlimit; tn++) {
-                unsigned startOffset = script_->mainOffset + tn->start;
+                unsigned startOffset = script_->mainOffset() + tn->start;
                 if (startOffset == offset + 1) {
                     unsigned catchOffset = startOffset + tn->length;
 
                     if (tn->kind != JSTRY_ITER && tn->kind != JSTRY_LOOP) {
                         checkBranchTarget(cx, catchOffset, branchTargets, values, stackDepth);
                         checkExceptionTarget(cx, catchOffset, exceptionTargets);
                     }
                 }
--- a/js/src/jsanalyze.h
+++ b/js/src/jsanalyze.h
@@ -223,17 +223,17 @@ static inline uint32_t ThisSlot() {
 }
 static inline uint32_t ArgSlot(uint32_t arg) {
     return 1 + arg;
 }
 static inline uint32_t LocalSlot(JSScript *script, uint32_t local) {
     return 1 + (script->function() ? script->function()->nargs : 0) + local;
 }
 static inline uint32_t TotalSlots(JSScript *script) {
-    return LocalSlot(script, 0) + script->nfixed;
+    return LocalSlot(script, 0) + script->nfixed();
 }
 
 static inline uint32_t StackSlot(JSScript *script, uint32_t index) {
     return TotalSlots(script) + index;
 }
 
 static inline uint32_t GetBytecodeSlot(JSScript *script, jsbytecode *pc)
 {
--- a/js/src/jsfun.cpp
+++ b/js/src/jsfun.cpp
@@ -296,17 +296,17 @@ js::fun_resolve(JSContext *cx, HandleObj
 
     if (JSID_IS_ATOM(id, cx->names().length) || JSID_IS_ATOM(id, cx->names().name)) {
         JS_ASSERT(!IsInternalFunctionObject(obj));
 
         RootedValue v(cx);
         if (JSID_IS_ATOM(id, cx->names().length)) {
             if (fun->isInterpretedLazy() && !fun->getOrCreateScript(cx))
                 return false;
-            uint16_t length = fun->hasScript() ? fun->nonLazyScript()->funLength :
+            uint16_t length = fun->hasScript() ? fun->nonLazyScript()->funLength() :
                 fun->nargs - fun->hasRest();
             v.setInt32(length);
         } else {
             v.setString(fun->atom() == nullptr ? cx->runtime()->emptyString : fun->atom());
         }
 
         if (!DefineNativeProperty(cx, fun, id, v, JS_PropertyStub, JS_StrictPropertyStub,
                                   JSPROP_PERMANENT | JSPROP_READONLY, 0, 0)) {
@@ -682,18 +682,18 @@ js::FunctionToString(JSContext *cx, Hand
         StableCharPtr chars = src->chars();
         bool exprBody = fun->isExprClosure();
 
         // The source data for functions created by calling the Function
         // constructor is only the function's body.  This depends on the fact,
         // asserted below, that in Function("function f() {}"), the inner
         // function's sourceStart points to the '(', not the 'f'.
         bool funCon = !fun->isArrow() &&
-                      script->sourceStart == 0 &&
-                      script->sourceEnd == script->scriptSource()->length() &&
+                      script->sourceStart() == 0 &&
+                      script->sourceEnd() == script->scriptSource()->length() &&
                       script->scriptSource()->argumentsNotIncluded();
 
         // Functions created with the constructor can't be arrow functions or
         // expression closures.
         JS_ASSERT_IF(funCon, !fun->isArrow());
         JS_ASSERT_IF(funCon, !exprBody);
         JS_ASSERT_IF(!funCon && !fun->isArrow(), src->length() > 0 && chars[0] == '(');
 
@@ -1199,17 +1199,17 @@ JSFunction::createScriptForLazilyInterpr
 
         script = fun->nonLazyScript();
 
         // Try to insert the newly compiled script into the lazy script cache.
         if (!lazy->numInnerFunctions()) {
             // A script's starting column isn't set by the bytecode emitter, so
             // specify this from the lazy script so that if an identical lazy
             // script is encountered later a match can be determined.
-            script->column = lazy->column();
+            script->setColumn(lazy->column());
 
             LazyScriptCache::Lookup lookup(cx, lazy);
             cx->runtime()->lazyScriptCache.insert(lookup, script);
         }
 
         // Remember the compiled script on the lazy script itself, in case
         // there are clones of the function still pointing to the lazy script.
         lazy->initScript(script);
--- a/js/src/jsinfer.cpp
+++ b/js/src/jsinfer.cpp
@@ -205,17 +205,17 @@ types::TypeObjectString(TypeObject *type
 {
     return TypeString(Type::ObjectType(type));
 }
 
 unsigned JSScript::id() {
     if (!id_) {
         id_ = ++compartment()->types.scriptCount;
         InferSpew(ISpewOps, "script #%u: %p %s:%d",
-                  id_, this, filename() ? filename() : "<null>", lineno);
+                  id_, this, filename() ? filename() : "<null>", lineno());
     }
     return id_;
 }
 
 void
 types::InferSpew(SpewChannel channel, const char *fmt, ...)
 {
     if (!InferSpewActive(channel))
@@ -956,17 +956,17 @@ types::FinishCompilation(JSContext *cx, 
 
         if (!CheckFrozenTypeSet(cx, entry.thisTypes, types::TypeScript::ThisTypes(entry.script)))
             succeeded = false;
         unsigned nargs = entry.script->function() ? entry.script->function()->nargs : 0;
         for (size_t i = 0; i < nargs; i++) {
             if (!CheckFrozenTypeSet(cx, &entry.argTypes[i], types::TypeScript::ArgTypes(entry.script, i)))
                 succeeded = false;
         }
-        for (size_t i = 0; i < entry.script->nTypeSets; i++) {
+        for (size_t i = 0; i < entry.script->nTypeSets(); i++) {
             if (!CheckFrozenTypeSet(cx, &entry.bytecodeTypes[i], &entry.script->types->typeArray()[i]))
                 succeeded = false;
         }
 
         // If necessary, add constraints to trigger invalidation on the script
         // after any future changes to the stack type sets.
         if (entry.script->hasFreezeConstraints)
             continue;
@@ -1949,17 +1949,17 @@ types::UseNewTypeForInitializer(JSScript
     unsigned offset = script->pcToOffset(pc);
 
     JSTryNote *tn = script->trynotes()->vector;
     JSTryNote *tnlimit = tn + script->trynotes()->length;
     for (; tn < tnlimit; tn++) {
         if (tn->kind != JSTRY_ITER && tn->kind != JSTRY_LOOP)
             continue;
 
-        unsigned startOffset = script->mainOffset + tn->start;
+        unsigned startOffset = script->mainOffset() + tn->start;
         unsigned endOffset = startOffset + tn->length;
 
         if (offset >= startOffset && offset < endOffset)
             return GenericObject;
     }
 
     return SingletonObject;
 }
@@ -2135,17 +2135,17 @@ TypeCompartment::addPendingRecompile(JSC
     }
 
     if (!pendingRecompiles->append(info)) {
         cx->compartment()->types.setPendingNukeTypes(cx);
         return;
     }
 
     InferSpew(ISpewOps, "addPendingRecompile: %p:%s:%d",
-              co->script(), co->script()->filename(), co->script()->lineno);
+              co->script(), co->script()->filename(), co->script()->lineno());
 
     co->setPendingInvalidation();
 }
 
 void
 TypeCompartment::addPendingRecompile(JSContext *cx, JSScript *script)
 {
     JS_ASSERT(script);
@@ -3434,18 +3434,18 @@ types::UseNewTypeForClone(JSFunction *fu
      * whenever creating a new instance of the function we both give that
      * instance a singleton type and clone the underlying script.
      */
 
     uint32_t begin, end;
     if (fun->hasScript()) {
         if (!fun->nonLazyScript()->usesArgumentsAndApply)
             return false;
-        begin = fun->nonLazyScript()->sourceStart;
-        end = fun->nonLazyScript()->sourceEnd;
+        begin = fun->nonLazyScript()->sourceStart();
+        end = fun->nonLazyScript()->sourceEnd();
     } else {
         if (!fun->lazyScript()->usesArgumentsAndApply())
             return false;
         begin = fun->lazyScript()->begin();
         end = fun->lazyScript()->end();
     }
 
     return end - begin <= 100;
@@ -3482,17 +3482,17 @@ JSScript::makeTypes(JSContext *cx)
     new(types) TypeScript();
 
     TypeSet *typeArray = types->typeArray();
 
     for (unsigned i = 0; i < count; i++)
         new (&typeArray[i]) StackTypeSet();
 
 #ifdef DEBUG
-    for (unsigned i = 0; i < nTypeSets; i++)
+    for (unsigned i = 0; i < nTypeSets(); i++)
         InferSpew(ISpewOps, "typeSet: %sT%p%s bytecode%u #%u",
                   InferSpewColor(&typeArray[i]), &typeArray[i], InferSpewColorReset(),
                   i, id());
     TypeSet *thisTypes = TypeScript::ThisTypes(this);
     InferSpew(ISpewOps, "typeSet: %sT%p%s this #%u",
               InferSpewColor(thisTypes), thisTypes, InferSpewColorReset(),
               id());
     unsigned nargs = function() ? function()->nargs : 0;
@@ -4371,17 +4371,17 @@ TypeScript::printTypes(JSContext *cx, Ha
     AutoEnterAnalysis enter(nullptr, script->compartment());
 
     if (script->function())
         fprintf(stderr, "Function");
     else if (script->isForEval())
         fprintf(stderr, "Eval");
     else
         fprintf(stderr, "Main");
-    fprintf(stderr, " #%u %s:%d ", script->id(), script->filename(), script->lineno);
+    fprintf(stderr, " #%u %s:%d ", script->id(), script->filename(), (int) script->lineno());
 
     if (script->function()) {
         if (js::PropertyName *name = script->function()->name()) {
             const jschar *chars = name->getChars(nullptr);
             JSString::dumpChars(chars, name->length());
         }
     }
 
--- a/js/src/jsinferinlines.h
+++ b/js/src/jsinferinlines.h
@@ -587,64 +587,64 @@ extern void TypeDynamicResult(JSContext 
 
 /////////////////////////////////////////////////////////////////////
 // Script interface functions
 /////////////////////////////////////////////////////////////////////
 
 /* static */ inline unsigned
 TypeScript::NumTypeSets(JSScript *script)
 {
-    return script->nTypeSets + analyze::LocalSlot(script, 0);
+    return script->nTypeSets() + analyze::LocalSlot(script, 0);
 }
 
 /* static */ inline StackTypeSet *
 TypeScript::ThisTypes(JSScript *script)
 {
-    return script->types->typeArray() + script->nTypeSets + js::analyze::ThisSlot();
+    return script->types->typeArray() + script->nTypeSets() + js::analyze::ThisSlot();
 }
 
 /*
  * Note: for non-escaping arguments and locals, argTypes/localTypes reflect
  * only the initial type of the variable (e.g. passed values for argTypes,
  * or undefined for localTypes) and not types from subsequent assignments.
  */
 
 /* static */ inline StackTypeSet *
 TypeScript::ArgTypes(JSScript *script, unsigned i)
 {
     JS_ASSERT(i < script->function()->nargs);
-    return script->types->typeArray() + script->nTypeSets + js::analyze::ArgSlot(i);
+    return script->types->typeArray() + script->nTypeSets() + js::analyze::ArgSlot(i);
 }
 
 template <typename TYPESET>
 /* static */ inline TYPESET *
 TypeScript::BytecodeTypes(JSScript *script, jsbytecode *pc, uint32_t *hint, TYPESET *typeArray)
 {
     JS_ASSERT(js_CodeSpec[*pc].format & JOF_TYPESET);
 #ifdef JS_ION
     uint32_t *bytecodeMap = script->baselineScript()->bytecodeTypeMap();
 #else
     uint32_t *bytecodeMap = nullptr;
     MOZ_CRASH();
 #endif
     uint32_t offset = script->pcToOffset(pc);
 
     // See if this pc is the next typeset opcode after the last one looked up.
-    if (bytecodeMap[*hint + 1] == offset && (*hint + 1) < script->nTypeSets) {
+    if (bytecodeMap[*hint + 1] == offset && (*hint + 1) < script->nTypeSets()) {
         (*hint)++;
         return typeArray + *hint;
     }
 
     // See if this pc is the same as the last one looked up.
     if (bytecodeMap[*hint] == offset)
         return typeArray + *hint;
 
     // Fall back to a binary search.
     size_t bottom = 0;
-    size_t top = script->nTypeSets - 1;
+    size_t top = script->nTypeSets() - 1;
     size_t mid = bottom + (top - bottom) / 2;
     while (mid < top) {
         if (bytecodeMap[mid] < offset)
             bottom = mid + 1;
         else if (bytecodeMap[mid] > offset)
             top = mid;
         else
             break;
@@ -660,17 +660,17 @@ TypeScript::BytecodeTypes(JSScript *scri
     return typeArray + *hint;
 }
 
 /* static */ inline StackTypeSet *
 TypeScript::BytecodeTypes(JSScript *script, jsbytecode *pc)
 {
     JS_ASSERT(CurrentThreadCanAccessRuntime(script->runtimeFromMainThread()));
 #ifdef JS_ION
-    uint32_t *hint = script->baselineScript()->bytecodeTypeMap() + script->nTypeSets;
+    uint32_t *hint = script->baselineScript()->bytecodeTypeMap() + script->nTypeSets();
 #else
     uint32_t *hint = nullptr;
     MOZ_CRASH();
 #endif
     return BytecodeTypes(script, pc, hint, script->types->typeArray());
 }
 
 struct AllocationSiteKey : public DefaultHasher<AllocationSiteKey> {
--- a/js/src/jsiter.cpp
+++ b/js/src/jsiter.cpp
@@ -1557,17 +1557,17 @@ js_NewGenerator(JSContext *cx, const Fra
     Value *stackvp = stackfp->generatorArgsSnapshotBegin();
     unsigned vplen = stackfp->generatorArgsSnapshotEnd() - stackvp;
 
     /* Compute JSGenerator size. */
     unsigned nbytes = sizeof(JSGenerator) +
                    (-1 + /* one Value included in JSGenerator */
                     vplen +
                     VALUES_PER_STACK_FRAME +
-                    stackfp->script()->nslots) * sizeof(HeapValue);
+                    stackfp->script()->nslots()) * sizeof(HeapValue);
 
     JS_ASSERT(nbytes % sizeof(Value) == 0);
     JS_STATIC_ASSERT(sizeof(StackFrame) % sizeof(HeapValue) == 0);
 
     JSGenerator *gen = (JSGenerator *) cx->calloc_(nbytes);
     if (!gen)
         return nullptr;
 
--- a/js/src/jsobj.cpp
+++ b/js/src/jsobj.cpp
@@ -5437,18 +5437,18 @@ dumpValue(const Value &v)
         if (fun->displayAtom()) {
             fputs("<function ", stderr);
             FileEscapedString(stderr, fun->displayAtom(), 0);
         } else {
             fputs("<unnamed function", stderr);
         }
         if (fun->hasScript()) {
             JSScript *script = fun->nonLazyScript();
-            fprintf(stderr, " (%s:%u)",
-                    script->filename() ? script->filename() : "", script->lineno);
+            fprintf(stderr, " (%s:%d)",
+                    script->filename() ? script->filename() : "", (int) script->lineno());
         }
         fprintf(stderr, " at %p>", (void *) fun);
     } else if (v.isObject()) {
         JSObject *obj = &v.toObject();
         const Class *clasp = obj->getClass();
         fprintf(stderr, "<%s%s at %p>",
                 clasp->name,
                 (clasp == &JSObject::class_) ? "" : " object",
@@ -5664,17 +5664,17 @@ js_DumpStackFrame(JSContext *cx, StackFr
             fprintf(stderr, "callee fun: ");
             dumpValue(i.calleev());
         } else {
             fprintf(stderr, "global frame, no callee");
         }
         fputc('\n', stderr);
 
         fprintf(stderr, "file %s line %u\n",
-                i.script()->filename(), (unsigned) i.script()->lineno);
+                i.script()->filename(), (unsigned) i.script()->lineno());
 
         if (jsbytecode *pc = i.pc()) {
             fprintf(stderr, "  pc = %p\n", pc);
             fprintf(stderr, "  current op: %s\n", js_CodeName[*pc]);
         }
         if (!i.isJit())
             MaybeDumpObject("blockChain", i.interpFrame()->maybeBlockChain());
         MaybeDumpValue("this", i.thisv());
--- a/js/src/jsopcode.cpp
+++ b/js/src/jsopcode.cpp
@@ -432,21 +432,21 @@ class BytecodeParser
     }
 
     void reportOOM() {
         allocScope_.releaseEarly();
         js_ReportOutOfMemory(cx_);
     }
 
     uint32_t numSlots() {
-        return 1 + (script_->function() ? script_->function()->nargs : 0) + script_->nfixed;
+        return 1 + (script_->function() ? script_->function()->nargs : 0) + script_->nfixed();
     }
 
     uint32_t maximumStackDepth() {
-        return script_->nslots - script_->nfixed;
+        return script_->nslots() - script_->nfixed();
     }
 
     Bytecode& getCode(uint32_t offset) {
         JS_ASSERT(offset < script_->length());
         JS_ASSERT(codeArray_[offset]);
         return *codeArray_[offset];
     }
     Bytecode& getCode(const jsbytecode *pc) { return getCode(script_->pcToOffset(pc)); }
@@ -635,17 +635,17 @@ BytecodeParser::parse()
           case JSOP_TRY: {
             // Everything between a try and corresponding catch or finally is conditional.
             // Note that there is no problem with code which is skipped by a thrown
             // exception but is not caught by a later handler in the same function:
             // no more code will execute, and it does not matter what is defined.
             JSTryNote *tn = script_->trynotes()->vector;
             JSTryNote *tnlimit = tn + script_->trynotes()->length;
             for (; tn < tnlimit; tn++) {
-                uint32_t startOffset = script_->mainOffset + tn->start;
+                uint32_t startOffset = script_->mainOffset() + tn->start;
                 if (startOffset == offset + 1) {
                     uint32_t catchOffset = startOffset + tn->length;
                     if (tn->kind != JSTRY_ITER && tn->kind != JSTRY_LOOP) {
                         if (!addJump(catchOffset, &nextOffset, stackDepth, offsetStack))
                             return false;
                     }
                 }
             }
@@ -725,17 +725,17 @@ js_DisassembleAtPC(JSContext *cx, JSScri
 
     jsbytecode *next, *end;
     unsigned len;
 
     if (showAll && !parser.parse())
         return false;
 
     if (showAll)
-        Sprint(sp, "%s:%u\n", script->filename(), script->lineno);
+        Sprint(sp, "%s:%u\n", script->filename(), script->lineno());
 
     if (pc != nullptr)
         sp->put("    ");
     if (showAll)
         sp->put("sn stack ");
     sp->put("loc   ");
     if (lines)
         sp->put("line");
@@ -1596,18 +1596,18 @@ ExpressionDecompiler::decompilePC(jsbyte
         unsigned slot = GET_ARGNO(pc);
         JSAtom *atom = getArg(slot);
         return write(atom);
       }
       case JSOP_GETLOCAL:
       case JSOP_CALLLOCAL: {
         unsigned i = GET_SLOTNO(pc);
         JSAtom *atom;
-        if (i >= script->nfixed) {
-            i -= script->nfixed;
+        if (i >= script->nfixed()) {
+            i -= script->nfixed();
             JS_ASSERT(i < unsigned(parser.stackDepthAtPC(pc)));
             atom = findLetVar(pc, i);
             if (!atom)
                 return decompilePCForStackOperand(pc, i); // Destructing temporary
         } else {
             atom = getVar(i);
         }
         JS_ASSERT(atom);
@@ -2114,17 +2114,17 @@ js::GetPCCountScriptSummary(JSContext *c
 
     AppendJSONProperty(buf, "file", NO_COMMA);
     JSString *str = JS_NewStringCopyZ(cx, script->filename());
     if (!str || !(str = StringToSource(cx, str)))
         return nullptr;
     buf.append(str);
 
     AppendJSONProperty(buf, "line");
-    NumberValueToStringBuffer(cx, Int32Value(script->lineno), buf);
+    NumberValueToStringBuffer(cx, Int32Value(script->lineno()), buf);
 
     if (script->function()) {
         JSAtom *atom = script->function()->displayAtom();
         if (atom) {
             AppendJSONProperty(buf, "name");
             if (!(str = StringToSource(cx, atom)))
                 return nullptr;
             buf.append(str);
@@ -2213,23 +2213,23 @@ GetPCCountJSON(JSContext *cx, const Scri
 
     JSString *str = JS_DecompileScript(cx, script, nullptr, 0);
     if (!str || !(str = StringToSource(cx, str)))
         return false;
 
     buf.append(str);
 
     AppendJSONProperty(buf, "line");
-    NumberValueToStringBuffer(cx, Int32Value(script->lineno), buf);
+    NumberValueToStringBuffer(cx, Int32Value(script->lineno()), buf);
 
     AppendJSONProperty(buf, "opcodes");
     buf.append('[');
     bool comma = false;
 
-    SrcNoteLineScanner scanner(script->notes(), script->lineno);
+    SrcNoteLineScanner scanner(script->notes(), script->lineno());
 
     for (jsbytecode *pc = script->code(); pc < script->codeEnd(); pc += GetBytecodeLength(pc)) {
         size_t offset = script->pcToOffset(pc);
 
         JSOp op = (JSOp) *pc;
 
         if (comma)
             buf.append(',');
--- a/js/src/jsscript.cpp
+++ b/js/src/jsscript.cpp
@@ -162,17 +162,17 @@ Bindings::switchToScriptStorage(Binding 
 bool
 Bindings::clone(JSContext *cx, InternalBindingsHandle self,
                 uint8_t *dstScriptData, HandleScript srcScript)
 {
     /* The clone has the same bindingArray_ offset as 'src'. */
     Bindings &src = srcScript->bindings;
     ptrdiff_t off = (uint8_t *)src.bindingArray() - srcScript->data;
     JS_ASSERT(off >= 0);
-    JS_ASSERT(size_t(off) <= srcScript->dataSize);
+    JS_ASSERT(size_t(off) <= srcScript->dataSize());
     Binding *dstPackedBindings = (Binding *)(dstScriptData + off);
 
     /*
      * Since atoms are shareable throughout the runtime, we can simply copy
      * the source's bindingArray directly.
      */
     if (!initWithTemporaryStorage(cx, self, src.numArgs(), src.numVars(), src.bindingArray()))
         return false;
@@ -448,39 +448,39 @@ js::XDRScript(XDRState<mode> *xdr, Handl
     }
 
     if (mode == XDR_ENCODE)
         length = script->length();
     if (!xdr->codeUint32(&length))
         return false;
 
     if (mode == XDR_ENCODE) {
-        prologLength = script->mainOffset;
+        prologLength = script->mainOffset();
         JS_ASSERT(script->getVersion() != JSVERSION_UNKNOWN);
-        version = (uint32_t)script->getVersion() | (script->nfixed << 16);
-        lineno = script->lineno;
-        nslots = (uint32_t)script->nslots;
-        nslots = (uint32_t)((script->staticLevel << 16) | script->nslots);
-        natoms = script->natoms;
+        version = (uint32_t)script->getVersion() | (script->nfixed() << 16);
+        lineno = script->lineno();
+        nslots = (uint32_t)script->nslots();
+        nslots = (uint32_t)((script->staticLevel() << 16) | script->nslots());
+        natoms = script->natoms();
 
         nsrcnotes = script->numNotes();
 
         if (script->hasConsts())
             nconsts = script->consts()->length;
         if (script->hasObjects())
             nobjects = script->objects()->length;
         if (script->hasRegexps())
             nregexps = script->regexps()->length;
         if (script->hasTrynotes())
             ntrynotes = script->trynotes()->length;
         if (script->hasBlockScopes())
             nblockscopes = script->blockScopes()->length;
 
-        nTypeSets = script->nTypeSets;
-        funLength = script->funLength;
+        nTypeSets = script->nTypeSets();
+        funLength = script->funLength();
 
         if (script->noScriptRval)
             scriptBits |= (1 << NoScriptRval);
         if (script->savedCallerFun)
             scriptBits |= (1 << SavedCallerFun);
         if (script->strict)
             scriptBits |= (1 << Strict);
         if (script->explicitUseStrict)
@@ -585,21 +585,21 @@ js::XDRScript(XDRState<mode> *xdr, Handl
 
     if (mode == XDR_DECODE) {
         if (!JSScript::partiallyInit(cx, script, nconsts, nobjects, nregexps, ntrynotes,
                                      nblockscopes, nTypeSets))
         {
             return false;
         }
 
-        JS_ASSERT(!script->mainOffset);
-        script->mainOffset = prologLength;
+        JS_ASSERT(!script->mainOffset());
+        script->mainOffset_ = prologLength;
         script->setLength(length);
-        script->nfixed = uint16_t(version >> 16);
-        script->funLength = funLength;
+        script->nfixed_ = uint16_t(version >> 16);
+        script->funLength_ = funLength;
 
         scriptp.set(script);
 
         if (scriptBits & (1 << Strict))
             script->strict = true;
         if (scriptBits & (1 << ExplicitUseStrict))
             script->explicitUseStrict = true;
         if (scriptBits & (1 << ContainsDynamicNameAccess))
@@ -626,39 +626,39 @@ js::XDRScript(XDRState<mode> *xdr, Handl
 
     JS_STATIC_ASSERT(sizeof(jsbytecode) == 1);
     JS_STATIC_ASSERT(sizeof(jssrcnote) == 1);
 
     if (scriptBits & (1 << OwnSource)) {
         if (!script->scriptSource()->performXDR<mode>(xdr))
             return false;
     }
-    if (!xdr->codeUint32(&script->sourceStart))
+    if (!xdr->codeUint32(&script->sourceStart_))
         return false;
-    if (!xdr->codeUint32(&script->sourceEnd))
+    if (!xdr->codeUint32(&script->sourceEnd_))
         return false;
 
     if (!xdr->codeUint32(&lineno) || !xdr->codeUint32(&nslots))
         return false;
 
     if (mode == XDR_DECODE) {
-        script->lineno = lineno;
-        script->nslots = uint16_t(nslots);
-        script->staticLevel = uint16_t(nslots >> 16);
+        script->lineno_ = lineno;
+        script->nslots_ = uint16_t(nslots);
+        script->staticLevel_ = uint16_t(nslots >> 16);
     }
 
     jsbytecode *code = script->code();
     SharedScriptData *ssd;
     if (mode == XDR_DECODE) {
         ssd = SharedScriptData::new_(cx, length, nsrcnotes, natoms);
         if (!ssd)
             return false;
         code = ssd->data;
         if (natoms != 0) {
-            script->natoms = natoms;
+            script->natoms_ = natoms;
             script->atoms = ssd->atoms();
         }
     }
 
     if (!xdr->codeBytes(code, length) || !xdr->codeBytes(code + length, nsrcnotes)) {
         if (mode == XDR_DECODE)
             js_free(ssd);
         return false;
@@ -1056,17 +1056,17 @@ JSScript::loadSource(JSContext *cx, Scri
     *worked = true;
     return true;
 }
 
 JSFlatString *
 JSScript::sourceData(JSContext *cx)
 {
     JS_ASSERT(scriptSource()->hasSourceData());
-    return scriptSource()->substring(cx, sourceStart, sourceEnd);
+    return scriptSource()->substring(cx, sourceStart(), sourceEnd());
 }
 
 SourceDataCache::AutoSuppressPurge::AutoSuppressPurge(JSContext *cx)
  : cache_(cx->runtime()->sourceDataCache)
 {
     oldValue_ = cache_.numSuppressPurges_++;
 }
 
@@ -1800,21 +1800,21 @@ JSScript::Create(ExclusiveContext *cx, H
     // never trigger.  Oh well.
     if (staticLevel > UINT16_MAX) {
         if (cx->isJSContext()) {
             JS_ReportErrorNumber(cx->asJSContext(),
                                  js_GetErrorMessage, nullptr, JSMSG_TOO_DEEP, js_function_str);
         }
         return nullptr;
     }
-    script->staticLevel = uint16_t(staticLevel);
+    script->staticLevel_ = uint16_t(staticLevel);
 
     script->setSourceObject(sourceObject);
-    script->sourceStart = bufStart;
-    script->sourceEnd = bufEnd;
+    script->sourceStart_ = bufStart;
+    script->sourceEnd_ = bufEnd;
 
     return script;
 }
 
 static inline uint8_t *
 AllocScriptData(ExclusiveContext *cx, size_t size)
 {
     uint8_t *data = static_cast<uint8_t *>(cx->calloc_(JS_ROUNDUP(size, sizeof(Value))));
@@ -1831,20 +1831,20 @@ JSScript::partiallyInit(ExclusiveContext
                         uint32_t nobjects, uint32_t nregexps, uint32_t ntrynotes,
                         uint32_t nblockscopes, uint32_t nTypeSets)
 {
     size_t size = ScriptDataSize(script->bindings.count(), nconsts, nobjects, nregexps, ntrynotes,
                                  nblockscopes);
     script->data = AllocScriptData(cx, size);
     if (!script->data)
         return false;
-    script->dataSize = size;
+    script->dataSize_ = size;
 
     JS_ASSERT(nTypeSets <= UINT16_MAX);
-    script->nTypeSets = uint16_t(nTypeSets);
+    script->nTypeSets_ = uint16_t(nTypeSets);
 
     uint8_t *cursor = script->data;
     if (nconsts != 0) {
         script->setHasArray(CONSTS);
         cursor += sizeof(ConstArray);
     }
     if (nobjects != 0) {
         script->setHasArray(OBJECTS);
@@ -1943,45 +1943,45 @@ JSScript::fullyInitFromEmitter(Exclusive
     uint32_t natoms = bce->atomIndices->count();
     if (!partiallyInit(cx, script,
                        bce->constList.length(), bce->objectList.length, bce->regexpList.length,
                        bce->tryNoteList.length(), bce->blockScopeList.length(), bce->typesetCount))
     {
         return false;
     }
 
-    JS_ASSERT(script->mainOffset == 0);
-    script->mainOffset = prologLength;
-
-    script->lineno = bce->firstLine;
+    JS_ASSERT(script->mainOffset() == 0);
+    script->mainOffset_ = prologLength;
+
+    script->lineno_ = bce->firstLine;
 
     script->setLength(prologLength + mainLength);
-    script->natoms = natoms;
+    script->natoms_ = natoms;
     SharedScriptData *ssd = SharedScriptData::new_(cx, script->length(), nsrcnotes, natoms);
     if (!ssd)
         return false;
 
     jsbytecode *code = ssd->data;
     PodCopy<jsbytecode>(code, bce->prolog.code.begin(), prologLength);
     PodCopy<jsbytecode>(code + prologLength, bce->code().begin(), mainLength);
     if (!FinishTakingSrcNotes(cx, bce, (jssrcnote *)(code + script->length())))
         return false;
     InitAtomMap(bce->atomIndices.getMap(), ssd->atoms());
 
     if (!SaveSharedScriptData(cx, script, ssd, nsrcnotes))
         return false;
 
     uint32_t nfixed = bce->sc->isFunctionBox() ? script->bindings.numVars() : 0;
     JS_ASSERT(nfixed < SLOTNO_LIMIT);
-    script->nfixed = uint16_t(nfixed);
-    if (script->nfixed + bce->maxStackDepth >= JS_BIT(16)) {
+    script->nfixed_ = uint16_t(nfixed);
+    if (script->nfixed() + bce->maxStackDepth >= JS_BIT(16)) {
         bce->reportError(nullptr, JSMSG_NEED_DIET, "script");
         return false;
     }
-    script->nslots = script->nfixed + bce->maxStackDepth;
+    script->nslots_ = script->nfixed() + bce->maxStackDepth;
 
     FunctionBox *funbox = bce->sc->isFunctionBox() ? bce->sc->asFunctionBox() : nullptr;
 
     if (bce->constList.length() != 0)
         bce->constList.finish(script->consts());
     if (bce->objectList.length != 0)
         bce->objectList.finish(script->objects());
     if (bce->regexpList.length != 0)
@@ -2002,17 +2002,17 @@ JSScript::fullyInitFromEmitter(Exclusive
             // This must precede the script->bindings.transfer() call below
             script->setArgumentsHasVarBinding();
             if (funbox->definitelyNeedsArgsObj())
                 script->setNeedsArgsObj(true);
         } else {
             JS_ASSERT(!funbox->definitelyNeedsArgsObj());
         }
 
-        script->funLength = funbox->length;
+        script->funLength_ = funbox->length;
     }
 
     RootedFunction fun(cx, nullptr);
     if (funbox) {
         JS_ASSERT(!bce->script->noScriptRval);
         script->isGeneratorExp = funbox->inGenexpLambda;
         script->setGeneratorKind(funbox->generatorKind());
         script->setFunction(funbox->function());
@@ -2026,17 +2026,17 @@ JSScript::fullyInitFromEmitter(Exclusive
     }
 
     return true;
 }
 
 size_t
 JSScript::computedSizeOfData() const
 {
-    return dataSize;
+    return dataSize();
 }
 
 size_t
 JSScript::sizeOfData(mozilla::MallocSizeOf mallocSizeOf) const
 {
     return mallocSizeOf(data);
 }
 
@@ -2094,17 +2094,17 @@ void
 js::CallNewScriptHook(JSContext *cx, HandleScript script, HandleFunction fun)
 {
     if (script->selfHosted)
         return;
 
     JS_ASSERT(!script->isActiveEval);
     if (JSNewScriptHook hook = cx->runtime()->debugHooks.newScriptHook) {
         AutoKeepAtoms keepAtoms(cx->perThreadData);
-        hook(cx, script->filename(), script->lineno, script, fun,
+        hook(cx, script->filename(), script->lineno(), script, fun,
              cx->runtime()->debugHooks.newScriptHookData);
     }
 }
 
 void
 js::CallDestroyScriptHook(FreeOp *fop, JSScript *script)
 {
     if (script->selfHosted)
@@ -2263,35 +2263,35 @@ js::PCToLineNumber(unsigned startLine, j
 
 unsigned
 js::PCToLineNumber(JSScript *script, jsbytecode *pc, unsigned *columnp)
 {
     /* Cope with StackFrame.pc value prior to entering js_Interpret. */
     if (!pc)
         return 0;
 
-    return PCToLineNumber(script->lineno, script->notes(), script->code(), pc, columnp);
+    return PCToLineNumber(script->lineno(), script->notes(), script->code(), pc, columnp);
 }
 
 /* The line number limit is the same as the jssrcnote offset limit. */
 #define SN_LINE_LIMIT   (SN_3BYTE_OFFSET_FLAG << 16)
 
 jsbytecode *
 js_LineNumberToPC(JSScript *script, unsigned target)
 {
     ptrdiff_t offset = 0;
     ptrdiff_t best = -1;
-    unsigned lineno = script->lineno;
+    unsigned lineno = script->lineno();
     unsigned bestdiff = SN_LINE_LIMIT;
     for (jssrcnote *sn = script->notes(); !SN_IS_TERMINATOR(sn); sn = SN_NEXT(sn)) {
         /*
          * Exact-match only if offset is not in the prolog; otherwise use
          * nearest greater-or-equal line number match.
          */
-        if (lineno == target && offset >= ptrdiff_t(script->mainOffset))
+        if (lineno == target && offset >= ptrdiff_t(script->mainOffset()))
             goto out;
         if (lineno >= target) {
             unsigned diff = lineno - target;
             if (diff < bestdiff) {
                 bestdiff = diff;
                 best = offset;
             }
         }
@@ -2307,30 +2307,30 @@ js_LineNumberToPC(JSScript *script, unsi
         offset = best;
 out:
     return script->offsetToPC(offset);
 }
 
 JS_FRIEND_API(unsigned)
 js_GetScriptLineExtent(JSScript *script)
 {
-    unsigned lineno = script->lineno;
+    unsigned lineno = script->lineno();
     unsigned maxLineNo = lineno;
     for (jssrcnote *sn = script->notes(); !SN_IS_TERMINATOR(sn); sn = SN_NEXT(sn)) {
         SrcNoteType type = (SrcNoteType) SN_TYPE(sn);
         if (type == SRC_SETLINE)
             lineno = (unsigned) js_GetSrcNoteOffset(sn, 0);
         else if (type == SRC_NEWLINE)
             lineno++;
 
         if (maxLineNo < lineno)
             maxLineNo = lineno;
     }
 
-    return 1 + maxLineNo - script->lineno;
+    return 1 + maxLineNo - script->lineno();
 }
 
 void
 js::CurrentScriptFileLineOrigin(JSContext *cx, const char **file, unsigned *linenop,
                                 JSPrincipals **origin, LineOption opt)
 {
     if (opt == CALLED_FROM_JSOP_EVAL) {
         jsbytecode *pc = nullptr;
@@ -2380,17 +2380,17 @@ js::CloneScript(JSContext *cx, HandleObj
     uint32_t nconsts   = src->hasConsts()   ? src->consts()->length   : 0;
     uint32_t nobjects  = src->hasObjects()  ? src->objects()->length  : 0;
     uint32_t nregexps  = src->hasRegexps()  ? src->regexps()->length  : 0;
     uint32_t ntrynotes = src->hasTrynotes() ? src->trynotes()->length : 0;
     uint32_t nblockscopes = src->hasBlockScopes() ? src->blockScopes()->length : 0;
 
     /* Script data */
 
-    size_t size = src->dataSize;
+    size_t size = src->dataSize();
     uint8_t *data = AllocScriptData(cx, size);
     if (!data)
         return nullptr;
 
     /* Bindings */
 
     Rooted<Bindings> bindings(cx);
     InternalHandle<Bindings*> bindingsHandle =
@@ -2474,42 +2474,42 @@ js::CloneScript(JSContext *cx, HandleObj
     options.setPrincipals(cx->compartment()->principals)
            .setOriginPrincipals(src->originPrincipals())
            .setCompileAndGo(src->compileAndGo)
            .setSelfHostingMode(src->selfHosted)
            .setNoScriptRval(src->noScriptRval)
            .setVersion(src->getVersion());
 
     RootedScript dst(cx, JSScript::Create(cx, enclosingScope, src->savedCallerFun,
-                                          options, src->staticLevel,
-                                          sourceObject, src->sourceStart, src->sourceEnd));
+                                          options, src->staticLevel(),
+                                          sourceObject, src->sourceStart(), src->sourceEnd()));
     if (!dst) {
         js_free(data);
         return nullptr;
     }
 
     dst->bindings = bindings;
 
     /* This assignment must occur before all the Rebase calls. */
     dst->data = data;
-    dst->dataSize = size;
+    dst->dataSize_ = size;
     memcpy(data, src->data, size);
 
     /* Script filenames, bytecodes and atoms are runtime-wide. */
     dst->setCode(src->code());
     dst->atoms = src->atoms;
 
     dst->setLength(src->length());
-    dst->lineno = src->lineno;
-    dst->mainOffset = src->mainOffset;
-    dst->natoms = src->natoms;
-    dst->funLength = src->funLength;
-    dst->nfixed = src->nfixed;
-    dst->nTypeSets = src->nTypeSets;
-    dst->nslots = src->nslots;
+    dst->lineno_ = src->lineno();
+    dst->mainOffset_ = src->mainOffset();
+    dst->natoms_ = src->natoms();
+    dst->funLength_ = src->funLength();
+    dst->nfixed_ = src->nfixed();
+    dst->nTypeSets_ = src->nTypeSets();
+    dst->nslots_ = src->nslots();
     if (src->argumentsHasVarBinding()) {
         dst->setArgumentsHasVarBinding();
         if (src->analyzedArgsUsage())
             dst->setNeedsArgsObj(src->needsArgsObj());
     }
     dst->cloneHasArray(src);
     dst->strict = src->strict;
     dst->explicitUseStrict = src->explicitUseStrict;
@@ -2805,17 +2805,17 @@ JSScript::markChildren(JSTracer *trc)
 {
     // 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
     // fullyInitFromEmitter() or fullyInitTrivial().
 
     JS_ASSERT_IF(trc->runtime->gcStrictCompartmentChecking, zone()->isCollecting());
 
-    for (uint32_t i = 0; i < natoms; ++i) {
+    for (uint32_t i = 0; i < natoms(); ++i) {
         if (atoms[i])
             MarkString(trc, &atoms[i], "atom");
     }
 
     if (hasObjects()) {
         ObjectArray *objarray = objects();
         MarkObjectRange(trc, objarray->length, objarray->vector, "objects");
     }
@@ -3113,17 +3113,17 @@ LazyScript::Create(ExclusiveContext *cx,
                                 begin, end, lineno, column);
 }
 
 uint32_t
 LazyScript::staticLevel(JSContext *cx) const
 {
     for (StaticScopeIter<NoGC> ssi(enclosingScope()); !ssi.done(); ssi++) {
         if (ssi.type() == StaticScopeIter<NoGC>::FUNCTION)
-            return ssi.funScript()->staticLevel + 1;
+            return ssi.funScript()->staticLevel() + 1;
     }
     return 1;
 }
 
 void
 JSScript::updateBaselineOrIonRaw()
 {
 #ifdef JS_ION
@@ -3173,17 +3173,17 @@ LazyScriptHashPolicy::hash(const Lookup 
 {
     LazyScript *lazy = lookup.lazy;
     LazyScriptHash(lazy->lineno(), lazy->column(), lazy->begin(), lazy->end(), hashes);
 }
 
 void
 LazyScriptHashPolicy::hash(JSScript *script, HashNumber hashes[3])
 {
-    LazyScriptHash(script->lineno, script->column, script->sourceStart, script->sourceEnd, hashes);
+    LazyScriptHash(script->lineno(), script->column(), script->sourceStart(), script->sourceEnd(), hashes);
 }
 
 bool
 LazyScriptHashPolicy::match(JSScript *script, const Lookup &lookup)
 {
     JSContext *cx = lookup.cx;
     LazyScript *lazy = lookup.lazy;
 
@@ -3194,31 +3194,31 @@ LazyScriptHashPolicy::match(JSScript *sc
     // While the surrounding code in the source may differ, this is
     // sufficient to ensure that compiling the lazy script will yield an
     // identical result to compiling the original script.
     //
     // Note that the filenames and origin principals of the lazy script and
     // original script can differ. If there is a match, these will be fixed
     // up in the resulting clone by the caller.
 
-    if (script->lineno != lazy->lineno() ||
-        script->column != lazy->column() ||
+    if (script->lineno() != lazy->lineno() ||
+        script->column() != lazy->column() ||
         script->getVersion() != lazy->version() ||
-        script->sourceStart != lazy->begin() ||
-        script->sourceEnd != lazy->end())
+        script->sourceStart() != lazy->begin() ||
+        script->sourceEnd() != lazy->end())
     {
         return false;
     }
 
     SourceDataCache::AutoSuppressPurge asp(cx);
 
     const jschar *scriptChars = script->scriptSource()->chars(cx, asp);
     if (!scriptChars)
         return false;
 
     const jschar *lazyChars = lazy->source()->chars(cx, asp);
     if (!lazyChars)
         return false;
 
-    size_t begin = script->sourceStart;
-    size_t length = script->sourceEnd - begin;
+    size_t begin = script->sourceStart();
+    size_t length = script->sourceEnd() - begin;
     return !memcmp(scriptChars + begin, lazyChars + begin, length);
 }
--- a/js/src/jsscript.h
+++ b/js/src/jsscript.h
@@ -482,23 +482,47 @@ GeneratorKindAsBits(GeneratorKind genera
 }
 
 static inline GeneratorKind
 GeneratorKindFromBits(unsigned val) {
     JS_ASSERT(val <= StarGenerator);
     return static_cast<GeneratorKind>(val);
 }
 
+/*
+ * NB: after a successful XDR_DECODE, XDRScript callers must do any required
+ * subsequent set-up of owning function or script object and then call
+ * js_CallNewScriptHook.
+ */
+template<XDRMode mode>
+bool
+XDRScript(XDRState<mode> *xdr, HandleObject enclosingScope, HandleScript enclosingScript,
+          HandleFunction fun, MutableHandleScript scriptp);
+
+JSScript *
+CloneScript(JSContext *cx, HandleObject enclosingScope, HandleFunction fun, HandleScript script,
+            NewObjectKind newKind = GenericObject);
+
 } /* namespace js */
 
 class JSScript : public js::gc::BarrieredCell<JSScript>
 {
     static const uint32_t stepFlagMask = 0x80000000U;
     static const uint32_t stepCountMask = 0x7fffffffU;
 
+    template <js::XDRMode mode>
+    friend
+    bool
+    js::XDRScript(js::XDRState<mode> *xdr, js::HandleObject enclosingScope, js::HandleScript enclosingScript,
+                  js::HandleFunction fun, js::MutableHandleScript scriptp);
+
+    friend JSScript *
+    js::CloneScript(JSContext *cx, js::HandleObject enclosingScope, js::HandleFunction fun, js::HandleScript src,
+                    js::NewObjectKind newKind);
+
   public:
     //
     // We order fields according to their size in order to avoid wasting space
     // for alignment.
     //
 
     // Larger-than-word-sized fields.
 
@@ -546,61 +570,56 @@ class JSScript : public js::gc::Barriere
      * nullptr if there's no Baseline or Ion script.
      */
     uint8_t *baselineOrIonRaw;
     uint8_t *baselineOrIonSkipArgCheck;
 
     // 32-bit fields.
 
     uint32_t        length_;    /* length of code vector */
-  public:
-    uint32_t        dataSize;   /* size of the used part of the data array */
+    uint32_t        dataSize_;  /* size of the used part of the data array */
 
-    uint32_t        lineno;     /* base line number of script */
-    uint32_t        column;     /* base column of script, optionally set */
+    uint32_t        lineno_;    /* base line number of script */
+    uint32_t        column_;    /* base column of script, optionally set */
 
-    uint32_t        mainOffset; /* offset of main entry point from code, after
+    uint32_t        mainOffset_;/* offset of main entry point from code, after
                                    predef'ing prolog */
 
-    uint32_t        natoms;     /* length of atoms array */
+    uint32_t        natoms_;    /* length of atoms array */
 
     /* Range of characters in scriptSource which contains this script's source. */
-    uint32_t        sourceStart;
-    uint32_t        sourceEnd;
+    uint32_t        sourceStart_;
+    uint32_t        sourceEnd_;
 
-  private:
     uint32_t        useCount;   /* Number of times the script has been called
                                  * or has had backedges taken. Reset if the
                                  * script's JIT code is forcibly discarded. */
 
 #ifdef DEBUG
     // Unique identifier within the compartment for this script, used for
     // printing analysis information.
     uint32_t        id_;
-  private:
     uint32_t        idpad;
 #endif
 
     // 16-bit fields.
 
-  private:
     uint16_t        PADDING16;
     uint16_t        version;    /* JS version under which script was compiled */
 
-  public:
-    uint16_t        funLength;  /* ES6 function length */
+    uint16_t        funLength_; /* ES6 function length */
 
-    uint16_t        nfixed;     /* number of slots besides stack operands in
+    uint16_t        nfixed_;    /* number of slots besides stack operands in
                                    slot array */
 
-    uint16_t        nTypeSets;  /* number of type sets used in this script for
+    uint16_t        nTypeSets_; /* number of type sets used in this script for
                                    dynamic type monitoring */
 
-    uint16_t        nslots;     /* vars plus maximum stack depth */
-    uint16_t        staticLevel;/* static level for display maintenance */
+    uint16_t        nslots_;    /* vars plus maximum stack depth */
+    uint16_t        staticLevel_;/* static level for display maintenance */
 
     // Bit fields.
 
   public:
     // The kinds of the optional arrays.
     enum ArrayKind {
         CONSTS,
         OBJECTS,
@@ -743,16 +762,68 @@ class JSScript : public js::gc::Barriere
         return size_t(pc - code());
     }
 
     jsbytecode *offsetToPC(size_t offset) const {
         JS_ASSERT(offset < length());
         return code() + offset;
     }
 
+    size_t mainOffset() const {
+        js::AutoThreadSafeAccess ts(this);
+        return mainOffset_;
+    }
+
+    size_t lineno() const {
+        js::AutoThreadSafeAccess ts(this);
+        return lineno_;
+    }
+
+    size_t column() const {
+        js::AutoThreadSafeAccess ts(this);
+        return column_;
+    }
+
+    void setColumn(size_t column) { column_ = column; }
+
+    size_t nfixed() const {
+        js::AutoThreadSafeAccess ts(this);
+        return nfixed_;
+    }
+
+    size_t nslots() const {
+        js::AutoThreadSafeAccess ts(this);
+        return nslots_;
+    }
+
+    size_t staticLevel() const {
+        js::AutoThreadSafeAccess ts(this);
+        return staticLevel_;
+    }
+
+    size_t nTypeSets() const {
+        js::AutoThreadSafeAccess ts(this);
+        return nTypeSets_;
+    }
+
+    size_t funLength() const {
+        js::AutoThreadSafeAccess ts(this);
+        return funLength_;
+    }
+
+    size_t sourceStart() const {
+        js::AutoThreadSafeAccess ts(this);
+        return sourceStart_;
+    }
+
+    size_t sourceEnd() const {
+        js::AutoThreadSafeAccess ts(this);
+        return sourceEnd_;
+    }
+
     /* See ContextFlags::funArgumentsHasLocalBinding comment. */
     bool argumentsHasVarBinding() const { return argsHasVarBinding_; }
     jsbytecode *argumentsBytecode() const { JS_ASSERT(code()[0] == JSOP_ARGUMENTS); return code(); }
     void setArgumentsHasVarBinding();
     bool argumentsAliasesFormals() const {
         return argumentsHasVarBinding() && !strict;
     }
 
@@ -968,17 +1039,17 @@ class JSScript : public js::gc::Barriere
     bool initScriptCounts(JSContext *cx);
     js::PCCounts getPCCounts(jsbytecode *pc);
     void addIonCounts(js::jit::IonScriptCounts *ionCounts);
     js::jit::IonScriptCounts *getIonCounts();
     js::ScriptCounts releaseScriptCounts();
     void destroyScriptCounts(js::FreeOp *fop);
 
     jsbytecode *main() {
-        return code() + mainOffset;
+        return code() + mainOffset();
     }
 
     /*
      * 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;
@@ -1003,16 +1074,18 @@ class JSScript : public js::gc::Barriere
     #define OFF(fooOff, hasFoo, t)   (fooOff() + (hasFoo() ? sizeof(t) : 0))
 
     size_t constsOffset()     { return 0; }
     size_t objectsOffset()    { return OFF(constsOffset,     hasConsts,     js::ConstArray);      }
     size_t regexpsOffset()    { return OFF(objectsOffset,    hasObjects,    js::ObjectArray);     }
     size_t trynotesOffset()   { return OFF(regexpsOffset,    hasRegexps,    js::ObjectArray);     }
     size_t blockScopesOffset(){ return OFF(trynotesOffset,   hasTrynotes,   js::TryNoteArray);    }
 
+    size_t dataSize() const { return dataSize_; }
+
     js::ConstArray *consts() {
         JS_ASSERT(hasConsts());
         return reinterpret_cast<js::ConstArray *>(data + constsOffset());
     }
 
     js::ObjectArray *objects() {
         JS_ASSERT(hasObjects());
         return reinterpret_cast<js::ObjectArray *>(data + objectsOffset());
@@ -1030,18 +1103,20 @@ class JSScript : public js::gc::Barriere
 
     js::BlockScopeArray *blockScopes() {
         JS_ASSERT(hasBlockScopes());
         return reinterpret_cast<js::BlockScopeArray *>(data + blockScopesOffset());
     }
 
     bool hasLoops();
 
+    size_t natoms() const { return natoms_; }
+
     js::HeapPtrAtom &getAtom(size_t index) const {
-        JS_ASSERT(index < natoms);
+        JS_ASSERT(index < natoms());
         return atoms[index];
     }
 
     js::HeapPtrAtom &getAtom(jsbytecode *pc) const {
         JS_ASSERT(containsPC(pc) && containsPC(pc + sizeof(uint32_t)));
         return getAtom(GET_UINT32_INDEX(pc));
     }
 
@@ -1558,20 +1633,16 @@ enum LineOption {
     CALLED_FROM_JSOP_EVAL,
     NOT_CALLED_FROM_JSOP_EVAL
 };
 
 extern void
 CurrentScriptFileLineOrigin(JSContext *cx, const char **file, unsigned *linenop,
                             JSPrincipals **origin, LineOption opt = NOT_CALLED_FROM_JSOP_EVAL);
 
-extern JSScript *
-CloneScript(JSContext *cx, HandleObject enclosingScope, HandleFunction fun, HandleScript script,
-            NewObjectKind newKind = GenericObject);
-
 bool
 CloneFunctionScript(JSContext *cx, HandleFunction original, HandleFunction clone,
                     NewObjectKind newKind = GenericObject);
 
 /*
  * JSAPI clients are allowed to leave CompileOptions.originPrincipals nullptr in
  * which case the JS engine sets options.originPrincipals = origin.principals.
  * This normalization step must occur before the originPrincipals get stored in
@@ -1579,21 +1650,11 @@ CloneFunctionScript(JSContext *cx, Handl
  */
 
 static inline JSPrincipals *
 NormalizeOriginPrincipals(JSPrincipals *principals, JSPrincipals *originPrincipals)
 {
     return originPrincipals ? originPrincipals : principals;
 }
 
-/*
- * NB: after a successful XDR_DECODE, XDRScript callers must do any required
- * subsequent set-up of owning function or script object and then call
- * js_CallNewScriptHook.
- */
-template<XDRMode mode>
-bool
-XDRScript(XDRState<mode> *xdr, HandleObject enclosingScope, HandleScript enclosingScript,
-          HandleFunction fun, MutableHandleScript scriptp);
-
 } /* namespace js */
 
 #endif /* jsscript_h */
--- a/js/src/shell/js.cpp
+++ b/js/src/shell/js.cpp
@@ -1517,17 +1517,17 @@ TrapHandler(JSContext *cx, JSScript *, j
 
     size_t length;
     const jschar *chars = JS_GetStringCharsAndLength(cx, str, &length);
     if (!chars)
         return JSTRAP_ERROR;
 
     if (!frame.evaluateUCInStackFrame(cx, chars, length,
                                       script->filename(),
-                                      script->lineno,
+                                      script->lineno(),
                                       &rval))
     {
         *rvalArg = rval;
         return JSTRAP_ERROR;
     }
     *rvalArg = rval;
     if (!rval.isUndefined())
         return JSTRAP_RETURN;
@@ -1701,17 +1701,17 @@ static void
 SrcNotes(JSContext *cx, HandleScript script, Sprinter *sp)
 {
     Sprint(sp, "\nSource notes:\n");
     Sprint(sp, "%4s %4s %5s %6s %-8s %s\n",
            "ofs", "line", "pc", "delta", "desc", "args");
     Sprint(sp, "---- ---- ----- ------ -------- ------\n");
     unsigned offset = 0;
     unsigned colspan = 0;
-    unsigned lineno = script->lineno;
+    unsigned lineno = script->lineno();
     jssrcnote *notes = script->notes();
     unsigned switchTableEnd = 0, switchTableStart = 0;
     for (jssrcnote *sn = notes; !SN_IS_TERMINATOR(sn); sn = SN_NEXT(sn)) {
         unsigned delta = SN_DELTA(sn);
         offset += delta;
         SrcNoteType type = (SrcNoteType) SN_TYPE(sn);
         const char *name = js_SrcNoteSpec[type].name;
         Sprint(sp, "%3u: %4u %5u [%4u] %-8s", unsigned(sn - notes), lineno, offset, delta, name);
--- a/js/src/vm/Debugger.cpp
+++ b/js/src/vm/Debugger.cpp
@@ -2576,17 +2576,17 @@ class Debugger::ScriptQuery {
         JSCompartment *compartment = script->compartment();
         if (!compartments.has(compartment))
             return;
         if (urlCString.ptr()) {
             if (!script->filename() || strcmp(script->filename(), urlCString.ptr()) != 0)
                 return;
         }
         if (hasLine) {
-            if (line < script->lineno || script->lineno + js_GetScriptLineExtent(script) < line)
+            if (line < script->lineno() || script->lineno() + js_GetScriptLineExtent(script) < line)
                 return;
         }
         if (innermost) {
             /*
              * For 'innermost' queries, we don't place scripts in |vector| right
              * away; we may later find another script that is nested inside this
              * one. Instead, we record the innermost script we've found so far
              * for each compartment in innermostForCompartment, and only
@@ -2596,17 +2596,17 @@ class Debugger::ScriptQuery {
              * So: check this script against the innermost one we've found so
              * far (if any), as recorded in innermostForCompartment, and replace
              * that if it's better.
              */
             CompartmentToScriptMap::AddPtr p = innermostForCompartment.lookupForAdd(compartment);
             if (p) {
                 /* Is our newly found script deeper than the last one we found? */
                 JSScript *incumbent = p->value();
-                if (script->staticLevel > incumbent->staticLevel)
+                if (script->staticLevel() > incumbent->staticLevel())
                     p->value() = script;
             } else {
                 /*
                  * This is the first matching script we've encountered for this
                  * compartment, so it is thus the innermost such script.
                  */
                 if (!innermostForCompartment.add(p, compartment, script)) {
                     oom = true;
@@ -2879,17 +2879,17 @@ DebuggerScript_getUrl(JSContext *cx, uns
     }
     return true;
 }
 
 static bool
 DebuggerScript_getStartLine(JSContext *cx, unsigned argc, Value *vp)
 {
     THIS_DEBUGSCRIPT_SCRIPT(cx, argc, vp, "(get startLine)", args, obj, script);
-    args.rval().setNumber(script->lineno);
+    args.rval().setNumber(uint32_t(script->lineno()));
     return true;
 }
 
 static bool
 DebuggerScript_getLineCount(JSContext *cx, unsigned argc, Value *vp)
 {
     THIS_DEBUGSCRIPT_SCRIPT(cx, argc, vp, "(get lineCount)", args, obj, script);
 
@@ -2912,33 +2912,33 @@ DebuggerScript_getSource(JSContext *cx, 
     args.rval().setObject(*sourceObject);
     return true;
 }
 
 static bool
 DebuggerScript_getSourceStart(JSContext *cx, unsigned argc, Value *vp)
 {
     THIS_DEBUGSCRIPT_SCRIPT(cx, argc, vp, "(get sourceStart)", args, obj, script);
-    args.rval().setNumber(script->sourceStart);
+    args.rval().setNumber(uint32_t(script->sourceStart()));
     return true;
 }
 
 static bool
 DebuggerScript_getSourceLength(JSContext *cx, unsigned argc, Value *vp)
 {
     THIS_DEBUGSCRIPT_SCRIPT(cx, argc, vp, "(get sourceEnd)", args, obj, script);
-    args.rval().setNumber(script->sourceEnd - script->sourceStart);
+    args.rval().setNumber(uint32_t(script->sourceEnd() - script->sourceStart()));
     return true;
 }
 
 static bool
 DebuggerScript_getStaticLevel(JSContext *cx, unsigned argc, Value *vp)
 {
     THIS_DEBUGSCRIPT_SCRIPT(cx, argc, vp, "(get staticLevel)", args, obj, script);
-    args.rval().setNumber(uint32_t(script->staticLevel));
+    args.rval().setNumber(uint32_t(script->staticLevel()));
     return true;
 }
 
 static bool
 DebuggerScript_getSourceMapUrl(JSContext *cx, unsigned argc, Value *vp)
 {
     THIS_DEBUGSCRIPT_SCRIPT(cx, argc, vp, "(get sourceMapURL)", args, obj, script);
 
@@ -3032,17 +3032,17 @@ class BytecodeRangeWithPosition : privat
 {
   public:
     using BytecodeRange::empty;
     using BytecodeRange::frontPC;
     using BytecodeRange::frontOpcode;
     using BytecodeRange::frontOffset;
 
     BytecodeRangeWithPosition(JSContext *cx, JSScript *script)
-      : BytecodeRange(cx, script), lineno(script->lineno), column(0),
+      : BytecodeRange(cx, script), lineno(script->lineno()), column(0),
         sn(script->notes()), snpc(script->code())
     {
         if (!SN_IS_TERMINATOR(sn))
             snpc += SN_DELTA(sn);
         updatePosition();
         while (frontPC() != script->main())
             popFront();
     }
@@ -3197,17 +3197,17 @@ class FlowGraphSummary {
     bool populate(JSContext *cx, JSScript *script) {
         if (!entries_.growBy(script->length()))
             return false;
         unsigned mainOffset = script->pcToOffset(script->main());
         entries_[mainOffset] = Entry::createWithMultipleEdgesFromMultipleLines();
         for (size_t i = mainOffset + 1; i < script->length(); i++)
             entries_[i] = Entry::createWithNoEdges();
 
-        size_t prevLineno = script->lineno;
+        size_t prevLineno = script->lineno();
         size_t prevColumn = 0;
         JSOp prevOp = JSOP_NOP;
         for (BytecodeRangeWithPosition r(cx, script); !r.empty(); r.popFront()) {
             size_t lineno = r.frontLineNumber();
             size_t column = r.frontColumnNumber();
             JSOp op = r.frontOpcode();
 
             if (FlowsIntoNext(prevOp))
@@ -3577,17 +3577,17 @@ DebuggerScript_isInCatchScope(JSContext 
     size_t offset;
     if (!ScriptOffset(cx, script, args[0], &offset))
         return false;
 
     /*
      * Try note ranges are relative to the mainOffset of the script, so adjust
      * offset accordingly.
      */
-    offset -= script->mainOffset;
+    offset -= script->mainOffset();
 
     args.rval().setBoolean(false);
     if (script->hasTrynotes()) {
         JSTryNote* tnBegin = script->trynotes()->vector;
         JSTryNote* tnEnd = tnBegin + script->trynotes()->length;
         while (tnBegin != tnEnd) {
             if (tnBegin->start <= offset &&
                 offset <= tnBegin->start + tnBegin->length &&
--- a/js/src/vm/ForkJoin.cpp
+++ b/js/src/vm/ForkJoin.cpp
@@ -694,22 +694,22 @@ js::ParallelDo::enqueueInitialScript(Exe
     // to suspect any of its callees are not compiled, then we can
     // just skip the compilation step.
     RootedScript script(cx_, callee->getOrCreateScript(cx_));
     if (!script)
         return RedLight;
     if (script->hasParallelIonScript()) {
         if (!script->parallelIonScript()->hasUncompiledCallTarget()) {
             Spew(SpewOps, "Script %p:%s:%d already compiled, no uncompiled callees",
-                 script.get(), script->filename(), script->lineno);
+                 script.get(), script->filename(), script->lineno());
             return GreenLight;
         }
 
         Spew(SpewOps, "Script %p:%s:%d already compiled, may have uncompiled callees",
-             script.get(), script->filename(), script->lineno);
+             script.get(), script->filename(), script->lineno());
     }
 
     // Otherwise, add to the worklist of scripts to process.
     if (addToWorklist(script) == RedLight)
         return fatalError(status);
     return GreenLight;
 }
 
@@ -760,28 +760,28 @@ js::ParallelDo::compileForParallelExecut
                 if (previousUseCount < currentUseCount) {
                     worklistData_[i].useCount = currentUseCount;
                     worklistData_[i].stallCount = 0;
                     gatheringTypeInformation = true;
 
                     Spew(SpewCompile,
                          "Script %p:%s:%d has no baseline script, "
                          "but use count grew from %d to %d",
-                         script.get(), script->filename(), script->lineno,
+                         script.get(), script->filename(), script->lineno(),
                          previousUseCount, currentUseCount);
                 } else {
                     uint32_t stallCount = ++worklistData_[i].stallCount;
                     if (stallCount < stallThreshold) {
                         gatheringTypeInformation = true;
                     }
 
                     Spew(SpewCompile,
                          "Script %p:%s:%d has no baseline script, "
                          "and use count has %u stalls at %d",
-                         script.get(), script->filename(), script->lineno,
+                         script.get(), script->filename(), script->lineno(),
                          stallCount, previousUseCount);
                 }
                 continue;
             }
 
             if (!script->hasParallelIonScript()) {
                 // Script has not yet been compiled. Attempt to compile it.
                 SpewBeginCompile(script);
@@ -791,35 +791,35 @@ js::ParallelDo::compileForParallelExecut
                 switch (mstatus) {
                   case Method_Error:
                     return fatalError(status);
 
                   case Method_CantCompile:
                     Spew(SpewCompile,
                          "Script %p:%s:%d cannot be compiled, "
                          "falling back to sequential execution",
-                         script.get(), script->filename(), script->lineno);
+                         script.get(), script->filename(), script->lineno());
                     return sequentialExecution(true, status);
 
                   case Method_Skipped:
                     // A "skipped" result either means that we are compiling
                     // in parallel OR some other transient error occurred.
                     if (script->isParallelIonCompilingOffThread()) {
                         Spew(SpewCompile,
                              "Script %p:%s:%d compiling off-thread",
-                             script.get(), script->filename(), script->lineno);
+                             script.get(), script->filename(), script->lineno());
                         offMainThreadCompilationsInProgress = true;
                         continue;
                     }
                     return sequentialExecution(false, status);
 
                   case Method_Compiled:
                     Spew(SpewCompile,
                          "Script %p:%s:%d compiled",
-                         script.get(), script->filename(), script->lineno);
+                         script.get(), script->filename(), script->lineno());
                     JS_ASSERT(script->hasParallelIonScript());
                     break;
                 }
             }
 
             // At this point, either the script was already compiled
             // or we just compiled it.  Check whether its "uncompiled
             // call target" flag is set and add the targets to our
@@ -858,17 +858,17 @@ js::ParallelDo::compileForParallelExecut
                 if (worklistData_[i].stallCount < stallThreshold) {
                     worklistData_[i].reset();
                     allScriptsPresent = false;
 
                     Spew(SpewCompile,
                          "Script %p:%s:%d is not stalled, "
                          "but no parallel ion script found, "
                          "restarting loop",
-                         script.get(), script->filename(), script->lineno);
+                         script.get(), script->filename(), script->lineno());
                 }
             }
         }
         if (allScriptsPresent)
             break;
     }
 
     Spew(SpewCompile, "Compilation complete (final worklist length %d)",
@@ -909,17 +909,17 @@ js::ParallelDo::appendCallTargetsToWorkl
 
     // Iterate through the callees and enqueue them.
     RootedScript target(cx_);
     IonScript *ion = worklist_[index]->parallelIonScript();
     for (uint32_t i = 0; i < ion->callTargetEntries(); i++) {
         target = ion->callTargetList()[i];
         parallel::Spew(parallel::SpewCompile,
                        "Adding call target %s:%u",
-                       target->filename(), target->lineno);
+                       target->filename(), target->lineno());
         if (appendCallTargetToWorklist(target, status) == RedLight)
             return RedLight;
     }
 
     return GreenLight;
 }
 
 js::ParallelDo::TrafficLight
@@ -929,48 +929,48 @@ js::ParallelDo::appendCallTargetToWorkli
     // GreenLight: call target appended if necessary
     // RedLight: fatal error or completed work via warmups or fallback
 
     JS_ASSERT(script);
 
     // Fallback to sequential if disabled.
     if (!script->canParallelIonCompile()) {
         Spew(SpewCompile, "Skipping %p:%s:%u, canParallelIonCompile() is false",
-             script.get(), script->filename(), script->lineno);
+             script.get(), script->filename(), script->lineno());
         return sequentialExecution(true, status);
     }
 
     if (script->hasParallelIonScript()) {
         // Skip if the code is expected to result in a bailout.
         if (script->parallelIonScript()->bailoutExpected()) {
             Spew(SpewCompile, "Skipping %p:%s:%u, bailout expected",
-                 script.get(), script->filename(), script->lineno);
+                 script.get(), script->filename(), script->lineno());
             return sequentialExecution(false, status);
         }
     }
 
     if (!addToWorklist(script))
         return fatalError(status);
 
     return GreenLight;
 }
 
 bool
 js::ParallelDo::addToWorklist(HandleScript script)
 {
     for (uint32_t i = 0; i < worklist_.length(); i++) {
         if (worklist_[i] == script) {
             Spew(SpewCompile, "Skipping %p:%s:%u, already in worklist",
-                 script.get(), script->filename(), script->lineno);
+                 script.get(), script->filename(), script->lineno());
             return true;
         }
     }
 
     Spew(SpewCompile, "Enqueued %p:%s:%u",
-         script.get(), script->filename(), script->lineno);
+         script.get(), script->filename(), script->lineno());
 
     // Note that we add all possibly compilable functions to the worklist,
     // even if they're already compiled. This is so that we can return
     // Method_Compiled and not Method_Skipped if we have a worklist full of
     // already-compiled functions.
     if (!worklist_.append(script))
         return false;
 
@@ -1110,17 +1110,17 @@ js::ParallelDo::invalidateBailedOutScrip
         // No script to invalidate.
         if (!script || !script->hasParallelIonScript())
             continue;
 
         Spew(SpewBailouts,
              "Bailout from thread %d: cause %d, topScript %p:%s:%d",
              i,
              bailoutRecords_[i].cause,
-             script.get(), script->filename(), script->lineno);
+             script.get(), script->filename(), script->lineno());
 
         switch (bailoutRecords_[i].cause) {
           // An interrupt is not the fault of the script, so don't
           // invalidate it.
           case ParallelBailoutInterrupt: continue;
 
           // An illegal write will not be made legal by invalidation.
           case ParallelBailoutIllegalWrite: continue;
@@ -1129,17 +1129,17 @@ js::ParallelDo::invalidateBailedOutScrip
           default: break;
         }
 
         // Already invalidated.
         if (hasScript(invalid, script))
             continue;
 
         Spew(SpewBailouts, "Invalidating script %p:%s:%d due to cause %d",
-             script.get(), script->filename(), script->lineno,
+             script.get(), script->filename(), script->lineno(),
              bailoutRecords_[i].cause);
 
         types::RecompileInfo co = script->parallelIonScript()->recompileInfo();
 
         if (!invalid.append(co))
             return false;
 
         // any script that we have marked for invalidation will need
@@ -2064,17 +2064,17 @@ class ParallelSpewer
 
         spew(SpewOps, "%s%sBAILOUT %d%s: %d at %s:%d:%d", bold(), yellow(), count, reset(), cause, filename, line, column);
     }
 
     void beginCompile(HandleScript script) {
         if (!active[SpewCompile])
             return;
 
-        spew(SpewCompile, "COMPILE %p:%s:%u", script.get(), script->filename(), script->lineno);
+        spew(SpewCompile, "COMPILE %p:%s:%u", script.get(), script->filename(), script->lineno());
         depth++;
     }
 
     void endCompile(MethodStatus status) {
         if (!active[SpewCompile])
             return;
 
         JS_ASSERT(depth > 0);
--- a/js/src/vm/Interpreter.cpp
+++ b/js/src/vm/Interpreter.cpp
@@ -1344,17 +1344,17 @@ Interpret(JSContext *cx, RunState &state
     RootedPropertyName rootName0(cx);
     RootedId rootId0(cx);
     RootedShape rootShape0(cx);
     RootedScript rootScript0(cx);
     DebugOnly<uint32_t> blockDepth;
 
     if (JS_UNLIKELY(REGS.fp()->isGeneratorFrame())) {
         JS_ASSERT(script->containsPC(REGS.pc));
-        JS_ASSERT(REGS.stackDepth() <= script->nslots);
+        JS_ASSERT(REGS.stackDepth() <= script->nslots());
 
         /*
          * To support generator_throw and to catch ignored exceptions,
          * fail if cx->isExceptionPending() is true.
          */
         if (cx->isExceptionPending()) {
             probes::EnterScript(cx, script, script->function(), REGS.fp());
             goto error;
@@ -3226,17 +3226,17 @@ CASE(JSOP_ENTERBLOCK)
 CASE(JSOP_ENTERLET0)
 CASE(JSOP_ENTERLET1)
 CASE(JSOP_ENTERLET2)
 {
     StaticBlockObject &blockObj = script->getObject(REGS.pc)->as<StaticBlockObject>();
 
     if (*REGS.pc == JSOP_ENTERBLOCK) {
         JS_ASSERT(REGS.stackDepth() == blockObj.stackDepth());
-        JS_ASSERT(REGS.stackDepth() + blockObj.slotCount() <= script->nslots);
+        JS_ASSERT(REGS.stackDepth() + blockObj.slotCount() <= script->nslots());
         Value *vp = REGS.sp + blockObj.slotCount();
         SetValueRangeToUndefined(REGS.sp, vp);
         REGS.sp = vp;
     }
 
     /* Clone block iff there are any closed-over variables. */
     if (!REGS.fp()->pushBlock(cx, blockObj))
         goto error;
@@ -3297,18 +3297,18 @@ CASE(JSOP_YIELD)
     REGS.fp()->setYielding();
     REGS.pc += JSOP_YIELD_LENGTH;
     interpReturnOK = true;
     goto exit;
 
 CASE(JSOP_ARRAYPUSH)
 {
     uint32_t slot = GET_UINT16(REGS.pc);
-    JS_ASSERT(script->nfixed <= slot);
-    JS_ASSERT(slot < script->nslots);
+    JS_ASSERT(script->nfixed() <= slot);
+    JS_ASSERT(slot < script->nslots());
     RootedObject &obj = rootObject0;
     obj = &REGS.fp()->unaliasedLocal(slot).toObject();
     if (!js_NewbornArrayPush(cx, obj, REGS.sp[-1]))
         goto error;
     REGS.sp--;
 }
 END_CASE(JSOP_ARRAYPUSH)
 
--- a/js/src/vm/OldDebugAPI.cpp
+++ b/js/src/vm/OldDebugAPI.cpp
@@ -405,17 +405,17 @@ JS_GetLinePCs(JSContext *cx, JSScript *s
         return false;
 
     jsbytecode **pcs = cx->pod_malloc<jsbytecode*>(len);
     if (!pcs) {
         js_free(lines);
         return false;
     }
 
-    unsigned lineno = script->lineno;
+    unsigned lineno = script->lineno();
     unsigned offset = 0;
     unsigned i = 0;
     for (jssrcnote *sn = script->notes(); !SN_IS_TERMINATOR(sn); sn = SN_NEXT(sn)) {
         offset += SN_DELTA(sn);
         SrcNoteType type = (SrcNoteType) SN_TYPE(sn);
         if (type == SRC_SETLINE || type == SRC_NEWLINE) {
             if (type == SRC_SETLINE)
                 lineno = (unsigned) js_GetSrcNoteOffset(sn, 0);
@@ -573,17 +573,17 @@ JS_GetScriptSourceMap(JSContext *cx, JSS
     ScriptSource *source = script->scriptSource();
     JS_ASSERT(source);
     return source->hasSourceMapURL() ? source->sourceMapURL() : nullptr;
 }
 
 JS_PUBLIC_API(unsigned)
 JS_GetScriptBaseLineNumber(JSContext *cx, JSScript *script)
 {
-    return script->lineno;
+    return script->lineno();
 }
 
 JS_PUBLIC_API(unsigned)
 JS_GetScriptLineExtent(JSContext *cx, JSScript *script)
 {
     return js_GetScriptLineExtent(script);
 }
 
@@ -832,37 +832,37 @@ JS_DumpBytecode(JSContext *cx, JSScript 
 {
 #if defined(DEBUG)
     Rooted<JSScript*> script(cx, scriptArg);
 
     Sprinter sprinter(cx);
     if (!sprinter.init())
         return;
 
-    fprintf(stdout, "--- SCRIPT %s:%d ---\n", script->filename(), script->lineno);
+    fprintf(stdout, "--- SCRIPT %s:%d ---\n", script->filename(), (int) script->lineno());
     js_Disassemble(cx, script, true, &sprinter);
     fputs(sprinter.string(), stdout);
-    fprintf(stdout, "--- END SCRIPT %s:%d ---\n", script->filename(), script->lineno);
+    fprintf(stdout, "--- END SCRIPT %s:%d ---\n", script->filename(), (int) script->lineno());
 #endif
 }
 
 extern JS_PUBLIC_API(void)
 JS_DumpPCCounts(JSContext *cx, JSScript *scriptArg)
 {
     Rooted<JSScript*> script(cx, scriptArg);
     JS_ASSERT(script->hasScriptCounts);
 
     Sprinter sprinter(cx);
     if (!sprinter.init())
         return;
 
-    fprintf(stdout, "--- SCRIPT %s:%d ---\n", script->filename(), script->lineno);
+    fprintf(stdout, "--- SCRIPT %s:%d ---\n", script->filename(), (int) script->lineno());
     js_DumpPCCounts(cx, script, &sprinter);
     fputs(sprinter.string(), stdout);
-    fprintf(stdout, "--- END SCRIPT %s:%d ---\n", script->filename(), script->lineno);
+    fprintf(stdout, "--- END SCRIPT %s:%d ---\n", script->filename(), (int) script->lineno());
 }
 
 namespace {
 
 typedef Vector<JSScript *, 0, SystemAllocPolicy> ScriptsToDump;
 
 static void
 DumpBytecodeScriptCallback(JSRuntime *rt, void *data, JSScript *script)
--- a/js/src/vm/Probes-inl.h
+++ b/js/src/vm/Probes-inl.h
@@ -84,31 +84,31 @@ probes::ExitScript(JSContext *cx, JSScri
 inline bool
 probes::StartExecution(JSScript *script)
 {
     bool ok = true;
 
 #ifdef INCLUDE_MOZILLA_DTRACE
     if (JAVASCRIPT_EXECUTE_START_ENABLED())
         JAVASCRIPT_EXECUTE_START((script->filename() ? (char *)script->filename() : nullName),
-                                 script->lineno);
+                                 script->lineno());
 #endif
 
     return ok;
 }
 
 inline bool
 probes::StopExecution(JSScript *script)
 {
     bool ok = true;
 
 #ifdef INCLUDE_MOZILLA_DTRACE
     if (JAVASCRIPT_EXECUTE_DONE_ENABLED())
         JAVASCRIPT_EXECUTE_DONE((script->filename() ? (char *)script->filename() : nullName),
-                                script->lineno);
+                                script->lineno());
 #endif
 
     return ok;
 }
 
 } /* namespace js */
  
 #endif /* vm_Probes_inl_h */
--- a/js/src/vm/SPSProfiler.cpp
+++ b/js/src/vm/SPSProfiler.cpp
@@ -223,17 +223,17 @@ SPSProfiler::allocProfileString(JSContex
     if (script->filename()) {
         if (!buf.appendInflated(script->filename(), strlen(script->filename())))
             return nullptr;
     } else if (!buf.append("<unknown>")) {
         return nullptr;
     }
     if (!buf.append(":"))
         return nullptr;
-    if (!NumberValueToStringBuffer(cx, NumberValue(script->lineno), buf))
+    if (!NumberValueToStringBuffer(cx, NumberValue(script->lineno()), buf))
         return nullptr;
     if (hasAtom && !buf.append(")"))
         return nullptr;
 
     size_t len = buf.length();
     char *cstr = js_pod_malloc<char>(len + 1);
     if (cstr == nullptr)
         return nullptr;
--- a/js/src/vm/ScopeObject.cpp
+++ b/js/src/vm/ScopeObject.cpp
@@ -605,32 +605,32 @@ ClonedBlockObject::create(JSContext *cx,
     obj->setReservedSlot(SCOPE_CHAIN_SLOT, ObjectValue(*frame.scopeChain()));
     obj->setReservedSlot(DEPTH_SLOT, PrivateUint32Value(block->stackDepth()));
 
     /*
      * Copy in the closed-over locals. Closed-over locals don't need
      * any fixup since the initial value is 'undefined'.
      */
     unsigned nslots = block->slotCount();
-    unsigned base = frame.script()->nfixed + block->stackDepth();
+    unsigned base = frame.script()->nfixed() + block->stackDepth();
     for (unsigned i = 0; i < nslots; ++i) {
         if (block->isAliased(i))
             obj->as<ClonedBlockObject>().setVar(i, frame.unaliasedLocal(base + i));
     }
 
     JS_ASSERT(obj->isDelegate());
 
     return &obj->as<ClonedBlockObject>();
 }
 
 void
 ClonedBlockObject::copyUnaliasedValues(AbstractFramePtr frame)
 {
     StaticBlockObject &block = staticBlock();
-    unsigned base = frame.script()->nfixed + block.stackDepth();
+    unsigned base = frame.script()->nfixed() + block.stackDepth();
     for (unsigned i = 0; i < slotCount(); ++i) {
         if (!block.isAliased(i))
             setVar(i, frame.unaliasedLocal(base + i), DONT_CHECK_ALIASING);
     }
 }
 
 StaticBlockObject *
 StaticBlockObject::create(ExclusiveContext *cx)
@@ -2236,24 +2236,24 @@ AnalyzeEntrainedVariablesInScript(JSCont
 
         buf.printf("Script ");
 
         if (JSAtom *name = script->function()->displayAtom()) {
             buf.putString(name);
             buf.printf(" ");
         }
 
-        buf.printf("(%s:%d) has variables entrained by ", script->filename(), script->lineno);
+        buf.printf("(%s:%d) has variables entrained by ", script->filename(), script->lineno());
 
         if (JSAtom *name = innerScript->function()->displayAtom()) {
             buf.putString(name);
             buf.printf(" ");
         }
 
-        buf.printf("(%s:%d) ::", innerScript->filename(), innerScript->lineno);
+        buf.printf("(%s:%d) ::", innerScript->filename(), innerScript->lineno());
 
         for (PropertyNameSet::Range r = remainingNames.all(); !r.empty(); r.popFront()) {
             buf.printf(" ");
             buf.putString(r.front());
         }
 
         printf("%s\n", buf.string());
     }
--- a/js/src/vm/Stack-inl.h
+++ b/js/src/vm/Stack-inl.h
@@ -90,24 +90,24 @@ StackFrame::initCallFrame(JSContext *cx,
     JS_ASSERT(!hasHookData());
 
     initVarsToUndefined();
 }
 
 inline void
 StackFrame::initVarsToUndefined()
 {
-    SetValueRangeToUndefined(slots(), script()->nfixed);
+    SetValueRangeToUndefined(slots(), script()->nfixed());
 }
 
 inline Value &
 StackFrame::unaliasedVar(unsigned i, MaybeCheckAliasing checkAliasing)
 {
     JS_ASSERT_IF(checkAliasing, !script()->varIsAliased(i));
-    JS_ASSERT(i < script()->nfixed);
+    JS_ASSERT(i < script()->nfixed());
     return slots()[i];
 }
 
 inline Value &
 StackFrame::unaliasedLocal(unsigned i, MaybeCheckAliasing checkAliasing)
 {
 #ifdef DEBUG
     CheckLocalUnaliased(checkAliasing, script(), maybeBlockChain(), i);
@@ -251,17 +251,17 @@ InterpreterStack::allocateFrame(JSContex
 JS_ALWAYS_INLINE StackFrame *
 InterpreterStack::getCallFrame(JSContext *cx, const CallArgs &args, HandleScript script,
                                StackFrame::Flags *flags, Value **pargv)
 {
     JSFunction *fun = &args.callee().as<JSFunction>();
 
     JS_ASSERT(fun->nonLazyScript() == script);
     unsigned nformal = fun->nargs;
-    unsigned nvals = script->nslots;
+    unsigned nvals = script->nslots();
 
     if (args.length() >= nformal) {
         *pargv = args.array();
         uint8_t *buffer = allocateFrame(cx, sizeof(StackFrame) + nvals * sizeof(Value));
         return reinterpret_cast<StackFrame *>(buffer);
     }
 
     // Pad any missing arguments with |undefined|.
--- a/js/src/vm/Stack.cpp
+++ b/js/src/vm/Stack.cpp
@@ -94,17 +94,17 @@ StackFrame::initExecuteFrame(JSContext *
 
 template <StackFrame::TriggerPostBarriers doPostBarrier>
 void
 StackFrame::copyFrameAndValues(JSContext *cx, Value *vp, StackFrame *otherfp,
                                const Value *othervp, Value *othersp)
 {
     JS_ASSERT(othervp == otherfp->generatorArgsSnapshotBegin());
     JS_ASSERT(othersp >= otherfp->slots());
-    JS_ASSERT(othersp <= otherfp->generatorSlotsSnapshotBegin() + otherfp->script()->nslots);
+    JS_ASSERT(othersp <= otherfp->generatorSlotsSnapshotBegin() + otherfp->script()->nslots());
 
     /* Copy args, StackFrame, and slots. */
     const Value *srcend = otherfp->generatorArgsSnapshotEnd();
     Value *dst = vp;
     for (const Value *src = othervp; src < srcend; src++, dst++) {
         *dst = *src;
         if (doPostBarrier)
             HeapValue::writeBarrierPost(*dst, dst);
@@ -174,20 +174,20 @@ StackFrame::maybeSuspendedGenerator(JSRu
     JSGenerator *gen = reinterpret_cast<JSGenerator *>(p);
     JS_ASSERT(gen->fp == this);
     return gen;
 }
 
 bool
 StackFrame::copyRawFrameSlots(AutoValueVector *vec)
 {
-    if (!vec->resize(numFormalArgs() + script()->nfixed))
+    if (!vec->resize(numFormalArgs() + script()->nfixed()))
         return false;
     PodCopy(vec->begin(), argv(), numFormalArgs());
-    PodCopy(vec->begin() + numFormalArgs(), slots(), script()->nfixed);
+    PodCopy(vec->begin() + numFormalArgs(), slots(), script()->nfixed());
     return true;
 }
 
 JSObject *
 StackFrame::createRestParameter(JSContext *cx)
 {
     JS_ASSERT(fun()->hasRest());
     unsigned nformal = fun()->nargs - 1, nactual = numActualArgs();
@@ -492,17 +492,17 @@ InterpreterStack::pushInvokeFrame(JSCont
 
 StackFrame *
 InterpreterStack::pushExecuteFrame(JSContext *cx, HandleScript script, const Value &thisv,
                                    HandleObject scopeChain, ExecuteType type,
                                    AbstractFramePtr evalInFrame)
 {
     LifoAlloc::Mark mark = allocator_.mark();
 
-    unsigned nvars = 2 /* callee, this */ + script->nslots;
+    unsigned nvars = 2 /* callee, this */ + script->nslots();
     uint8_t *buffer = allocateFrame(cx, sizeof(StackFrame) + nvars * sizeof(Value));
     if (!buffer)
         return nullptr;
 
     StackFrame *fp = reinterpret_cast<StackFrame *>(buffer + 2 * sizeof(Value));
     fp->mark_ = mark;
     fp->initExecuteFrame(cx, script, evalInFrame, thisv, *scopeChain, type);
     fp->initVarsToUndefined();
@@ -1201,19 +1201,19 @@ size_t
 ScriptFrameIter::numFrameSlots() const
 {
     switch (data_.state_) {
       case DONE:
         break;
      case JIT: {
 #ifdef JS_ION
         if (data_.ionFrames_.isOptimizedJS())
-            return ionInlineFrames_.snapshotIterator().slots() - ionInlineFrames_.script()->nfixed;
+            return ionInlineFrames_.snapshotIterator().slots() - ionInlineFrames_.script()->nfixed();
         jit::BaselineFrame *frame = data_.ionFrames_.baselineFrame();
-        return frame->numValueSlots() - data_.ionFrames_.script()->nfixed;
+        return frame->numValueSlots() - data_.ionFrames_.script()->nfixed();
 #else
         break;
 #endif
       }
       case SCRIPTED:
         JS_ASSERT(data_.interpFrames_.sp() >= interpFrame()->base());
         return data_.interpFrames_.sp() - interpFrame()->base();
     }
@@ -1225,21 +1225,21 @@ ScriptFrameIter::frameSlotValue(size_t i
 {
     switch (data_.state_) {
       case DONE:
         break;
       case JIT:
 #ifdef JS_ION
         if (data_.ionFrames_.isOptimizedJS()) {
             jit::SnapshotIterator si(ionInlineFrames_.snapshotIterator());
-            index += ionInlineFrames_.script()->nfixed;
+            index += ionInlineFrames_.script()->nfixed();
             return si.maybeReadSlotByIndex(index);
         }
 
-        index += data_.ionFrames_.script()->nfixed;
+        index += data_.ionFrames_.script()->nfixed();
         return *data_.ionFrames_.baselineFrame()->valueSlot(index);
 #else
         break;
 #endif
       case SCRIPTED:
           return interpFrame()->base()[index];
     }
     MOZ_ASSUME_UNREACHABLE("Unexpected state");
@@ -1285,21 +1285,21 @@ AbstractFramePtr::hasPushedSPSFrame() co
 #ifdef DEBUG
 void
 js::CheckLocalUnaliased(MaybeCheckAliasing checkAliasing, JSScript *script,
                         StaticBlockObject *maybeBlock, unsigned i)
 {
     if (!checkAliasing)
         return;
 
-    JS_ASSERT(i < script->nslots);
-    if (i < script->nfixed) {
+    JS_ASSERT(i < script->nslots());
+    if (i < script->nfixed()) {
         JS_ASSERT(!script->varIsAliased(i));
     } else {
-        unsigned depth = i - script->nfixed;
+        unsigned depth = i - script->nfixed();
         for (StaticBlockObject *b = maybeBlock; b; b = b->enclosingBlock()) {
             if (b->containsVarAtDepth(depth)) {
                 JS_ASSERT(!b->isAliased(depth - b->stackDepth()));
                 break;
             }
         }
     }
 }
--- a/js/src/vm/Stack.h
+++ b/js/src/vm/Stack.h
@@ -375,17 +375,17 @@ class StackFrame
      * These utilities provide raw access to the values associated with a
      * StackFrame (see "VM stack layout" comment). The utilities are private
      * since they are not able to assert that only unaliased vars/formals are
      * accessed. Normal code should prefer the StackFrame::unaliased* members
      * (or FrameRegs::stackDepth for the usual "depth is at least" assertions).
      */
   public:
     Value *slots() const { return (Value *)(this + 1); }
-    Value *base() const { return slots() + script()->nfixed; }
+    Value *base() const { return slots() + script()->nfixed(); }
     Value *argv() const { return argv_; }
 
   private:
     friend class FrameRegs;
     friend class InterpreterStack;
     friend class ScriptFrameIter;
     friend class CallObject;
     friend class ClonedBlockObject;
@@ -478,17 +478,17 @@ class StackFrame
         return isEvalFrame() && script()->strict;
     }
 
     bool isNonStrictEvalFrame() const {
         return isEvalFrame() && !script()->strict;
     }
 
     bool isDirectEvalFrame() const {
-        return isEvalFrame() && script()->staticLevel > 0;
+        return isEvalFrame() && script()->staticLevel() > 0;
     }
 
     bool isNonStrictDirectEvalFrame() const {
         return isNonStrictEvalFrame() && isDirectEvalFrame();
     }
 
     /*
      * Previous frame
@@ -1016,17 +1016,17 @@ class FrameRegs
     StackFrame *fp() const { return fp_; }
 
     unsigned stackDepth() const {
         JS_ASSERT(sp >= fp_->base());
         return sp - fp_->base();
     }
 
     Value *spForStackDepth(unsigned depth) const {
-        JS_ASSERT(fp_->script()->nfixed + depth <= fp_->script()->nslots);
+        JS_ASSERT(fp_->script()->nfixed() + depth <= fp_->script()->nslots());
         return fp_->base() + depth;
     }
 
     /* For generators. */
     void rebaseFromTo(const FrameRegs &from, StackFrame &to) {
         fp_ = &to;
         sp = to.slots() + (from.sp - from.fp_->slots());
         pc = from.pc;
@@ -1036,17 +1036,17 @@ class FrameRegs
     void popInlineFrame() {
         pc = fp_->prevpc();
         sp = fp_->prevsp() - fp_->numActualArgs() - 1;
         fp_ = fp_->prev();
         JS_ASSERT(fp_);
     }
     void prepareToRun(StackFrame &fp, JSScript *script) {
         pc = script->code();
-        sp = fp.slots() + script->nfixed;
+        sp = fp.slots() + script->nfixed();
         fp_ = &fp;
     }
 
     void setToEndOfScript();
 
     MutableHandleValue stackHandleAt(int i) {
         return MutableHandleValue::fromMarkedLocation(&sp[i]);
     }