Title: [221200] trunk/Source/_javascript_Core
- Revision
- 221200
- Author
- [email protected]
- Date
- 2017-08-25 12:12:37 -0700 (Fri, 25 Aug 2017)
Log Message
DFG::JITCode::osrEntry should get sorted since we perform a binary search on it
https://bugs.webkit.org/show_bug.cgi?id=175893
Reviewed by Mark Lam.
* dfg/DFGJITCode.cpp:
(JSC::DFG::JITCode::finalizeOSREntrypoints):
* dfg/DFGJITCode.h:
(JSC::DFG::JITCode::finalizeCatchOSREntrypoints): Deleted.
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::linkOSREntries):
Modified Paths
Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (221199 => 221200)
--- trunk/Source/_javascript_Core/ChangeLog 2017-08-25 19:04:23 UTC (rev 221199)
+++ trunk/Source/_javascript_Core/ChangeLog 2017-08-25 19:12:37 UTC (rev 221200)
@@ -1,5 +1,19 @@
2017-08-25 Saam Barati <[email protected]>
+ DFG::JITCode::osrEntry should get sorted since we perform a binary search on it
+ https://bugs.webkit.org/show_bug.cgi?id=175893
+
+ Reviewed by Mark Lam.
+
+ * dfg/DFGJITCode.cpp:
+ (JSC::DFG::JITCode::finalizeOSREntrypoints):
+ * dfg/DFGJITCode.h:
+ (JSC::DFG::JITCode::finalizeCatchOSREntrypoints): Deleted.
+ * dfg/DFGSpeculativeJIT.cpp:
+ (JSC::DFG::SpeculativeJIT::linkOSREntries):
+
+2017-08-25 Saam Barati <[email protected]>
+
Support compiling catch in the DFG
https://bugs.webkit.org/show_bug.cgi?id=174590
<rdar://problem/34047845>
Modified: trunk/Source/_javascript_Core/dfg/DFGJITCode.cpp (221199 => 221200)
--- trunk/Source/_javascript_Core/dfg/DFGJITCode.cpp 2017-08-25 19:04:23 UTC (rev 221199)
+++ trunk/Source/_javascript_Core/dfg/DFGJITCode.cpp 2017-08-25 19:12:37 UTC (rev 221200)
@@ -238,6 +238,24 @@
return std::nullopt;
}
+void JITCode::finalizeOSREntrypoints()
+{
+ auto comparator = [] (const auto& a, const auto& b) {
+ return a.m_bytecodeIndex < b.m_bytecodeIndex;
+ };
+ std::sort(catchEntrypoints.begin(), catchEntrypoints.end(), comparator);
+ std::sort(osrEntry.begin(), osrEntry.end(), comparator);
+
+#if !ASSERT_DISABLED
+ auto verifyIsSorted = [&] (auto& osrVector) {
+ for (unsigned i = 0; i + 1 < osrVector.size(); ++i)
+ ASSERT(osrVector[i].m_bytecodeIndex <= osrVector[i + 1].m_bytecodeIndex);
+ };
+ verifyIsSorted(catchEntrypoints);
+ verifyIsSorted(osrEntry);
+#endif
+}
+
} } // namespace JSC::DFG
#endif // ENABLE(DFG_JIT)
Modified: trunk/Source/_javascript_Core/dfg/DFGJITCode.h (221199 => 221200)
--- trunk/Source/_javascript_Core/dfg/DFGJITCode.h 2017-08-25 19:04:23 UTC (rev 221199)
+++ trunk/Source/_javascript_Core/dfg/DFGJITCode.h 2017-08-25 19:12:37 UTC (rev 221200)
@@ -77,19 +77,7 @@
[] (const CatchEntrypointData* item) { return item->m_bytecodeIndex; });
}
- void finalizeCatchOSREntrypoints()
- {
- std::sort(catchEntrypoints.begin(), catchEntrypoints.end(), [] (const CatchEntrypointData& a, const CatchEntrypointData& b) {
- return a.m_bytecodeIndex < b.m_bytecodeIndex;
- });
-#if !ASSERT_DISABLED
- unsigned previousIndex = 0;
- for (const CatchEntrypointData& entrypoint : catchEntrypoints) {
- ASSERT(previousIndex < entrypoint.m_bytecodeIndex);
- previousIndex = entrypoint.m_bytecodeIndex;
- }
-#endif
- }
+ void finalizeOSREntrypoints();
void appendCatchEntrypoint(unsigned bytecodeIndex, unsigned machineCodeOffset, Vector<FlushFormat>&& argumentFormats)
{
Modified: trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.cpp (221199 => 221200)
--- trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.cpp 2017-08-25 19:04:23 UTC (rev 221199)
+++ trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.cpp 2017-08-25 19:12:37 UTC (rev 221200)
@@ -1930,7 +1930,7 @@
}
}
- m_jit.jitCode()->finalizeCatchOSREntrypoints();
+ m_jit.jitCode()->finalizeOSREntrypoints();
ASSERT(osrEntryIndex == m_osrEntryHeads.size());
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes