Changeset 238997 in webkit
- Timestamp:
- Dec 7, 2018 5:12:57 PM (5 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r238923 r238997 1 2018-12-07 Tadeu Zagallo <tzagallo@apple.com> 2 3 Align the metadata table on all platforms 4 https://bugs.webkit.org/show_bug.cgi?id=192050 5 <rdar://problem/46312674> 6 7 Reviewed by Mark Lam. 8 9 Although certain platforms don't require the metadata to be aligned, 10 values were being concurrently read and written to ValueProfiles, 11 which caused crashes since these operations are not atomic on unaligned 12 addresses. 13 14 * bytecode/Opcode.cpp: 15 (JSC::metadataAlignment): 16 * bytecode/Opcode.h: 17 * bytecode/UnlinkedMetadataTableInlines.h: 18 (JSC::UnlinkedMetadataTable::finalize): 19 1 20 2018-12-05 Mark Lam <mark.lam@apple.com> 2 21 -
trunk/Source/JavaScriptCore/bytecode/Opcode.cpp
r237638 r238997 194 194 }; 195 195 196 #if CPU(NEEDS_ALIGNED_ACCESS)197 196 static unsigned metadataAlignments[] = { 198 197 … … 202 201 203 202 }; 204 #endif205 203 206 204 unsigned metadataSize(OpcodeID opcodeID) … … 209 207 } 210 208 211 #if CPU(NEEDS_ALIGNED_ACCESS)212 209 unsigned metadataAlignment(OpcodeID opcodeID) 213 210 { 214 211 return metadataAlignments[opcodeID]; 215 212 } 216 #endif217 213 218 214 } // namespace JSC -
trunk/Source/JavaScriptCore/bytecode/Opcode.h
r238732 r238997 252 252 253 253 unsigned metadataSize(OpcodeID); 254 #if CPU(NEEDS_ALIGNED_ACCESS)255 254 unsigned metadataAlignment(OpcodeID); 256 #endif257 255 258 256 } // namespace JSC -
trunk/Source/JavaScriptCore/bytecode/UnlinkedMetadataTableInlines.h
r237987 r238997 91 91 92 92 if (numberOfEntries > 0) { 93 #if CPU(NEEDS_ALIGNED_ACCESS)94 93 offset = roundUpToMultipleOf(metadataAlignment(static_cast<OpcodeID>(i)), offset); 95 #endif96 94 buffer()[i] = offset; 97 95 offset += numberOfEntries * metadataSize(static_cast<OpcodeID>(i));
Note: See TracChangeset
for help on using the changeset viewer.