Repository navigation
Commit bd3aa0e
committed
[JSC] Compare lengths inline before calling
https://bugs.webkit.org/show_bug.cgi?id=326312
Reviewed by Yusuke Suzuki.
When either operand of a string equality is a rope, DFG and FTL always
take the slow path and call operationCompareStringEq. If the lengths
differ, the operation returns false without resolving the rope, so the
same comparison takes the slow path every time.
This patch compares the lengths in the rope case first. If they differ,
the result is false and no call is made. Otherwise we call the operation
as before.
* Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileStringEquality):
* Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileCompareStrictEq):
Canonical link: https://commits.webkit.org/322690@mainoperationCompareStringEq for ropes1 parent 253c954 commit bd3aa0e
2 files changed
Lines changed: 48 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7341 | 7341 | | |
7342 | 7342 | | |
7343 | 7343 | | |
| 7344 | + | |
7344 | 7345 | | |
7345 | 7346 | | |
7346 | 7347 | | |
| |||
7349 | 7350 | | |
7350 | 7351 | | |
7351 | 7352 | | |
7352 | | - | |
| 7353 | + | |
7353 | 7354 | | |
7354 | 7355 | | |
7355 | 7356 | | |
| |||
7455 | 7456 | | |
7456 | 7457 | | |
7457 | 7458 | | |
| 7459 | + | |
7458 | 7460 | | |
7459 | 7461 | | |
7460 | 7462 | | |
7461 | 7463 | | |
7462 | 7464 | | |
7463 | 7465 | | |
7464 | 7466 | | |
7465 | | - | |
| 7467 | + | |
| 7468 | + | |
| 7469 | + | |
| 7470 | + | |
| 7471 | + | |
| 7472 | + | |
| 7473 | + | |
| 7474 | + | |
| 7475 | + | |
| 7476 | + | |
| 7477 | + | |
| 7478 | + | |
| 7479 | + | |
| 7480 | + | |
| 7481 | + | |
| 7482 | + | |
7466 | 7483 | | |
7467 | 7484 | | |
7468 | 7485 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22733 | 22733 | | |
22734 | 22734 | | |
22735 | 22735 | | |
| 22736 | + | |
22736 | 22737 | | |
22737 | 22738 | | |
22738 | 22739 | | |
22739 | 22740 | | |
22740 | 22741 | | |
22741 | 22742 | | |
22742 | | - | |
| 22743 | + | |
22743 | 22744 | | |
22744 | 22745 | | |
22745 | 22746 | | |
22746 | 22747 | | |
22747 | 22748 | | |
22748 | | - | |
| 22749 | + | |
22749 | 22750 | | |
22750 | 22751 | | |
22751 | 22752 | | |
| |||
22856 | 22857 | | |
22857 | 22858 | | |
22858 | 22859 | | |
22859 | | - | |
| 22860 | + | |
22860 | 22861 | | |
22861 | 22862 | | |
22862 | 22863 | | |
22863 | 22864 | | |
| 22865 | + | |
| 22866 | + | |
| 22867 | + | |
| 22868 | + | |
| 22869 | + | |
| 22870 | + | |
| 22871 | + | |
| 22872 | + | |
| 22873 | + | |
| 22874 | + | |
| 22875 | + | |
| 22876 | + | |
| 22877 | + | |
| 22878 | + | |
| 22879 | + | |
| 22880 | + | |
| 22881 | + | |
| 22882 | + | |
| 22883 | + | |
| 22884 | + | |
| 22885 | + | |
| 22886 | + | |
| 22887 | + | |
| 22888 | + | |
| 22889 | + | |
22864 | 22890 | | |
22865 | 22891 | | |
22866 | 22892 | | |
| |||
0 commit comments