Bug 899296 - Restore bytecode-level constant folding in lazily compiled functions. r=jorendorff.
authorBoris Zbarsky <bzbarsky@mit.edu>
Thu, 12 Sep 2013 11:08:21 -0500
changeset 146816 4473d84c6ab6e2190d92aab9fbe09c08117bd612
parent 146815 67a98b765933163049203aab43cefb5b722eb93a
child 146817 79d504af18f6ca2aed025ec1915f8efa4a1b8fa3
push id33706
push userjorendorff@mozilla.com
push dateThu, 12 Sep 2013 16:08:41 +0000
treeherdermozilla-inbound@4473d84c6ab6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjorendorff
bugs899296
milestone26.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 899296 - Restore bytecode-level constant folding in lazily compiled functions. r=jorendorff.
js/src/frontend/Parser.cpp
--- a/js/src/frontend/Parser.cpp
+++ b/js/src/frontend/Parser.cpp
@@ -2244,30 +2244,32 @@ Parser<FullParseHandler>::standaloneLazy
     if (!funpc.init(tokenStream))
         return null();
 
     if (!functionArgsAndBodyGeneric(pn, fun, Normal, Statement, &newDirectives)) {
         JS_ASSERT(directives == newDirectives);
         return null();
     }
 
-
     if (fun->isNamedLambda()) {
         if (AtomDefnPtr p = pc->lexdeps->lookup(fun->name())) {
             Definition *dn = p.value().get<FullParseHandler>();
             if (!ConvertDefinitionToNamedLambdaUse(tokenStream, pc, funbox, dn))
                 return NULL;
         }
     }
 
     InternalHandle<Bindings*> bindings =
         InternalHandle<Bindings*>::fromMarkedLocation(&funbox->bindings);
     if (!pc->generateFunctionBindings(context, alloc, bindings))
         return null();
 
+    if (!FoldConstants(context, &pn, this))
+        return null();
+
     return pn;
 }
 
 template <typename ParseHandler>
 bool
 Parser<ParseHandler>::functionArgsAndBodyGeneric(Node pn, HandleFunction fun, FunctionType type,
                                                  FunctionSyntaxKind kind,
                                                  Directives *newDirectives)