Bug 867784 - Allocate RegExpObjects initially tenured; r=sstangl,terrence

This commit is contained in:
Brian Hackett 2013-03-20 16:15:00 -07:00
parent 786bc9fc87
commit c0d3ad3d1f

View File

@ -35,7 +35,9 @@ RegExpObjectBuilder::getOrCreate()
if (reobj_)
return true;
JSObject *obj = NewBuiltinClassInstance(cx, &RegExpClass);
// Note: RegExp objects are always allocated in the tenured heap. This is
// not strictly required, but simplifies embedding them in jitcode.
JSObject *obj = NewBuiltinClassInstance(cx, &RegExpClass, TenuredObject);
if (!obj)
return false;
obj->initPrivate(NULL);
@ -49,7 +51,10 @@ RegExpObjectBuilder::getOrCreateClone(RegExpObject *proto)
{
JS_ASSERT(!reobj_);
JSObject *clone = NewObjectWithGivenProto(cx, &RegExpClass, proto, proto->getParent());
// Note: RegExp objects are always allocated in the tenured heap. This is
// not strictly required, but simplifies embedding them in jitcode.
JSObject *clone = NewObjectWithGivenProto(cx, &RegExpClass, proto, proto->getParent(),
TenuredObject);
if (!clone)
return false;
clone->initPrivate(NULL);