-
Notifications
You must be signed in to change notification settings - Fork 645
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add fast path for Array.prototype.indexOf/lastIndexOf (#1447)
Summary: Pull Request resolved: #1447 If `this` is truly an Array object, go fast path, otherwise, falls to slow path. In fast path, use specialized loop given the type of search value and reverse mode. For checking Number, add a new function that returns double value if the HV is a number and returns NaN if it's not. This avoids repeated tag checking in `isNumber()` and `getNumber()` for HV32 mode. On the given benchmark it's ~12X faster on both HV32 and HV64 mode. Reviewed By: neildhar Differential Revision: D58201521 fbshipit-source-id: 59464da416e9123f2cfc8860339b4fed26aeaa50
- Loading branch information
1 parent
e007fbd
commit 063293b
Showing
5 changed files
with
218 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.