Repository navigation
Commit 95cec22
committed
[JSC] Use Vector+InlineCapacity in LiveRange in AirAllocateRegistersByGreedy
https://bugs.webkit.org/show_bug.cgi?id=324009
rdar://187246753
Reviewed by Keith Miller.
Use Vector with InlineCapacity in AirAllocateRegistersByGreedy's
LiveRange construction.
1. Use InlineCapacity to avoid repeated alloc & free calls. Most of
cases, this size 4 is enough.
2. Use Vector instead of Deque. And during construction, we append
instead of prepend, and then when finalizing, we just reverse it.
Deque is faster for this prepend, but Vector iteration etc. is
faster than Deque due to Deque's iterator handles round-trip.
And read-side is more heavy in this LiveRange data structure.
* Source/JavaScriptCore/b3/air/AirAllocateRegistersByGreedy.cpp:
(JSC::B3::Air::Greedy::LiveRange::validate):
(JSC::B3::Air::Greedy::LiveRange::prependDescending):
(JSC::B3::Air::Greedy::LiveRange::lowestSoFar const):
(JSC::B3::Air::Greedy::LiveRange::finishDescendingBuild):
(JSC::B3::Air::Greedy::LiveRange::intervals const):
(JSC::B3::Air::Greedy::GreedyAllocator::buildLiveRanges):
(JSC::B3::Air::Greedy::GreedyAllocator::addTmpImpl):
(JSC::B3::Air::Greedy::LiveRange::prepend): Deleted.
* Source/JavaScriptCore/b3/air/AirTmpMap.h:
(JSC::B3::Air::TmpMap::forEachValue):
Canonical link: https://commits.webkit.org/321011@main1 parent 6b58d86 commit 95cec22
2 files changed
Lines changed: 53 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
202 | 207 | | |
203 | 208 | | |
204 | | - | |
| 209 | + | |
205 | 210 | | |
206 | 211 | | |
207 | 212 | | |
208 | 213 | | |
209 | 214 | | |
210 | 215 | | |
211 | | - | |
| 216 | + | |
| 217 | + | |
212 | 218 | | |
213 | 219 | | |
214 | 220 | | |
215 | 221 | | |
| 222 | + | |
| 223 | + | |
216 | 224 | | |
217 | 225 | | |
218 | 226 | | |
219 | | - | |
220 | | - | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
221 | 232 | | |
222 | 233 | | |
223 | | - | |
224 | | - | |
| 234 | + | |
| 235 | + | |
225 | 236 | | |
226 | | - | |
227 | | - | |
| 237 | + | |
| 238 | + | |
228 | 239 | | |
229 | 240 | | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
230 | 252 | | |
231 | 253 | | |
232 | 254 | | |
| |||
244 | 266 | | |
245 | 267 | | |
246 | 268 | | |
247 | | - | |
| 269 | + | |
248 | 270 | | |
249 | 271 | | |
250 | 272 | | |
| |||
370 | 392 | | |
371 | 393 | | |
372 | 394 | | |
373 | | - | |
| 395 | + | |
374 | 396 | | |
375 | 397 | | |
376 | 398 | | |
| |||
676 | 698 | | |
677 | 699 | | |
678 | 700 | | |
679 | | - | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
680 | 704 | | |
681 | 705 | | |
682 | 706 | | |
| |||
1340 | 1364 | | |
1341 | 1365 | | |
1342 | 1366 | | |
1343 | | - | |
1344 | | - | |
| 1367 | + | |
| 1368 | + | |
1345 | 1369 | | |
1346 | | - | |
| 1370 | + | |
1347 | 1371 | | |
1348 | 1372 | | |
1349 | 1373 | | |
| |||
1385 | 1409 | | |
1386 | 1410 | | |
1387 | 1411 | | |
1388 | | - | |
| 1412 | + | |
1389 | 1413 | | |
1390 | 1414 | | |
1391 | 1415 | | |
| |||
1554 | 1578 | | |
1555 | 1579 | | |
1556 | 1580 | | |
1557 | | - | |
| 1581 | + | |
| 1582 | + | |
| 1583 | + | |
| 1584 | + | |
| 1585 | + | |
1558 | 1586 | | |
1559 | 1587 | | |
1560 | 1588 | | |
| |||
2216 | 2244 | | |
2217 | 2245 | | |
2218 | 2246 | | |
2219 | | - | |
| 2247 | + | |
2220 | 2248 | | |
2221 | 2249 | | |
2222 | 2250 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
100 | 108 | | |
101 | 109 | | |
102 | 110 | | |
| |||
0 commit comments