dart-sdk/tests
Stephen Adams 5cbba84b91 [dart2js] Better const Maps and Sets
Constant Sets now have their own classes rather than being constructed as a wrapper over a const Map. The new scheme is similar to Maps - using a ConstantStringSet backed by a JavaScript Object 'dictionary' when the elements are all suitable String values, otherwise using a GeneralConstantSet backed by a list of elements that is converted to a lookup map on demand.

Constant Sets and Maps with suitable String keys are backed by a JavaScript Object literal 'dictionary'. The use of the Object literal has been changed so that the property values are no longer the values of the Dart Map, but the position of the key in the order of the entries. The values are provided as a List (Array), so there is an additional indexing operation to access the value on lookup. This does not seem to affect performance.

The advantage of the two-level lookup using the 'dictionary' is that Maps with the same keys (in the same order) can share a 'dictionary'. In order to achieve the advantage, the JavaScript Object is modeled as a first class ConstantValue - JavaScriptObjectConstantValue.

These changes achieve a code size benefit of -0.90% (~130K) on the main unit of a certain large app, and -0.35% for flute/benchmarks/lib/complex.dart

Change-Id: Icad2e6136218486a439e3c5ed0296462e3c3c4e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310020
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2023-06-20 23:44:08 +00:00
..
co19
co19_2
corelib
corelib_2
dartdevc [tests] Add regression test for DDC compiler crash 2023-06-16 22:31:26 +00:00
dartdevc_2
ffi [vm/ffi] Add DynamicLibrary.close() 2023-06-15 17:19:37 +00:00
ffi_2 [vm/ffi] Add DynamicLibrary.close() 2023-06-15 17:19:37 +00:00
language [dart2js] Better const Maps and Sets 2023-06-20 23:44:08 +00:00
language_2 Breaking changes for analyzer version 6.0.0 2023-06-16 16:31:27 +00:00
lib [dart:js_interop] Allow interop inline classes to elide @JS 2023-06-13 23:27:23 +00:00
lib_2 [vm/test] Remove Isolate.packageRoot dynamic getter 2023-06-14 07:51:08 +00:00
modular
standalone [vm/io] Fix standalone/io/client_socket_add_destroy_no_error_test 2023-06-09 18:14:53 +00:00
standalone_2 [vm/io] Fix standalone/io/client_socket_add_destroy_no_error_test 2023-06-09 18:14:53 +00:00
web [tests] Remove obsolete Dart 3.0 experiments from language tests 2023-06-15 08:26:27 +00:00
web_2
legacy_status_dart2js.csv
OWNERS
README.md

This directory contains tests of the language and core library implementations. For more information, see https://github.com/dart-lang/sdk/wiki/Testing.