Closed Bug 1538692 Opened 5 years ago Closed 5 years ago

Add support for relational string comparison to Ion and CacheIR

Categories

(Core :: JavaScript Engine: JIT, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla68
Tracking Status
firefox68 --- fixed

People

(Reporter: anba, Assigned: anba)

References

(Blocks 1 open bug)

Details

Attachments

(3 files)

Add support for relational string comparison to Ion and CacheIR, so that we don't fall back into the slower MCompare::Compare_Unknown case.

This improves the µ-benchmark from bug 1502882 when the str_cmp_full comparator function is used from 13.8ms to 6.2ms for me.

Add jit::StringsCompare to call js::CompareStrings, mirroring the existing
jit::StringsEqual and js::EqualStrings pair for equality comparison. JSOP_LE
and JSOP_GT are implemented by pushing the operands in reverse order and then
calling jit::StringsCompare for JSOP_LT resp. JSOP_GE. This avoids creating
four different VMFunction wrappers and also matches how the ECMAScript spec
defines relational comparison evaluation.

ion/compare-string.js

  • Add relational comparison operators.
  • Ensure string rope tests are actually using ropes.
  • Lower iteration count to reduce time needed to complete test for --tbpl configuration.

Pushed by ccoroiu@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/998ea689fe14
Part 1: Support relational string comparison in Ion. r=mgaudet
https://hg.mozilla.org/integration/autoland/rev/e30a80c7854f
Part 2: Support relational string comparison in CacheIR. r=mgaudet
https://hg.mozilla.org/integration/autoland/rev/3697baa32253
Part 3: Change bool template parameter to bool enum class. r=mgaudet

Keywords: checkin-needed
https://hg.mozilla.org/projects/ash/rev/998ea689fe149c52983e32af9e7cf50a8cc95c37
Bug 1538692 - Part 1: Support relational string comparison in Ion. r=mgaudet

https://hg.mozilla.org/projects/ash/rev/e30a80c7854ff12c5c792a10402eed2d4d30c56e
Bug 1538692 - Part 2: Support relational string comparison in CacheIR. r=mgaudet

https://hg.mozilla.org/projects/ash/rev/3697baa3225394badb3c53571f4d5870ed002385
Bug 1538692 - Part 3: Change bool template parameter to bool enum class. r=mgaudet
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: