Backed out changeset 4a8eb498c244 (bug 972087) for potentially breaking the build on a CLOSED TREE
authorWes Kocher <wkocher@mozilla.com>
Fri, 28 Feb 2014 14:32:09 -0800
changeset 171693 cc06ddfe4b3a312b013bc1e48c37165fd3ae16da
parent 171692 18f113ab1a354c218f5217c98f4969fb977d1bf4
child 171694 b8c1ff82160e557b0d08f75abd4161fa309df22d
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
bugs972087
milestone30.0a1
backs out4a8eb498c24468466765d42defc459c123ca4222
Backed out changeset 4a8eb498c244 (bug 972087) for potentially breaking the build on a CLOSED TREE
js/src/vm/SelfHosting.cpp
--- a/js/src/vm/SelfHosting.cpp
+++ b/js/src/vm/SelfHosting.cpp
@@ -1008,29 +1008,26 @@ static JSObject *
 CloneObject(JSContext *cx, JSObject *selfHostedObject, CloneMemory &clonedObjects)
 {
     DependentAddPtr<CloneMemory> p(cx, clonedObjects, selfHostedObject);
     if (p)
         return p->value();
     RootedObject clone(cx);
     if (selfHostedObject->is<JSFunction>()) {
         JSFunction *selfHostedFunction = &selfHostedObject->as<JSFunction>();
-        bool needsName = selfHostedFunction->isInterpreted() &&
-                         selfHostedFunction->atom() != nullptr;
-        js::gc::AllocKind kind = needsName
+        bool hasName = selfHostedFunction->atom() != nullptr;
+        js::gc::AllocKind kind = hasName
                                  ? JSFunction::ExtendedFinalizeKind
                                  : selfHostedFunction->getAllocKind();
         clone = CloneFunctionObject(cx, HandleFunction::fromMarkedLocation(&selfHostedFunction),
                                     cx->global(), kind, TenuredObject);
-        // To be able to re-lazify cloned interpreted functions, their name in
-        // the self-hosting compartment has to be stored on the clone.
-        if (clone && needsName) {
-            JS_ASSERT(clone->as<JSFunction>().isSelfHostedBuiltin());
+        // To be able to re-lazify the cloned function, its name in the
+        // self-hosting compartment has to be stored on the clone.
+        if (clone && hasName)
             clone->as<JSFunction>().setExtendedSlot(0, StringValue(selfHostedFunction->atom()));
-        }
     } else if (selfHostedObject->is<RegExpObject>()) {
         RegExpObject &reobj = selfHostedObject->as<RegExpObject>();
         RootedAtom source(cx, reobj.getSource());
         JS_ASSERT(source->isPermanentAtom());
         clone = RegExpObject::createNoStatics(cx, source, reobj.getFlags(), nullptr);
     } else if (selfHostedObject->is<DateObject>()) {
         clone = JS_NewDateObjectMsec(cx, selfHostedObject->as<DateObject>().UTCTime().toNumber());
     } else if (selfHostedObject->is<BooleanObject>()) {