Changeset 181407 in webkit
- Timestamp:
- Mar 11, 2015, 2:29:57 PM (11 years ago)
- Location:
- trunk/Source
- Files:
-
- 29 edited
-
JavaScriptCore/API/JSBase.cpp (modified) (1 diff)
-
JavaScriptCore/ChangeLog (modified) (1 diff)
-
JavaScriptCore/bytecode/CodeBlock.cpp (modified) (4 diffs)
-
JavaScriptCore/bytecode/CodeBlock.h (modified) (1 diff)
-
JavaScriptCore/heap/Heap.cpp (modified) (5 diffs)
-
JavaScriptCore/heap/Heap.h (modified) (5 diffs)
-
JavaScriptCore/heap/HeapInlines.h (modified) (1 diff)
-
JavaScriptCore/heap/SlotVisitor.h (modified) (1 diff)
-
JavaScriptCore/heap/SlotVisitorInlines.h (modified) (1 diff)
-
JavaScriptCore/runtime/JSArrayBufferView.cpp (modified) (1 diff)
-
JavaScriptCore/runtime/JSGenericTypedArrayViewInlines.h (modified) (1 diff)
-
JavaScriptCore/runtime/JSString.cpp (modified) (4 diffs)
-
JavaScriptCore/runtime/JSString.h (modified) (1 diff)
-
JavaScriptCore/runtime/SparseArrayValueMap.cpp (modified) (1 diff)
-
JavaScriptCore/runtime/WeakMapData.cpp (modified) (1 diff)
-
WebCore/ChangeLog (modified) (1 diff)
-
WebCore/Modules/mediasource/SourceBuffer.cpp (modified) (4 diffs)
-
WebCore/Modules/mediasource/SourceBuffer.h (modified) (1 diff)
-
WebCore/bindings/js/JSDocumentCustom.cpp (modified) (1 diff)
-
WebCore/bindings/js/JSImageDataCustom.cpp (modified) (1 diff)
-
WebCore/bindings/js/JSNodeListCustom.cpp (modified) (1 diff)
-
WebCore/bindings/scripts/CodeGeneratorJS.pm (modified) (2 diffs)
-
WebCore/dom/CollectionIndexCache.cpp (modified) (1 diff)
-
WebCore/dom/CollectionIndexCache.h (modified) (2 diffs)
-
WebCore/html/HTMLCanvasElement.cpp (modified) (1 diff)
-
WebCore/html/HTMLCollection.h (modified) (1 diff)
-
WebCore/html/HTMLImageLoader.cpp (modified) (1 diff)
-
WebCore/html/HTMLMediaElement.cpp (modified) (1 diff)
-
WebCore/xml/XMLHttpRequest.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/API/JSBase.cpp
r181215 r181407 140 140 ExecState* exec = toJS(ctx); 141 141 JSLockHolder locker(exec); 142 exec->vm().heap.reportExtraMemoryCost(size); 142 143 // FIXME: switch to deprecatedReportExtraMemory. 144 // https://bugs.webkit.org/show_bug.cgi?id=142593 145 exec->vm().heap.reportExtraMemoryAllocated(size); 143 146 } 144 147 -
trunk/Source/JavaScriptCore/ChangeLog
r181404 r181407 1 2015-03-11 Geoffrey Garen <ggaren@apple.com> 2 3 Refactored the JSC::Heap extra cost API for clarity and to make some known bugs more obvious 4 https://bugs.webkit.org/show_bug.cgi?id=142589 5 6 Reviewed by Andreas Kling. 7 8 * API/JSBase.cpp: 9 (JSReportExtraMemoryCost): Added a FIXME to annotate a known bug. 10 11 * bytecode/CodeBlock.cpp: 12 (JSC::CodeBlock::CodeBlock): 13 (JSC::CodeBlock::visitAggregate): 14 * bytecode/CodeBlock.h: 15 (JSC::CodeBlock::setJITCode): Updated for rename. 16 17 * heap/Heap.cpp: 18 (JSC::Heap::Heap): 19 (JSC::Heap::reportExtraMemoryAllocatedSlowCase): 20 (JSC::Heap::deprecatedReportExtraMemorySlowCase): Renamed our reporting 21 APIs to clarify their relationship to each other: One must report extra 22 memory at the time of allocation, and at the time the GC visits it. 23 24 (JSC::Heap::extraMemorySize): 25 (JSC::Heap::size): 26 (JSC::Heap::capacity): 27 (JSC::Heap::sizeAfterCollect): 28 (JSC::Heap::willStartCollection): Updated for renames. Added explicit 29 API for deprecated users who can't use our best API. 30 31 (JSC::Heap::reportExtraMemoryCostSlowCase): Deleted. 32 (JSC::Heap::extraSize): Deleted. 33 34 * heap/Heap.h: 35 * heap/HeapInlines.h: 36 (JSC::Heap::reportExtraMemoryAllocated): 37 (JSC::Heap::reportExtraMemoryVisited): 38 (JSC::Heap::deprecatedReportExtraMemory): 39 (JSC::Heap::reportExtraMemoryCost): Deleted. Ditto. 40 41 * heap/SlotVisitor.h: 42 * heap/SlotVisitorInlines.h: 43 (JSC::SlotVisitor::reportExtraMemoryVisited): 44 (JSC::SlotVisitor::reportExtraMemoryUsage): Deleted. Moved this 45 functionality into the Heap since it's pretty detailed in its access 46 to the heap. 47 48 * runtime/JSArrayBufferView.cpp: 49 (JSC::JSArrayBufferView::ConstructionContext::ConstructionContext): 50 * runtime/JSGenericTypedArrayViewInlines.h: 51 (JSC::JSGenericTypedArrayView<Adaptor>::visitChildren): Updated for 52 renames. 53 54 * runtime/JSString.cpp: 55 (JSC::JSString::visitChildren): 56 (JSC::JSRopeString::resolveRopeToAtomicString): 57 (JSC::JSRopeString::resolveRope): 58 * runtime/JSString.h: 59 (JSC::JSString::finishCreation): Updated for renames. 60 61 * runtime/SparseArrayValueMap.cpp: 62 (JSC::SparseArrayValueMap::add): Added FIXME. 63 64 * runtime/WeakMapData.cpp: 65 (JSC::WeakMapData::visitChildren): Updated for rename. 66 1 67 2015-03-11 Ryosuke Niwa <rniwa@webkit.org> 2 68 -
trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp
r181334 r181407 1678 1678 1679 1679 m_heap->m_codeBlocks.add(this); 1680 m_heap->reportExtraMemory Cost(sizeof(CodeBlock));1680 m_heap->reportExtraMemoryAllocated(sizeof(CodeBlock)); 1681 1681 } 1682 1682 … … 2132 2132 2133 2133 m_heap->m_codeBlocks.add(this); 2134 m_heap->reportExtraMemory Cost(sizeof(CodeBlock) + m_instructions.size() * sizeof(Instruction));2134 m_heap->reportExtraMemoryAllocated(sizeof(CodeBlock) + m_instructions.size() * sizeof(Instruction)); 2135 2135 } 2136 2136 … … 2224 2224 otherBlock->visitAggregate(visitor); 2225 2225 2226 visitor.reportExtraMemory Usage(ownerExecutable(), sizeof(CodeBlock));2226 visitor.reportExtraMemoryVisited(ownerExecutable(), sizeof(CodeBlock)); 2227 2227 if (m_jitCode) 2228 visitor.reportExtraMemory Usage(ownerExecutable(), m_jitCode->size());2228 visitor.reportExtraMemoryVisited(ownerExecutable(), m_jitCode->size()); 2229 2229 if (m_instructions.size()) { 2230 2230 // Divide by refCount() because m_instructions points to something that is shared … … 2232 2232 // Having each CodeBlock report only its proportional share of the size is one way 2233 2233 // of accomplishing this. 2234 visitor.reportExtraMemory Usage(ownerExecutable(), m_instructions.size() * sizeof(Instruction) / m_instructions.refCount());2234 visitor.reportExtraMemoryVisited(ownerExecutable(), m_instructions.size() * sizeof(Instruction) / m_instructions.refCount()); 2235 2235 } 2236 2236 -
trunk/Source/JavaScriptCore/bytecode/CodeBlock.h
r180993 r181407 274 274 { 275 275 ASSERT(m_heap->isDeferred()); 276 m_heap->reportExtraMemory Cost(code->size());276 m_heap->reportExtraMemoryAllocated(code->size()); 277 277 ConcurrentJITLocker locker(m_lock); 278 278 WTF::storeStoreFence(); // This is probably not needed because the lock will also do something similar, but it's good to be paranoid. -
trunk/Source/JavaScriptCore/heap/Heap.cpp
r181350 r181407 310 310 , m_objectSpace(this) 311 311 , m_storageSpace(this) 312 , m_extraMemoryUsage(0) 312 , m_extraMemorySize(0) 313 , m_deprecatedExtraMemorySize(0) 313 314 , m_machineThreads(this) 314 315 , m_sharedData(vm) … … 393 394 } 394 395 395 void Heap::reportExtraMemoryCostSlowCase(size_t cost) 396 { 397 // Our frequency of garbage collection tries to balance memory use against speed 398 // by collecting based on the number of newly created values. However, for values 399 // that hold on to a great deal of memory that's not in the form of other JS values, 400 // that is not good enough - in some cases a lot of those objects can pile up and 401 // use crazy amounts of memory without a GC happening. So we track these extra 402 // memory costs. Only unusually large objects are noted, and we only keep track 403 // of this extra cost until the next GC. In garbage collected languages, most values 404 // are either very short lived temporaries, or have extremely long lifetimes. So 405 // if a large value survives one garbage collection, there is not much point to 406 // collecting more frequently as long as it stays alive. 407 408 didAllocate(cost); 396 void Heap::reportExtraMemoryAllocatedSlowCase(size_t size) 397 { 398 didAllocate(size); 409 399 collectIfNecessaryOrDefer(); 400 } 401 402 void Heap::deprecatedReportExtraMemorySlowCase(size_t size) 403 { 404 m_deprecatedExtraMemorySize += size; 405 reportExtraMemoryAllocatedSlowCase(size); 410 406 } 411 407 … … 855 851 } 856 852 857 size_t Heap::extra Size()858 { 859 return m_extraMemory Usage + m_arrayBuffers.size();853 size_t Heap::extraMemorySize() 854 { 855 return m_extraMemorySize + m_deprecatedExtraMemorySize + m_arrayBuffers.size(); 860 856 } 861 857 862 858 size_t Heap::size() 863 859 { 864 return m_objectSpace.size() + m_storageSpace.size() + extra Size();860 return m_objectSpace.size() + m_storageSpace.size() + extraMemorySize(); 865 861 } 866 862 867 863 size_t Heap::capacity() 868 864 { 869 return m_objectSpace.capacity() + m_storageSpace.capacity() + extra Size();865 return m_objectSpace.capacity() + m_storageSpace.capacity() + extraMemorySize(); 870 866 } 871 867 … … 877 873 // always the case that m_totalBytesCopied <= m_storageSpace.size(). 878 874 ASSERT(m_totalBytesCopied <= m_storageSpace.size()); 879 return m_totalBytesVisited + m_totalBytesCopied + extra Size();875 return m_totalBytesVisited + m_totalBytesCopied + extraMemorySize(); 880 876 } 881 877 … … 1125 1121 if (m_operationInProgress == FullCollection) { 1126 1122 m_sizeBeforeLastFullCollect = m_sizeAfterLastCollect + m_bytesAllocatedThisCycle; 1127 m_extraMemoryUsage = 0; 1123 m_extraMemorySize = 0; 1124 m_deprecatedExtraMemorySize = 0; 1128 1125 1129 1126 if (m_fullActivityCallback) -
trunk/Source/JavaScriptCore/heap/Heap.h
r181297 r181407 162 162 bool collectIfNecessaryOrDefer(); // Returns true if it did collect. 163 163 164 void reportExtraMemoryCost(size_t cost); 164 // Use this API to report non-GC memory referenced by GC objects. Be sure to 165 // call both of these functions: Calling only one may trigger catastropic 166 // memory growth. 167 void reportExtraMemoryAllocated(size_t); 168 void reportExtraMemoryVisited(JSCell*, size_t); 169 170 // Use this API to report non-GC memory if you can't use the better API above. 171 void deprecatedReportExtraMemory(size_t); 172 165 173 JS_EXPORT_PRIVATE void reportAbandonedObjectGraph(); 166 174 … … 168 176 JS_EXPORT_PRIVATE bool unprotect(JSValue); // True when the protect count drops to 0. 169 177 170 size_t extra Size(); // extra memory usage outside of pages allocated by the heap178 size_t extraMemorySize(); // Non-GC memory referenced by GC objects. 171 179 JS_EXPORT_PRIVATE size_t size(); 172 180 JS_EXPORT_PRIVATE size_t capacity(); … … 262 270 template<typename ClassType> void* allocateObjectOfType(size_t); // Chooses one of the methods above based on type. 263 271 264 static const size_t minExtraCost = 256; 265 static const size_t maxExtraCost = 1024 * 1024; 272 static const size_t minExtraMemory = 256; 266 273 267 274 class FinalizerOwner : public WeakHandleOwner { … … 270 277 271 278 JS_EXPORT_PRIVATE bool isValidAllocation(size_t); 272 JS_EXPORT_PRIVATE void reportExtraMemoryCostSlowCase(size_t); 279 JS_EXPORT_PRIVATE void reportExtraMemoryAllocatedSlowCase(size_t); 280 JS_EXPORT_PRIVATE void deprecatedReportExtraMemorySlowCase(size_t); 273 281 274 282 void collectImpl(HeapOperation, void* stackOrigin, void* stackTop, MachineThreads::RegisterState&); … … 354 362 CopiedSpace m_storageSpace; 355 363 GCIncomingRefCountedSet<ArrayBuffer> m_arrayBuffers; 356 size_t m_extraMemoryUsage; 364 size_t m_extraMemorySize; 365 size_t m_deprecatedExtraMemorySize; 357 366 358 367 HashSet<const JSCell*> m_copyingRememberedSet; -
trunk/Source/JavaScriptCore/heap/HeapInlines.h
r181297 r181407 153 153 } 154 154 155 inline void Heap::reportExtraMemoryCost(size_t cost) 156 { 157 if (cost > minExtraCost) 158 reportExtraMemoryCostSlowCase(cost); 155 inline void Heap::reportExtraMemoryAllocated(size_t size) 156 { 157 if (size > minExtraMemory) 158 reportExtraMemoryAllocatedSlowCase(size); 159 } 160 161 inline void Heap::reportExtraMemoryVisited(JSCell* owner, size_t size) 162 { 163 #if ENABLE(GGC) 164 // We don't want to double-count the extra memory that was reported in previous collections. 165 if (operationInProgress() == EdenCollection && Heap::isRemembered(owner)) 166 return; 167 #else 168 UNUSED_PARAM(owner); 169 #endif 170 171 size_t* counter = &m_extraMemorySize; 172 173 #if ENABLE(COMPARE_AND_SWAP) 174 for (;;) { 175 size_t oldSize = *counter; 176 if (WTF::weakCompareAndSwapSize(counter, oldSize, oldSize + size)) 177 return; 178 } 179 #else 180 (*counter) += size; 181 #endif 182 } 183 184 inline void Heap::deprecatedReportExtraMemory(size_t size) 185 { 186 if (size > minExtraMemory) 187 deprecatedReportExtraMemorySlowCase(size); 159 188 } 160 189 -
trunk/Source/JavaScriptCore/heap/SlotVisitor.h
r167326 r181407 106 106 void copyLater(JSCell*, CopyToken, void*, size_t); 107 107 108 void reportExtraMemory Usage(JSCell* owner, size_t);108 void reportExtraMemoryVisited(JSCell* owner, size_t); 109 109 110 110 void addWeakReferenceHarvester(WeakReferenceHarvester*); -
trunk/Source/JavaScriptCore/heap/SlotVisitorInlines.h
r167326 r181407 253 253 } 254 254 255 inline void SlotVisitor::reportExtraMemoryUsage(JSCell* owner, size_t size) 256 { 257 #if ENABLE(GGC) 258 // We don't want to double-count the extra memory that was reported in previous collections. 259 if (heap()->operationInProgress() == EdenCollection && Heap::isRemembered(owner)) 260 return; 261 #else 262 UNUSED_PARAM(owner); 263 #endif 264 265 size_t* counter = &m_shared.m_vm->heap.m_extraMemoryUsage; 266 267 #if ENABLE(COMPARE_AND_SWAP) 268 for (;;) { 269 size_t oldSize = *counter; 270 if (WTF::weakCompareAndSwapSize(counter, oldSize, oldSize + size)) 271 return; 272 } 273 #else 274 (*counter) += size; 275 #endif 255 inline void SlotVisitor::reportExtraMemoryVisited(JSCell* owner, size_t size) 256 { 257 heap()->reportExtraMemoryVisited(owner, size); 276 258 } 277 259 -
trunk/Source/JavaScriptCore/runtime/JSArrayBufferView.cpp
r172176 r181407 79 79 } 80 80 81 vm.heap.reportExtraMemory Cost(static_cast<size_t>(length) * elementSize);81 vm.heap.reportExtraMemoryAllocated(static_cast<size_t>(length) * elementSize); 82 82 83 83 m_structure = structure; -
trunk/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewInlines.h
r178928 r181407 447 447 448 448 case OversizeTypedArray: { 449 visitor.reportExtraMemory Usage(thisObject, thisObject->byteSize());449 visitor.reportExtraMemoryVisited(thisObject, thisObject->byteSize()); 450 450 break; 451 451 } -
trunk/Source/JavaScriptCore/runtime/JSString.cpp
r181297 r181407 78 78 StringImpl* impl = thisObject->m_value.impl(); 79 79 ASSERT(impl); 80 visitor.reportExtraMemory Usage(thisObject, impl->costDuringGC());80 visitor.reportExtraMemoryVisited(thisObject, impl->costDuringGC()); 81 81 } 82 82 } … … 182 182 // If we resolved a string that didn't previously exist, notify the heap that we've grown. 183 183 if (m_value.impl()->hasOneRef()) 184 Heap::heap(this)->reportExtraMemory Cost(m_value.impl()->cost());184 Heap::heap(this)->reportExtraMemoryAllocated(m_value.impl()->cost()); 185 185 } 186 186 … … 241 241 LChar* buffer; 242 242 if (RefPtr<StringImpl> newImpl = StringImpl::tryCreateUninitialized(m_length, buffer)) { 243 Heap::heap(this)->reportExtraMemory Cost(newImpl->cost());243 Heap::heap(this)->reportExtraMemoryAllocated(newImpl->cost()); 244 244 m_value = newImpl.release(); 245 245 } else { … … 255 255 UChar* buffer; 256 256 if (RefPtr<StringImpl> newImpl = StringImpl::tryCreateUninitialized(m_length, buffer)) { 257 Heap::heap(this)->reportExtraMemory Cost(newImpl->cost());257 Heap::heap(this)->reportExtraMemoryAllocated(newImpl->cost()); 258 258 m_value = newImpl.release(); 259 259 } else { -
trunk/Source/JavaScriptCore/runtime/JSString.h
r178928 r181407 108 108 m_length = length; 109 109 setIs8Bit(m_value.impl()->is8Bit()); 110 Heap::heap(this)->reportExtraMemory Cost(cost);110 Heap::heap(this)->reportExtraMemoryAllocated(cost); 111 111 vm.m_newStringsSinceLastHashCons++; 112 112 } -
trunk/Source/JavaScriptCore/runtime/SparseArrayValueMap.cpp
r171824 r181407 81 81 size_t capacity = m_map.capacity(); 82 82 if (capacity != m_reportedCapacity) { 83 Heap::heap(array)->reportExtraMemoryCost((capacity - m_reportedCapacity) * (sizeof(unsigned) + sizeof(WriteBarrier<Unknown>))); 83 // FIXME: Switch to deprecatedReportExtraMemory, or adopt reportExtraMemoryVisited. 84 // https://bugs.webkit.org/show_bug.cgi?id=142593 85 Heap::heap(array)->reportExtraMemoryAllocated((capacity - m_reportedCapacity) * (sizeof(unsigned) + sizeof(WriteBarrier<Unknown>))); 84 86 m_reportedCapacity = capacity; 85 87 } -
trunk/Source/JavaScriptCore/runtime/WeakMapData.cpp
r171824 r181407 65 65 // This isn't exact, but it is close enough, and proportional to the actual 66 66 // external mermory usage. 67 visitor.reportExtraMemory Usage(thisObj, thisObj->m_map.capacity() * (sizeof(JSObject*) + sizeof(WriteBarrier<Unknown>)));67 visitor.reportExtraMemoryVisited(thisObj, thisObj->m_map.capacity() * (sizeof(JSObject*) + sizeof(WriteBarrier<Unknown>))); 68 68 } 69 69 -
trunk/Source/WebCore/ChangeLog
r181405 r181407 1 2015-03-11 Geoffrey Garen <ggaren@apple.com> 2 3 Refactored the JSC::Heap extra cost API for clarity and to make some known bugs more obvious 4 https://bugs.webkit.org/show_bug.cgi?id=142589 5 6 Reviewed by Andreas Kling. 7 8 Updated for renames to JSC extra cost APIs. 9 10 Added FIXMEs to our 10 use cases that are currently wrong, including 11 canvas, which is the cause of https://bugs.webkit.org/show_bug.cgi?id=142457. 12 13 * Modules/mediasource/SourceBuffer.cpp: 14 (WebCore::SourceBuffer::appendBufferInternal): 15 (WebCore::SourceBuffer::sourceBufferPrivateAppendComplete): 16 (WebCore::SourceBuffer::reportExtraMemoryAllocated): 17 (WebCore::SourceBuffer::reportExtraMemoryCost): Deleted. 18 * Modules/mediasource/SourceBuffer.h: 19 * bindings/js/JSDocumentCustom.cpp: 20 (WebCore::toJS): 21 * bindings/js/JSImageDataCustom.cpp: 22 (WebCore::toJS): 23 * bindings/js/JSNodeListCustom.cpp: 24 (WebCore::createWrapper): 25 * bindings/scripts/CodeGeneratorJS.pm: 26 (GenerateImplementation): 27 * dom/CollectionIndexCache.cpp: 28 (WebCore::reportExtraMemoryAllocatedForCollectionIndexCache): 29 (WebCore::reportExtraMemoryCostForCollectionIndexCache): Deleted. 30 * dom/CollectionIndexCache.h: 31 (WebCore::Iterator>::computeNodeCountUpdatingListCache): 32 * html/HTMLCanvasElement.cpp: 33 (WebCore::HTMLCanvasElement::createImageBuffer): 34 * html/HTMLCollection.h: 35 (WebCore::CollectionNamedElementCache::didPopulate): 36 * html/HTMLImageLoader.cpp: 37 (WebCore::HTMLImageLoader::imageChanged): 38 * html/HTMLMediaElement.cpp: 39 (WebCore::HTMLMediaElement::parseAttribute): 40 * xml/XMLHttpRequest.cpp: 41 (WebCore::XMLHttpRequest::dropProtection): 42 1 43 2015-03-11 Benjamin Poulain <bpoulain@apple.com> 2 44 -
trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp
r180801 r181407 582 582 m_appendBufferTimer.startOneShot(0); 583 583 584 reportExtraMemory Cost();584 reportExtraMemoryAllocated(); 585 585 } 586 586 … … 668 668 } 669 669 670 reportExtraMemory Cost();670 reportExtraMemoryAllocated(); 671 671 if (extraMemoryCost() > this->maximumBufferSize()) 672 672 m_bufferFull = true; … … 1989 1989 } 1990 1990 1991 void SourceBuffer::reportExtraMemory Cost()1991 void SourceBuffer::reportExtraMemoryAllocated() 1992 1992 { 1993 1993 size_t extraMemoryCost = this->extraMemoryCost(); … … 1999 1999 2000 2000 JSC::JSLockHolder lock(scriptExecutionContext()->vm()); 2001 if (extraMemoryCostDelta > 0) 2002 scriptExecutionContext()->vm().heap.reportExtraMemoryCost(extraMemoryCostDelta); 2001 if (extraMemoryCostDelta > 0) { 2002 // FIXME: Switch to deprecatedReportExtraMemory, or adopt reportExtraMemoryVisited. 2003 // https://bugs.webkit.org/show_bug.cgi?id=142593 2004 scriptExecutionContext()->vm().heap.reportExtraMemoryAllocated(extraMemoryCostDelta); 2005 } 2003 2006 } 2004 2007 -
trunk/Source/WebCore/Modules/mediasource/SourceBuffer.h
r180801 r181407 193 193 194 194 size_t extraMemoryCost() const; 195 void reportExtraMemory Cost();195 void reportExtraMemoryAllocated(); 196 196 197 197 std::unique_ptr<PlatformTimeRanges> bufferedAccountingForEndOfStream() const; -
trunk/Source/WebCore/bindings/js/JSDocumentCustom.cpp
r179353 r181407 110 110 nodeCount++; 111 111 112 exec->heap()->reportExtraMemoryCost(nodeCount * sizeof(Node)); 112 // FIXME: Switch to deprecatedReportExtraMemory, or adopt reportExtraMemoryVisited. 113 // https://bugs.webkit.org/show_bug.cgi?id=142593 114 exec->heap()->reportExtraMemoryAllocated(nodeCount * sizeof(Node)); 113 115 } 114 116 -
trunk/Source/WebCore/bindings/js/JSImageDataCustom.cpp
r170167 r181407 48 48 Identifier dataName(exec, "data"); 49 49 wrapper->putDirect(exec->vm(), dataName, toJS(exec, globalObject, imageData->data()), DontDelete | ReadOnly); 50 exec->heap()->reportExtraMemoryCost(imageData->data()->length()); 50 // FIXME: Switch to deprecatedReportExtraMemory, or adopt reportExtraMemoryVisited. 51 // https://bugs.webkit.org/show_bug.cgi?id=142593 52 exec->heap()->reportExtraMemoryAllocated(imageData->data()->length()); 51 53 52 54 return wrapper; -
trunk/Source/WebCore/bindings/js/JSNodeListCustom.cpp
r166520 r181407 63 63 JSC::JSValue createWrapper(JSDOMGlobalObject& globalObject, NodeList& nodeList) 64 64 { 65 globalObject.vm().heap.reportExtraMemoryCost(nodeList.memoryCost()); 65 // FIXME: Switch to deprecatedReportExtraMemory, or adopt reportExtraMemoryVisited. 66 // https://bugs.webkit.org/show_bug.cgi?id=142593 67 globalObject.vm().heap.reportExtraMemoryAllocated(nodeList.memoryCost()); 66 68 return createNewWrapper<JSNodeList>(&globalObject, &nodeList); 67 69 } -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
r181358 r181407 2866 2866 push(@implContent, " thisObject->visitAdditionalChildren(visitor);\n") if $interface->extendedAttributes->{"JSCustomMarkFunction"}; 2867 2867 if ($interface->extendedAttributes->{"ReportExtraMemoryCost"}) { 2868 push(@implContent, " visitor.reportExtraMemory Usage(cell, thisObject->impl().memoryCost());\n");2868 push(@implContent, " visitor.reportExtraMemoryVisited(cell, thisObject->impl().memoryCost());\n"); 2869 2869 } 2870 2870 if ($numCachedAttributes > 0) { … … 3081 3081 END 3082 3082 push(@implContent, <<END) if $interface->extendedAttributes->{"ReportExtraMemoryCost"}; 3083 globalObject->vm().heap.reportExtraMemory Cost(impl->memoryCost());3083 globalObject->vm().heap.reportExtraMemoryAllocated(impl->memoryCost()); 3084 3084 END 3085 3085 -
trunk/Source/WebCore/dom/CollectionIndexCache.cpp
r164968 r181407 31 31 namespace WebCore { 32 32 33 void reportExtraMemory CostForCollectionIndexCache(size_t cost)33 void reportExtraMemoryAllocatedForCollectionIndexCache(size_t cost) 34 34 { 35 35 JSC::VM& vm = JSDOMWindowBase::commonVM(); 36 36 JSC::JSLockHolder lock(vm); 37 vm.heap.reportExtraMemoryCost(cost); 37 // FIXME: Switch to deprecatedReportExtraMemory, or adopt reportExtraMemoryVisited. 38 // https://bugs.webkit.org/show_bug.cgi?id=142593 39 vm.heap.reportExtraMemoryAllocated(cost); 38 40 } 39 41 -
trunk/Source/WebCore/dom/CollectionIndexCache.h
r166460 r181407 31 31 namespace WebCore { 32 32 33 void reportExtraMemory CostForCollectionIndexCache(size_t);33 void reportExtraMemoryAllocatedForCollectionIndexCache(size_t); 34 34 35 35 template <class Collection, class Iterator> … … 101 101 102 102 if (unsigned capacityDifference = m_cachedList.capacity() - oldCapacity) 103 reportExtraMemory CostForCollectionIndexCache(capacityDifference * sizeof(NodeType*));103 reportExtraMemoryAllocatedForCollectionIndexCache(capacityDifference * sizeof(NodeType*)); 104 104 105 105 return m_cachedList.size(); -
trunk/Source/WebCore/html/HTMLCanvasElement.cpp
r180520 r181407 577 577 JSC::JSLockHolder lock(scriptExecutionContext()->vm()); 578 578 size_t numBytes = 4 * m_imageBuffer->internalSize().width() * m_imageBuffer->internalSize().height(); 579 scriptExecutionContext()->vm().heap.reportExtraMemoryCost(numBytes); 579 // FIXME: Switch to deprecatedReportExtraMemory, or adopt reportExtraMemoryVisited. 580 // https://bugs.webkit.org/show_bug.cgi?id=142593 581 scriptExecutionContext()->vm().heap.reportExtraMemoryAllocated(numBytes); 580 582 581 583 #if USE(IOSURFACE_CANVAS_BACKING_STORE) || ENABLE(ACCELERATED_2D_CANVAS) -
trunk/Source/WebCore/html/HTMLCollection.h
r177259 r181407 161 161 #endif 162 162 if (size_t cost = memoryCost()) 163 reportExtraMemory CostForCollectionIndexCache(cost);163 reportExtraMemoryAllocatedForCollectionIndexCache(cost); 164 164 } 165 165 -
trunk/Source/WebCore/html/HTMLImageLoader.cpp
r180653 r181407 89 89 JSC::VM& vm = JSDOMWindowBase::commonVM(); 90 90 JSC::JSLockHolder lock(vm); 91 vm.heap.reportExtraMemoryCost(cachedImage->encodedSize()); 91 // FIXME: Switch to deprecatedReportExtraMemory, or adopt reportExtraMemoryVisited. 92 // https://bugs.webkit.org/show_bug.cgi?id=142593 93 vm.heap.reportExtraMemoryAllocated(cachedImage->encodedSize()); 92 94 } 93 95 } -
trunk/Source/WebCore/html/HTMLMediaElement.cpp
r181358 r181407 637 637 m_reportedExtraMemoryCost = extraMemoryCost; 638 638 639 if (extraMemoryCostDelta > 0) 640 vm.heap.reportExtraMemoryCost(extraMemoryCostDelta); 639 if (extraMemoryCostDelta > 0) { 640 // FIXME: Switch to deprecatedReportExtraMemory, or adopt reportExtraMemoryVisited. 641 // https://bugs.webkit.org/show_bug.cgi?id=142593 642 vm.heap.reportExtraMemoryAllocated(extraMemoryCostDelta); 643 } 641 644 } 642 645 } -
trunk/Source/WebCore/xml/XMLHttpRequest.cpp
r180801 r181407 914 914 JSC::VM& vm = scriptExecutionContext()->vm(); 915 915 JSC::JSLockHolder lock(vm); 916 vm.heap.reportExtraMemoryCost(m_responseBuilder.length() * 2); 916 // FIXME: Switch to deprecatedReportExtraMemory, or adopt reportExtraMemoryVisited. 917 // https://bugs.webkit.org/show_bug.cgi?id=142593 918 vm.heap.reportExtraMemoryAllocated(m_responseBuilder.length() * 2); 917 919 918 920 unsetPendingActivity(this);
Note:
See TracChangeset
for help on using the changeset viewer.