Repository navigation
Commit 4c6df0b
committed
[JSC] B3 can use undefined bits or not defined required bits when spilling
https://bugs.webkit.org/show_bug.cgi?id=156486
Patch by Benjamin Poulain <[email protected]> on 2016-04-11
Reviewed by Filip Pizlo.
Spilling had issues when replacing arguments in place.
The problems are:
1) If we have a 32bit stackslot, a x86 instruction could still try to load 64bits from it.
2) If we have a 64bit stackslot, Move32 would only set half the bits.
3) We were reducing Move to Move32 even if the top bits are read from the stack slot.
The case 1 appear with something like this:
Move32 %tmp0, %tmp1
Op64 %tmp1, %tmp2, %tmp3
When we spill %tmp1, the stack slot is 32bit, Move32 sets 32bits
but Op64 supports addressing for %tmp1. When we substitute %tmp1 in Op64,
we are creating a 64bit read for a 32bit stack slot.
The case 2 is an other common one. If we have:
BB#1
Move32 %tmp0, %tmp1
Jump WebPlatformForEmbedded#3
BB#2
Op64 %tmp0, %tmp1
Jump WebPlatformForEmbedded#3
BB#3
Use64 %tmp1
We have a stack slot of 64bits. When spilling %tmp1 in WebPlatformForEmbedded#1, we are
effectively doing a 32bit store on the stack slot, leaving the top bits undefined.
Case 3 is pretty much the same as 2 but we create the Move32 ourself
because the source is a 32bit with ZDef.
Case (1) is solved by requiring that the stack slot is at least as large as the largest
use/def of that tmp.
Case (2) and (3) are solved by not replacing a Tmp by an Address if the Def
is smaller than the stack slot.
* b3/air/AirIteratedRegisterCoalescing.cpp:
* b3/testb3.cpp:
(JSC::B3::testSpillDefSmallerThanUse):
(JSC::B3::testSpillUseLargerThanDef):
(JSC::B3::run):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@199337 268f45cc-cd09-0410-ab3c-d52691b4dbfc1 parent 7d9b5f7 commit 4c6df0b
4 files changed
Lines changed: 175 additions & 8 deletions
File tree
- Source/JavaScriptCore
- b3
- air
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
1 | 50 | | |
2 | 51 | | |
3 | 52 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1419 | 1419 | | |
1420 | 1420 | | |
1421 | 1421 | | |
| 1422 | + | |
| 1423 | + | |
| 1424 | + | |
| 1425 | + | |
| 1426 | + | |
1422 | 1427 | | |
1423 | 1428 | | |
1424 | 1429 | | |
| |||
1429 | 1434 | | |
1430 | 1435 | | |
1431 | 1436 | | |
1432 | | - | |
| 1437 | + | |
1433 | 1438 | | |
1434 | 1439 | | |
1435 | 1440 | | |
| |||
1447 | 1452 | | |
1448 | 1453 | | |
1449 | 1454 | | |
1450 | | - | |
| 1455 | + | |
1451 | 1456 | | |
1452 | 1457 | | |
1453 | 1458 | | |
1454 | 1459 | | |
1455 | | - | |
| 1460 | + | |
1456 | 1461 | | |
1457 | 1462 | | |
1458 | 1463 | | |
1459 | 1464 | | |
1460 | | - | |
| 1465 | + | |
1461 | 1466 | | |
1462 | 1467 | | |
1463 | 1468 | | |
1464 | 1469 | | |
| 1470 | + | |
| 1471 | + | |
| 1472 | + | |
| 1473 | + | |
| 1474 | + | |
| 1475 | + | |
| 1476 | + | |
| 1477 | + | |
| 1478 | + | |
1465 | 1479 | | |
1466 | | - | |
| 1480 | + | |
1467 | 1481 | | |
1468 | 1482 | | |
1469 | 1483 | | |
1470 | 1484 | | |
1471 | 1485 | | |
1472 | 1486 | | |
1473 | | - | |
| 1487 | + | |
1474 | 1488 | | |
1475 | 1489 | | |
1476 | 1490 | | |
| |||
1488 | 1502 | | |
1489 | 1503 | | |
1490 | 1504 | | |
1491 | | - | |
| 1505 | + | |
1492 | 1506 | | |
1493 | | - | |
| 1507 | + | |
1494 | 1508 | | |
1495 | 1509 | | |
1496 | 1510 | | |
| |||
1505 | 1519 | | |
1506 | 1520 | | |
1507 | 1521 | | |
| 1522 | + | |
1508 | 1523 | | |
1509 | 1524 | | |
1510 | 1525 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
63 | 72 | | |
64 | 73 | | |
65 | 74 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11408 | 11408 | | |
11409 | 11409 | | |
11410 | 11410 | | |
| 11411 | + | |
| 11412 | + | |
| 11413 | + | |
| 11414 | + | |
| 11415 | + | |
| 11416 | + | |
| 11417 | + | |
| 11418 | + | |
| 11419 | + | |
| 11420 | + | |
| 11421 | + | |
| 11422 | + | |
| 11423 | + | |
| 11424 | + | |
| 11425 | + | |
| 11426 | + | |
| 11427 | + | |
| 11428 | + | |
| 11429 | + | |
| 11430 | + | |
| 11431 | + | |
| 11432 | + | |
| 11433 | + | |
| 11434 | + | |
| 11435 | + | |
| 11436 | + | |
| 11437 | + | |
| 11438 | + | |
| 11439 | + | |
| 11440 | + | |
| 11441 | + | |
| 11442 | + | |
| 11443 | + | |
| 11444 | + | |
| 11445 | + | |
| 11446 | + | |
| 11447 | + | |
| 11448 | + | |
| 11449 | + | |
| 11450 | + | |
| 11451 | + | |
| 11452 | + | |
| 11453 | + | |
| 11454 | + | |
| 11455 | + | |
| 11456 | + | |
| 11457 | + | |
| 11458 | + | |
| 11459 | + | |
| 11460 | + | |
| 11461 | + | |
| 11462 | + | |
| 11463 | + | |
| 11464 | + | |
| 11465 | + | |
| 11466 | + | |
| 11467 | + | |
| 11468 | + | |
| 11469 | + | |
| 11470 | + | |
| 11471 | + | |
| 11472 | + | |
| 11473 | + | |
| 11474 | + | |
| 11475 | + | |
| 11476 | + | |
| 11477 | + | |
| 11478 | + | |
| 11479 | + | |
| 11480 | + | |
| 11481 | + | |
| 11482 | + | |
| 11483 | + | |
| 11484 | + | |
| 11485 | + | |
| 11486 | + | |
| 11487 | + | |
| 11488 | + | |
| 11489 | + | |
| 11490 | + | |
| 11491 | + | |
| 11492 | + | |
| 11493 | + | |
| 11494 | + | |
| 11495 | + | |
| 11496 | + | |
| 11497 | + | |
| 11498 | + | |
| 11499 | + | |
| 11500 | + | |
| 11501 | + | |
11411 | 11502 | | |
11412 | 11503 | | |
11413 | 11504 | | |
| |||
12784 | 12875 | | |
12785 | 12876 | | |
12786 | 12877 | | |
| 12878 | + | |
| 12879 | + | |
| 12880 | + | |
12787 | 12881 | | |
12788 | 12882 | | |
12789 | 12883 | | |
| |||
0 commit comments