Bug 901178 - Backout 7d4e75a5d414. r=nbp in person
authorGary Kwong <gary@rumblingedge.com>
Tue, 13 Aug 2013 15:44:45 -0700
changeset 155471 34921ae3f262160cd34a6246507a73752333669e
parent 155470 46f7b11d25949a12bda7294b161064b72f5b2a70
child 155472 6d3868ec1d2b016e58ff6f1d83818020ca7921b0
push id2961
push userlsblakk@mozilla.com
push dateMon, 28 Oct 2013 21:59:28 +0000
treeherdermozilla-beta@73ef4f13486f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnbp
bugs901178
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 901178 - Backout 7d4e75a5d414. r=nbp in person
js/src/jit/CodeGenerator.cpp
js/src/jit/IonBuilder.cpp
js/src/jsfun.h
--- a/js/src/jit/CodeGenerator.cpp
+++ b/js/src/jit/CodeGenerator.cpp
@@ -737,32 +737,19 @@ CodeGenerator::emitLambdaInit(const Regi
         } s;
         uint32_t word;
     } u;
     u.s.nargs = fun->nargs;
     u.s.flags = fun->flags & ~JSFunction::EXTENDED;
 
     JS_STATIC_ASSERT(offsetof(JSFunction, flags) == offsetof(JSFunction, nargs) + 2);
     masm.store32(Imm32(u.word), Address(output, offsetof(JSFunction, nargs)));
-
-    // Initialize the JSFunction union with the script / native / lazyScript
-    // corresponding to the flag.
-    ImmGCPtr scriptOrLazyScript(NULL);
-    if (fun->isInterpretedLazy())
-        scriptOrLazyScript = ImmGCPtr(fun->lazyScriptOrNull());
-    else
-        scriptOrLazyScript = ImmGCPtr(fun->nonLazyScript());
-
-    masm.storePtr(scriptOrLazyScript, Address(output, JSFunction::offsetOfNativeOrScript()));
-
-    // Lambda scripted functions are given the scope chain as the environment in
-    // which the caller was at the time of the creation of the lambda.
+    masm.storePtr(ImmGCPtr(fun->nonLazyScript()),
+                  Address(output, JSFunction::offsetOfNativeOrScript()));
     masm.storePtr(scopeChain, Address(output, JSFunction::offsetOfEnvironment()));
-
-    // Copy the name of the function used for diagnostics.
     masm.storePtr(ImmGCPtr(fun->displayAtom()), Address(output, JSFunction::offsetOfAtom()));
 }
 
 bool
 CodeGenerator::visitLambdaPar(LLambdaPar *lir)
 {
     Register resultReg = ToRegister(lir->output());
     Register sliceReg = ToRegister(lir->forkJoinSlice());
--- a/js/src/jit/IonBuilder.cpp
+++ b/js/src/jit/IonBuilder.cpp
@@ -8694,16 +8694,19 @@ IonBuilder::jsop_object(JSObject *obj)
     current->push(ins);
 
     return true;
 }
 
 bool
 IonBuilder::jsop_lambda(JSFunction *fun)
 {
+    if (fun->isInterpreted() && !fun->getOrCreateScript(cx))
+        return false;
+
     JS_ASSERT(script()->analysis()->usesScopeChain());
     if (fun->isArrow())
         return abort("bound arrow function");
     if (fun->isNative() && IsAsmJSModuleNative(fun->native()))
         return abort("asm.js module function");
 
     MLambda *ins = MLambda::New(current->scopeChain(), fun);
     current->add(ins);
--- a/js/src/jsfun.h
+++ b/js/src/jsfun.h
@@ -321,17 +321,16 @@ class JSFunction : public JSObject
     }
 
     void setJitInfo(const JSJitInfo *data) {
         JS_ASSERT(isNative());
         u.n.jitinfo = data;
     }
 
     static unsigned offsetOfNativeOrScript() {
-        JS_STATIC_ASSERT(offsetof(U, n.native) == offsetof(U, i.s.lazy_));
         JS_STATIC_ASSERT(offsetof(U, n.native) == offsetof(U, i.s.script_));
         JS_STATIC_ASSERT(offsetof(U, n.native) == offsetof(U, nativeOrScript));
         return offsetof(JSFunction, u.nativeOrScript);
     }
 
 #if JS_BITS_PER_WORD == 32
     static const js::gc::AllocKind FinalizeKind = js::gc::FINALIZE_OBJECT2_BACKGROUND;
     static const js::gc::AllocKind ExtendedFinalizeKind = js::gc::FINALIZE_OBJECT4_BACKGROUND;