Title: [130137] trunk/Source
Revision
130137
Author
ca...@chromium.org
Date
2012-10-02 01:25:19 -0700 (Tue, 02 Oct 2012)

Log Message

Unreviewed, rolling out r130129.
http://trac.webkit.org/changeset/130129
https://bugs.webkit.org/show_bug.cgi?id=98125

broke 4 webkit_unit_tests
(MemoryInstrumentationTest.hashMapWith*) (Requested by caseq
on #webkit).

Patch by Sheriff Bot <webkit.review....@gmail.com> on 2012-10-02

Source/WebCore:

* dom/WebCoreMemoryInstrumentation.h:
* platform/KURL.cpp:
* platform/KURLGoogle.cpp:
* platform/PlatformMemoryInstrumentation.h:

Source/WebKit/chromium:

* tests/MemoryInstrumentationTest.cpp:

Source/WTF:

* GNUmakefile.list.am:
* WTF.gypi:
* WTF.pro:
* WTF.vcproj/WTF.vcproj:
* WTF.xcodeproj/project.pbxproj:
* wtf/MemoryInstrumentation.h:
(WTF):
* wtf/MemoryInstrumentationString.h: Removed.
* wtf/text/AtomicString.cpp:
(WTF::AtomicString::reportMemoryUsage):
(WTF):
* wtf/text/AtomicString.h:
(AtomicString):
* wtf/text/CString.h:
(WTF::CStringBuffer::length):
(CStringBuffer):
(WTF::CStringBuffer::reportMemoryUsage):
(CString):
(WTF::CString::reportMemoryUsage):
* wtf/text/StringImpl.cpp:
(WTF::StringImpl::reportMemoryUsage):
(WTF):
* wtf/text/StringImpl.h:
(StringImpl):
* wtf/text/WTFString.cpp:
(WTF::String::reportMemoryUsage):
(WTF):
* wtf/text/WTFString.h:
(String):

Modified Paths

Removed Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (130136 => 130137)


--- trunk/Source/WTF/ChangeLog	2012-10-02 08:20:47 UTC (rev 130136)
+++ trunk/Source/WTF/ChangeLog	2012-10-02 08:25:19 UTC (rev 130137)
@@ -1,3 +1,43 @@
+2012-10-02  Sheriff Bot  <webkit.review....@gmail.com>
+
+        Unreviewed, rolling out r130129.
+        http://trac.webkit.org/changeset/130129
+        https://bugs.webkit.org/show_bug.cgi?id=98125
+
+        broke 4 webkit_unit_tests
+        (MemoryInstrumentationTest.hashMapWith*) (Requested by caseq
+        on #webkit).
+
+        * GNUmakefile.list.am:
+        * WTF.gypi:
+        * WTF.pro:
+        * WTF.vcproj/WTF.vcproj:
+        * WTF.xcodeproj/project.pbxproj:
+        * wtf/MemoryInstrumentation.h:
+        (WTF):
+        * wtf/MemoryInstrumentationString.h: Removed.
+        * wtf/text/AtomicString.cpp:
+        (WTF::AtomicString::reportMemoryUsage):
+        (WTF):
+        * wtf/text/AtomicString.h:
+        (AtomicString):
+        * wtf/text/CString.h:
+        (WTF::CStringBuffer::length):
+        (CStringBuffer):
+        (WTF::CStringBuffer::reportMemoryUsage):
+        (CString):
+        (WTF::CString::reportMemoryUsage):
+        * wtf/text/StringImpl.cpp:
+        (WTF::StringImpl::reportMemoryUsage):
+        (WTF):
+        * wtf/text/StringImpl.h:
+        (StringImpl):
+        * wtf/text/WTFString.cpp:
+        (WTF::String::reportMemoryUsage):
+        (WTF):
+        * wtf/text/WTFString.h:
+        (String):
+
 2012-09-29  Ilya Tikhonovsky  <loi...@chromium.org>
 
         Web Inspector: NMI make String* instrumentation non intrusive

Modified: trunk/Source/WTF/GNUmakefile.list.am (130136 => 130137)


--- trunk/Source/WTF/GNUmakefile.list.am	2012-10-02 08:20:47 UTC (rev 130136)
+++ trunk/Source/WTF/GNUmakefile.list.am	2012-10-02 08:25:19 UTC (rev 130137)
@@ -83,7 +83,6 @@
     Source/WTF/wtf/MemoryInstrumentationArrayBufferView.h \
     Source/WTF/wtf/MemoryInstrumentationHashMap.h \
     Source/WTF/wtf/MemoryInstrumentationHashSet.h \
-    Source/WTF/wtf/MemoryInstrumentationString.h \
     Source/WTF/wtf/MemoryInstrumentationVector.h \
     Source/WTF/wtf/MessageQueue.h \
     Source/WTF/wtf/MetaAllocator.cpp \

Modified: trunk/Source/WTF/WTF.gypi (130136 => 130137)


--- trunk/Source/WTF/WTF.gypi	2012-10-02 08:20:47 UTC (rev 130136)
+++ trunk/Source/WTF/WTF.gypi	2012-10-02 08:25:19 UTC (rev 130137)
@@ -53,7 +53,6 @@
             'wtf/MemoryInstrumentationArrayBufferView.h',
             'wtf/MemoryInstrumentationHashMap.h',
             'wtf/MemoryInstrumentationHashSet.h',
-            'wtf/MemoryInstrumentationString.h',
             'wtf/MemoryInstrumentationVector.h',
             'wtf/MessageQueue.h',
             'wtf/NonCopyingSort.h',

Modified: trunk/Source/WTF/WTF.pro (130136 => 130137)


--- trunk/Source/WTF/WTF.pro	2012-10-02 08:20:47 UTC (rev 130136)
+++ trunk/Source/WTF/WTF.pro	2012-10-02 08:25:19 UTC (rev 130137)
@@ -90,7 +90,6 @@
     MemoryInstrumentationArrayBufferView.h \
     MemoryInstrumentationHashMap.h \
     MemoryInstrumentationHashSet.h \
-    MemoryInstrumentationString.h \
     MemoryInstrumentationVector.h \
     MessageQueue.h \
     MetaAllocator.h \

Modified: trunk/Source/WTF/WTF.vcproj/WTF.vcproj (130136 => 130137)


--- trunk/Source/WTF/WTF.vcproj/WTF.vcproj	2012-10-02 08:20:47 UTC (rev 130136)
+++ trunk/Source/WTF/WTF.vcproj/WTF.vcproj	2012-10-02 08:25:19 UTC (rev 130137)
@@ -917,10 +917,6 @@
 			>
 		</File>
 		<File
-		        RelativePath="..\wtf\MemoryInstrumentationString.h"
-			>
-		</File>
-		<File
 		        RelativePath="..\wtf\MemoryInstrumentationVector.h"
 			>
 		</File>

Modified: trunk/Source/WTF/WTF.xcodeproj/project.pbxproj (130136 => 130137)


--- trunk/Source/WTF/WTF.xcodeproj/project.pbxproj	2012-10-02 08:20:47 UTC (rev 130136)
+++ trunk/Source/WTF/WTF.xcodeproj/project.pbxproj	2012-10-02 08:25:19 UTC (rev 130137)
@@ -43,7 +43,6 @@
 		4F1B2DB6160B44AA00586559 /* MemoryInstrumentationHashSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 4F1B2DB5160B44AA00586559 /* MemoryInstrumentationHashSet.h */; };
 		4F1D115415FF11BE0026E908 /* MemoryInstrumentation.h in Headers */ = {isa = PBXBuildFile; fileRef = 4F1D115315FF11BE0026E908 /* MemoryInstrumentation.h */; };
 		4FCB710A160A1A07008425EC /* MemoryInstrumentationVector.h in Headers */ = {isa = PBXBuildFile; fileRef = 4FCB7109160A1A07008425EC /* MemoryInstrumentationVector.h */; };
-		4FCF27E116172E8600CBF037 /* MemoryInstrumentationString.h in Headers */ = {isa = PBXBuildFile; fileRef = 4FCF27E016172E8600CBF037 /* MemoryInstrumentationString.h */; };
 		4FD8554716133E0E00C5B704 /* MemoryInstrumentationArrayBufferView.h in Headers */ = {isa = PBXBuildFile; fileRef = 4FD8554616133E0E00C5B704 /* MemoryInstrumentationArrayBufferView.h */; };
 		7E29C33E15FFD79B00516D61 /* ObjcRuntimeExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E29C33D15FFD79B00516D61 /* ObjcRuntimeExtras.h */; };
 		8134013815B092FD001FF0B8 /* Base64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8134013615B092FD001FF0B8 /* Base64.cpp */; };
