Bug 962449 - Make various getOrCreate methods static to efficiently fix hazards. r=Waldo

This commit is contained in:
Bobby Holley
2014-01-31 14:51:42 -08:00
parent eeea4a7b8e
commit aa754b4923
13 changed files with 99 additions and 82 deletions

View File

@@ -1551,14 +1551,14 @@ js_NewGenerator(JSContext *cx, const FrameRegs &stackRegs)
return nullptr;
JSObject *proto = pval.isObject() ? &pval.toObject() : nullptr;
if (!proto) {
proto = global->getOrCreateStarGeneratorObjectPrototype(cx);
proto = GlobalObject::getOrCreateStarGeneratorObjectPrototype(cx, global);
if (!proto)
return nullptr;
}
obj = NewObjectWithGivenProto(cx, &StarGeneratorObject::class_, proto, global);
} else {
JS_ASSERT(stackfp->script()->isLegacyGenerator());
JSObject *proto = global->getOrCreateLegacyGeneratorObjectPrototype(cx);
JSObject *proto = GlobalObject::getOrCreateLegacyGeneratorObjectPrototype(cx, global);
if (!proto)
return nullptr;
obj = NewObjectWithGivenProto(cx, &LegacyGeneratorObject::class_, proto, global);