Changeset 128284 in webkit
- Timestamp:
- Sep 12, 2012 2:46:32 AM (12 years ago)
- Location:
- trunk/Source
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r128283 r128284 1 2012-09-12 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r128279. 4 http://trac.webkit.org/changeset/128279 5 https://bugs.webkit.org/show_bug.cgi?id=96487 6 7 "Snow Leopard compilation broken" (Requested by yurys on 8 #webkit). 9 10 * wtf/MemoryInstrumentation.h: 11 (GenericMemoryTypes): 12 (WebCore): 13 (WebCore::MemoryInstrumentation::addRootObject): 14 (WebCore::MemoryObjectInfo::reportObjectInfo): 15 (WebCore::MemoryClassInfo::MemoryClassInfo): 16 * wtf/text/AtomicString.h: 17 (AtomicString): 18 * wtf/text/StringImpl.h: 19 * wtf/text/WTFString.h: 20 1 21 2012-09-12 Yury Semikhatsky <yurys@chromium.org> 2 22 -
trunk/Source/WTF/wtf/MemoryInstrumentation.h
r128283 r128284 44 44 typedef const char* MemoryObjectType; 45 45 46 class GenericMemoryTypes { 47 public: 48 static MemoryObjectType Undefined; 49 }; 50 46 51 enum MemoryOwningType { 47 52 byPointer, … … 61 66 template <typename T> void addRootObject(const T& t) 62 67 { 63 addInstrumentedObject(t, 0);68 addInstrumentedObject(t, GenericMemoryTypes::Undefined); 64 69 processDeferredInstrumentedPointers(); 65 70 } … … 180 185 if (!m_objectSize) { 181 186 m_objectSize = actualSize ? actualSize : sizeof(T); 182 if ( !objectType)187 if (objectType != GenericMemoryTypes::Undefined) 183 188 m_objectType = objectType; 184 189 } … … 193 198 public: 194 199 template<typename T> 195 MemoryClassInfo(MemoryObjectInfo* memoryObjectInfo, const T*, MemoryObjectType objectType = 0, size_t actualSize = 0)200 MemoryClassInfo(MemoryObjectInfo* memoryObjectInfo, const T*, MemoryObjectType objectType = GenericMemoryTypes::Undefined, size_t actualSize = 0) 196 201 : m_memoryObjectInfo(memoryObjectInfo) 197 202 , m_memoryInstrumentation(memoryObjectInfo->memoryInstrumentation()) -
trunk/Source/WTF/wtf/text/AtomicString.h
r128279 r128284 155 155 void show() const; 156 156 #endif 157 158 template<typename MemoryObjectInfo>159 void reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const160 {161 typename MemoryObjectInfo::ClassInfo info(memoryObjectInfo, this);162 info.addInstrumentedMember(m_string);163 }164 165 157 private: 166 158 // The explicit constructors with AtomicString::ConstructFromLiteral must be used for literals. -
trunk/Source/WTF/wtf/text/StringImpl.h
r128279 r128284 715 715 ALWAYS_INLINE static StringStats& stringStats() { return m_stringStats; } 716 716 #endif 717 718 template<typename MemoryObjectInfo>719 void reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const720 {721 size_t selfSize = sizeof(StringImpl);722 723 // Count size used by internal buffer but skip strings that were constructed from literals.724 if ((m_hashAndFlags & BufferInternal) && !hasTerminatingNullCharacter())725 // Three cases are covered here:726 // 1) a normal 8-bit string with internal storage (BufferInternal)727 // 2) a normal 16-bit string with internal storage (BufferInternal)728 // 3) empty unique string with length = 0 (BufferInternal)729 selfSize += m_length * (m_hashAndFlags & s_hashFlag8BitBuffer ? sizeof(LChar) : sizeof(UChar));730 731 typename MemoryObjectInfo::ClassInfo info(memoryObjectInfo, this, 0, selfSize);732 733 if (m_hashAndFlags & BufferSubstring)734 info.addInstrumentedMember(m_substringBuffer);735 else if (m_hashAndFlags & s_hashFlagHas16BitShadow) // Substring never has its own shadow.736 info.addRawBuffer(m_copyData16, (m_length + (hasTerminatingNullCharacter() ? 1 : 0)) * sizeof(UChar));737 }738 739 717 private: 740 718 // This number must be at least 2 to avoid sharing empty, null as well as 1 character strings from SmallStrings. -
trunk/Source/WTF/wtf/text/WTFString.h
r128279 r128284 454 454 return 0; 455 455 return (*m_impl)[index]; 456 }457 458 template<typename MemoryObjectInfo>459 void reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const460 {461 typename MemoryObjectInfo::ClassInfo info(memoryObjectInfo, this);462 info.addInstrumentedMember(m_impl);463 456 } 464 457 -
trunk/Source/WebCore/ChangeLog
r128283 r128284 1 2012-09-12 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r128279. 4 http://trac.webkit.org/changeset/128279 5 https://bugs.webkit.org/show_bug.cgi?id=96487 6 7 "Snow Leopard compilation broken" (Requested by yurys on 8 #webkit). 9 10 * dom/WebCoreMemoryInstrumentation.cpp: 11 (WebCore): 12 (WebCore::String): 13 (WebCore::StringImpl): 14 (WebCore::AtomicString): 15 * dom/WebCoreMemoryInstrumentation.h: 16 (WebCore): 17 * inspector/MemoryInstrumentationImpl.cpp: 18 (WebCore::MemoryInstrumentationImpl::countObjectSize): 19 * platform/SharedBuffer.cpp: 20 (WebCore::SharedBuffer::reportMemoryUsage): 21 1 22 2012-09-12 Yury Semikhatsky <yurys@chromium.org> 2 23 -
trunk/Source/WebCore/dom/WebCoreMemoryInstrumentation.cpp
r128279 r128284 38 38 namespace WebCore { 39 39 40 MemoryObjectType GenericMemoryTypes::Undefined = 0; 41 40 42 MemoryObjectType WebCoreMemoryTypes::Page = "Page"; 41 43 MemoryObjectType WebCoreMemoryTypes::DOM = "Page.DOM"; … … 56 58 MemoryObjectType WebCoreMemoryTypes::CachedResourceXSLT = "MemoryCache.XSLT"; 57 59 60 template<> void MemoryInstrumentationTraits::addInstrumentedObject<String>(MemoryInstrumentation* instrumentation, const String* const& string, MemoryObjectType ownerObjectType, MemoryOwningType owningType) 61 { 62 MemoryInstrumentationTraits::addInstrumentedObject<const String>(instrumentation, string, ownerObjectType, owningType); 63 } 64 65 template<> void MemoryInstrumentationTraits::addInstrumentedObject<const String>(MemoryInstrumentation* instrumentation, const String* const& string, MemoryObjectType ownerObjectType, MemoryOwningType owningType) 66 { 67 if (!string || instrumentation->visited(string)) 68 return; 69 if (owningType == byPointer) 70 instrumentation->countObjectSize(ownerObjectType, sizeof(String)); 71 instrumentation->addInstrumentedObject(string->impl(), ownerObjectType); 72 } 73 74 template<> void MemoryInstrumentationTraits::addInstrumentedObject<StringImpl>(MemoryInstrumentation* instrumentation, const StringImpl* const& stringImpl, MemoryObjectType ownerObjectType, MemoryOwningType owningType) 75 { 76 MemoryInstrumentationTraits::addInstrumentedObject<const StringImpl>(instrumentation, stringImpl, ownerObjectType, owningType); 77 } 78 79 template<> void MemoryInstrumentationTraits::addInstrumentedObject<const StringImpl>(MemoryInstrumentation* instrumentation, const StringImpl* const& stringImpl, MemoryObjectType ownerObjectType, MemoryOwningType) 80 { 81 if (!stringImpl || instrumentation->visited(stringImpl)) 82 return; 83 instrumentation->countObjectSize(ownerObjectType, stringImpl->sizeInBytes()); 84 } 85 58 86 template<> void MemoryInstrumentationTraits::addInstrumentedObject<KURL>(MemoryInstrumentation* instrumentation, const KURL* const& url, MemoryObjectType ownerObjectType, MemoryOwningType owningType) 59 87 { … … 72 100 } 73 101 102 template<> void MemoryInstrumentationTraits::addInstrumentedObject<AtomicString>(MemoryInstrumentation* instrumentation, const AtomicString* const& atomicString, MemoryObjectType ownerObjectType, MemoryOwningType owningType) 103 { 104 MemoryInstrumentationTraits::addInstrumentedObject<const AtomicString>(instrumentation, atomicString, ownerObjectType, owningType); 105 } 106 107 template<> void MemoryInstrumentationTraits::addInstrumentedObject<const AtomicString>(MemoryInstrumentation* instrumentation, const AtomicString* const& atomicString, MemoryObjectType ownerObjectType, MemoryOwningType owningType) 108 { 109 MemoryInstrumentationTraits::addInstrumentedObject<const String>(instrumentation, reinterpret_cast<const String* const>(atomicString), ownerObjectType, owningType); 110 } 111 74 112 } // namespace WebCore -
trunk/Source/WebCore/dom/WebCoreMemoryInstrumentation.h
r128279 r128284 43 43 template<> void MemoryInstrumentationTraits::addInstrumentedObject<const KURL>(MemoryInstrumentation*, const KURL* const&, MemoryObjectType, MemoryOwningType); 44 44 45 template<> void MemoryInstrumentationTraits::addInstrumentedObject<String>(MemoryInstrumentation*, const String* const&, MemoryObjectType, MemoryOwningType); 46 template<> void MemoryInstrumentationTraits::addInstrumentedObject<const String>(MemoryInstrumentation*, const String* const&, MemoryObjectType, MemoryOwningType); 47 48 template<> void MemoryInstrumentationTraits::addInstrumentedObject<StringImpl>(MemoryInstrumentation*, const StringImpl* const&, MemoryObjectType, MemoryOwningType); 49 template<> void MemoryInstrumentationTraits::addInstrumentedObject<const StringImpl>(MemoryInstrumentation*, const StringImpl* const&, MemoryObjectType, MemoryOwningType); 50 51 template<> void MemoryInstrumentationTraits::addInstrumentedObject<AtomicString>(MemoryInstrumentation*, const AtomicString* const&, MemoryObjectType, MemoryOwningType); 52 template<> void MemoryInstrumentationTraits::addInstrumentedObject<const AtomicString>(MemoryInstrumentation*, const AtomicString* const&, MemoryObjectType, MemoryOwningType); 53 54 45 55 // Link time guards with no body. 46 56 template<> void MemoryInstrumentationTraits::addObject<KURL>(MemoryInstrumentation*, const KURL* const&, MemoryObjectType, MemoryOwningType); 47 57 template<> void MemoryInstrumentationTraits::addObject<const KURL>(MemoryInstrumentation*, const KURL* const&, MemoryObjectType, MemoryOwningType); 58 59 template<> void MemoryInstrumentationTraits::addObject<String>(MemoryInstrumentation*, const String* const&, MemoryObjectType, MemoryOwningType); 60 template<> void MemoryInstrumentationTraits::addObject<const String>(MemoryInstrumentation*, const String* const&, MemoryObjectType, MemoryOwningType); 61 62 template<> void MemoryInstrumentationTraits::addObject<StringImpl>(MemoryInstrumentation*, const StringImpl* const&, MemoryObjectType, MemoryOwningType); 63 template<> void MemoryInstrumentationTraits::addObject<const StringImpl>(MemoryInstrumentation*, const StringImpl* const&, MemoryObjectType, MemoryOwningType); 64 65 template<> void MemoryInstrumentationTraits::addObject<AtomicString>(MemoryInstrumentation*, const AtomicString* const&, MemoryObjectType, MemoryOwningType); 66 template<> void MemoryInstrumentationTraits::addObject<const AtomicString>(MemoryInstrumentation*, const AtomicString* const&, MemoryObjectType, MemoryOwningType); 48 67 49 68 class WebCoreMemoryTypes { -
trunk/Source/WebCore/inspector/MemoryInstrumentationImpl.cpp
r128279 r128284 53 53 void MemoryInstrumentationImpl::countObjectSize(MemoryObjectType objectType, size_t size) 54 54 { 55 ASSERT(objectType );55 ASSERT(objectType != GenericMemoryTypes::Undefined); 56 56 TypeToSizeMap::AddResult result = m_totalSizes.add(objectType, size); 57 57 if (!result.isNewEntry) -
trunk/Source/WebCore/platform/SharedBuffer.cpp
r128279 r128284 251 251 void SharedBuffer::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const 252 252 { 253 MemoryClassInfo info(memoryObjectInfo, this );253 MemoryClassInfo info(memoryObjectInfo, this, GenericMemoryTypes::Undefined); 254 254 info.addVector(m_buffer); 255 255 info.addVector(m_segments); -
trunk/Source/WebKit/chromium/ChangeLog
r128279 r128284 1 2012-09-12 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r128279. 4 http://trac.webkit.org/changeset/128279 5 https://bugs.webkit.org/show_bug.cgi?id=96487 6 7 "Snow Leopard compilation broken" (Requested by yurys on 8 #webkit). 9 10 * tests/MemoryInstrumentationTest.cpp: 11 (WebCore::InstrumentedUndefined::reportMemoryUsage): 12 (WebCore::TEST): 13 1 14 2012-09-12 Ilya Tikhonovsky <loislo@chromium.org> 2 15 -
trunk/Source/WebKit/chromium/tests/MemoryInstrumentationTest.cpp
r128279 r128284 180 180 void reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const 181 181 { 182 MemoryClassInfo info(memoryObjectInfo, this );182 MemoryClassInfo info(memoryObjectInfo, this, GenericMemoryTypes::Undefined); 183 183 } 184 184 int m_data; … … 246 246 MemoryInstrumentationImpl impl(visitedObjects); 247 247 StringOwnerInstrumented stringOwnerInstrumented; 248 stringOwnerInstrumented.m_name.characters(); // Force 16bit shadow creation.249 248 impl.addRootObject(stringOwnerInstrumented); 250 EXPECT_EQ(s izeof(StringImpl) + stringOwnerInstrumented.m_name.length() * 2, impl.reportedSizeForAllTypes());249 EXPECT_EQ(stringOwnerInstrumented.m_name.impl()->sizeInBytes(), impl.reportedSizeForAllTypes()); 251 250 EXPECT_EQ(2, visitedObjects.size()); 252 251 }
Note: See TracChangeset
for help on using the changeset viewer.