@@ -316,7 +315,6 @@
 		4F1B2DB5160B44AA00586559 /* MemoryInstrumentationHashSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MemoryInstrumentationHashSet.h; sourceTree = "<group>"; };
 		4F1D115315FF11BE0026E908 /* MemoryInstrumentation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MemoryInstrumentation.h; sourceTree = "<group>"; };
 		4FCB7109160A1A07008425EC /* MemoryInstrumentationVector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MemoryInstrumentationVector.h; sourceTree = "<group>"; };
-		4FCF27E016172E8600CBF037 /* MemoryInstrumentationString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MemoryInstrumentationString.h; sourceTree = "<group>"; };
 		4FD8554616133E0E00C5B704 /* MemoryInstrumentationArrayBufferView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MemoryInstrumentationArrayBufferView.h; sourceTree = "<group>"; };
 		5D247B6214689B8600E78B76 /* libWTF.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libWTF.a; sourceTree = BUILT_PRODUCTS_DIR; };
 		5D247B6E14689C4700E78B76 /* Base.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Base.xcconfig; sourceTree = "<group>"; };
@@ -703,7 +701,6 @@
 				4FD8554616133E0E00C5B704 /* MemoryInstrumentationArrayBufferView.h */,
 				F3525E451619A4EE00278BC1 /* MemoryInstrumentationHashMap.h */,
 				4F1B2DB5160B44AA00586559 /* MemoryInstrumentationHashSet.h */,
