Bug 893890 - Don't attach new object metadata to objects created while parsing/emitting scripts, r=luke.
authorBrian Hackett <bhackett1024@gmail.com>
Fri, 26 Jul 2013 14:15:37 -0600
changeset 140202 fb48c7d58b8be9ce281d9dc032aaa10d5125efd0
parent 140201 60542f3605e380b38582e6cab5ff6cb53aa75ac6
child 140203 a0c2043c95e392dd509c522e40c92b59ba56a4af
child 140213 5f7438a285d0f8335366b99111728f1934def219
child 140241 49a09ddadf6ce4cb1e7cc186410531a432c7c3bc
child 140254 4874fa438b1c9316ae97485a28531959149465a3
push idunknown
push userunknown
push dateunknown
reviewersluke
bugs893890
milestone25.0a1
Bug 893890 - Don't attach new object metadata to objects created while parsing/emitting scripts, r=luke.
js/src/jsobjinlines.h
--- a/js/src/jsobjinlines.h
+++ b/js/src/jsobjinlines.h
@@ -1188,21 +1188,22 @@ DefineConstructorAndPrototype(JSContext 
                               const JSPropertySpec *static_ps, const JSFunctionSpec *static_fs,
                               JSObject **ctorp = NULL,
                               gc::AllocKind ctorKind = JSFunction::FinalizeKind);
 
 static JS_ALWAYS_INLINE bool
 NewObjectMetadata(ExclusiveContext *cxArg, JSObject **pmetadata)
 {
     // The metadata callback is invoked before each created object, except when
-    // analysis is active as the callback may reenter JS.
+    // analysis/compilation/parsing is active as the callback may reenter JS.
     JS_ASSERT(!*pmetadata);
     if (JSContext *cx = cxArg->maybeJSContext()) {
         if (JS_UNLIKELY((size_t)cx->compartment()->objectMetadataCallback) &&
-            !cx->compartment()->activeAnalysis)
+            !cx->compartment()->activeAnalysis &&
+            !cx->runtime()->mainThread.activeCompilations)
         {
             gc::AutoSuppressGC suppress(cx);
             return cx->compartment()->objectMetadataCallback(cx, pmetadata);
         }
     }
     return true;
 }