Bug 1350171 - Try to transition IC mode before attaching AddSlot stubs. r=h4writer

This commit is contained in:
Jan de Mooij 2017-03-27 14:41:04 +02:00
Родитель 7cdbb80ceb
Коммит 268ae3bf52
3 изменённых файлов: 26 добавлений и 2 удалений

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

@ -0,0 +1,8 @@
function test() {
var o = {};
o.watch('x', test);
try {
o.x = 3;
} catch(e) {}
}
test();

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

@ -1578,7 +1578,15 @@ DoSetPropFallback(JSContext* cx, BaselineFrame* frame, ICSetProp_Fallback* stub_
if (stub.invalid())
return true;
if (!attached && stub->state().canAttachStub()) {
if (attached)
return true;
// The SetProperty call might have entered this IC recursively, so try
// to transition.
if (stub->state().maybeTransition())
stub->discardStubs(cx);
if (stub->state().canAttachStub()) {
RootedValue idVal(cx, StringValue(name));
SetPropIRGenerator gen(cx, script, pc, CacheKind::SetProp, stub->state().mode(),
&isTemporarilyUnoptimizable, lhs, idVal, rhs);

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

@ -248,7 +248,15 @@ IonSetPropertyIC::update(JSContext* cx, HandleScript outerScript, IonSetProperty
}
}
if (!attached && ic->state().canAttachStub()) {
if (attached)
return true;
// The SetProperty call might have entered this IC recursively, so try
// to transition.
if (ic->state().maybeTransition())
ic->discardStubs(cx->zone());
if (ic->state().canAttachStub()) {
RootedValue objv(cx, ObjectValue(*obj));
RootedScript script(cx, ic->script());
jsbytecode* pc = ic->pc();