-				4FCF27E016172E8600CBF037 /* MemoryInstrumentationString.h */,
 				4FCB7109160A1A07008425EC /* MemoryInstrumentationVector.h */,
 				A8A472CC151A825B004123FF /* MessageQueue.h */,
 				A8A472CD151A825B004123FF /* MetaAllocator.cpp */,
@@ -1160,7 +1157,6 @@
 				4F1B2DB6160B44AA00586559 /* MemoryInstrumentationHashSet.h in Headers */,
 				4FD8554716133E0E00C5B704 /* MemoryInstrumentationArrayBufferView.h in Headers */,
 				F3525E461619A4EE00278BC1 /* MemoryInstrumentationHashMap.h in Headers */,
-				4FCF27E116172E8600CBF037 /* MemoryInstrumentationString.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};

Modified: trunk/Source/WTF/wtf/MemoryInstrumentation.h (130136 => 130137)


--- trunk/Source/WTF/wtf/MemoryInstrumentation.h	2012-10-02 08:20:47 UTC (rev 130136)
+++ trunk/Source/WTF/wtf/MemoryInstrumentation.h	2012-10-02 08:25:19 UTC (rev 130137)
@@ -307,28 +307,13 @@
     memoryInstrumentation->countObjectSize(memoryObjectInfo.objectType(), memoryObjectInfo.objectSize());
 }
 
-// Link time guard for classes with external memory instrumentation.
+// Link time guard for vector memory instrumentation.
 template<typename T, size_t inlineCapacity> class Vector;
 template<typename T, size_t inlineCapacity> void reportMemoryUsage(const Vector<T, inlineCapacity>* const&, MemoryObjectInfo*);
 
 template<typename KeyArg, typename MappedArg, typename HashArg, typename KeyTraitsArg, typename MappedTraitsArg> class HashMap;
 template<typename KeyArg, typename MappedArg, typename HashArg, typename KeyTraitsArg, typename MappedTraitsArg> void reportMemoryUsage(const HashMap<KeyArg, MappedArg, HashArg, KeyTraitsArg, MappedTraitsArg>* const&, MemoryObjectInfo*);
 
-class String;
-void reportMemoryUsage(const String* const&, MemoryObjectInfo*);
-
-class StringImpl;
-void reportMemoryUsage(const StringImpl* const&, MemoryObjectInfo*);
-
-class AtomicString;
-void reportMemoryUsage(const AtomicString* const&, MemoryObjectInfo*);
-
-class CString;
-void reportMemoryUsage(const CString* const&, MemoryObjectInfo*);
-
-class CStringBuffer;
-void reportMemoryUsage(const CStringBuffer* const&, MemoryObjectInfo*);
-
 } // namespace WTF
 
 #endif // !defined(MemoryInstrumentation_h)

Deleted: trunk/Source/WTF/wtf/MemoryInstrumentationString.h (130136 => 130137)


--- trunk/Source/WTF/wtf/MemoryInstrumentationString.h	2012-10-02 08:20:47 UTC (rev 130136)
+++ trunk/Source/WTF/wtf/MemoryInstrumentationString.h	2012-10-02 08:25:19 UTC (rev 130137)
@@ -1,92 +0,0 @@
-/*
- * Copyright (C) 2012 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- *     * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef MemoryInstrumentationString_h
-#define MemoryInstrumentationString_h
-
-#include <wtf/MemoryInstrumentation.h>
-#include <wtf/text/AtomicString.h>
-#include <wtf/text/CString.h>
-#include <wtf/text/StringBuilder.h>
-#include <wtf/text/WTFString.h>
-
-namespace WTF {
-
-inline void reportMemoryUsage(const StringImpl* const& stringImpl, MemoryObjectInfo* memoryObjectInfo)
-{
-    size_t selfSize = sizeof(StringImpl);
-
-    // Count size used by internal buffer but skip strings that were constructed from literals.
-    if (stringImpl->hasInternalBuffer())
-        selfSize += stringImpl->length() * (stringImpl->is8Bit() ? sizeof(LChar) : sizeof(UChar));
-
-    MemoryClassInfo info(memoryObjectInfo, stringImpl, 0, selfSize);
-
-    if (StringImpl* baseString = stringImpl->baseString())
-        info.addMember(baseString);
-    else {
-        if (stringImpl->hasOwnedBuffer()) {
-            if (stringImpl->is8Bit())
-                info.addRawBuffer(stringImpl->characters8(), stringImpl->length());
-            else
-                info.addRawBuffer(stringImpl->characters16(), stringImpl->length() * 2);
-        }
-
-        if (stringImpl->has16BitShadow())
-            info.addRawBuffer(stringImpl->characters(), (stringImpl->length() + (stringImpl->hasTerminatingNullCharacter() ? 1 : 0)) * sizeof(UChar));
-    }
-}
-
-inline void reportMemoryUsage(const String* const& string, MemoryObjectInfo* memoryObjectInfo)
-{
-    MemoryClassInfo info(memoryObjectInfo, string);
-    info.addMember(string->impl());
-}
-
-inline void reportMemoryUsage(const AtomicString* const& atomicString, MemoryObjectInfo* memoryObjectInfo)
-{
-    MemoryClassInfo info(memoryObjectInfo, atomicString);
-    info.addMember(atomicString->string());
-}
-
-inline void reportMemoryUsage(const CStringBuffer* const& cStringBuffer, MemoryObjectInfo* memoryObjectInfo)
-{
-    MemoryClassInfo info(memoryObjectInfo, cStringBuffer, 0, sizeof(*cStringBuffer) + cStringBuffer->length());
-}
-
-inline void reportMemoryUsage(const CString* const& cString, MemoryObjectInfo* memoryObjectInfo)
-{
-    MemoryClassInfo info(memoryObjectInfo, cString);
-    info.addMember(cString->buffer());
-}
-
-}
-
-#endif // !defined(MemoryInstrumentationVector_h)

Modified: trunk/Source/WTF/wtf/text/AtomicString.cpp (130136 => 130137)


--- trunk/Source/WTF/wtf/text/AtomicString.cpp	2012-10-02 08:20:47 UTC (rev 130136)
+++ trunk/Source/WTF/wtf/text/AtomicString.cpp	2012-10-02 08:25:19 UTC (rev 130137)
@@ -436,4 +436,10 @@
 }
 #endif
 
+void AtomicString::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
+{
+    MemoryClassInfo info(memoryObjectInfo, this);
+    info.addMember(m_string);
+}
+
 } // namespace WTF

Modified: trunk/Source/WTF/wtf/text/AtomicString.h (130136 => 130137)


--- trunk/Source/WTF/wtf/text/AtomicString.h	2012-10-02 08:20:47 UTC (rev 130136)
+++ trunk/Source/WTF/wtf/text/AtomicString.h	2012-10-02 08:25:19 UTC (rev 130137)
@@ -159,6 +159,8 @@
     void show() const;
 #endif
 
+    WTF_EXPORT_STRING_API void reportMemoryUsage(MemoryObjectInfo*) const;
+
 private:
     // The explicit constructors with AtomicString::ConstructFromLiteral must be used for literals.
     AtomicString(ASCIILiteral);

Modified: trunk/Source/WTF/wtf/text/CString.h (130136 => 130137)


--- trunk/Source/WTF/wtf/text/CString.h	2012-10-02 08:20:47 UTC (rev 130136)
+++ trunk/Source/WTF/wtf/text/CString.h	2012-10-02 08:25:19 UTC (rev 130137)
@@ -37,8 +37,14 @@
 class CStringBuffer : public RefCounted<CStringBuffer> {
 public:
     const char* data() { return m_data; }
-    size_t length() const { return m_length; }
+    size_t length() { return m_length; }
 
+    template<typename MemoryObjectInfo>
+    void reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
+    {
+        typename MemoryObjectInfo::ClassInfo info(memoryObjectInfo, this, 0, sizeof(CStringBuffer) + m_length);
+    }
+
 private:
     friend class CString;
 
@@ -75,6 +81,13 @@
 
     CStringBuffer* buffer() const { return m_buffer.get(); }
 
+    template<typename MemoryObjectInfo>
+    void reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
+    {
+        typename MemoryObjectInfo::ClassInfo info(memoryObjectInfo, this);
+        info.addMember(m_buffer);
+    }
+
 private:
     void copyBufferIfNeeded();
     void init(const char*, size_t length);

Modified: trunk/Source/WTF/wtf/text/StringImpl.cpp (130136 => 130137)


--- trunk/Source/WTF/wtf/text/StringImpl.cpp	2012-10-02 08:20:47 UTC (rev 130136)
+++ trunk/Source/WTF/wtf/text/StringImpl.cpp	2012-10-02 08:25:19 UTC (rev 130137)
@@ -1792,4 +1792,24 @@
     return size + sizeof(*this);
 }
 
+void StringImpl::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
+{
+    size_t selfSize = sizeof(StringImpl);
+
+        // Count size used by internal buffer but skip strings that were constructed from literals.
+    if ((m_hashAndFlags & BufferInternal) && !hasTerminatingNullCharacter())
+        // Three cases are covered here:
+        // 1) a normal 8-bit string with internal storage (BufferInternal)
+        // 2) a normal 16-bit string with internal storage (BufferInternal)
+        // 3) empty unique string with length = 0 (BufferInternal)
+        selfSize += m_length * (m_hashAndFlags & s_hashFlag8BitBuffer ? sizeof(LChar) : sizeof(UChar));
+
+    MemoryClassInfo info(memoryObjectInfo, this, 0, selfSize);
+
+    if (m_hashAndFlags & BufferSubstring)
+        info.addMember(m_substringBuffer);
+    else if (m_hashAndFlags & s_hashFlagHas16BitShadow) // Substring never has its own shadow.
+        info.addRawBuffer(m_copyData16, (m_length + (hasTerminatingNullCharacter() ? 1 : 0)) * sizeof(UChar));
+}
+
 } // namespace WTF

Modified: trunk/Source/WTF/wtf/text/StringImpl.h (130136 => 130137)


--- trunk/Source/WTF/wtf/text/StringImpl.h	2012-10-02 08:20:47 UTC (rev 130136)
+++ trunk/Source/WTF/wtf/text/StringImpl.h	2012-10-02 08:25:19 UTC (rev 130137)
@@ -453,9 +453,6 @@
 
     unsigned length() const { return m_length; }
     bool is8Bit() const { return m_hashAndFlags & s_hashFlag8BitBuffer; }
-    bool hasInternalBuffer() const { return bufferOwnership() == BufferInternal && !hasTerminatingNullCharacter(); }
-    bool hasOwnedBuffer() const { return bufferOwnership() == BufferOwned; }
-    StringImpl* baseString() const { return bufferOwnership() == BufferSubstring ? m_substringBuffer : 0; }
 
     // FIXME: Remove all unnecessary usages of characters()
     ALWAYS_INLINE const LChar* characters8() const { ASSERT(is8Bit()); return m_data8; }
@@ -719,6 +716,8 @@
     ALWAYS_INLINE static StringStats& stringStats() { return m_stringStats; }
 #endif
 
+    WTF_EXPORT_STRING_API void reportMemoryUsage(MemoryObjectInfo*) const;
+
 private:
     // This number must be at least 2 to avoid sharing empty, null as well as 1 character strings from SmallStrings.
     static const unsigned s_copyCharsInlineCutOff = 20;

Modified: trunk/Source/WTF/wtf/text/WTFString.cpp (130136 => 130137)


--- trunk/Source/WTF/wtf/text/WTFString.cpp	2012-10-02 08:20:47 UTC (rev 130136)
+++ trunk/Source/WTF/wtf/text/WTFString.cpp	2012-10-02 08:25:19 UTC (rev 130137)
@@ -835,6 +835,12 @@
     return utf8;
 }
 
+void String::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
+{
+    MemoryClassInfo info(memoryObjectInfo, this);
+    info.addMember(m_impl);
+}
+
 // String Operations
 
 static bool isCharacterAllowedInBase(UChar c, int base)

Modified: trunk/Source/WTF/wtf/text/WTFString.h (130136 => 130137)


--- trunk/Source/WTF/wtf/text/WTFString.h	2012-10-02 08:20:47 UTC (rev 130136)
+++ trunk/Source/WTF/wtf/text/WTFString.h	2012-10-02 08:25:19 UTC (rev 130137)
@@ -457,6 +457,8 @@
         return (*m_impl)[index];
     }
 
+    WTF_EXPORT_STRING_API void reportMemoryUsage(MemoryObjectInfo*) const;
+
 private:
     RefPtr<StringImpl> m_impl;
 };

Modified: trunk/Source/WebCore/ChangeLog (130136 => 130137)


--- trunk/Source/WebCore/ChangeLog	2012-10-02 08:20:47 UTC (rev 130136)
+++ trunk/Source/WebCore/ChangeLog	2012-10-02 08:25:19 UTC (rev 130137)
@@ -1,3 +1,18 @@
+2012-10-02  Sheriff Bot  <webkit.review....@gmail.com>
+
+        Unreviewed, rolling out r130129.
+        http://trac.webkit.org/changeset/130129
+        https://bugs.webkit.org/show_bug.cgi?id=98125
+
+        broke 4 webkit_unit_tests
+        (MemoryInstrumentationTest.hashMapWith*) (Requested by caseq
+        on #webkit).
+
+        * dom/WebCoreMemoryInstrumentation.h:
+        * platform/KURL.cpp:
+        * platform/KURLGoogle.cpp:
+        * platform/PlatformMemoryInstrumentation.h:
+
 2012-10-02  Pavel Feldman  <pfeld...@chromium.org>
 
         Web Inspector: move runScript into the snippets model

Modified: trunk/Source/WebCore/dom/WebCoreMemoryInstrumentation.h (130136 => 130137)


--- trunk/Source/WebCore/dom/WebCoreMemoryInstrumentation.h	2012-10-02 08:20:47 UTC (rev 130136)
+++ trunk/Source/WebCore/dom/WebCoreMemoryInstrumentation.h	2012-10-02 08:25:19 UTC (rev 130137)
@@ -32,7 +32,6 @@
 #define WebCoreMemoryInstrumentation_h
 
 #include "PlatformMemoryInstrumentation.h"
-#include <wtf/MemoryInstrumentationString.h>
 
 namespace WebCore {
 

Modified: trunk/Source/WebCore/platform/KURL.cpp (130136 => 130137)


--- trunk/Source/WebCore/platform/KURL.cpp	2012-10-02 08:20:47 UTC (rev 130136)
+++ trunk/Source/WebCore/platform/KURL.cpp	2012-10-02 08:25:19 UTC (rev 130137)
@@ -35,7 +35,6 @@
 #if !USE(WTFURL)
 #include <wtf/HexNumber.h>
 #endif
-#include <wtf/MemoryInstrumentationString.h>
 #include <wtf/StdLibExtras.h>
 #include <wtf/text/CString.h>
 #include <wtf/text/StringBuilder.h>

Modified: trunk/Source/WebCore/platform/KURLGoogle.cpp (130136 => 130137)


--- trunk/Source/WebCore/platform/KURLGoogle.cpp	2012-10-02 08:20:47 UTC (rev 130136)
+++ trunk/Source/WebCore/platform/KURLGoogle.cpp	2012-10-02 08:25:19 UTC (rev 130137)
@@ -44,7 +44,6 @@
 #include "PlatformMemoryInstrumentation.h"
 #include "TextEncoding.h"
 #include <wtf/HashMap.h>
-#include <wtf/MemoryInstrumentationString.h>
 #include <wtf/Vector.h>
 #include <wtf/StdLibExtras.h>
 #include <wtf/text/CString.h>

Modified: trunk/Source/WebCore/platform/PlatformMemoryInstrumentation.h (130136 => 130137)


--- trunk/Source/WebCore/platform/PlatformMemoryInstrumentation.h	2012-10-02 08:20:47 UTC (rev 130136)
+++ trunk/Source/WebCore/platform/PlatformMemoryInstrumentation.h	2012-10-02 08:25:19 UTC (rev 130137)
@@ -32,7 +32,6 @@
 #define PlatformMemoryInstrumentation_h
 
 #include <wtf/MemoryInstrumentation.h>
-#include <wtf/MemoryInstrumentationString.h>
 
 namespace WebCore {
 

Modified: trunk/Source/WebKit/chromium/ChangeLog (130136 => 130137)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-10-02 08:20:47 UTC (rev 130136)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-10-02 08:25:19 UTC (rev 130137)
@@ -1,3 +1,15 @@
+2012-10-02  Sheriff Bot  <webkit.review....@gmail.com>
+
+        Unreviewed, rolling out r130129.
+        http://trac.webkit.org/changeset/130129
+        https://bugs.webkit.org/show_bug.cgi?id=98125
+
+        broke 4 webkit_unit_tests
+        (MemoryInstrumentationTest.hashMapWith*) (Requested by caseq
+        on #webkit).
+
+        * tests/MemoryInstrumentationTest.cpp:
+
 2012-09-29  Ilya Tikhonovsky  <loi...@chromium.org>
 
         Web Inspector: NMI make String* instrumentation non intrusive

Modified: trunk/Source/WebKit/chromium/tests/MemoryInstrumentationTest.cpp (130136 => 130137)


--- trunk/Source/WebKit/chromium/tests/MemoryInstrumentationTest.cpp	2012-10-02 08:20:47 UTC (rev 130136)
+++ trunk/Source/WebKit/chromium/tests/MemoryInstrumentationTest.cpp	2012-10-02 08:25:19 UTC (rev 130137)
@@ -42,13 +42,11 @@
 #include <wtf/MemoryInstrumentationArrayBufferView.h>
 #include <wtf/MemoryInstrumentationHashMap.h>
 #include <wtf/MemoryInstrumentationHashSet.h>
-#include <wtf/MemoryInstrumentationString.h>
 #include <wtf/MemoryInstrumentationVector.h>
 #include <wtf/RefCounted.h>
 #include <wtf/Vector.h>
 #include <wtf/text/AtomicString.h>
 #include <wtf/text/CString.h>
-#include <wtf/text/StringBuffer.h>
 #include <wtf/text/StringHash.h>
 #include <wtf/text/StringImpl.h>
 #include <wtf/text/WTFString.h>
@@ -280,57 +278,12 @@
 
 TEST(MemoryInstrumentationTest, visitStrings)
 {
-    { // 8-bit string.
+    {
         InstrumentationTestHelper helper;
         InstrumentedOwner<String> stringInstrumentedOwner("String");
+        stringInstrumentedOwner.m_value.characters(); // Force 16bit shadow creation.
         helper.addRootObject(stringInstrumentedOwner);
-        EXPECT_EQ(sizeof(StringImpl) + stringInstrumentedOwner.m_value.length(), helper.reportedSizeForAllTypes());
-        EXPECT_EQ(1, helper.visitedObjects());
-    }
-
-    { // 8-bit string with 16bit shadow.
-        InstrumentationTestHelper helper;
-        InstrumentedOwner<String> stringInstrumentedOwner("String");
-        stringInstrumentedOwner.m_value.characters();
-        helper.addRootObject(stringInstrumentedOwner);
-        EXPECT_EQ(sizeof(StringImpl) + stringInstrumentedOwner.m_value.length() * 3, helper.reportedSizeForAllTypes());
-        EXPECT_EQ(2, helper.visitedObjects());
-    }
-
-    { // 16 bit string.
-        InstrumentationTestHelper helper;
-        String string("String");
-        InstrumentedOwner<String> stringInstrumentedOwner(String(string.characters(), string.length()));
-        helper.addRootObject(stringInstrumentedOwner);
         EXPECT_EQ(sizeof(StringImpl) + stringInstrumentedOwner.m_value.length() * 2, helper.reportedSizeForAllTypes());
-        EXPECT_EQ(1, helper.visitedObjects());
-    }
-
-    { // ASCIILiteral
-        InstrumentationTestHelper helper;
-        ASCIILiteral literal("String");
-        InstrumentedOwner<String> stringInstrumentedOwner(literal);
-        helper.addRootObject(stringInstrumentedOwner);
-        EXPECT_EQ(sizeof(StringImpl), helper.reportedSizeForAllTypes());
-        EXPECT_EQ(1, helper.visitedObjects());
-    }
-
-    { // Substring
-        InstrumentationTestHelper helper;
-        String baseString("String");
-        baseString.characters(); // Force 16 shadow creation.
-        InstrumentedOwner<String> stringInstrumentedOwner(baseString.substringSharingImpl(1, 4));
-        helper.addRootObject(stringInstrumentedOwner);
-        EXPECT_EQ(sizeof(StringImpl) * 2 + baseString.length() * 3, helper.reportedSizeForAllTypes());
-        EXPECT_EQ(3, helper.visitedObjects());
-    }
-
-    { // Owned buffer.
-        InstrumentationTestHelper helper;
-        StringBuffer<LChar> buffer(6);
-        InstrumentedOwner<String> stringInstrumentedOwner(String::adopt(buffer));
-        helper.addRootObject(stringInstrumentedOwner);
-        EXPECT_EQ(sizeof(StringImpl) + stringInstrumentedOwner.m_value.length(), helper.reportedSizeForAllTypes());
         EXPECT_EQ(2, helper.visitedObjects());
     }
 
@@ -339,7 +292,7 @@
         InstrumentedOwner<AtomicString> atomicStringInstrumentedOwner("AtomicString");
         atomicStringInstrumentedOwner.m_value.string().characters(); // Force 16bit shadow creation.
         helper.addRootObject(atomicStringInstrumentedOwner);
-        EXPECT_EQ(sizeof(StringImpl) + atomicStringInstrumentedOwner.m_value.length() * 3, helper.reportedSizeForAllTypes());
+        EXPECT_EQ(sizeof(StringImpl) + atomicStringInstrumentedOwner.m_value.length() * 2, helper.reportedSizeForAllTypes());
         EXPECT_EQ(2, helper.visitedObjects());
     }
 
@@ -499,7 +452,7 @@
         value->append("string");
     InstrumentedOwner<StringVector* > root(value.get());
     helper.addRootObject(root);
-    EXPECT_EQ(sizeof(StringVector) + sizeof(String) * value->capacity() + (sizeof(StringImpl) + 6) * value->size(), helper.reportedSizeForAllTypes());
+    EXPECT_EQ(sizeof(StringVector) + sizeof(String) * value->capacity() + sizeof(StringImpl) * value->size(), helper.reportedSizeForAllTypes());
     EXPECT_EQ(count + 2, (size_t)helper.visitedObjects());
 }
 
@@ -514,7 +467,7 @@
         value->add(String::number(i));
     InstrumentedOwner<ValueType* > root(value.get());
     helper.addRootObject(root);
-    EXPECT_EQ(sizeof(ValueType) + sizeof(String) * value->capacity() + (sizeof(StringImpl) + 1) * value->size(), helper.reportedSizeForAllTypes());
+    EXPECT_EQ(sizeof(ValueType) + sizeof(String) * value->capacity() + sizeof(StringImpl) * value->size(), helper.reportedSizeForAllTypes());
     EXPECT_EQ(count + 1, (size_t)helper.visitedObjects());
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to