Bug 739512 - Patch 2b: rename nClosed{Args,Vars}() as numClosed{Args,Vars}(). r=luke.
authorNicholas Nethercote <nnethercote@mozilla.com>
Mon, 09 Apr 2012 16:37:16 -0700
changeset 94594 cd73b2ca1fcc334ae58ff41e368058835f180a36
parent 94593 81012bc3fa5dc90353893a52fc3ae017a7369732
child 94595 8e79f8755d6539b441b1e064d7b04dfabceae375
push id886
push userlsblakk@mozilla.com
push dateMon, 04 Jun 2012 19:57:52 +0000
treeherdermozilla-beta@bbd8d5efd6d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersluke
bugs739512
milestone14.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 739512 - Patch 2b: rename nClosed{Args,Vars}() as numClosed{Args,Vars}(). r=luke.
js/src/jsanalyze.cpp
js/src/jsscript.cpp
js/src/jsscript.h
js/src/vm/ScopeObject.cpp
--- a/js/src/jsanalyze.cpp
+++ b/js/src/jsanalyze.cpp
@@ -183,28 +183,28 @@ ScriptAnalysis::analyzeBytecode(JSContex
      */
 
     PodZero(escapedSlots, numSlots);
 
     if (script->usesEval || script->mayNeedArgsObj() || script->compartment()->debugMode()) {
         for (unsigned i = 0; i < nargs; i++)
             escapedSlots[ArgSlot(i)] = true;
     } else {
-        for (uint32_t i = 0; i < script->nClosedArgs(); i++) {
+        for (uint32_t i = 0; i < script->numClosedArgs(); i++) {
             unsigned arg = script->getClosedArg(i);
             JS_ASSERT(arg < nargs);
             escapedSlots[ArgSlot(arg)] = true;
         }
     }
 
     if (script->usesEval || script->compartment()->debugMode()) {
         for (unsigned i = 0; i < script->nfixed; i++)
             escapedSlots[LocalSlot(script, i)] = true;
     } else {
-        for (uint32_t i = 0; i < script->nClosedVars(); i++) {
+        for (uint32_t i = 0; i < script->numClosedVars(); i++) {
             unsigned local = script->getClosedVar(i);
             JS_ASSERT(local < script->nfixed);
             escapedSlots[LocalSlot(script, local)] = true;
         }
     }
 
     /*
      * If the script is in debug mode, JS_SetFrameReturnValue can be called at
@@ -213,23 +213,23 @@ ScriptAnalysis::analyzeBytecode(JSContex
     if (cx->compartment->debugMode())
         usesReturnValue_ = true;
 
     bool heavyweight = script->function() && script->function()->isHeavyweight();
 
     isCompileable = true;
 
     isInlineable = true;
-    if (script->nClosedArgs() || script->nClosedVars() || heavyweight ||
+    if (script->numClosedArgs() || script->numClosedVars() || heavyweight ||
         script->usesEval || script->mayNeedArgsObj() || cx->compartment->debugMode()) {
         isInlineable = false;
     }
 
     modifiesArguments_ = false;
-    if (script->nClosedArgs() || heavyweight)
+    if (script->numClosedArgs() || heavyweight)
         modifiesArguments_ = true;
 
     canTrackVars = true;
 
     /*
      * If we are in the middle of one or more jumps, the offset of the highest
      * target jumping over this bytecode.  Includes implicit jumps from
      * try/catch/finally blocks.
--- a/js/src/jsscript.cpp
+++ b/js/src/jsscript.cpp
@@ -536,18 +536,18 @@ js::XDRScript(XDRState<mode> *xdr, JSScr
             nconsts = script->consts()->length;
         if (JSScript::isValidOffset(script->objectsOffset))
             nobjects = script->objects()->length;
         if (JSScript::isValidOffset(script->regexpsOffset))
             nregexps = script->regexps()->length;
         if (JSScript::isValidOffset(script->trynotesOffset))
             ntrynotes = script->trynotes()->length;
         /* no globals when encoding;  see assertion above */
-        nClosedArgs = script->nClosedArgs();
-        nClosedVars = script->nClosedVars();
+        nClosedArgs = script->numClosedArgs();
+        nClosedVars = script->numClosedVars();
 
         nTypeSets = script->nTypeSets;
 
         if (script->noScriptRval)
             scriptBits |= (1 << NoScriptRval);
         if (script->savedCallerFun)
             scriptBits |= (1 << SavedCallerFun);
         if (script->strictModeCode)
--- a/js/src/jsscript.h
+++ b/js/src/jsscript.h
@@ -742,21 +742,21 @@ struct JSScript : public js::gc::Cell
         return reinterpret_cast<js::ClosedSlotArray *>(data + closedArgsOffset);
     }
 
     js::ClosedSlotArray *closedVars() {
         JS_ASSERT(isValidOffset(closedVarsOffset));
         return reinterpret_cast<js::ClosedSlotArray *>(data + closedVarsOffset);
     }
 
-    uint32_t nClosedArgs() {
+    uint32_t numClosedArgs() {
         return isValidOffset(closedArgsOffset) ? closedArgs()->length : 0;
     }
 
-    uint32_t nClosedVars() {
+    uint32_t numClosedVars() {
         return isValidOffset(closedVarsOffset) ? closedVars()->length : 0;
     }
 
     js::HeapPtrAtom &getAtom(size_t index) const {
         JS_ASSERT(index < natoms);
         return atoms[index];
     }
 
--- a/js/src/vm/ScopeObject.cpp
+++ b/js/src/vm/ScopeObject.cpp
@@ -94,27 +94,27 @@ js_PutCallObject(StackFrame *fp)
             } else {
                 /*
                  * For each arg & var that is closed over, copy it from the stack
                  * into the call object. We use initArg/VarUnchecked because,
                  * when you call a getter on a call object, js_NativeGetInline
                  * caches the return value in the slot, so we can't assert that
                  * it's undefined.
                  */
-                uint32_t nclosed = script->nClosedArgs();
+                uint32_t nclosed = script->numClosedArgs();
                 for (uint32_t i = 0; i < nclosed; i++) {
                     uint32_t e = script->getClosedArg(i);
 #ifdef JS_GC_ZEAL
                     callobj.setArg(e, fp->formalArg(e));
 #else
                     callobj.initArgUnchecked(e, fp->formalArg(e));
 #endif
                 }
 
-                nclosed = script->nClosedVars();
+                nclosed = script->numClosedVars();
                 for (uint32_t i = 0; i < nclosed; i++) {
                     uint32_t e = script->getClosedVar(i);
 #ifdef JS_GC_ZEAL
                     callobj.setVar(e, fp->slots()[e]);
 #else
                     callobj.initVarUnchecked(e, fp->slots()[e]);
 #endif
                 }