Commit 572b501
[dart2wasm] Avoid indirect call to
After a recent change we started to eagerly calculate the hash code of
json object keys so when we create the string objects we initialize the
hash as well (as we know it will be needed to create the map).
This means that the actual creation of the hash map can do less work.
Right now it does an indirect call to `key.hashCode`, but since we know
those particular maps from the json decoder come only with string keys
and most of them will have their hash code already prepopulated we can
get avoid the indirect call to `key.hashCode` in most cases.
Change-Id: I38987281bd8b216832cac950ea74d0ca201ff651
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/409980
Reviewed-by: Ömer Ağacan <[email protected]>
Commit-Queue: Martin Kustermann <[email protected]>key.hashCode in json map creations1 parent 9820c8d commit 572b501
File tree
2 files changed
+19
-6
lines changed- sdk/lib/_internal/wasm/lib
2 files changed
+19
-6
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 | | |
| |||
459 | 460 | | |
460 | 461 | | |
461 | 462 | | |
462 | | - | |
| 463 | + | |
463 | 464 | | |
464 | 465 | | |
465 | 466 | | |
| |||
486 | 487 | | |
487 | 488 | | |
488 | 489 | | |
489 | | - | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
490 | 501 | | |
491 | 502 | | |
492 | 503 | | |
| |||
1254 | 1265 | | |
1255 | 1266 | | |
1256 | 1267 | | |
1257 | | - | |
| 1268 | + | |
1258 | 1269 | | |
1259 | 1270 | | |
1260 | | - | |
| 1271 | + | |
| 1272 | + | |
| 1273 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
213 | | - | |
| 213 | + | |
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
| |||
0 commit comments