Bug 872384 - Clone self hosted objects directly into tenured; r=till

The jit is allowed to bake pointers to intrinsics into jitcode. Since all
self-hosted clones are intrinsics, we need these to always be tenured.

--HG--
extra : rebase_source : b4e6b63db874a95d5eac4cafa34a7aaadd163f58
This commit is contained in:
Terrence Cole 2013-05-16 10:24:22 -07:00
parent 4a127d1c70
commit e61de5ae64

View File

@ -611,7 +611,7 @@ CloneObject(JSContext *cx, HandleObject srcObj, CloneMemory &clonedObjects)
return NULL;
} else {
RootedFunction fun(cx, srcObj->toFunction());
clone = CloneFunctionObject(cx, fun, cx->global(), fun->getAllocKind());
clone = CloneFunctionObject(cx, fun, cx->global(), fun->getAllocKind(), TenuredObject);
}
} else if (srcObj->isRegExp()) {
RegExpObject &reobj = srcObj->asRegExp();
@ -632,7 +632,7 @@ CloneObject(JSContext *cx, HandleObject srcObj, CloneMemory &clonedObjects)
return NULL;
clone = StringObject::create(cx, str);
} else if (srcObj->isArray()) {
clone = NewDenseEmptyArray(cx);
clone = NewDenseEmptyArray(cx, NULL, TenuredObject);
} else {
JS_ASSERT(srcObj->isNative());
clone = NewObjectWithGivenProto(cx, srcObj->getClass(), NULL, cx->global(),