a45efb1555
When a compact linked hash map is empty, it can add all the entries of
another compact linked hash map by a block-copy.
Adding elements to an empty map occurs with `Map.of(m)` which is
essentially `{}..addAll(m)`.
For AOT it does not make much difference for small maps, but is better
for large maps.
dart-aot-null linux-armv8c
MapCopy.Map.Thing.of.Map.2 3.737% 410.25 395.47
MapCopy.Map.String.of.Map.2 3.858% 400.93 386.03
MapCopy.Map.Thing.of.Map.100 503.4% 2308.06 382.49
MapCopy.Map.String.of.Map.100 543.6% 2297.51 356.96
JIT seems to do well on smaller maps too
dart linux-x64
MapCopy.Map.Thing.of.Map.2 80.22% 2681.76 1488.06
MapCopy.Map.String.of.Map.2 85.56% 2671.52 1439.70
MapCopy.Map.Thing.of.Map.100 777.8% 12859.79 1465.04
MapCopy.Map.String.of.Map.100 867.3% 12829.22 1326.28
Added similar fast path for identity maps, sets, and identity sets.
TEST=existing
Change-Id: Ifa8afc95797bc603113dcc7984c6a6d61af56595
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/222249
Reviewed-by: Dan Field <dnfield@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
This package hosts VM specific Dart code and helper scripts.