зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1350171
- Try to transition IC mode before attaching AddSlot stubs. r=h4writer
This commit is contained in:
Родитель
7cdbb80ceb
Коммит
268ae3bf52
|
@ -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())
|
if (stub.invalid())
|
||||||
return true;
|
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));
|
RootedValue idVal(cx, StringValue(name));
|
||||||
SetPropIRGenerator gen(cx, script, pc, CacheKind::SetProp, stub->state().mode(),
|
SetPropIRGenerator gen(cx, script, pc, CacheKind::SetProp, stub->state().mode(),
|
||||||
&isTemporarilyUnoptimizable, lhs, idVal, rhs);
|
&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));
|
RootedValue objv(cx, ObjectValue(*obj));
|
||||||
RootedScript script(cx, ic->script());
|
RootedScript script(cx, ic->script());
|
||||||
jsbytecode* pc = ic->pc();
|
jsbytecode* pc = ic->pc();
|
||||||
|
|
Загрузка…
Ссылка в новой задаче