Changeset 143054 in webkit
- Timestamp:
- Feb 15, 2013 2:47:35 PM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r143051 r143054 1 2013-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 1 21 2013-02-15 Adam Barth <abarth@webkit.org> 2 22 -
trunk/Source/WebCore/dom/DocumentSharedObjectPool.cpp
r143044 r143054 87 87 return elementData.release(); 88 88 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)); 90 90 91 91 return elementData.release(); -
trunk/Source/WebCore/dom/Element.cpp
r143044 r143054 2864 2864 static size_t sizeForShareableElementDataWithAttributeCount(unsigned count) 2865 2865 { 2866 return sizeof(ShareableElementData) + sizeof(Attribute) * count;2866 return sizeof(ShareableElementData) - sizeof(void*) + sizeof(Attribute) * count; 2867 2867 } 2868 2868 … … 2882 2882 { 2883 2883 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]); 2885 2885 } 2886 2886 … … 2888 2888 { 2889 2889 for (unsigned i = 0; i < m_arraySize; ++i) 2890 m_attributeArray[i].~Attribute();2890 (reinterpret_cast<Attribute*>(&m_attributeArray)[i]).~Attribute(); 2891 2891 } 2892 2892 … … 2902 2902 2903 2903 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)); 2905 2905 } 2906 2906 … … 2940 2940 m_attributeVector.reserveCapacity(other.length()); 2941 2941 for (unsigned i = 0; i < other.length(); ++i) 2942 m_attributeVector.uncheckedAppend(other. m_attributeArray[i]);2942 m_attributeVector.uncheckedAppend(other.immutableAttributeArray()[i]); 2943 2943 } 2944 2944 -
trunk/Source/WebCore/dom/Element.h
r143044 r143054 120 120 }; 121 121 122 #if COMPILER(MSVC)123 #pragma warning(push)124 #pragma warning(disable: 4200) // Disable "zero-sized array in struct/union" warning125 #endif126 127 122 class ShareableElementData : public ElementData { 128 123 public: 129 124 static PassRefPtr<ShareableElementData> createWithAttributes(const Vector<Attribute>&); 130 125 126 const Attribute* immutableAttributeArray() const { return reinterpret_cast<const Attribute*>(&m_attributeArray); } 127 131 128 explicit ShareableElementData(const Vector<Attribute>&); 132 129 explicit ShareableElementData(const UniqueElementData&); 133 130 ~ShareableElementData(); 134 131 135 Attribute m_attributeArray[0];132 void* m_attributeArray; 136 133 }; 137 138 #if COMPILER(MSVC)139 #pragma warning(pop)140 #endif141 134 142 135 class UniqueElementData : public ElementData { … … 1042 1035 if (m_isUnique) 1043 1036 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]; 1045 1038 } 1046 1039
Note: See TracChangeset
for help on using the changeset viewer.