Changeset 194382 in webkit
- Timestamp:
- Dec 22, 2015, 5:50:19 PM (10 years ago)
- Location:
- trunk/Source
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r194376 r194382 1 2015-12-22 Filip Pizlo <fpizlo@apple.com> 2 3 FTL B3 should be able to run richards 4 https://bugs.webkit.org/show_bug.cgi?id=152514 5 6 Reviewed by Michael Saboff. 7 8 This came down to a liveness bug and a register allocation bug. 9 10 The liveness bug was that the code that determined whether we should go around the fixpoint 11 assumed that BitVector::quickSet() would return true if the bit changed state from false to 12 true. That's not how it works. It returns the old value of the bit, so it will return false 13 if the bit changed from false to true. Since there is already a lot of code that relies on 14 this behavior, I fixed Liveness instead of changing BitVector. 15 16 The register allocation bug was that we weren't guarding some checks of tmp()'s with checks 17 that the Arg isTmp(). 18 19 The liveness took a long time to track down, and I needed to add a lot of dumping to do it. 20 It's now possible to dump more of the liveness states, including liveAtHead. I found this 21 extremely helpful, so I removed the code that cleared liveAtHead. 22 23 * b3/air/AirIteratedRegisterCoalescing.cpp: 24 * b3/air/AirLiveness.h: 25 (JSC::B3::Air::AbstractLiveness::AbstractLiveness): 26 (JSC::B3::Air::AbstractLiveness::Iterable::Iterable): 27 (JSC::B3::Air::AbstractLiveness::Iterable::iterator::iterator): 28 (JSC::B3::Air::AbstractLiveness::Iterable::iterator::operator*): 29 (JSC::B3::Air::AbstractLiveness::Iterable::iterator::operator++): 30 (JSC::B3::Air::AbstractLiveness::Iterable::iterator::operator==): 31 (JSC::B3::Air::AbstractLiveness::Iterable::iterator::operator!=): 32 (JSC::B3::Air::AbstractLiveness::Iterable::begin): 33 (JSC::B3::Air::AbstractLiveness::Iterable::end): 34 (JSC::B3::Air::AbstractLiveness::liveAtHead): 35 (JSC::B3::Air::AbstractLiveness::liveAtTail): 36 * b3/air/AirStackSlot.h: 37 (WTF::printInternal): 38 * ftl/FTLOSRExitCompiler.cpp: 39 (JSC::FTL::compileFTLOSRExit): 40 1 41 2015-12-22 Saam barati <sbarati@apple.com> 2 42 -
trunk/Source/JavaScriptCore/b3/air/AirIteratedRegisterCoalescing.cpp
r194331 r194382 1191 1191 bool forceMove32IfDidSpill = false; 1192 1192 bool didSpill = false; 1193 if (type == Arg::GP && inst.opcode == Move) { 1193 if (type == Arg::GP && inst.opcode == Move 1194 && inst.args[0].isTmp() && inst.args[1].isTmp()) { 1194 1195 if (m_tmpWidth.defWidth(inst.args[0].tmp()) <= Arg::Width32 1195 1196 || m_tmpWidth.useWidth(inst.args[1].tmp()) <= Arg::Width32) -
trunk/Source/JavaScriptCore/b3/air/AirLiveness.h
r194331 r194382 35 35 #include "B3IndexSet.h" 36 36 #include <wtf/IndexSparseSet.h> 37 #include <wtf/ListDump.h> 37 38 38 39 namespace JSC { namespace B3 { namespace Air { … … 142 143 for (unsigned newValue : m_workset) { 143 144 if (liveAtTail.add(newValue)) { 144 if ( dirtyBlocks.quickSet(predecessor->index()))145 if (!dirtyBlocks.quickSet(predecessor->index())) 145 146 changed = true; 146 147 } … … 149 150 } 150 151 } while (changed); 151 152 m_liveAtHead.clear();153 152 } 154 153 … … 245 244 }; 246 245 246 template<typename UnderlyingIterable> 247 class Iterable { 248 public: 249 Iterable(AbstractLiveness& liveness, const UnderlyingIterable& iterable) 250 : m_liveness(liveness) 251 , m_iterable(iterable) 252 { 253 } 254 255 class iterator { 256 public: 257 iterator() 258 : m_liveness(nullptr) 259 , m_iter() 260 { 261 } 262 263 iterator(AbstractLiveness& liveness, typename UnderlyingIterable::const_iterator iter) 264 : m_liveness(&liveness) 265 , m_iter(iter) 266 { 267 } 268 269 typename Adapter::Thing operator*() 270 { 271 return m_liveness->indexToValue(*m_iter); 272 } 273 274 iterator& operator++() 275 { 276 ++m_iter; 277 return *this; 278 } 279 280 bool operator==(const iterator& other) const 281 { 282 ASSERT(m_liveness == other.m_liveness); 283 return m_iter == other.m_iter; 284 } 285 286 bool operator!=(const iterator& other) const 287 { 288 return !(*this == other); 289 } 290 291 private: 292 AbstractLiveness* m_liveness; 293 typename UnderlyingIterable::const_iterator m_iter; 294 }; 295 296 iterator begin() const { return iterator(m_liveness, m_iterable.begin()); } 297 iterator end() const { return iterator(m_liveness, m_iterable.end()); } 298 299 private: 300 AbstractLiveness& m_liveness; 301 const UnderlyingIterable& m_iterable; 302 }; 303 304 Iterable<Vector<unsigned>> liveAtHead(BasicBlock* block) 305 { 306 return Iterable<Vector<unsigned>>(*this, m_liveAtHead[block]); 307 } 308 309 Iterable<typename Adapter::IndexSet> liveAtTail(BasicBlock* block) 310 { 311 return Iterable<typename Adapter::IndexSet>(*this, m_liveAtTail[block]); 312 } 313 247 314 private: 248 315 friend class LocalCalc; -
trunk/Source/JavaScriptCore/b3/air/AirStackSlot.h
r191745 r194382 110 110 } } } // namespace JSC::B3::Air 111 111 112 namespace WTF { 113 114 inline void printInternal(PrintStream& out, JSC::B3::Air::StackSlot* stackSlot) 115 { 116 out.print(*stackSlot); 117 } 118 119 } // namespace WTF 120 112 121 #endif // ENABLE(B3_JIT) 113 122 -
trunk/Source/JavaScriptCore/ftl/FTLOSRExitCompiler.cpp
r193640 r194382 627 627 #endif // FTL_USES_B3 628 628 dataLog(" Exit values: ", exit.m_descriptor->m_values, "\n"); 629 #if FTL_USES_B3 630 dataLog(" Value reps: ", listDump(exit.m_valueReps), "\n"); 631 #endif // FTL_USES_B3 629 632 if (!exit.m_descriptor->m_materializations.isEmpty()) { 630 633 dataLog(" Materializations:\n"); -
trunk/Source/WTF/ChangeLog
r194372 r194382 1 2015-12-22 Filip Pizlo <fpizlo@apple.com> 2 3 FTL B3 should be able to run richards 4 https://bugs.webkit.org/show_bug.cgi?id=152514 5 6 Reviewed by Michael Saboff. 7 8 Change the list dumping helpers to work with a broader set of list kinds. 9 10 * wtf/ListDump.h: 11 (WTF::ListDump::dump): 12 (WTF::MapDump::dump): 13 (WTF::sortedMapDump): 14 (WTF::ListDumpInContext::dump): 15 1 16 2015-12-22 Filip Pizlo <fpizlo@apple.com> 2 17 -
trunk/Source/WTF/wtf/ListDump.h
r191705 r194382 44 44 void dump(PrintStream& out) const 45 45 { 46 for ( typename T::const_iteratoriter = m_list.begin(); iter != m_list.end(); ++iter)46 for (auto iter = m_list.begin(); iter != m_list.end(); ++iter) 47 47 out.print(m_comma, *iter); 48 48 } … … 85 85 void dump(PrintStream& out) const 86 86 { 87 for ( typename T::const_iteratoriter = m_map.begin(); iter != m_map.end(); ++iter)87 for (auto iter = m_map.begin(); iter != m_map.end(); ++iter) 88 88 out.print(m_comma, iter->key, m_arrow, iter->value); 89 89 } … … 136 136 { 137 137 Vector<typename T::KeyType> keys; 138 for ( typename T::const_iteratoriter = map.begin(); iter != map.end(); ++iter)138 for (auto iter = map.begin(); iter != map.end(); ++iter) 139 139 keys.append(iter->key); 140 140 std::sort(keys.begin(), keys.end(), comparator); … … 158 158 void dump(PrintStream& out) const 159 159 { 160 for ( typename T::const_iteratoriter = m_list.begin(); iter != m_list.end(); ++iter)160 for (auto iter = m_list.begin(); iter != m_list.end(); ++iter) 161 161 out.print(m_comma, inContext(*iter, m_context)); 162 162 }
Note:
See TracChangeset
for help on using the changeset viewer.