Repository navigation
Commit 290ba26
committed
[JSC] DFG backwards propagation should not request negative zero for the operand of
https://bugs.webkit.org/show_bug.cgi?id=327815
Reviewed by Yusuke Suzuki.
Branch only converts its operand to a boolean, so it cannot observe -0, same as LogicalNot
(323639@main). This patch applies LogicalNot's rule to Branch. Without it, code like
`if (!(x % 1))`, which Ajv generates for `type: "integer"`, keeps exiting for negative
integers and ends up with double ArithMod.
Tests: JSTests/stress/branch-does-not-observe-negative-zero.js
JSTests/stress/branch-on-negative-zero-should-not-recompile.js
* JSTests/stress/branch-does-not-observe-negative-zero.js: Added.
(shouldBe):
(ifMod):
(ifNotMod):
(ifInt52Mod):
(ifMul):
(ifDiv):
(ifNegate):
(ifAdd):
(modAfterBranch):
(mulAfterBranch):
(modAcrossBlocks):
* JSTests/stress/branch-on-negative-zero-should-not-recompile.js: Added.
(ifMod):
(ifNotMod):
(ternaryMod):
(whileMod):
* Source/JavaScriptCore/dfg/DFGBackwardsPropagationPhase.cpp:
(JSC::DFG::BackwardsPropagationPhase::propagate):
Canonical link: https://commits.webkit.org/323940@mainBranch
1 parent 3a082bf commit 290ba26
3 files changed
Lines changed: 102 additions & 0 deletions
File tree
- JSTests/stress
- Source/JavaScriptCore/dfg
| 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 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
561 | 561 | | |
562 | 562 | | |
563 | 563 | | |
| 564 | + | |
564 | 565 | | |
565 | 566 | | |
566 | 567 | | |
| |||
0 commit comments