Closed Bug 1588473 Opened 6 years ago Closed 6 years ago

Move UINT32_CHAR_BUFFER_LENGTH length check from JSLinearString::isIndexSlow to fast path

Categories

(Core :: JavaScript Engine, task, P1)

task

Tracking

()

RESOLVED FIXED
mozilla71
Tracking Status
firefox71 --- fixed

People

(Reporter: jandem, Assigned: jandem)

Details

Attachments

(1 file)

In https://phabricator.services.mozilla.com/D48495 Waldo suggests moving the UINT32_CHAR_BUFFER_LENGTH length check that's in the out-of-line isIndexSlow into the fast path. Because the fast path already has to check for length == 0, checking the upper bound there as well is cheap (compilers will combine them into a single check ).

Er, forgot to improve the title.

Summary: Move length checks into JSLinearString::isIndex → Move UINT32_CHAR_BUFFER_LENGTH length check from JSLinearString::isIndexSlow to fast path
Flags: needinfo?(jdemooij)

We also have to handle |length == 0| there so by checking the upper bound too we
make it possible for C++ compilers to combine them into a single branch.

Assignee: nobody → jdemooij
Status: NEW → ASSIGNED
Flags: needinfo?(jdemooij)
Priority: -- → P1
Pushed by jdemooij@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/1c3c4eeab4b1 Move |length > UINT32_CHAR_BUFFER_LENGTH| check from isIndexSlow slow path to the fast path. r=jwalden
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla71
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: