Watch for GCs under nativeLookup, bug 709863. r=dvander

This commit is contained in:
Brian Hackett 2011-12-15 09:01:00 -08:00
Родитель 17f3f4069d
Коммит 3cc89b2739
1 изменённых файлов: 16 добавлений и 3 удалений

Просмотреть файл

@ -90,7 +90,15 @@ ic::GetGlobalName(VMFrame &f, ic::GetGlobalNameIC *ic)
JSAtom *atom = f.script()->getAtom(GET_INDEX(f.pc()));
jsid id = ATOM_TO_JSID(atom);
RecompilationMonitor monitor(f.cx);
const Shape *shape = obj->nativeLookup(f.cx, id);
if (monitor.recompiled()) {
stubs::GetGlobalName(f);
return;
}
if (!shape ||
!shape->hasDefaultGetterOrIsMethod() ||
!shape->hasSlot())
@ -203,11 +211,16 @@ ic::SetGlobalName(VMFrame &f, ic::SetGlobalNameIC *ic)
JSObject *obj = f.fp()->scopeChain().getGlobal();
JSScript *script = f.script();
JSAtom *atom = script->getAtom(GET_INDEX(f.pc()));
RecompilationMonitor monitor(f.cx);
const Shape *shape = obj->nativeLookup(f.cx, ATOM_TO_JSID(atom));
LookupStatus status = UpdateSetGlobalName(f, ic, obj, shape);
if (status == Lookup_Error)
THROW();
if (!monitor.recompiled()) {
LookupStatus status = UpdateSetGlobalName(f, ic, obj, shape);
if (status == Lookup_Error)
THROW();
}
if (ic->usePropertyCache)
STRICT_VARIANT(stubs::SetGlobalName)(f, atom);