Bug 1174712 - Tolerate singleton objects with uncacheable prototypes in Ion caches, r=jandem.

This commit is contained in:
Brian Hackett 2015-06-16 08:50:35 -07:00
Родитель 90ee9d633a
Коммит abdda6fd96
1 изменённых файлов: 8 добавлений и 2 удалений

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

@ -424,11 +424,17 @@ GeneratePrototypeGuards(JSContext* cx, IonScript* ion, MacroAssembler& masm, JSO
return; return;
while (pobj != holder) { while (pobj != holder) {
if (pobj->hasUncacheableProto()) { if (pobj->hasUncacheableProto()) {
MOZ_ASSERT(!pobj->isSingleton());
masm.movePtr(ImmGCPtr(pobj), scratchReg); masm.movePtr(ImmGCPtr(pobj), scratchReg);
Address groupAddr(scratchReg, JSObject::offsetOfGroup()); Address groupAddr(scratchReg, JSObject::offsetOfGroup());
if (pobj->isSingleton()) {
// Singletons can have their group's |proto| mutated directly.
masm.loadPtr(groupAddr, scratchReg);
Address protoAddr(scratchReg, ObjectGroup::offsetOfProto());
masm.branchPtr(Assembler::NotEqual, protoAddr, ImmGCPtr(pobj->getProto()), failures);
} else {
masm.branchPtr(Assembler::NotEqual, groupAddr, ImmGCPtr(pobj->group()), failures); masm.branchPtr(Assembler::NotEqual, groupAddr, ImmGCPtr(pobj->group()), failures);
} }
}
pobj = pobj->getProto(); pobj = pobj->getProto();
} }
} }