Changeset 120143 in webkit
- Timestamp:
- Jun 12, 2012, 5:23:49 PM (13 years ago)
- Location:
- trunk/Source
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r120137 r120143 1 2012-06-12 Leo Yang <leo.yang@torchmobile.com.cn> 2 3 Dynamic hash table in DOMObjectHashTableMap is wrong in multiple threads 4 https://bugs.webkit.org/show_bug.cgi?id=87334 5 6 Reviewed by Geoffrey Garen. 7 8 Add a copy member function to JSC::HasTable. This function will copy all data 9 members except for *table* which contains thread specific data that prevents 10 up copying it. When you want to copy a JSC::HashTable that was constructed 11 on another thread you should call JSC::HashTable::copy(). 12 13 * runtime/Lookup.h: 14 (JSC::HashTable::copy): 15 (HashTable): 16 1 17 2012-06-12 Filip Pizlo <fpizlo@apple.com> 2 18 -
trunk/Source/JavaScriptCore/runtime/Lookup.h
r117859 r120143 115 115 mutable const HashEntry* table; // Table allocated at runtime. 116 116 117 ALWAYS_INLINE HashTable copy() const 118 { 119 // Don't copy dynamic table since it's thread specific. 120 HashTable result = { compactSize, compactHashSizeMask, values, 0 }; 121 return result; 122 } 123 117 124 ALWAYS_INLINE void initializeIfNeeded(JSGlobalData* globalData) const 118 125 { -
trunk/Source/WebCore/ChangeLog
r120142 r120143 1 2012-06-12 Leo Yang <leo.yang@torchmobile.com.cn> 2 3 Dynamic hash table in DOMObjectHashTableMap is wrong in multiple threads 4 https://bugs.webkit.org/show_bug.cgi?id=87334 5 6 Reviewed by Geoffrey Garen. 7 8 Adapt to JSC::HashTable::copy to avoid copy dynamic table member of a HashTable. 9 The dynamic table may be allocated on other thread and contains thread specific 10 identifiers. For example, a hash table of JSEntryArray was first initialized on a 11 worker thread, and then the user reloaded the page, another worker thread is 12 created due to reload, the dynamic allocated table in *staticTable* is specific 13 to the first worker thread which has died. If the user reload the page again, 14 the dynamic table will be freed and memory corruption will occur. 15 16 No functionalities changed, no new tests. 17 18 * bindings/js/DOMObjectHashTableMap.h: 19 (WebCore::DOMObjectHashTableMap::get): 20 1 21 2012-06-12 James Robinson <jamesr@chromium.org> 2 22 -
trunk/Source/WebCore/bindings/js/DOMObjectHashTableMap.h
r112555 r120143 48 48 if (iter != m_map.end()) 49 49 return &iter->second; 50 return &m_map.set(staticTable, JSC::HashTable(*staticTable)).iterator->second;50 return &m_map.set(staticTable, staticTable->copy()).iterator->second; 51 51 } 52 52
Note:
See TracChangeset
for help on using the changeset viewer.