Changeset 143054 in webkit


Ignore:
Timestamp:
Feb 15, 2013 2:47:35 PM (11 years ago)
Author:
commit-queue@webkit.org
Message:

Unreviewed, rolling out r143044.
http://trac.webkit.org/changeset/143044
https://bugs.webkit.org/show_bug.cgi?id=109974

broke windows build (Requested by kling on #webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2013-02-15

  • dom/DocumentSharedObjectPool.cpp:

(WebCore::DocumentSharedObjectPool::cachedShareableElementDataWithAttributes):

  • dom/Element.cpp:

(WebCore::sizeForShareableElementDataWithAttributeCount):
(WebCore::ShareableElementData::ShareableElementData):
(WebCore::ShareableElementData::~ShareableElementData):
(WebCore::UniqueElementData::UniqueElementData):

  • dom/Element.h:

(WebCore::ShareableElementData::immutableAttributeArray):
(ShareableElementData):
(WebCore::ElementData::attributeItem):

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r143051 r143054  
     12013-02-15  Sheriff Bot  <webkit.review.bot@gmail.com>
     2
     3        Unreviewed, rolling out r143044.
     4        http://trac.webkit.org/changeset/143044
     5        https://bugs.webkit.org/show_bug.cgi?id=109974
     6
     7        broke windows build (Requested by kling on #webkit).
     8
     9        * dom/DocumentSharedObjectPool.cpp:
     10        (WebCore::DocumentSharedObjectPool::cachedShareableElementDataWithAttributes):
     11        * dom/Element.cpp:
     12        (WebCore::sizeForShareableElementDataWithAttributeCount):
     13        (WebCore::ShareableElementData::ShareableElementData):
     14        (WebCore::ShareableElementData::~ShareableElementData):
     15        (WebCore::UniqueElementData::UniqueElementData):
     16        * dom/Element.h:
     17        (WebCore::ShareableElementData::immutableAttributeArray):
     18        (ShareableElementData):
     19        (WebCore::ElementData::attributeItem):
     20
    1212013-02-15  Adam Barth  <abarth@webkit.org>
    222
  • trunk/Source/WebCore/dom/DocumentSharedObjectPool.cpp

    r143044 r143054  
    8787        return elementData.release();
    8888
    89     cacheIterator->value = adoptPtr(new ShareableElementDataCacheEntry(ShareableElementDataCacheKey(elementData->m_attributeArray, elementData->length()), elementData));
     89    cacheIterator->value = adoptPtr(new ShareableElementDataCacheEntry(ShareableElementDataCacheKey(elementData->immutableAttributeArray(), elementData->length()), elementData));
    9090
    9191    return elementData.release();
  • trunk/Source/WebCore/dom/Element.cpp

    r143044 r143054  
    28642864static size_t sizeForShareableElementDataWithAttributeCount(unsigned count)
    28652865{
    2866     return sizeof(ShareableElementData) + sizeof(Attribute) * count;
     2866    return sizeof(ShareableElementData) - sizeof(void*) + sizeof(Attribute) * count;
    28672867}
    28682868
     
    28822882{
    28832883    for (unsigned i = 0; i < m_arraySize; ++i)
    2884         new (&m_attributeArray[i]) Attribute(attributes[i]);
     2884        new (&reinterpret_cast<Attribute*>(&m_attributeArray)[i]) Attribute(attributes[i]);
    28852885}
    28862886
     
    28882888{
    28892889    for (unsigned i = 0; i < m_arraySize; ++i)
    2890         m_attributeArray[i].~Attribute();
     2890        (reinterpret_cast<Attribute*>(&m_attributeArray)[i]).~Attribute();
    28912891}
    28922892
     
    29022902
    29032903    for (unsigned i = 0; i < m_arraySize; ++i)
    2904         new (&m_attributeArray[i]) Attribute(other.m_attributeVector.at(i));
     2904        new (&reinterpret_cast<Attribute*>(&m_attributeArray)[i]) Attribute(other.m_attributeVector.at(i));
    29052905}
    29062906
     
    29402940    m_attributeVector.reserveCapacity(other.length());
    29412941    for (unsigned i = 0; i < other.length(); ++i)
    2942         m_attributeVector.uncheckedAppend(other.m_attributeArray[i]);
     2942        m_attributeVector.uncheckedAppend(other.immutableAttributeArray()[i]);
    29432943}
    29442944
  • trunk/Source/WebCore/dom/Element.h

    r143044 r143054  
    120120};
    121121
    122 #if COMPILER(MSVC)
    123 #pragma warning(push)
    124 #pragma warning(disable: 4200) // Disable "zero-sized array in struct/union" warning
    125 #endif
    126 
    127122class ShareableElementData : public ElementData {
    128123public:
    129124    static PassRefPtr<ShareableElementData> createWithAttributes(const Vector<Attribute>&);
    130125
     126    const Attribute* immutableAttributeArray() const { return reinterpret_cast<const Attribute*>(&m_attributeArray); }
     127
    131128    explicit ShareableElementData(const Vector<Attribute>&);
    132129    explicit ShareableElementData(const UniqueElementData&);
    133130    ~ShareableElementData();
    134131
    135     Attribute m_attributeArray[0];
     132    void* m_attributeArray;
    136133};
    137 
    138 #if COMPILER(MSVC)
    139 #pragma warning(pop)
    140 #endif
    141134
    142135class UniqueElementData : public ElementData {
     
    10421035    if (m_isUnique)
    10431036        return &static_cast<const UniqueElementData*>(this)->m_attributeVector.at(index);
    1044     return &static_cast<const ShareableElementData*>(this)->m_attributeArray[index];
     1037    return &static_cast<const ShareableElementData*>(this)->immutableAttributeArray()[index];
    10451038}
    10461039
Note: See TracChangeset for help on using the changeset viewer.