Bug 696261: Correct references to 'tempPool' in comments; it's now 'tempLifoAlloc'. r=cdleary
authorJim Blandy <jimb@mozilla.com>
Fri, 21 Oct 2011 16:53:30 -0700
changeset 79111 41f8fb72be221799fbd3ef3aa044eb57dd70cde2
parent 79110 107c941e27dced818c50b5e213a99f3cde5396eb
child 79112 cb50e96dbee0f90e7f48e50e7f169ec30ba82598
push id247
push usertim.taubert@gmx.de
push dateSat, 22 Oct 2011 19:08:15 +0000
treeherderfx-team@72bb20c484a2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscdleary
bugs696261
milestone10.0a1
Bug 696261: Correct references to 'tempPool' in comments; it's now 'tempLifoAlloc'. r=cdleary
js/src/frontend/BytecodeCompiler.cpp
js/src/frontend/BytecodeGenerator.h
js/src/frontend/Parser.cpp
js/src/frontend/Parser.h
js/src/frontend/TokenStream.h
js/src/jsfun.cpp
js/src/jsopcode.cpp
js/src/jsxdrapi.cpp
--- a/js/src/frontend/BytecodeCompiler.cpp
+++ b/js/src/frontend/BytecodeCompiler.cpp
@@ -420,17 +420,17 @@ BytecodeCompiler::compileFunctionBody(JS
     if (fn) {
         fn->pn_body = NULL;
         fn->pn_cookie.makeFree();
 
         uintN nargs = fun->nargs;
         if (nargs) {
             /*
              * NB: do not use AutoLocalNameArray because it will release space
-             * allocated from cx->tempPool by DefineArg.
+             * allocated from cx->tempLifoAlloc by DefineArg.
              */
             Vector<JSAtom *> names(cx);
             if (!funcg.bindings.getLocalNameArray(cx, &names)) {
                 fn = NULL;
             } else {
                 for (uintN i = 0; i < nargs; i++) {
                     if (!DefineArg(fn, names[i], i, &funcg)) {
                         fn = NULL;
--- a/js/src/frontend/BytecodeGenerator.h
+++ b/js/src/frontend/BytecodeGenerator.h
@@ -673,19 +673,20 @@ struct CodeGenerator : public TreeContex
     CodeGenerator(Parser *parser, uintN lineno);
     bool init(JSContext *cx, TreeContext::InitBehavior ib = USED_AS_CODE_GENERATOR);
 
     JSContext *context() {
         return parser->context;
     }
 
     /*
-     * Note that cgs are magic: they own the arena "top-of-stack" space above
-     * their tempMark points. This means that you cannot alloc from tempPool
-     * and save the pointer beyond the next CodeGenerator destructor call.
+     * Note that cgs are magic: they own the arena "top-of-stack" space
+     * above their tempMark points. This means that you cannot alloc from
+     * tempLifoAlloc and save the pointer beyond the next CodeGenerator
+     * destructor call.
      */
     ~CodeGenerator();
 
     /*
      * Adds a use of a variable that is statically known to exist on the
      * global object.
      *
      * The actual slot of the variable on the global object is not known
--- a/js/src/frontend/Parser.cpp
+++ b/js/src/frontend/Parser.cpp
@@ -171,20 +171,21 @@ Parser::setPrincipals(JSPrincipals *prin
 }
 
 ObjectBox *
 Parser::newObjectBox(JSObject *obj)
 {
     JS_ASSERT(obj);
 
     /*
-     * We use JSContext.tempPool to allocate parsed objects and place them on
-     * a list in this Parser to ensure GC safety. Thus the tempPool arenas
-     * containing the entries must be alive until we are done with scanning,
-     * parsing and code generation for the whole script or top-level function.
+     * We use JSContext.tempLifoAlloc to allocate parsed objects and place them
+     * on a list in this Parser to ensure GC safety. Thus the tempLifoAlloc
+     * arenas containing the entries must be alive until we are done with
+     * scanning, parsing and code generation for the whole script or top-level
+     * function.
      */
     ObjectBox *objbox = context->tempLifoAlloc().new_<ObjectBox>();
     if (!objbox) {
         js_ReportOutOfMemory(context);
         return NULL;
     }
     objbox->traceLink = traceListHead;
     traceListHead = objbox;
@@ -196,20 +197,21 @@ Parser::newObjectBox(JSObject *obj)
 
 FunctionBox *
 Parser::newFunctionBox(JSObject *obj, ParseNode *fn, TreeContext *tc)
 {
     JS_ASSERT(obj);
     JS_ASSERT(obj->isFunction());
 
     /*
-     * We use JSContext.tempPool to allocate parsed objects and place them on
-     * a list in this Parser to ensure GC safety. Thus the tempPool arenas
-     * containing the entries must be alive until we are done with scanning,
-     * parsing and code generation for the whole script or top-level function.
+     * We use JSContext.tempLifoAlloc to allocate parsed objects and place them
+     * on a list in this Parser to ensure GC safety. Thus the tempLifoAlloc
+     * arenas containing the entries must be alive until we are done with
+     * scanning, parsing and code generation for the whole script or top-level
+     * function.
      */
     FunctionBox *funbox = context->tempLifoAlloc().newPod<FunctionBox>();
     if (!funbox) {
         js_ReportOutOfMemory(context);
         return NULL;
     }
     funbox->traceLink = traceListHead;
     traceListHead = funbox;
--- a/js/src/frontend/Parser.h
+++ b/js/src/frontend/Parser.h
@@ -97,17 +97,17 @@ namespace js {
 
 enum FunctionSyntaxKind { Expression, Statement };
 
 struct Parser : private AutoGCRooter
 {
     JSContext           *const context; /* FIXME Bug 551291: use AutoGCRooter::context? */
     void                *tempFreeList[NUM_TEMP_FREELISTS];
     TokenStream         tokenStream;
-    void                *tempPoolMark;  /* initial JSContext.tempPool mark */
+    void                *tempPoolMark;  /* initial JSContext.tempLifoAlloc mark */
     JSPrincipals        *principals;    /* principals associated with source */
     StackFrame          *const callerFrame;  /* scripted caller frame for eval and dbgapi */
     JSObject            *const callerVarObj; /* callerFrame's varObj */
     ParseNodeAllocator  allocator;
     uint32              functionCount;  /* number of functions in current unit */
     ObjectBox           *traceListHead; /* list of parsed object for GC tracing */
     TreeContext         *tc;            /* innermost tree context (stack-allocated) */
 
@@ -120,20 +120,21 @@ struct Parser : private AutoGCRooter
     Parser(JSContext *cx, JSPrincipals *prin = NULL, StackFrame *cfp = NULL, bool fold = true);
     ~Parser();
 
     friend void AutoGCRooter::trace(JSTracer *trc);
     friend struct TreeContext;
     friend struct BytecodeCompiler;
 
     /*
-     * Initialize a parser. Parameters are passed on to init tokenStream.
-     * The compiler owns the arena pool "tops-of-stack" space above the current
-     * JSContext.tempPool mark. This means you cannot allocate from tempPool
-     * and save the pointer beyond the next Parser destructor invocation.
+     * Initialize a parser. Parameters are passed on to init tokenStream. The
+     * compiler owns the arena pool "tops-of-stack" space above the current
+     * JSContext.tempLifoAlloc mark. This means you cannot allocate from
+     * tempLifoAlloc and save the pointer beyond the next Parser destructor
+     * invocation.
      */
     bool init(const jschar *base, size_t length, const char *filename, uintN lineno,
               JSVersion version);
 
     void setPrincipals(JSPrincipals *prin);
 
     const char *getFilename() const { return tokenStream.getFilename(); }
     JSVersion versionWithFlags() const { return tokenStream.versionWithFlags(); }
@@ -145,17 +146,18 @@ struct Parser : private AutoGCRooter
      */
     ParseNode *parse(JSObject *chain);
 
 #if JS_HAS_XML_SUPPORT
     ParseNode *parseXMLText(JSObject *chain, bool allowList);
 #endif
 
     /*
-     * Allocate a new parsed object or function container from cx->tempPool.
+     * Allocate a new parsed object or function container from
+     * cx->tempLifoAlloc.
      */
     ObjectBox *newObjectBox(JSObject *obj);
 
     FunctionBox *newFunctionBox(JSObject *obj, ParseNode *fn, TreeContext *tc);
 
     /*
      * Create a new function object given tree context (tc) and a name (which
      * is optional if this is a function expression).
--- a/js/src/frontend/TokenStream.h
+++ b/js/src/frontend/TokenStream.h
@@ -379,17 +379,17 @@ class TokenStream
     typedef Vector<jschar, 32> CharBuffer;
 
     /*
      * To construct a TokenStream, first call the constructor, which is
      * infallible, then call |init|, which can fail. To destroy a TokenStream,
      * first call |close| then call the destructor. If |init| fails, do not call
      * |close|.
      *
-     * This class uses JSContext.tempPool to allocate internal buffers. The
+     * This class uses JSContext.tempLifoAlloc to allocate internal buffers. The
      * caller should JS_ARENA_MARK before calling |init| and JS_ARENA_RELEASE
      * after calling |close|.
      */
     TokenStream(JSContext *);
 
     /*
      * Create a new token stream from an input buffer.
      * Return false on memory-allocation failure.
--- a/js/src/jsfun.cpp
+++ b/js/src/jsfun.cpp
@@ -2176,18 +2176,18 @@ Function(JSContext *cx, uintN argc, Valu
         if (args_length < old_args_length ||
             args_length >= ~(size_t)0 / sizeof(jschar)) {
             js_ReportAllocationOverflow(cx);
             return false;
         }
 
         /*
          * Allocate a string to hold the concatenated arguments, including room
-         * for a terminating 0.  Mark cx->tempPool for later release, to free
-         * collected_args and its tokenstream in one swoop.
+         * for a terminating 0. Mark cx->tempLifeAlloc for later release, to
+         * free collected_args and its tokenstream in one swoop.
          */
         LifoAllocScope las(&cx->tempLifoAlloc());
         jschar *cp = cx->tempLifoAlloc().newArray<jschar>(args_length + 1);
         if (!cp) {
             js_ReportOutOfMemory(cx);
             return false;
         }
         jschar *collected_args = cp;
--- a/js/src/jsopcode.cpp
+++ b/js/src/jsopcode.cpp
@@ -4062,20 +4062,20 @@ Decompile(SprintStack *ss, jsbytecode *p
                     Vector<JSAtom *> *outerLocalNames;
                     JSScript *inner, *outer;
                     SprintStack ss2;
                     JSFunction *outerfun;
 
                     LOAD_FUNCTION(0);
 
                     /*
-                     * All allocation when decompiling is LIFO, using malloc
-                     * or, more commonly, arena-allocating from cx->tempPool.
-                     * Therefore after InitSprintStack succeeds, we must
-                     * release to mark before returning.
+                     * All allocation when decompiling is LIFO, using malloc or,
+                     * more commonly, arena-allocating from cx->tempLifoAlloc
+                     * Therefore after InitSprintStack succeeds, we must release
+                     * to mark before returning.
                      */
                     LifoAllocScope las(&cx->tempLifoAlloc());
                     if (fun->script()->bindings.hasLocalNames()) {
                         innerLocalNames = cx->new_<Vector<JSAtom *> >(cx);
                         if (!innerLocalNames ||
                             fun->script()->bindings.getLocalNameArray(cx, innerLocalNames))
                         {
                             return NULL;
@@ -4174,19 +4174,19 @@ Decompile(SprintStack *ss, jsbytecode *p
                          * JSOP_LAMBDA.
                          */
                         LOCAL_ASSERT(js_CodeSpec[JSOP_NAME].prec ==
                                      js_CodeSpec[saveop].prec);
                         saveop = JSOP_NAME;
                     }
 
                     /*
-                     * Alas, we have to malloc a copy of the result left on
-                     * the top of ss2 because both ss and ss2 arena-allocate
-                     * from cx's tempPool.
+                     * Alas, we have to malloc a copy of the result left on the
+                     * top of ss2 because both ss and ss2 arena-allocate from
+                     * cx's tempLifoAlloc
                      */
                     rval = JS_strdup(cx, PopStr(&ss2, op));
                     las.releaseEarly();
                     if (!rval)
                         return NULL;
                     todo = SprintCString(&ss->sprinter, rval);
                     cx->free_((void *)rval);
                     break;
--- a/js/src/jsxdrapi.cpp
+++ b/js/src/jsxdrapi.cpp
@@ -643,18 +643,19 @@ js_XDRAtom(JSXDRState *xdr, JSAtom **ato
     if (!JS_XDRUint32(xdr, &nchars))
         return JS_FALSE;
     atom = NULL;
     cx = xdr->cx;
     if (nchars <= ArrayLength(stackChars)) {
         chars = stackChars;
     } else {
         /*
-         * This is very uncommon. Don't use the tempPool arena for this as
-         * most allocations here will be bigger than tempPool's arenasize.
+         * This is very uncommon. Don't use the tempLifoAlloc arena for this as
+         * most allocations here will be bigger than tempLifoAlloc's default
+         * chunk size.
          */
         chars = (jschar *) cx->malloc_(nchars * sizeof(jschar));
         if (!chars)
             return JS_FALSE;
     }
 
     if (XDRChars(xdr, chars, nchars))
         atom = js_AtomizeChars(cx, chars, nchars);