зеркало из https://github.com/mozilla/gecko-dev.git
Bug 912079 part 4 - Optimize SuppressDeletedPropertyHelper when the property matches the iterator's previous one. r=anba
--HG-- extra : rebase_source : 7c860b0162c165f536e5b316204ea76eebaff59d
This commit is contained in:
Родитель
4118107c85
Коммит
5a386c6f89
|
@ -1205,6 +1205,17 @@ SuppressDeletedProperty(JSContext* cx, NativeIterator* ni, HandleObject obj,
|
|||
if (ni->obj != obj)
|
||||
return true;
|
||||
|
||||
// Optimization for the following common case:
|
||||
//
|
||||
// for (var p in o) {
|
||||
// delete o[p];
|
||||
// }
|
||||
//
|
||||
// Note that usually both strings will be atoms so we only check for pointer
|
||||
// equality here.
|
||||
if (ni->props_cursor > ni->begin() && ni->props_cursor[-1] == str)
|
||||
return true;
|
||||
|
||||
while (true) {
|
||||
bool restart = false;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче