Many users of Heap::reportExtraMemory* are wrong, causing lots of memory growth
https://bugs.webkit.org/show_bug.cgi?id=142593
Reviewed by Andreas Kling.
Adopt deprecatedReportExtraMemory as a short-term fix for runaway
memory growth in these cases where we have not adopted
reportExtraMemoryVisited.
Long-term, we should use reportExtraMemoryAllocated+reportExtraMemoryVisited.
That's tracked by https://bugs.webkit.org/show_bug.cgi?id=142595.
Source/JavaScriptCore:
(JSReportExtraMemoryCost):
- runtime/SparseArrayValueMap.cpp:
(JSC::SparseArrayValueMap::add):
Source/WebCore:
Using IOSDebug, I can see that the canvas stress test @ http://jsfiddle.net/fvyw4ba0/,
which used to keep > 1000 1MB NonVolatile GPU allocations live, now keeps about 10 live.
- Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::reportExtraMemoryAllocated):
- bindings/js/JSDocumentCustom.cpp:
(WebCore::toJS):
- bindings/js/JSImageDataCustom.cpp:
(WebCore::toJS):
- bindings/js/JSNodeListCustom.cpp:
(WebCore::createWrapper):
- dom/CollectionIndexCache.cpp:
(WebCore::reportExtraMemoryAllocatedForCollectionIndexCache):
- html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::createImageBuffer):
- html/HTMLImageLoader.cpp:
(WebCore::HTMLImageLoader::imageChanged):
- html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::parseAttribute):
(WebCore::XMLHttpRequest::dropProtection):