Commit c57cd9b
deps: V8: cherry-pick cfc3404f from upstream
Original commit message:
[string] Fix regexp fast path in MaybeCallFunctionAtSymbol
The regexp fast path in MaybeCallFunctionAtSymbol had an issue in which
we'd call ToString after checking that the given {object} was a fast
regexp and deciding to take the fast path. This is invalid since
ToString() can call into user-controlled JS and may mutate {object}.
There's no way to place the ToString call correctly in this instance:
1 before BranchIfFastRegExp, it's a spec violation if we end up on the
slow regexp path;
2 the problem with the current location is already described above;
3 and we can't place it into the fast-path regexp builtin (e.g.
RegExpReplace) either due to the same reasons as 1.
The solution in this CL is to restrict the fast path to string
arguments only, i.e. cases where ToString would be a nop and can safely
be skipped.
Bug: chromium:782145
Change-Id: Ifd35b3a9a6cf2e77c96cb860a8ec98eaec35aa85
Reviewed-on: https://chromium-review.googlesource.com/758257
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#49213}
Refs: v8/v8@cfc3404
Refs: v8/v8@55a9807
PR-URL: #173541 parent f34ee5c commit c57cd9b
File tree
4 files changed
+40
-14
lines changed- deps/v8
- include
- src/builtins
- test/mjsunit/regress
4 files changed
+40
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1004 | 1004 | | |
1005 | 1005 | | |
1006 | 1006 | | |
1007 | | - | |
1008 | | - | |
1009 | | - | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
1010 | 1010 | | |
1011 | 1011 | | |
1012 | 1012 | | |
| |||
1036 | 1036 | | |
1037 | 1037 | | |
1038 | 1038 | | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
1039 | 1042 | | |
1040 | 1043 | | |
1041 | 1044 | | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
1042 | 1048 | | |
1043 | 1049 | | |
1044 | 1050 | | |
1045 | 1051 | | |
1046 | 1052 | | |
| 1053 | + | |
1047 | 1054 | | |
1048 | 1055 | | |
1049 | 1056 | | |
| |||
1149 | 1156 | | |
1150 | 1157 | | |
1151 | 1158 | | |
1152 | | - | |
| 1159 | + | |
1153 | 1160 | | |
1154 | | - | |
1155 | | - | |
1156 | | - | |
1157 | | - | |
| 1161 | + | |
| 1162 | + | |
1158 | 1163 | | |
1159 | 1164 | | |
1160 | 1165 | | |
| |||
1392 | 1397 | | |
1393 | 1398 | | |
1394 | 1399 | | |
1395 | | - | |
| 1400 | + | |
1396 | 1401 | | |
1397 | | - | |
1398 | | - | |
1399 | | - | |
1400 | | - | |
| 1402 | + | |
| 1403 | + | |
1401 | 1404 | | |
1402 | 1405 | | |
1403 | 1406 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| 92 | + | |
92 | 93 | | |
93 | 94 | | |
94 | 95 | | |
| 96 | + | |
95 | 97 | | |
96 | 98 | | |
97 | 99 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
0 commit comments