Changeset 128284 in webkit


Ignore:
Timestamp:
Sep 12, 2012 2:46:32 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

Unreviewed, rolling out r128279.
http://trac.webkit.org/changeset/128279
https://bugs.webkit.org/show_bug.cgi?id=96487

"Snow Leopard compilation broken" (Requested by yurys on
#webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2012-09-12

Source/WebCore:

  • dom/WebCoreMemoryInstrumentation.cpp:

(WebCore):
(WebCore::String):
(WebCore::StringImpl):
(WebCore::AtomicString):

  • dom/WebCoreMemoryInstrumentation.h:

(WebCore):

  • inspector/MemoryInstrumentationImpl.cpp:

(WebCore::MemoryInstrumentationImpl::countObjectSize):

  • platform/SharedBuffer.cpp:

(WebCore::SharedBuffer::reportMemoryUsage):

Source/WebKit/chromium:

  • tests/MemoryInstrumentationTest.cpp:

(WebCore::InstrumentedUndefined::reportMemoryUsage):
(WebCore::TEST):

Source/WTF:

  • wtf/MemoryInstrumentation.h:

(GenericMemoryTypes):
(WebCore):
(WebCore::MemoryInstrumentation::addRootObject):
(WebCore::MemoryObjectInfo::reportObjectInfo):
(WebCore::MemoryClassInfo::MemoryClassInfo):

  • wtf/text/AtomicString.h:

(AtomicString):

  • wtf/text/StringImpl.h:
  • wtf/text/WTFString.h:
Location:
trunk/Source
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r128283 r128284  
     12012-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
    1212012-09-12  Yury Semikhatsky  <yurys@chromium.org>
    222
  • trunk/Source/WTF/wtf/MemoryInstrumentation.h

    r128283 r128284  
    4444typedef const char* MemoryObjectType;
    4545
     46class GenericMemoryTypes {
     47public:
     48    static MemoryObjectType Undefined;
     49};
     50
    4651enum MemoryOwningType {
    4752    byPointer,
     
    6166    template <typename T> void addRootObject(const T& t)
    6267    {
    63         addInstrumentedObject(t, 0);
     68        addInstrumentedObject(t, GenericMemoryTypes::Undefined);
    6469        processDeferredInstrumentedPointers();
    6570    }
     
    180185        if (!m_objectSize) {
    181186            m_objectSize = actualSize ? actualSize : sizeof(T);
    182             if (!objectType)
     187            if (objectType != GenericMemoryTypes::Undefined)
    183188                m_objectType = objectType;
    184189        }
     
    193198public:
    194199    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)
    196201        : m_memoryObjectInfo(memoryObjectInfo)
    197202        , m_memoryInstrumentation(memoryObjectInfo->memoryInstrumentation())
  • trunk/Source/WTF/wtf/text/AtomicString.h

    r128279 r128284  
    155155    void show() const;
    156156#endif
    157 
    158     template<typename MemoryObjectInfo>
    159     void reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
    160     {
    161         typename MemoryObjectInfo::ClassInfo info(memoryObjectInfo, this);
    162         info.addInstrumentedMember(m_string);
    163     }
    164    
    165157private:
    166158    // The explicit constructors with AtomicString::ConstructFromLiteral must be used for literals.
  • trunk/Source/WTF/wtf/text/StringImpl.h

    r128279 r128284  
    715715    ALWAYS_INLINE static StringStats& stringStats() { return m_stringStats; }
    716716#endif
    717 
    718     template<typename MemoryObjectInfo>
    719     void reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
    720     {
    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 
    739717private:
    740718    // 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  
    454454            return 0;
    455455        return (*m_impl)[index];
    456     }
    457 
    458     template<typename MemoryObjectInfo>
    459     void reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
    460     {
    461         typename MemoryObjectInfo::ClassInfo info(memoryObjectInfo, this);
    462         info.addInstrumentedMember(m_impl);
    463456    }
    464457
  • trunk/Source/WebCore/ChangeLog

    r128283 r128284  
     12012-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
    1222012-09-12  Yury Semikhatsky  <yurys@chromium.org>
    223
  • trunk/Source/WebCore/dom/WebCoreMemoryInstrumentation.cpp

    r128279 r128284  
    3838namespace WebCore {
    3939
     40MemoryObjectType GenericMemoryTypes::Undefined = 0;
     41
    4042MemoryObjectType WebCoreMemoryTypes::Page = "Page";
    4143MemoryObjectType WebCoreMemoryTypes::DOM = "Page.DOM";
     
    5658MemoryObjectType WebCoreMemoryTypes::CachedResourceXSLT = "MemoryCache.XSLT";
    5759
     60template<> 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
     65template<> 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
     74template<> 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
     79template<> 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
    5886template<> void MemoryInstrumentationTraits::addInstrumentedObject<KURL>(MemoryInstrumentation* instrumentation, const KURL* const& url, MemoryObjectType ownerObjectType, MemoryOwningType owningType)
    5987{
     
    72100}
    73101
     102template<> 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
     107template<> 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
    74112} // namespace WebCore
  • trunk/Source/WebCore/dom/WebCoreMemoryInstrumentation.h

    r128279 r128284  
    4343template<> void MemoryInstrumentationTraits::addInstrumentedObject<const KURL>(MemoryInstrumentation*, const KURL* const&, MemoryObjectType, MemoryOwningType);
    4444
     45template<> void MemoryInstrumentationTraits::addInstrumentedObject<String>(MemoryInstrumentation*, const String* const&, MemoryObjectType, MemoryOwningType);
     46template<> void MemoryInstrumentationTraits::addInstrumentedObject<const String>(MemoryInstrumentation*, const String* const&, MemoryObjectType, MemoryOwningType);
     47
     48template<> void MemoryInstrumentationTraits::addInstrumentedObject<StringImpl>(MemoryInstrumentation*, const StringImpl* const&, MemoryObjectType, MemoryOwningType);
     49template<> void MemoryInstrumentationTraits::addInstrumentedObject<const StringImpl>(MemoryInstrumentation*, const StringImpl* const&, MemoryObjectType, MemoryOwningType);
     50
     51template<> void MemoryInstrumentationTraits::addInstrumentedObject<AtomicString>(MemoryInstrumentation*, const AtomicString* const&, MemoryObjectType, MemoryOwningType);
     52template<> void MemoryInstrumentationTraits::addInstrumentedObject<const AtomicString>(MemoryInstrumentation*, const AtomicString* const&, MemoryObjectType, MemoryOwningType);
     53
     54
    4555// Link time guards with no body.
    4656template<> void MemoryInstrumentationTraits::addObject<KURL>(MemoryInstrumentation*, const KURL* const&, MemoryObjectType, MemoryOwningType);
    4757template<> void MemoryInstrumentationTraits::addObject<const KURL>(MemoryInstrumentation*, const KURL* const&, MemoryObjectType, MemoryOwningType);
     58
     59template<> void MemoryInstrumentationTraits::addObject<String>(MemoryInstrumentation*, const String* const&, MemoryObjectType, MemoryOwningType);
     60template<> void MemoryInstrumentationTraits::addObject<const String>(MemoryInstrumentation*, const String* const&, MemoryObjectType, MemoryOwningType);
     61
     62template<> void MemoryInstrumentationTraits::addObject<StringImpl>(MemoryInstrumentation*, const StringImpl* const&, MemoryObjectType, MemoryOwningType);
     63template<> void MemoryInstrumentationTraits::addObject<const StringImpl>(MemoryInstrumentation*, const StringImpl* const&, MemoryObjectType, MemoryOwningType);
     64
     65template<> void MemoryInstrumentationTraits::addObject<AtomicString>(MemoryInstrumentation*, const AtomicString* const&, MemoryObjectType, MemoryOwningType);
     66template<> void MemoryInstrumentationTraits::addObject<const AtomicString>(MemoryInstrumentation*, const AtomicString* const&, MemoryObjectType, MemoryOwningType);
    4867
    4968class WebCoreMemoryTypes {
  • trunk/Source/WebCore/inspector/MemoryInstrumentationImpl.cpp

    r128279 r128284  
    5353void MemoryInstrumentationImpl::countObjectSize(MemoryObjectType objectType, size_t size)
    5454{
    55     ASSERT(objectType);
     55    ASSERT(objectType != GenericMemoryTypes::Undefined);
    5656    TypeToSizeMap::AddResult result = m_totalSizes.add(objectType, size);
    5757    if (!result.isNewEntry)
  • trunk/Source/WebCore/platform/SharedBuffer.cpp

    r128279 r128284  
    251251void SharedBuffer::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
    252252{
    253     MemoryClassInfo info(memoryObjectInfo, this);
     253    MemoryClassInfo info(memoryObjectInfo, this, GenericMemoryTypes::Undefined);
    254254    info.addVector(m_buffer);
    255255    info.addVector(m_segments);
  • trunk/Source/WebKit/chromium/ChangeLog

    r128279 r128284  
     12012-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
    1142012-09-12  Ilya Tikhonovsky  <loislo@chromium.org>
    215
  • trunk/Source/WebKit/chromium/tests/MemoryInstrumentationTest.cpp

    r128279 r128284  
    180180    void reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
    181181    {
    182         MemoryClassInfo info(memoryObjectInfo, this);
     182        MemoryClassInfo info(memoryObjectInfo, this, GenericMemoryTypes::Undefined);
    183183    }
    184184    int m_data;
     
    246246    MemoryInstrumentationImpl impl(visitedObjects);
    247247    StringOwnerInstrumented stringOwnerInstrumented;
    248     stringOwnerInstrumented.m_name.characters(); // Force 16bit shadow creation.
    249248    impl.addRootObject(stringOwnerInstrumented);
    250     EXPECT_EQ(sizeof(StringImpl) + stringOwnerInstrumented.m_name.length() * 2, impl.reportedSizeForAllTypes());
     249    EXPECT_EQ(stringOwnerInstrumented.m_name.impl()->sizeInBytes(), impl.reportedSizeForAllTypes());
    251250    EXPECT_EQ(2, visitedObjects.size());
    252251}
Note: See TracChangeset for help on using the changeset viewer.