Changeset 221143 in webkit
- Timestamp:
- Aug 24, 2017 9:59:00 AM (7 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r221126 r221143 1 2017-08-24 Saam Barati <sbarati@apple.com> 2 3 DFG::JITCode::osrEntry should get sorted since we perform a binary search on it 4 https://bugs.webkit.org/show_bug.cgi?id=175893 5 6 Reviewed by Mark Lam. 7 8 * dfg/DFGJITCode.cpp: 9 (JSC::DFG::JITCode::finalizeOSREntrypoints): 10 * dfg/DFGJITCode.h: 11 (JSC::DFG::JITCode::finalizeCatchOSREntrypoints): Deleted. 12 * dfg/DFGSpeculativeJIT.cpp: 13 (JSC::DFG::SpeculativeJIT::linkOSREntries): 14 1 15 2017-08-23 Keith Miller <keith_miller@apple.com> 2 16 -
trunk/Source/JavaScriptCore/dfg/DFGJITCode.cpp
r221119 r221143 239 239 } 240 240 241 void JITCode::finalizeOSREntrypoints() 242 { 243 auto comparator = [] (const auto& a, const auto& b) { 244 return a.m_bytecodeIndex < b.m_bytecodeIndex; 245 }; 246 std::sort(catchEntrypoints.begin(), catchEntrypoints.end(), comparator); 247 std::sort(osrEntry.begin(), osrEntry.end(), comparator); 248 249 #if !ASSERT_DISABLED 250 auto verifyIsSorted = [&] (auto& osrVector) { 251 for (unsigned i = 0; i + 1 < osrVector.size(); ++i) 252 ASSERT(osrVector[i].m_bytecodeIndex <= osrVector[i + 1].m_bytecodeIndex); 253 }; 254 verifyIsSorted(catchEntrypoints); 255 verifyIsSorted(osrEntry); 256 #endif 257 } 258 241 259 } } // namespace JSC::DFG 242 260 -
trunk/Source/JavaScriptCore/dfg/DFGJITCode.h
r221119 r221143 78 78 } 79 79 80 void finalizeCatchOSREntrypoints() 81 { 82 std::sort(catchEntrypoints.begin(), catchEntrypoints.end(), [] (const CatchEntrypointData& a, const CatchEntrypointData& b) { 83 return a.m_bytecodeIndex < b.m_bytecodeIndex; 84 }); 85 #if !ASSERT_DISABLED 86 unsigned previousIndex = 0; 87 for (const CatchEntrypointData& entrypoint : catchEntrypoints) { 88 ASSERT(previousIndex < entrypoint.m_bytecodeIndex); 89 previousIndex = entrypoint.m_bytecodeIndex; 90 } 91 #endif 92 } 80 void finalizeOSREntrypoints(); 93 81 94 82 void appendCatchEntrypoint(unsigned bytecodeIndex, unsigned machineCodeOffset, Vector<FlushFormat>&& argumentFormats) -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
r221119 r221143 1931 1931 } 1932 1932 1933 m_jit.jitCode()->finalize CatchOSREntrypoints();1933 m_jit.jitCode()->finalizeOSREntrypoints(); 1934 1934 1935 1935 ASSERT(osrEntryIndex == m_osrEntryHeads.size());
Note: See TracChangeset
for help on using the changeset viewer.