Bug 835385 - GC: Fix for some jit test rooting analysis failures r=terrence
authorJon Coppeard <jcoppeard@mozilla.com>
Mon, 28 Jan 2013 16:43:07 +0000
changeset 120205 280f2844d29638d6360a64c2be6345ca2bd41520
parent 120204 f6367c0f3f2bd5ee86f4c958670ed06edc0e70d0
child 120206 719e2132cc42b114904510d5cf329d8a4cbe593a
push id24243
push userryanvm@gmail.com
push dateWed, 30 Jan 2013 00:49:21 +0000
treeherdermozilla-central@5c248ef0fe62 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersterrence
bugs835385
milestone21.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 835385 - GC: Fix for some jit test rooting analysis failures r=terrence
js/src/jsfun.h
--- a/js/src/jsfun.h
+++ b/js/src/jsfun.h
@@ -195,19 +195,19 @@ class JSFunction : public JSObject
     inline void initEnvironment(JSObject *obj);
 
     static inline size_t offsetOfEnvironment() { return offsetof(JSFunction, u.i.env_); }
     static inline size_t offsetOfAtom() { return offsetof(JSFunction, atom_); }
 
     js::UnrootedScript getOrCreateScript(JSContext *cx) {
         JS_ASSERT(isInterpreted());
         if (isInterpretedLazy()) {
+            js::RootedFunction self(cx, this);
             js::MaybeCheckStackRoots(cx);
-            js::RootedFunction self(cx, this);
-            if (!initializeLazyScript(cx))
+            if (!self->initializeLazyScript(cx))
                 return js::UnrootedScript(NULL);
             return self->u.i.script_;
         }
         JS_ASSERT(hasScript());
         return u.i.script_;
     }
 
     static bool maybeGetOrCreateScript(JSContext *cx, js::HandleFunction fun,