[INFER] Finalize 'new' script objects in background when possible, bug 678048.
authorBrian Hackett <bhackett1024@gmail.com>
Thu, 11 Aug 2011 20:56:17 -0700
changeset 76117 3a7425b9623025ea6886589cd577cf27fbe0a8d7
parent 76116 e5de9834cd1837c88a3d9d1706f3c72aeb401896
child 76118 1f767f82d1c309e5f69364f1ddcb24d1f5eff0f9
push id3
push userfelipc@gmail.com
push dateFri, 30 Sep 2011 20:09:13 +0000
bugs678048
milestone8.0a1
[INFER] Finalize 'new' script objects in background when possible, bug 678048.
js/src/jsobjinlines.h
--- a/js/src/jsobjinlines.h
+++ b/js/src/jsobjinlines.h
@@ -1527,16 +1527,19 @@ NewObject(JSContext *cx, js::Class *clas
  * Create a plain object with the specified type. This bypasses getNewType to
  * avoid losing creation site information for objects made by scripted 'new'.
  */
 static JS_ALWAYS_INLINE JSObject *
 NewObjectWithType(JSContext *cx, types::TypeObject *type, JSObject *parent, gc::FinalizeKind kind)
 {
     JS_ASSERT(type == type->proto->newType);
 
+    if (CanBeFinalizedInBackground(kind, &js_ObjectClass))
+        kind = GetBackgroundFinalizeKind(kind);
+
     JSObject* obj = js_NewGCObject(cx, kind);
     if (!obj)
         goto out;
 
     /*
      * Default parent to the parent of the prototype, which was set from
      * the parent of the prototype's constructor.
      */