Bug 1848090 - When parsing JSON, Stop allocating in the nursery after two nursery...
commit5777657ab859934962882a5ad5fa9ddbe829e489
authorJon Coppeard <jcoppeard@mozilla.com>
Thu, 17 Aug 2023 09:51:17 +0000 (17 09:51 +0000)
committerJon Coppeard <jcoppeard@mozilla.com>
Thu, 17 Aug 2023 09:51:17 +0000 (17 09:51 +0000)
tree1e8271cd08e4a9e36175d478f83257792b9be4a6
parent41ec09a4bd1687d7ab26ac03ec6736f26aee2e0c
Bug 1848090 - When parsing JSON, Stop allocating in the nursery after two nursery collections r=sfink

The patch adds a nursery collection callback for the duration of parsing and
counts the collections. After the second collection we switch to allocating
everything in the tenured heap.

This change made parsing the JSON data in the bug significantly faster.

Differential Revision: https://phabricator.services.mozilla.com/D186362
js/src/util/StringBuffer.cpp
js/src/util/StringBuffer.h
js/src/vm/JSONParser.cpp
js/src/vm/JSONParser.h
js/src/vm/PlainObject.cpp
js/src/vm/PlainObject.h