mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-03 10:33:33 +00:00
Bug 893897. Don't deoptimize typeobjects in TypeScript::MonitorAssign if they only have a few properties. r=bhackett
This commit is contained in:
parent
e9e910b57d
commit
53cee71509
@ -966,7 +966,14 @@ TypeScript::MonitorAssign(JSContext *cx, HandleObject obj, jsid id)
|
||||
uint32_t i;
|
||||
if (js_IdIsIndex(id, &i))
|
||||
return;
|
||||
MarkTypeObjectUnknownProperties(cx, obj->type());
|
||||
|
||||
// But if we don't have too many properties yet, don't do anything. The
|
||||
// idea here is that normal object initialization should not trigger
|
||||
// deoptimization in most cases, while actual usage as a hashmap should.
|
||||
TypeObject* type = obj->type();
|
||||
if (type->getPropertyCount() < 8)
|
||||
return;
|
||||
MarkTypeObjectUnknownProperties(cx, type);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user