Bug 989204 - Followup: Fix --disable-optimize JS shell build. (r=jandem over IRC)
authorEric Faust <efaustbmo@gmail.com>
Fri, 04 Apr 2014 02:25:46 -0700
changeset 177086 44c63bf18e7404da845cefc442cd7b6e773bbd26
parent 177085 bd167d38965c44d36ea69b0171c74832b30b5334
child 177087 2855e25b83e43978f5fc6ab314bb83825fa70808
push id26541
push userryanvm@gmail.com
push dateFri, 04 Apr 2014 18:50:44 +0000
treeherdermozilla-central@2a069087bed1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs989204
milestone31.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 989204 - Followup: Fix --disable-optimize JS shell build. (r=jandem over IRC)
js/src/frontend/Parser.cpp
js/src/jsfun.cpp
--- a/js/src/frontend/Parser.cpp
+++ b/js/src/frontend/Parser.cpp
@@ -1252,19 +1252,19 @@ Parser<ParseHandler>::newFunction(Generi
         pc = pc->parent;
 
     RootedFunction fun(context);
     JSFunction::Flags flags = (kind == Expression)
                               ? JSFunction::INTERPRETED_LAMBDA
                               : (kind == Arrow)
                                 ? JSFunction::INTERPRETED_LAMBDA_ARROW
                                 : JSFunction::INTERPRETED;
-    gc::AllocKind allocKind = (kind == Arrow)
-                              ? JSFunction::ExtendedFinalizeKind
-                              : JSFunction::FinalizeKind;
+    gc::AllocKind allocKind = JSFunction::FinalizeKind;
+    if (kind == Arrow)
+        allocKind = JSFunction::ExtendedFinalizeKind;
     fun = NewFunctionWithProto(context, NullPtr(), nullptr, 0, flags, NullPtr(), atom, proto,
                                allocKind, MaybeSingletonObject);
     if (!fun)
         return nullptr;
     if (options().selfHostingMode)
         fun->setIsSelfHostedBuiltin();
     return fun;
 }
--- a/js/src/jsfun.cpp
+++ b/js/src/jsfun.cpp
@@ -430,19 +430,19 @@ js::XDRInterpretedFunction(XDRState<mode
     if (mode == XDR_DECODE) {
         JSObject *proto = nullptr;
         if (firstword & IsStarGenerator) {
             proto = GlobalObject::getOrCreateStarGeneratorFunctionPrototype(cx, cx->global());
             if (!proto)
                 return false;
         }
 
-        gc::AllocKind allocKind = uint16_t(flagsword) & JSFunction::EXTENDED
-                                  ? JSFunction::ExtendedFinalizeKind
-                                  : JSFunction::FinalizeKind;
+        gc::AllocKind allocKind = JSFunction::FinalizeKind;
+        if (uint16_t(flagsword) & JSFunction::EXTENDED)
+            allocKind = JSFunction::ExtendedFinalizeKind;
         fun = NewFunctionWithProto(cx, NullPtr(), nullptr, 0, JSFunction::INTERPRETED,
                                    /* parent = */ NullPtr(), NullPtr(), proto,
                                    allocKind, TenuredObject);
         if (!fun)
             return false;
         script = nullptr;
     }
 
@@ -487,19 +487,19 @@ js::CloneFunctionAndScript(JSContext *cx
     /* NB: Keep this in sync with XDRInterpretedFunction. */
     JSObject *cloneProto = nullptr;
     if (srcFun->isStarGenerator()) {
         cloneProto = GlobalObject::getOrCreateStarGeneratorFunctionPrototype(cx, cx->global());
         if (!cloneProto)
             return nullptr;
     }
 
-    gc::AllocKind allocKind = srcFun->isExtended()
-                              ? JSFunction::ExtendedFinalizeKind
-                              : JSFunction::FinalizeKind;
+    gc::AllocKind allocKind = JSFunction::FinalizeKind;
+    if (srcFun->isExtended())
+        allocKind = JSFunction::ExtendedFinalizeKind;
     RootedFunction clone(cx, NewFunctionWithProto(cx, NullPtr(), nullptr, 0,
                                                   JSFunction::INTERPRETED, NullPtr(), NullPtr(),
                                                   cloneProto, allocKind, TenuredObject));
     if (!clone)
         return nullptr;
 
     RootedScript srcScript(cx, srcFun->getOrCreateScript(cx));
     if (!srcScript)