Commit 9acf475
committed
deps: V8: cherry-pick c135d5e81f82
Original commit message:
[api][strings] Optimize ContainsOnlyOneByte with SIMD
Add Highway-based SIMD implementation for checking if strings contain
only one-byte (Latin-1) characters. Highway provides portable SIMD
abstraction across different architectures with automatic target
selection at runtime.
The SIMD implementation processes 8 uint16_t values (128 bits) at
once,checking if any character has the high byte set. This provides
significant speedup over the previous implementation which processed 2-4
values per iteration and only checked every 16 iterations.
The optimization applies to both String::ContainsOnlyOneByte() in the
public API and the internal IsOnly8Bit() helper used during string
hashing. This improves performance for string validation, encoding
decisions, and UTF-8/UTF-16 conversion operations.
Additionally, it resolves a TODO by leszeks.
Change-Id: I41f519339fb96f3bf3f4fa30283f84ccbb5115d0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7159233
Reviewed-by: Erik Corry <erikcorry@chromium.org>
Commit-Queue: Erik Corry <erikcorry@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#104120}
Refs: v8/v8@c135d5e1 parent 1d41c8f commit 9acf475
File tree
5 files changed
+48
-64
lines changed- deps/v8/src
- api
- strings
5 files changed
+48
-64
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
| 162 | + | |
| 163 | + | |
162 | 164 | | |
163 | 165 | | |
164 | 166 | | |
| |||
5575 | 5577 | | |
5576 | 5578 | | |
5577 | 5579 | | |
5578 | | - | |
5579 | | - | |
5580 | | - | |
5581 | | - | |
5582 | | - | |
5583 | | - | |
5584 | | - | |
5585 | | - | |
5586 | | - | |
5587 | | - | |
5588 | | - | |
5589 | | - | |
5590 | | - | |
5591 | | - | |
5592 | | - | |
5593 | | - | |
5594 | | - | |
5595 | | - | |
5596 | | - | |
5597 | | - | |
5598 | | - | |
5599 | | - | |
5600 | 5580 | | |
5601 | 5581 | | |
5602 | 5582 | | |
| |||
5613 | 5593 | | |
5614 | 5594 | | |
5615 | 5595 | | |
5616 | | - | |
5617 | | - | |
5618 | | - | |
5619 | | - | |
5620 | | - | |
5621 | | - | |
5622 | | - | |
5623 | | - | |
5624 | | - | |
5625 | | - | |
5626 | | - | |
5627 | | - | |
5628 | | - | |
5629 | | - | |
5630 | | - | |
5631 | | - | |
5632 | | - | |
5633 | | - | |
5634 | | - | |
5635 | | - | |
5636 | | - | |
5637 | | - | |
5638 | | - | |
5639 | | - | |
5640 | | - | |
5641 | | - | |
5642 | | - | |
5643 | | - | |
5644 | | - | |
| 5596 | + | |
5645 | 5597 | | |
5646 | 5598 | | |
5647 | 5599 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | 14 | | |
21 | 15 | | |
22 | 16 | | |
| |||
43 | 37 | | |
44 | 38 | | |
45 | 39 | | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
51 | 47 | | |
| 48 | + | |
52 | 49 | | |
53 | | - | |
| 50 | + | |
| 51 | + | |
54 | 52 | | |
55 | 53 | | |
56 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
73 | 74 | | |
74 | 75 | | |
75 | 76 | | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
76 | 104 | | |
77 | 105 | | |
78 | 106 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
20 | 26 | | |
21 | 27 | | |
22 | 28 | | |
| |||
0 commit comments