From f125fd9d0823ec3240dbc66c30fc3ffeef889d8c Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Thu, 26 Feb 2026 07:21:09 -0800 Subject: [PATCH] [deps] Roll dart-lang/native Closes: https://github.com/dart-lang/native/issues/2718 Closes: https://github.com/dart-lang/native/issues/2938 TEST=pkg/compiler/test/record_use/record_use_test.dart TEST=pkg/dart2wasm/test/record_use_test.dart TEST=pkg/vm/test/transformations/record_use_test.dart Change-Id: I4770c8ac5d50c4117e76a91b3eafe5f981006f14 Cq-Include-Trybots: luci.dart.try:dart2wasm-asserts-linux-chrome-try,dart2wasm-asserts-minified-linux-d8-try,dart2wasm-linux-chrome-try,dart2wasm-linux-d8-try,dart2wasm-linux-firefox-try,dart2wasm-linux-jscm-chrome-try,dart2wasm-linux-optimized-jsc-try,pkg-linux-debug-try,pkg-linux-release-arm64-try,pkg-linux-release-try,pkg-mac-release-arm64-try,pkg-mac-release-try,pkg-win-release-arm64-try,pkg-win-release-try,dart2js-canary-linux-try,dart2js-hostasserts-linux-d8-try,dart2js-linux-chrome-try,dart2js-linux-firefox-try,dart2js-mac-chrome-try,dart2js-mac-safari-try,dart2js-minified-csp-linux-chrome-try,dart2js-minified-linux-d8-try,dart2js-unit-linux-x64-release-try,dart2js-win-chrome-try Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/483560 Reviewed-by: Nate Biggs Reviewed-by: Michael Goderbauer --- DEPS | 2 +- .../src/js_emitter/record_use_emitter.dart | 1 - .../test/native_assets/compile_test.dart | 40 ++++++++- .../record_use/record_use.dart | 10 +-- .../record_use/lib/basic.dart.json.expect | 2 +- .../record_use/lib/complex.dart.json.expect | 2 +- .../const_argument_instance.dart.json.expect | 26 +++--- .../record_use/lib/different.dart.json.expect | 2 +- .../lib/enhanced_enum.dart.json.expect | 30 +++---- .../lib/enum_const_arg.dart.json.expect | 24 +++--- .../record_use/lib/extension.dart.json.expect | 2 +- ...nsion_call_const_receiver.dart.json.expect | 2 +- ...n_call_non_const_receiver.dart.json.expect | 2 +- .../lib/extension_operator.dart.json.expect | 2 +- .../extension_static_call.dart.json.expect | 2 +- .../extension_static_tearoff.dart.json.expect | 2 +- ...on_tearoff_const_receiver.dart.json.expect | 2 +- ...earoff_non_const_receiver.dart.json.expect | 2 +- .../lib/instance_class.dart.json.expect | 2 +- .../lib/instance_complex.dart.json.expect | 70 ++++++++-------- .../lib/instance_duplicates.dart.json.expect | 20 ++--- .../lib/instance_method.dart.json.expect | 2 +- .../instance_not_annotation.dart.json.expect | 2 +- .../loading_units_multiple.dart.json.expect | 2 +- .../lib/loading_units_simple.dart.json.expect | 2 +- .../lib/map_complex_keys.dart.json.expect | 18 ++-- .../lib/named_and_positional.dart.json.expect | 58 ++++++------- .../lib/named_both.dart.json.expect | 56 ++++++------- .../lib/named_optional.dart.json.expect | 2 +- .../lib/named_required.dart.json.expect | 2 +- .../named_with_function_arg.dart.json.expect | 2 +- .../record_use/lib/nested.dart.json.expect | 26 +++--- .../nested_instance_constant.dart.json.expect | 2 +- .../lib/partfile_main.dart.json.expect | 2 +- .../lib/positional_both.dart.json.expect | 22 ++--- ...l_both_with_type_argument.dart.json.expect | 22 ++--- .../lib/positional_optional.dart.json.expect | 2 +- .../lib/record_const.dart.json.expect | 56 ++++++------- .../lib/record_enum.dart.json.expect | 2 +- ...d_instance_constant_empty.dart.json.expect | 14 ++-- .../record_use/lib/simple.dart.json.expect | 2 +- .../record_use/lib/tearoff.dart.json.expect | 2 +- .../lib/top_level_method.dart.json.expect | 2 +- .../lib/types_of_arguments.dart.json.expect | 82 +++++++++---------- ...ss_instance_not_annotated.dart.json.expect | 2 +- .../unsupported_collections.dart.json.expect | 14 ++-- ...um_instance_not_annotated.dart.json.expect | 2 +- .../lib/unsupported_instance.dart.json.expect | 26 +++--- 48 files changed, 348 insertions(+), 325 deletions(-) diff --git a/DEPS b/DEPS index 044763b5321..201ba288f33 100644 --- a/DEPS +++ b/DEPS @@ -143,7 +143,7 @@ vars = { "i18n_rev": "de7e11b7cc231d8daf6e49dc12690d7339241691", "leak_tracker_rev": "f5620600a5ce1c44f65ddaa02001e200b096e14c", # rolled manually "material_color_utilities_rev": "799b6ba2f3f1c28c67cc7e0b4f18e0c7d7f3c03e", - "native_rev": "7d68fee0390f3b4d569cf9b0eec6583da04fab74", # rolled manually while record_use is experimental + "native_rev": "8c3f3ecd2e8f06b0922951e3d433f8754cb4dd4c", # rolled manually while record_use is experimental "protobuf_rev": "d5639f45b8468fba684b076b9403ccd5f2290056", "pub_rev": "26c6985c742593d081f8b58450f463a584a4203a", # rolled manually "shelf_rev": "6e60bbeb17b2c07613fe1d6dd02ced2d05b82cc2", diff --git a/pkg/compiler/lib/src/js_emitter/record_use_emitter.dart b/pkg/compiler/lib/src/js_emitter/record_use_emitter.dart index 2999421b5d9..34a7161d26d 100644 --- a/pkg/compiler/lib/src/js_emitter/record_use_emitter.dart +++ b/pkg/compiler/lib/src/js_emitter/record_use_emitter.dart @@ -119,7 +119,6 @@ class RecordUseCollector { metadata: Metadata( comment: 'Recorded usages of objects tagged with a `RecordUse` annotation', - version: version, extension: {'AppTag': 'TBD', 'environment': environment}, ), calls: calls, diff --git a/pkg/dartdev/test/native_assets/compile_test.dart b/pkg/dartdev/test/native_assets/compile_test.dart index 0191a05a3ef..d58808e22e0 100644 --- a/pkg/dartdev/test/native_assets/compile_test.dart +++ b/pkg/dartdev/test/native_assets/compile_test.dart @@ -130,7 +130,7 @@ void main() async { expect(recordedUsages.existsSync(), true); final actualRecordedUsages = recordedUsages.readAsStringSync(); - final u = RecordedUsages.fromJson(jsonDecode(actualRecordedUsages)); + final u = Recordings.fromJson(jsonDecode(actualRecordedUsages)); printOnFailure(actualRecordedUsages); final constArguments = u.constArgumentsFor(Definition( 'package:drop_data_asset/src/drop_data_asset.dart', @@ -149,8 +149,8 @@ void main() async { ], )); expect(constArguments.length, 1); - expect(constArguments.first.named.isEmpty, true); - expect(constArguments.first.positional, + expect(constArguments.first.namedArguments.isEmpty, true); + expect(constArguments.first.positionalArguments, const [IntConstant(3), IntConstant(4)]); }); }); @@ -186,7 +186,7 @@ void main() async { expect(recordedUsages.existsSync(), true); final actualRecordedUsages = recordedUsages.readAsStringSync(); - final u = RecordedUsages.fromJson(jsonDecode(actualRecordedUsages)); + final u = Recordings.fromJson(jsonDecode(actualRecordedUsages)); final constantsOf = u.constantsOf(Definition( 'package:drop_data_asset/src/drop_data_asset.dart', [Name('RecordCallToC')], @@ -195,3 +195,35 @@ void main() async { }); }); } + +extension on Recordings { + List constArgumentsFor(Definition definition) { + final result = []; + for (final entry in calls.entries) { + // ignore: invalid_use_of_visible_for_testing_member + if (entry.key.semanticEquals(definition)) { + for (final call in entry.value) { + if (call is CallWithArguments) { + result.add(call); + } + } + } + } + return result; + } + + List constantsOf(Definition definition) { + final result = []; + for (final entry in instances.entries) { + // ignore: invalid_use_of_visible_for_testing_member + if (entry.key.semanticEquals(definition)) { + for (final instance in entry.value) { + if (instance is InstanceConstantReference) { + result.add(instance.instanceConstant); + } + } + } + } + return result; + } +} diff --git a/pkg/vm/lib/transformations/record_use/record_use.dart b/pkg/vm/lib/transformations/record_use/record_use.dart index 6da8e1ffa63..79fbbdd46db 100644 --- a/pkg/vm/lib/transformations/record_use/record_use.dart +++ b/pkg/vm/lib/transformations/record_use/record_use.dart @@ -128,15 +128,7 @@ Recordings _usages( Map> calls, Map> instances, ) { - return Recordings( - metadata: Metadata( - comment: - 'Recorded usages of objects tagged with a `RecordUse` annotation', - version: version, - ), - calls: calls, - instances: instances, - ); + return Recordings(calls: calls, instances: instances); } Constant evaluateConstant(ast.Constant constant) => switch (constant) { diff --git a/pkg/vm/testcases/transformations/record_use/lib/basic.dart.json.expect b/pkg/vm/testcases/transformations/record_use/lib/basic.dart.json.expect index fd57cf27ac6..99b8e21ad32 100644 --- a/pkg/vm/testcases/transformations/record_use/lib/basic.dart.json.expect +++ b/pkg/vm/testcases/transformations/record_use/lib/basic.dart.json.expect @@ -29,7 +29,7 @@ } ], "metadata": { - "comment": "Recorded usages of objects tagged with a `RecordUse` annotation", + "comment": "Recorded usages of objects tagged with a `RecordUse` annotation.", "version": "0.4.0" }, "uses": { diff --git a/pkg/vm/testcases/transformations/record_use/lib/complex.dart.json.expect b/pkg/vm/testcases/transformations/record_use/lib/complex.dart.json.expect index 2b1cf1f8b01..994940a05d1 100644 --- a/pkg/vm/testcases/transformations/record_use/lib/complex.dart.json.expect +++ b/pkg/vm/testcases/transformations/record_use/lib/complex.dart.json.expect @@ -32,7 +32,7 @@ } ], "metadata": { - "comment": "Recorded usages of objects tagged with a `RecordUse` annotation", + "comment": "Recorded usages of objects tagged with a `RecordUse` annotation.", "version": "0.4.0" }, "uses": { diff --git a/pkg/vm/testcases/transformations/record_use/lib/const_argument_instance.dart.json.expect b/pkg/vm/testcases/transformations/record_use/lib/const_argument_instance.dart.json.expect index 9f4adf477c4..b92a6efc3e3 100644 --- a/pkg/vm/testcases/transformations/record_use/lib/const_argument_instance.dart.json.expect +++ b/pkg/vm/testcases/transformations/record_use/lib/const_argument_instance.dart.json.expect @@ -5,7 +5,7 @@ "value": 14 }, { - "definition_index": 1, + "definition_index": 0, "type": "instance", "value": { "i": 0 @@ -13,6 +13,15 @@ } ], "definitions": [ + { + "path": [ + { + "kind": "class", + "name": "SomeClass" + } + ], + "uri": "package:record_use_test/const_argument_instance.dart" + }, { "path": [ { @@ -24,15 +33,6 @@ } ], "uri": "package:record_use_test/const_argument_instance.dart" - }, - { - "path": [ - { - "kind": "class", - "name": "SomeClass" - } - ], - "uri": "package:record_use_test/const_argument_instance.dart" } ], "loading_units": [ @@ -41,13 +41,13 @@ } ], "metadata": { - "comment": "Recorded usages of objects tagged with a `RecordUse` annotation", + "comment": "Recorded usages of objects tagged with a `RecordUse` annotation.", "version": "0.4.0" }, "uses": { "instances": [ { - "definition_index": 1, + "definition_index": 0, "uses": [ { "constant_index": 1, @@ -61,7 +61,7 @@ ], "static_calls": [ { - "definition_index": 0, + "definition_index": 1, "uses": [ { "loading_unit_indices": [ diff --git a/pkg/vm/testcases/transformations/record_use/lib/different.dart.json.expect b/pkg/vm/testcases/transformations/record_use/lib/different.dart.json.expect index f07ae0819cb..20c41685caf 100644 --- a/pkg/vm/testcases/transformations/record_use/lib/different.dart.json.expect +++ b/pkg/vm/testcases/transformations/record_use/lib/different.dart.json.expect @@ -1,6 +1,6 @@ { "metadata": { - "comment": "Recorded usages of objects tagged with a `RecordUse` annotation", + "comment": "Recorded usages of objects tagged with a `RecordUse` annotation.", "version": "0.4.0" } } \ No newline at end of file diff --git a/pkg/vm/testcases/transformations/record_use/lib/enhanced_enum.dart.json.expect b/pkg/vm/testcases/transformations/record_use/lib/enhanced_enum.dart.json.expect index 283cd73717c..00647a64202 100644 --- a/pkg/vm/testcases/transformations/record_use/lib/enhanced_enum.dart.json.expect +++ b/pkg/vm/testcases/transformations/record_use/lib/enhanced_enum.dart.json.expect @@ -4,6 +4,10 @@ "type": "int", "value": 10 }, + { + "type": "int", + "value": 20 + }, { "definition_index": 1, "index": 0, @@ -13,31 +17,27 @@ "customField": 0 } }, - { - "definition_index": 0, - "type": "instance", - "value": { - "a": 1 - } - }, - { - "type": "int", - "value": 20 - }, { "definition_index": 1, "index": 1, "name": "b", "type": "enum", "value": { - "customField": 3 + "customField": 1 } }, { "definition_index": 0, "type": "instance", "value": { - "a": 4 + "a": 2 + } + }, + { + "definition_index": 0, + "type": "instance", + "value": { + "a": 3 } } ], @@ -67,7 +67,7 @@ } ], "metadata": { - "comment": "Recorded usages of objects tagged with a `RecordUse` annotation", + "comment": "Recorded usages of objects tagged with a `RecordUse` annotation.", "version": "0.4.0" }, "uses": { @@ -76,7 +76,7 @@ "definition_index": 0, "uses": [ { - "constant_index": 2, + "constant_index": 4, "loading_unit_indices": [ 0 ], diff --git a/pkg/vm/testcases/transformations/record_use/lib/enum_const_arg.dart.json.expect b/pkg/vm/testcases/transformations/record_use/lib/enum_const_arg.dart.json.expect index dfa9ee38604..6a20ce7ec07 100644 --- a/pkg/vm/testcases/transformations/record_use/lib/enum_const_arg.dart.json.expect +++ b/pkg/vm/testcases/transformations/record_use/lib/enum_const_arg.dart.json.expect @@ -1,13 +1,22 @@ { "constants": [ { - "definition_index": 1, + "definition_index": 0, "index": 1, "name": "b", "type": "enum" } ], "definitions": [ + { + "path": [ + { + "kind": "enum", + "name": "A" + } + ], + "uri": "package:record_use_test/enum_const_arg.dart" + }, { "path": [ { @@ -19,15 +28,6 @@ } ], "uri": "package:record_use_test/enum_const_arg.dart" - }, - { - "path": [ - { - "kind": "enum", - "name": "A" - } - ], - "uri": "package:record_use_test/enum_const_arg.dart" } ], "loading_units": [ @@ -36,13 +36,13 @@ } ], "metadata": { - "comment": "Recorded usages of objects tagged with a `RecordUse` annotation", + "comment": "Recorded usages of objects tagged with a `RecordUse` annotation.", "version": "0.4.0" }, "uses": { "static_calls": [ { - "definition_index": 0, + "definition_index": 1, "uses": [ { "loading_unit_indices": [ diff --git a/pkg/vm/testcases/transformations/record_use/lib/extension.dart.json.expect b/pkg/vm/testcases/transformations/record_use/lib/extension.dart.json.expect index 71c7a6cbe0b..a363839625b 100644 --- a/pkg/vm/testcases/transformations/record_use/lib/extension.dart.json.expect +++ b/pkg/vm/testcases/transformations/record_use/lib/extension.dart.json.expect @@ -33,7 +33,7 @@ } ], "metadata": { - "comment": "Recorded usages of objects tagged with a `RecordUse` annotation", + "comment": "Recorded usages of objects tagged with a `RecordUse` annotation.", "version": "0.4.0" }, "uses": { diff --git a/pkg/vm/testcases/transformations/record_use/lib/extension_call_const_receiver.dart.json.expect b/pkg/vm/testcases/transformations/record_use/lib/extension_call_const_receiver.dart.json.expect index 249ca76c5aa..b28f2d0b7c8 100644 --- a/pkg/vm/testcases/transformations/record_use/lib/extension_call_const_receiver.dart.json.expect +++ b/pkg/vm/testcases/transformations/record_use/lib/extension_call_const_receiver.dart.json.expect @@ -33,7 +33,7 @@ } ], "metadata": { - "comment": "Recorded usages of objects tagged with a `RecordUse` annotation", + "comment": "Recorded usages of objects tagged with a `RecordUse` annotation.", "version": "0.4.0" }, "uses": { diff --git a/pkg/vm/testcases/transformations/record_use/lib/extension_call_non_const_receiver.dart.json.expect b/pkg/vm/testcases/transformations/record_use/lib/extension_call_non_const_receiver.dart.json.expect index fd62bc709a4..036f9c78526 100644 --- a/pkg/vm/testcases/transformations/record_use/lib/extension_call_non_const_receiver.dart.json.expect +++ b/pkg/vm/testcases/transformations/record_use/lib/extension_call_non_const_receiver.dart.json.expect @@ -33,7 +33,7 @@ } ], "metadata": { - "comment": "Recorded usages of objects tagged with a `RecordUse` annotation", + "comment": "Recorded usages of objects tagged with a `RecordUse` annotation.", "version": "0.4.0" }, "uses": { diff --git a/pkg/vm/testcases/transformations/record_use/lib/extension_operator.dart.json.expect b/pkg/vm/testcases/transformations/record_use/lib/extension_operator.dart.json.expect index a738022c8f5..af9f85b6ba9 100644 --- a/pkg/vm/testcases/transformations/record_use/lib/extension_operator.dart.json.expect +++ b/pkg/vm/testcases/transformations/record_use/lib/extension_operator.dart.json.expect @@ -33,7 +33,7 @@ } ], "metadata": { - "comment": "Recorded usages of objects tagged with a `RecordUse` annotation", + "comment": "Recorded usages of objects tagged with a `RecordUse` annotation.", "version": "0.4.0" }, "uses": { diff --git a/pkg/vm/testcases/transformations/record_use/lib/extension_static_call.dart.json.expect b/pkg/vm/testcases/transformations/record_use/lib/extension_static_call.dart.json.expect index f7ddff300f4..641bb75c39b 100644 --- a/pkg/vm/testcases/transformations/record_use/lib/extension_static_call.dart.json.expect +++ b/pkg/vm/testcases/transformations/record_use/lib/extension_static_call.dart.json.expect @@ -29,7 +29,7 @@ } ], "metadata": { - "comment": "Recorded usages of objects tagged with a `RecordUse` annotation", + "comment": "Recorded usages of objects tagged with a `RecordUse` annotation.", "version": "0.4.0" }, "uses": { diff --git a/pkg/vm/testcases/transformations/record_use/lib/extension_static_tearoff.dart.json.expect b/pkg/vm/testcases/transformations/record_use/lib/extension_static_tearoff.dart.json.expect index 79c2a58994c..ad99a14c75d 100644 --- a/pkg/vm/testcases/transformations/record_use/lib/extension_static_tearoff.dart.json.expect +++ b/pkg/vm/testcases/transformations/record_use/lib/extension_static_tearoff.dart.json.expect @@ -23,7 +23,7 @@ } ], "metadata": { - "comment": "Recorded usages of objects tagged with a `RecordUse` annotation", + "comment": "Recorded usages of objects tagged with a `RecordUse` annotation.", "version": "0.4.0" }, "uses": { diff --git a/pkg/vm/testcases/transformations/record_use/lib/extension_tearoff_const_receiver.dart.json.expect b/pkg/vm/testcases/transformations/record_use/lib/extension_tearoff_const_receiver.dart.json.expect index 8e604131bb9..4ea5fe41f62 100644 --- a/pkg/vm/testcases/transformations/record_use/lib/extension_tearoff_const_receiver.dart.json.expect +++ b/pkg/vm/testcases/transformations/record_use/lib/extension_tearoff_const_receiver.dart.json.expect @@ -29,7 +29,7 @@ } ], "metadata": { - "comment": "Recorded usages of objects tagged with a `RecordUse` annotation", + "comment": "Recorded usages of objects tagged with a `RecordUse` annotation.", "version": "0.4.0" }, "uses": { diff --git a/pkg/vm/testcases/transformations/record_use/lib/extension_tearoff_non_const_receiver.dart.json.expect b/pkg/vm/testcases/transformations/record_use/lib/extension_tearoff_non_const_receiver.dart.json.expect index 44a855bc7b2..ce94411feb4 100644 --- a/pkg/vm/testcases/transformations/record_use/lib/extension_tearoff_non_const_receiver.dart.json.expect +++ b/pkg/vm/testcases/transformations/record_use/lib/extension_tearoff_non_const_receiver.dart.json.expect @@ -29,7 +29,7 @@ } ], "metadata": { - "comment": "Recorded usages of objects tagged with a `RecordUse` annotation", + "comment": "Recorded usages of objects tagged with a `RecordUse` annotation.", "version": "0.4.0" }, "uses": { diff --git a/pkg/vm/testcases/transformations/record_use/lib/instance_class.dart.json.expect b/pkg/vm/testcases/transformations/record_use/lib/instance_class.dart.json.expect index d07bb169cdf..55beae19137 100644 --- a/pkg/vm/testcases/transformations/record_use/lib/instance_class.dart.json.expect +++ b/pkg/vm/testcases/transformations/record_use/lib/instance_class.dart.json.expect @@ -29,7 +29,7 @@ } ], "metadata": { - "comment": "Recorded usages of objects tagged with a `RecordUse` annotation", + "comment": "Recorded usages of objects tagged with a `RecordUse` annotation.", "version": "0.4.0" }, "uses": { diff --git a/pkg/vm/testcases/transformations/record_use/lib/instance_complex.dart.json.expect b/pkg/vm/testcases/transformations/record_use/lib/instance_complex.dart.json.expect index 8df28b3b422..239943d89f0 100644 --- a/pkg/vm/testcases/transformations/record_use/lib/instance_complex.dart.json.expect +++ b/pkg/vm/testcases/transformations/record_use/lib/instance_complex.dart.json.expect @@ -1,70 +1,70 @@ { "constants": [ { - "type": "int", - "value": 15 - }, - { - "type": "string", - "value": "s" - }, - { - "type": "string", - "value": "h" + "type": "null" }, { "type": "bool", "value": false }, - { - "type": "map", - "value": [ - { - "key": 2, - "value": 3 - } - ] - }, { "type": "bool", "value": true }, - { - "type": "string", - "value": "l" - }, { "type": "int", "value": 3 }, + { + "type": "int", + "value": 15 + }, + { + "type": "string", + "value": "h" + }, + { + "type": "string", + "value": "l" + }, + { + "type": "string", + "value": "s" + }, + { + "type": "map", + "value": [ + { + "key": 5, + "value": 1 + } + ] + }, { "type": "map", "value": [ { "key": 6, - "value": 7 + "value": 3 } ] }, { "type": "list", "value": [ - 8 + 9 ] }, - { - "type": "null" - }, { "definition_index": 0, "type": "instance", "value": { - "i": 0, - "s": 1, - "m": 4, - "b": 5, - "l": 9, - "n": 10 + "b": 2, + "i": 4, + "l": 10, + "m": 8, + "n": 0, + "s": 7 } } ], @@ -85,7 +85,7 @@ } ], "metadata": { - "comment": "Recorded usages of objects tagged with a `RecordUse` annotation", + "comment": "Recorded usages of objects tagged with a `RecordUse` annotation.", "version": "0.4.0" }, "uses": { diff --git a/pkg/vm/testcases/transformations/record_use/lib/instance_duplicates.dart.json.expect b/pkg/vm/testcases/transformations/record_use/lib/instance_duplicates.dart.json.expect index b6fef9dfb33..c9ad77d3b96 100644 --- a/pkg/vm/testcases/transformations/record_use/lib/instance_duplicates.dart.json.expect +++ b/pkg/vm/testcases/transformations/record_use/lib/instance_duplicates.dart.json.expect @@ -4,13 +4,6 @@ "type": "int", "value": 42 }, - { - "definition_index": 0, - "type": "instance", - "value": { - "i": 0 - } - }, { "type": "int", "value": 43 @@ -19,7 +12,14 @@ "definition_index": 0, "type": "instance", "value": { - "i": 2 + "i": 0 + } + }, + { + "definition_index": 0, + "type": "instance", + "value": { + "i": 1 } } ], @@ -40,7 +40,7 @@ } ], "metadata": { - "comment": "Recorded usages of objects tagged with a `RecordUse` annotation", + "comment": "Recorded usages of objects tagged with a `RecordUse` annotation.", "version": "0.4.0" }, "uses": { @@ -49,7 +49,7 @@ "definition_index": 0, "uses": [ { - "constant_index": 1, + "constant_index": 2, "loading_unit_indices": [ 0 ], diff --git a/pkg/vm/testcases/transformations/record_use/lib/instance_method.dart.json.expect b/pkg/vm/testcases/transformations/record_use/lib/instance_method.dart.json.expect index f07ae0819cb..20c41685caf 100644 --- a/pkg/vm/testcases/transformations/record_use/lib/instance_method.dart.json.expect +++ b/pkg/vm/testcases/transformations/record_use/lib/instance_method.dart.json.expect @@ -1,6 +1,6 @@ { "metadata": { - "comment": "Recorded usages of objects tagged with a `RecordUse` annotation", + "comment": "Recorded usages of objects tagged with a `RecordUse` annotation.", "version": "0.4.0" } } \ No newline at end of file diff --git a/pkg/vm/testcases/transformations/record_use/lib/instance_not_annotation.dart.json.expect b/pkg/vm/testcases/transformations/record_use/lib/instance_not_annotation.dart.json.expect index 4f001a56d5e..1b91146d735 100644 --- a/pkg/vm/testcases/transformations/record_use/lib/instance_not_annotation.dart.json.expect +++ b/pkg/vm/testcases/transformations/record_use/lib/instance_not_annotation.dart.json.expect @@ -22,7 +22,7 @@ } ], "metadata": { - "comment": "Recorded usages of objects tagged with a `RecordUse` annotation", + "comment": "Recorded usages of objects tagged with a `RecordUse` annotation.", "version": "0.4.0" }, "uses": { diff --git a/pkg/vm/testcases/transformations/record_use/lib/loading_units_multiple.dart.json.expect b/pkg/vm/testcases/transformations/record_use/lib/loading_units_multiple.dart.json.expect index 59c02184c65..7545a935812 100644 --- a/pkg/vm/testcases/transformations/record_use/lib/loading_units_multiple.dart.json.expect +++ b/pkg/vm/testcases/transformations/record_use/lib/loading_units_multiple.dart.json.expect @@ -32,7 +32,7 @@ } ], "metadata": { - "comment": "Recorded usages of objects tagged with a `RecordUse` annotation", + "comment": "Recorded usages of objects tagged with a `RecordUse` annotation.", "version": "0.4.0" }, "uses": { diff --git a/pkg/vm/testcases/transformations/record_use/lib/loading_units_simple.dart.json.expect b/pkg/vm/testcases/transformations/record_use/lib/loading_units_simple.dart.json.expect index 8ef082cc881..585581333c0 100644 --- a/pkg/vm/testcases/transformations/record_use/lib/loading_units_simple.dart.json.expect +++ b/pkg/vm/testcases/transformations/record_use/lib/loading_units_simple.dart.json.expect @@ -48,7 +48,7 @@ } ], "metadata": { - "comment": "Recorded usages of objects tagged with a `RecordUse` annotation", + "comment": "Recorded usages of objects tagged with a `RecordUse` annotation.", "version": "0.4.0" }, "uses": { diff --git a/pkg/vm/testcases/transformations/record_use/lib/map_complex_keys.dart.json.expect b/pkg/vm/testcases/transformations/record_use/lib/map_complex_keys.dart.json.expect index 27b0ffbdabe..567cfcb42f9 100644 --- a/pkg/vm/testcases/transformations/record_use/lib/map_complex_keys.dart.json.expect +++ b/pkg/vm/testcases/transformations/record_use/lib/map_complex_keys.dart.json.expect @@ -1,30 +1,30 @@ { "constants": [ + { + "type": "bool", + "value": true + }, { "type": "int", "value": 1 }, { "type": "string", - "value": "int-key" - }, - { - "type": "bool", - "value": true + "value": "bool-key" }, { "type": "string", - "value": "bool-key" + "value": "int-key" }, { "type": "map", "value": [ { "key": 0, - "value": 1 + "value": 2 }, { - "key": 2, + "key": 1, "value": 3 } ] @@ -54,7 +54,7 @@ } ], "metadata": { - "comment": "Recorded usages of objects tagged with a `RecordUse` annotation", + "comment": "Recorded usages of objects tagged with a `RecordUse` annotation.", "version": "0.4.0" }, "uses": { diff --git a/pkg/vm/testcases/transformations/record_use/lib/named_and_positional.dart.json.expect b/pkg/vm/testcases/transformations/record_use/lib/named_and_positional.dart.json.expect index eaf4020b34e..2f84903dad0 100644 --- a/pkg/vm/testcases/transformations/record_use/lib/named_and_positional.dart.json.expect +++ b/pkg/vm/testcases/transformations/record_use/lib/named_and_positional.dart.json.expect @@ -1,16 +1,8 @@ { "constants": [ - { - "type": "int", - "value": 3 - }, { "type": "null" }, - { - "type": "int", - "value": 5 - }, { "type": "int", "value": 1 @@ -19,9 +11,17 @@ "type": "int", "value": 2 }, + { + "type": "int", + "value": 3 + }, { "type": "int", "value": 4 + }, + { + "type": "int", + "value": 5 } ], "definitions": [ @@ -48,7 +48,7 @@ } ], "metadata": { - "comment": "Recorded usages of objects tagged with a `RecordUse` annotation", + "comment": "Recorded usages of objects tagged with a `RecordUse` annotation.", "version": "0.4.0" }, "uses": { @@ -61,12 +61,25 @@ 0 ], "named": { - "l": 1, - "k": 0 + "k": 3, + "l": 0 }, "positional": [ + 3 + ], + "type": "with_arguments" + }, + { + "loading_unit_indices": [ 0 ], + "named": { + "k": 1, + "l": 0 + }, + "positional": [ + 5 + ], "type": "with_arguments" }, { @@ -75,10 +88,10 @@ ], "named": { "k": 3, - "l": 1 + "l": 2 }, "positional": [ - 2 + 5 ], "type": "with_arguments" }, @@ -87,24 +100,11 @@ 0 ], "named": { - "l": 4, - "k": 0 + "k": 4, + "l": 2 }, "positional": [ - 2 - ], - "type": "with_arguments" - }, - { - "loading_unit_indices": [ - 0 - ], - "named": { - "l": 4, - "k": 5 - }, - "positional": [ - 2 + 5 ], "type": "with_arguments" } diff --git a/pkg/vm/testcases/transformations/record_use/lib/named_both.dart.json.expect b/pkg/vm/testcases/transformations/record_use/lib/named_both.dart.json.expect index 2ce9b096652..3ae16438614 100644 --- a/pkg/vm/testcases/transformations/record_use/lib/named_both.dart.json.expect +++ b/pkg/vm/testcases/transformations/record_use/lib/named_both.dart.json.expect @@ -1,16 +1,8 @@ { "constants": [ - { - "type": "int", - "value": 3 - }, { "type": "null" }, - { - "type": "int", - "value": 5 - }, { "type": "int", "value": 1 @@ -19,9 +11,17 @@ "type": "int", "value": 2 }, + { + "type": "int", + "value": 3 + }, { "type": "int", "value": 4 + }, + { + "type": "int", + "value": 5 } ], "definitions": [ @@ -48,7 +48,7 @@ } ], "metadata": { - "comment": "Recorded usages of objects tagged with a `RecordUse` annotation", + "comment": "Recorded usages of objects tagged with a `RecordUse` annotation.", "version": "0.4.0" }, "uses": { @@ -61,20 +61,9 @@ 0 ], "named": { - "i": 0, - "l": 1, - "k": 0 - }, - "type": "with_arguments" - }, - { - "loading_unit_indices": [ - 0 - ], - "named": { - "i": 2, + "i": 3, "k": 3, - "l": 1 + "l": 0 }, "type": "with_arguments" }, @@ -83,9 +72,9 @@ 0 ], "named": { - "i": 2, - "l": 4, - "k": 0 + "i": 5, + "k": 1, + "l": 0 }, "type": "with_arguments" }, @@ -94,9 +83,20 @@ 0 ], "named": { - "i": 2, - "l": 4, - "k": 5 + "i": 5, + "k": 3, + "l": 2 + }, + "type": "with_arguments" + }, + { + "loading_unit_indices": [ + 0 + ], + "named": { + "i": 5, + "k": 4, + "l": 2 }, "type": "with_arguments" } diff --git a/pkg/vm/testcases/transformations/record_use/lib/named_optional.dart.json.expect b/pkg/vm/testcases/transformations/record_use/lib/named_optional.dart.json.expect index 1878c65fa3d..13936df4248 100644 --- a/pkg/vm/testcases/transformations/record_use/lib/named_optional.dart.json.expect +++ b/pkg/vm/testcases/transformations/record_use/lib/named_optional.dart.json.expect @@ -33,7 +33,7 @@ } ], "metadata": { - "comment": "Recorded usages of objects tagged with a `RecordUse` annotation", + "comment": "Recorded usages of objects tagged with a `RecordUse` annotation.", "version": "0.4.0" }, "uses": { diff --git a/pkg/vm/testcases/transformations/record_use/lib/named_required.dart.json.expect b/pkg/vm/testcases/transformations/record_use/lib/named_required.dart.json.expect index ccfb60f10c9..b74eeda0937 100644 --- a/pkg/vm/testcases/transformations/record_use/lib/named_required.dart.json.expect +++ b/pkg/vm/testcases/transformations/record_use/lib/named_required.dart.json.expect @@ -33,7 +33,7 @@ } ], "metadata": { - "comment": "Recorded usages of objects tagged with a `RecordUse` annotation", + "comment": "Recorded usages of objects tagged with a `RecordUse` annotation.", "version": "0.4.0" }, "uses": { diff --git a/pkg/vm/testcases/transformations/record_use/lib/named_with_function_arg.dart.json.expect b/pkg/vm/testcases/transformations/record_use/lib/named_with_function_arg.dart.json.expect index 3bd09cb6186..8aaf4fbbbb4 100644 --- a/pkg/vm/testcases/transformations/record_use/lib/named_with_function_arg.dart.json.expect +++ b/pkg/vm/testcases/transformations/record_use/lib/named_with_function_arg.dart.json.expect @@ -32,7 +32,7 @@ } ], "metadata": { - "comment": "Recorded usages of objects tagged with a `RecordUse` annotation", + "comment": "Recorded usages of objects tagged with a `RecordUse` annotation.", "version": "0.4.0" }, "uses": { diff --git a/pkg/vm/testcases/transformations/record_use/lib/nested.dart.json.expect b/pkg/vm/testcases/transformations/record_use/lib/nested.dart.json.expect index 26c63543975..85413afda9b 100644 --- a/pkg/vm/testcases/transformations/record_use/lib/nested.dart.json.expect +++ b/pkg/vm/testcases/transformations/record_use/lib/nested.dart.json.expect @@ -4,6 +4,14 @@ "type": "int", "value": 42 }, + { + "type": "string", + "value": "test" + }, + { + "definition_index": 1, + "type": "instance" + }, { "definition_index": 0, "type": "instance", @@ -11,20 +19,12 @@ "i": 0 } }, - { - "type": "string", - "value": "test" - }, { "definition_index": 0, "type": "instance", "value": { - "i": 2 + "i": 1 } - }, - { - "definition_index": 1, - "type": "instance" } ], "definitions": [ @@ -53,7 +53,7 @@ } ], "metadata": { - "comment": "Recorded usages of objects tagged with a `RecordUse` annotation", + "comment": "Recorded usages of objects tagged with a `RecordUse` annotation.", "version": "0.4.0" }, "uses": { @@ -62,14 +62,14 @@ "definition_index": 0, "uses": [ { - "constant_index": 1, + "constant_index": 3, "loading_unit_indices": [ 0 ], "type": "constant" }, { - "constant_index": 3, + "constant_index": 4, "loading_unit_indices": [ 0 ], @@ -81,7 +81,7 @@ "definition_index": 1, "uses": [ { - "constant_index": 4, + "constant_index": 2, "loading_unit_indices": [ 0 ], diff --git a/pkg/vm/testcases/transformations/record_use/lib/nested_instance_constant.dart.json.expect b/pkg/vm/testcases/transformations/record_use/lib/nested_instance_constant.dart.json.expect index 1fb31ee99aa..41ece2f2e09 100644 --- a/pkg/vm/testcases/transformations/record_use/lib/nested_instance_constant.dart.json.expect +++ b/pkg/vm/testcases/transformations/record_use/lib/nested_instance_constant.dart.json.expect @@ -29,7 +29,7 @@ } ], "metadata": { - "comment": "Recorded usages of objects tagged with a `RecordUse` annotation", + "comment": "Recorded usages of objects tagged with a `RecordUse` annotation.", "version": "0.4.0" }, "uses": { diff --git a/pkg/vm/testcases/transformations/record_use/lib/partfile_main.dart.json.expect b/pkg/vm/testcases/transformations/record_use/lib/partfile_main.dart.json.expect index 9488337ad62..bc0cb3fdf68 100644 --- a/pkg/vm/testcases/transformations/record_use/lib/partfile_main.dart.json.expect +++ b/pkg/vm/testcases/transformations/record_use/lib/partfile_main.dart.json.expect @@ -29,7 +29,7 @@ } ], "metadata": { - "comment": "Recorded usages of objects tagged with a `RecordUse` annotation", + "comment": "Recorded usages of objects tagged with a `RecordUse` annotation.", "version": "0.4.0" }, "uses": { diff --git a/pkg/vm/testcases/transformations/record_use/lib/positional_both.dart.json.expect b/pkg/vm/testcases/transformations/record_use/lib/positional_both.dart.json.expect index 40bc6cb4162..daf8ad177f9 100644 --- a/pkg/vm/testcases/transformations/record_use/lib/positional_both.dart.json.expect +++ b/pkg/vm/testcases/transformations/record_use/lib/positional_both.dart.json.expect @@ -1,20 +1,20 @@ { "constants": [ - { - "type": "int", - "value": 5 - }, { "type": "int", "value": 3 }, { "type": "int", - "value": 6 + "value": 4 }, { "type": "int", - "value": 4 + "value": 5 + }, + { + "type": "int", + "value": 6 } ], "definitions": [ @@ -41,7 +41,7 @@ } ], "metadata": { - "comment": "Recorded usages of objects tagged with a `RecordUse` annotation", + "comment": "Recorded usages of objects tagged with a `RecordUse` annotation.", "version": "0.4.0" }, "uses": { @@ -54,8 +54,8 @@ 0 ], "positional": [ - 0, - 1 + 2, + 0 ], "type": "with_arguments" }, @@ -64,8 +64,8 @@ 0 ], "positional": [ - 2, - 3 + 3, + 1 ], "type": "with_arguments" } diff --git a/pkg/vm/testcases/transformations/record_use/lib/positional_both_with_type_argument.dart.json.expect b/pkg/vm/testcases/transformations/record_use/lib/positional_both_with_type_argument.dart.json.expect index 4089cc5c932..506e749c675 100644 --- a/pkg/vm/testcases/transformations/record_use/lib/positional_both_with_type_argument.dart.json.expect +++ b/pkg/vm/testcases/transformations/record_use/lib/positional_both_with_type_argument.dart.json.expect @@ -1,20 +1,20 @@ { "constants": [ - { - "type": "int", - "value": 5 - }, { "type": "int", "value": 3 }, { "type": "int", - "value": 6 + "value": 4 }, { "type": "int", - "value": 4 + "value": 5 + }, + { + "type": "int", + "value": 6 } ], "definitions": [ @@ -41,7 +41,7 @@ } ], "metadata": { - "comment": "Recorded usages of objects tagged with a `RecordUse` annotation", + "comment": "Recorded usages of objects tagged with a `RecordUse` annotation.", "version": "0.4.0" }, "uses": { @@ -54,8 +54,8 @@ 0 ], "positional": [ - 0, - 1 + 2, + 0 ], "type": "with_arguments" }, @@ -64,8 +64,8 @@ 0 ], "positional": [ - 2, - 3 + 3, + 1 ], "type": "with_arguments" } diff --git a/pkg/vm/testcases/transformations/record_use/lib/positional_optional.dart.json.expect b/pkg/vm/testcases/transformations/record_use/lib/positional_optional.dart.json.expect index 7b336aa6e3f..76f4e4f1030 100644 --- a/pkg/vm/testcases/transformations/record_use/lib/positional_optional.dart.json.expect +++ b/pkg/vm/testcases/transformations/record_use/lib/positional_optional.dart.json.expect @@ -33,7 +33,7 @@ } ], "metadata": { - "comment": "Recorded usages of objects tagged with a `RecordUse` annotation", + "comment": "Recorded usages of objects tagged with a `RecordUse` annotation.", "version": "0.4.0" }, "uses": { diff --git a/pkg/vm/testcases/transformations/record_use/lib/record_const.dart.json.expect b/pkg/vm/testcases/transformations/record_use/lib/record_const.dart.json.expect index 50f26a4d72f..12471922660 100644 --- a/pkg/vm/testcases/transformations/record_use/lib/record_const.dart.json.expect +++ b/pkg/vm/testcases/transformations/record_use/lib/record_const.dart.json.expect @@ -4,13 +4,21 @@ "type": "int", "value": 1 }, + { + "type": "int", + "value": 10 + }, + { + "type": "int", + "value": 20 + }, { "type": "string", "value": "foo" }, { "named": { - "name": 1 + "name": 3 }, "positional": [ 0 @@ -18,25 +26,17 @@ "type": "record" }, { - "type": "int", - "value": 10 - }, - { - "definition_index": 1, + "definition_index": 0, "type": "instance", "value": { - "value": 3 + "value": 1 } }, { - "type": "int", - "value": 20 - }, - { - "definition_index": 1, + "definition_index": 0, "type": "instance", "value": { - "value": 5 + "value": 2 } }, { @@ -44,12 +44,21 @@ "val": 6 }, "positional": [ - 4 + 5 ], "type": "record" } ], "definitions": [ + { + "path": [ + { + "kind": "class", + "name": "MyClass" + } + ], + "uri": "package:record_use_test/record_const.dart" + }, { "path": [ { @@ -61,15 +70,6 @@ } ], "uri": "package:record_use_test/record_const.dart" - }, - { - "path": [ - { - "kind": "class", - "name": "MyClass" - } - ], - "uri": "package:record_use_test/record_const.dart" } ], "loading_units": [ @@ -78,16 +78,16 @@ } ], "metadata": { - "comment": "Recorded usages of objects tagged with a `RecordUse` annotation", + "comment": "Recorded usages of objects tagged with a `RecordUse` annotation.", "version": "0.4.0" }, "uses": { "instances": [ { - "definition_index": 1, + "definition_index": 0, "uses": [ { - "constant_index": 4, + "constant_index": 5, "loading_unit_indices": [ 0 ], @@ -105,14 +105,14 @@ ], "static_calls": [ { - "definition_index": 0, + "definition_index": 1, "uses": [ { "loading_unit_indices": [ 0 ], "positional": [ - 2 + 4 ], "type": "with_arguments" }, diff --git a/pkg/vm/testcases/transformations/record_use/lib/record_enum.dart.json.expect b/pkg/vm/testcases/transformations/record_use/lib/record_enum.dart.json.expect index 9a25c48f8d4..25e274ddbec 100644 --- a/pkg/vm/testcases/transformations/record_use/lib/record_enum.dart.json.expect +++ b/pkg/vm/testcases/transformations/record_use/lib/record_enum.dart.json.expect @@ -40,7 +40,7 @@ } ], "metadata": { - "comment": "Recorded usages of objects tagged with a `RecordUse` annotation", + "comment": "Recorded usages of objects tagged with a `RecordUse` annotation.", "version": "0.4.0" }, "uses": { diff --git a/pkg/vm/testcases/transformations/record_use/lib/record_instance_constant_empty.dart.json.expect b/pkg/vm/testcases/transformations/record_use/lib/record_instance_constant_empty.dart.json.expect index d586e71155b..58f65c43e67 100644 --- a/pkg/vm/testcases/transformations/record_use/lib/record_instance_constant_empty.dart.json.expect +++ b/pkg/vm/testcases/transformations/record_use/lib/record_instance_constant_empty.dart.json.expect @@ -1,11 +1,11 @@ { "constants": [ { - "definition_index": 1, + "definition_index": 0, "type": "instance" }, { - "definition_index": 0, + "definition_index": 1, "type": "instance", "value": { "a": 0 @@ -17,7 +17,7 @@ "path": [ { "kind": "class", - "name": "MyClass" + "name": "A" } ], "uri": "package:record_use_test/record_instance_constant_empty.dart" @@ -26,7 +26,7 @@ "path": [ { "kind": "class", - "name": "A" + "name": "MyClass" } ], "uri": "package:record_use_test/record_instance_constant_empty.dart" @@ -38,7 +38,7 @@ } ], "metadata": { - "comment": "Recorded usages of objects tagged with a `RecordUse` annotation", + "comment": "Recorded usages of objects tagged with a `RecordUse` annotation.", "version": "0.4.0" }, "uses": { @@ -47,7 +47,7 @@ "definition_index": 0, "uses": [ { - "constant_index": 1, + "constant_index": 0, "loading_unit_indices": [ 0 ], @@ -59,7 +59,7 @@ "definition_index": 1, "uses": [ { - "constant_index": 0, + "constant_index": 1, "loading_unit_indices": [ 0 ], diff --git a/pkg/vm/testcases/transformations/record_use/lib/simple.dart.json.expect b/pkg/vm/testcases/transformations/record_use/lib/simple.dart.json.expect index 7b0c63061be..ad8c109beae 100644 --- a/pkg/vm/testcases/transformations/record_use/lib/simple.dart.json.expect +++ b/pkg/vm/testcases/transformations/record_use/lib/simple.dart.json.expect @@ -29,7 +29,7 @@ } ], "metadata": { - "comment": "Recorded usages of objects tagged with a `RecordUse` annotation", + "comment": "Recorded usages of objects tagged with a `RecordUse` annotation.", "version": "0.4.0" }, "uses": { diff --git a/pkg/vm/testcases/transformations/record_use/lib/tearoff.dart.json.expect b/pkg/vm/testcases/transformations/record_use/lib/tearoff.dart.json.expect index a383a81f91a..9cac08f0b0a 100644 --- a/pkg/vm/testcases/transformations/record_use/lib/tearoff.dart.json.expect +++ b/pkg/vm/testcases/transformations/record_use/lib/tearoff.dart.json.expect @@ -23,7 +23,7 @@ } ], "metadata": { - "comment": "Recorded usages of objects tagged with a `RecordUse` annotation", + "comment": "Recorded usages of objects tagged with a `RecordUse` annotation.", "version": "0.4.0" }, "uses": { diff --git a/pkg/vm/testcases/transformations/record_use/lib/top_level_method.dart.json.expect b/pkg/vm/testcases/transformations/record_use/lib/top_level_method.dart.json.expect index 63451eeb21b..d13213954e1 100644 --- a/pkg/vm/testcases/transformations/record_use/lib/top_level_method.dart.json.expect +++ b/pkg/vm/testcases/transformations/record_use/lib/top_level_method.dart.json.expect @@ -25,7 +25,7 @@ } ], "metadata": { - "comment": "Recorded usages of objects tagged with a `RecordUse` annotation", + "comment": "Recorded usages of objects tagged with a `RecordUse` annotation.", "version": "0.4.0" }, "uses": { diff --git a/pkg/vm/testcases/transformations/record_use/lib/types_of_arguments.dart.json.expect b/pkg/vm/testcases/transformations/record_use/lib/types_of_arguments.dart.json.expect index 9fd3084773e..fc86d2046e0 100644 --- a/pkg/vm/testcases/transformations/record_use/lib/types_of_arguments.dart.json.expect +++ b/pkg/vm/testcases/transformations/record_use/lib/types_of_arguments.dart.json.expect @@ -1,20 +1,19 @@ { "constants": [ { - "type": "int", - "value": 42 + "type": "non_constant" }, { "type": "null" }, - { - "type": "string", - "value": "s" - }, { "type": "bool", "value": true }, + { + "type": "int", + "value": 42 + }, { "type": "string", "value": "a" @@ -27,13 +26,6 @@ "type": "string", "value": "a2" }, - { - "type": "list", - "value": [ - 5, - 6 - ] - }, { "type": "string", "value": "b" @@ -46,11 +38,22 @@ "type": "string", "value": "b2" }, + { + "type": "string", + "value": "s" + }, { "type": "list", "value": [ - 9, - 10 + 5, + 6 + ] + }, + { + "type": "list", + "value": [ + 8, + 9 ] }, { @@ -58,16 +61,13 @@ "value": [ { "key": 4, - "value": 7 + "value": 11 }, { - "key": 8, - "value": 11 + "key": 7, + "value": 12 } ] - }, - { - "type": "non_constant" } ], "definitions": [ @@ -94,7 +94,7 @@ } ], "metadata": { - "comment": "Recorded usages of objects tagged with a `RecordUse` annotation", + "comment": "Recorded usages of objects tagged with a `RecordUse` annotation.", "version": "0.4.0" }, "uses": { @@ -107,7 +107,7 @@ 0 ], "positional": [ - 0 + 3 ], "type": "with_arguments" }, @@ -120,6 +120,15 @@ ], "type": "with_arguments" }, + { + "loading_unit_indices": [ + 0 + ], + "positional": [ + 10 + ], + "type": "with_arguments" + }, { "loading_unit_indices": [ 0 @@ -129,24 +138,6 @@ ], "type": "with_arguments" }, - { - "loading_unit_indices": [ - 0 - ], - "positional": [ - 3 - ], - "type": "with_arguments" - }, - { - "loading_unit_indices": [ - 0 - ], - "positional": [ - 12 - ], - "type": "with_arguments" - }, { "loading_unit_indices": [ 0 @@ -155,6 +146,15 @@ 13 ], "type": "with_arguments" + }, + { + "loading_unit_indices": [ + 0 + ], + "positional": [ + 0 + ], + "type": "with_arguments" } ] } diff --git a/pkg/vm/testcases/transformations/record_use/lib/unsupported_class_instance_not_annotated.dart.json.expect b/pkg/vm/testcases/transformations/record_use/lib/unsupported_class_instance_not_annotated.dart.json.expect index b152ca900a3..760068dcaa9 100644 --- a/pkg/vm/testcases/transformations/record_use/lib/unsupported_class_instance_not_annotated.dart.json.expect +++ b/pkg/vm/testcases/transformations/record_use/lib/unsupported_class_instance_not_annotated.dart.json.expect @@ -25,7 +25,7 @@ } ], "metadata": { - "comment": "Recorded usages of objects tagged with a `RecordUse` annotation", + "comment": "Recorded usages of objects tagged with a `RecordUse` annotation.", "version": "0.4.0" }, "uses": { diff --git a/pkg/vm/testcases/transformations/record_use/lib/unsupported_collections.dart.json.expect b/pkg/vm/testcases/transformations/record_use/lib/unsupported_collections.dart.json.expect index e1bb7edae1b..64afa5a03b4 100644 --- a/pkg/vm/testcases/transformations/record_use/lib/unsupported_collections.dart.json.expect +++ b/pkg/vm/testcases/transformations/record_use/lib/unsupported_collections.dart.json.expect @@ -4,21 +4,21 @@ "message": "Function/Method tear-offs are not supported for recording.", "type": "unsupported" }, + { + "type": "string", + "value": "key" + }, { "type": "list", "value": [ 0 ] }, - { - "type": "string", - "value": "key" - }, { "type": "map", "value": [ { - "key": 2, + "key": 1, "value": 0 } ] @@ -44,7 +44,7 @@ } ], "metadata": { - "comment": "Recorded usages of objects tagged with a `RecordUse` annotation", + "comment": "Recorded usages of objects tagged with a `RecordUse` annotation.", "version": "0.4.0" }, "uses": { @@ -57,7 +57,7 @@ 0 ], "positional": [ - 1 + 2 ], "type": "with_arguments" }, diff --git a/pkg/vm/testcases/transformations/record_use/lib/unsupported_enum_instance_not_annotated.dart.json.expect b/pkg/vm/testcases/transformations/record_use/lib/unsupported_enum_instance_not_annotated.dart.json.expect index e41c8d1f9d9..805223c9572 100644 --- a/pkg/vm/testcases/transformations/record_use/lib/unsupported_enum_instance_not_annotated.dart.json.expect +++ b/pkg/vm/testcases/transformations/record_use/lib/unsupported_enum_instance_not_annotated.dart.json.expect @@ -25,7 +25,7 @@ } ], "metadata": { - "comment": "Recorded usages of objects tagged with a `RecordUse` annotation", + "comment": "Recorded usages of objects tagged with a `RecordUse` annotation.", "version": "0.4.0" }, "uses": { diff --git a/pkg/vm/testcases/transformations/record_use/lib/unsupported_instance.dart.json.expect b/pkg/vm/testcases/transformations/record_use/lib/unsupported_instance.dart.json.expect index f3f3d0dc7a6..e7484dc9663 100644 --- a/pkg/vm/testcases/transformations/record_use/lib/unsupported_instance.dart.json.expect +++ b/pkg/vm/testcases/transformations/record_use/lib/unsupported_instance.dart.json.expect @@ -5,7 +5,7 @@ "type": "unsupported" }, { - "definition_index": 1, + "definition_index": 0, "type": "instance", "value": { "field": 0 @@ -13,6 +13,15 @@ } ], "definitions": [ + { + "path": [ + { + "kind": "class", + "name": "MyClass" + } + ], + "uri": "package:record_use_test/unsupported_instance.dart" + }, { "path": [ { @@ -24,15 +33,6 @@ } ], "uri": "package:record_use_test/unsupported_instance.dart" - }, - { - "path": [ - { - "kind": "class", - "name": "MyClass" - } - ], - "uri": "package:record_use_test/unsupported_instance.dart" } ], "loading_units": [ @@ -41,13 +41,13 @@ } ], "metadata": { - "comment": "Recorded usages of objects tagged with a `RecordUse` annotation", + "comment": "Recorded usages of objects tagged with a `RecordUse` annotation.", "version": "0.4.0" }, "uses": { "instances": [ { - "definition_index": 1, + "definition_index": 0, "uses": [ { "constant_index": 1, @@ -61,7 +61,7 @@ ], "static_calls": [ { - "definition_index": 0, + "definition_index": 1, "uses": [ { "loading_unit_indices": [