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:
Jan de Mooij 2018-04-26 18:41:30 +02:00
Родитель 4118107c85
Коммит 5a386c6f89
1 изменённых файлов: 11 добавлений и 0 удалений

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

@ -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;