Refactored the JSC::Heap extra cost API for clarity and to make some known bugs more obvious
https://bugs.webkit.org/show_bug.cgi?id=142589
Reviewed by Andreas Kling.
Source/JavaScriptCore:
(JSReportExtraMemoryCost): Added a FIXME to annotate a known bug.
(JSC::CodeBlock::CodeBlock):
(JSC::CodeBlock::visitAggregate):
(JSC::CodeBlock::setJITCode): Updated for rename.
(JSC::Heap::Heap):
(JSC::Heap::reportExtraMemoryAllocatedSlowCase):
(JSC::Heap::deprecatedReportExtraMemorySlowCase): Renamed our reporting
APIs to clarify their relationship to each other: One must report extra
memory at the time of allocation, and at the time the GC visits it.
(JSC::Heap::extraMemorySize):
(JSC::Heap::size):
(JSC::Heap::capacity):
(JSC::Heap::sizeAfterCollect):
(JSC::Heap::willStartCollection): Updated for renames. Added explicit
API for deprecated users who can't use our best API.
(JSC::Heap::reportExtraMemoryCostSlowCase): Deleted.
(JSC::Heap::extraSize): Deleted.
- heap/Heap.h:
- heap/HeapInlines.h:
(JSC::Heap::reportExtraMemoryAllocated):
(JSC::Heap::reportExtraMemoryVisited):
(JSC::Heap::deprecatedReportExtraMemory):
(JSC::Heap::reportExtraMemoryCost): Deleted. Ditto.
- heap/SlotVisitor.h:
- heap/SlotVisitorInlines.h:
(JSC::SlotVisitor::reportExtraMemoryVisited):
(JSC::SlotVisitor::reportExtraMemoryUsage): Deleted. Moved this
functionality into the Heap since it's pretty detailed in its access
to the heap.
- runtime/JSArrayBufferView.cpp:
(JSC::JSArrayBufferView::ConstructionContext::ConstructionContext):
- runtime/JSGenericTypedArrayViewInlines.h:
(JSC::JSGenericTypedArrayView<Adaptor>::visitChildren): Updated for
renames.
(JSC::JSString::visitChildren):
(JSC::JSRopeString::resolveRopeToAtomicString):
(JSC::JSRopeString::resolveRope):
(JSC::JSString::finishCreation): Updated for renames.
- runtime/SparseArrayValueMap.cpp:
(JSC::SparseArrayValueMap::add): Added FIXME.
(JSC::WeakMapData::visitChildren): Updated for rename.
Source/WebCore:
Updated for renames to JSC extra cost APIs.
Added FIXMEs to our 10 use cases that are currently wrong, including
canvas, which is the cause of https://bugs.webkit.org/show_bug.cgi?id=142457.
- Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::appendBufferInternal):
(WebCore::SourceBuffer::sourceBufferPrivateAppendComplete):
(WebCore::SourceBuffer::reportExtraMemoryAllocated):
(WebCore::SourceBuffer::reportExtraMemoryCost): Deleted.
- Modules/mediasource/SourceBuffer.h:
- bindings/js/JSDocumentCustom.cpp:
(WebCore::toJS):
- bindings/js/JSImageDataCustom.cpp:
(WebCore::toJS):
- bindings/js/JSNodeListCustom.cpp:
(WebCore::createWrapper):
- bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
- dom/CollectionIndexCache.cpp:
(WebCore::reportExtraMemoryAllocatedForCollectionIndexCache):
(WebCore::reportExtraMemoryCostForCollectionIndexCache): Deleted.
- dom/CollectionIndexCache.h:
(WebCore::Iterator>::computeNodeCountUpdatingListCache):
- html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::createImageBuffer):
(WebCore::CollectionNamedElementCache::didPopulate):
- html/HTMLImageLoader.cpp:
(WebCore::HTMLImageLoader::imageChanged):
- html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::parseAttribute):
(WebCore::XMLHttpRequest::dropProtection):