Version 2.14.0-160.0.dev
Merge commit '266ad2a5684be3c0590e419d0aa0f2630f30bc96' into 'dev'
diff --git a/benchmarks/Calls/dart/Calls.dart b/benchmarks/Calls/dart/Calls.dart
index 5b94b2a..ae54663 100644
--- a/benchmarks/Calls/dart/Calls.dart
+++ b/benchmarks/Calls/dart/Calls.dart
@@ -816,7 +816,7 @@
// Runs warmup phase, runs benchmark and reports result.
void report() {
- // Warmup for 200 ms.
+ // Warmup for 100 ms.
measureFor(const Duration(milliseconds: 100));
// Run benchmark for 2 seconds.
diff --git a/benchmarks/Calls/dart2/Calls.dart b/benchmarks/Calls/dart2/Calls.dart
index 32cc0dd..e1d07c9 100644
--- a/benchmarks/Calls/dart2/Calls.dart
+++ b/benchmarks/Calls/dart2/Calls.dart
@@ -818,7 +818,7 @@
// Runs warmup phase, runs benchmark and reports result.
void report() {
- // Warmup for 200 ms.
+ // Warmup for 100 ms.
measureFor(const Duration(milliseconds: 100));
// Run benchmark for 2 seconds.
diff --git a/benchmarks/MapLookup/dart/MapLookup.dart b/benchmarks/MapLookup/dart/MapLookup.dart
new file mode 100644
index 0000000..d7593f8
--- /dev/null
+++ b/benchmarks/MapLookup/dart/MapLookup.dart
@@ -0,0 +1,131 @@
+// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// Benchmark for https://github.com/dart-lang/sdk/issues/45908.
+//
+// Measures the average time needed for a lookup in Maps.
+
+import 'dart:math';
+
+import 'maps.dart';
+
+abstract class MapLookupBenchmark {
+ final String name;
+ const MapLookupBenchmark(this.name);
+
+ Map<String, String> get myMap;
+
+ // Returns the number of nanoseconds per call.
+ double measureFor(Duration duration) {
+ final map = myMap;
+
+ // Prevent `sw.elapsedMicroseconds` from dominating with maps with a
+ // small number of elements.
+ final int batching = max(1000 ~/ map.length, 1);
+
+ int numberOfLookups = 0;
+ int totalMicroseconds = 0;
+
+ final sw = Stopwatch()..start();
+ final durationInMicroseconds = duration.inMicroseconds;
+
+ do {
+ for (int i = 0; i < batching; i++) {
+ String? k = '0';
+ while (k != null) {
+ k = map[k];
+ }
+ numberOfLookups += map.length;
+ }
+ totalMicroseconds = sw.elapsedMicroseconds;
+ } while (totalMicroseconds < durationInMicroseconds);
+
+ final int totalNanoseconds = sw.elapsed.inMicroseconds * 1000;
+ return totalNanoseconds / numberOfLookups;
+ }
+
+ // Runs warmup phase, runs benchmark and reports result.
+ void report() {
+ // Warmup for 100 ms.
+ measureFor(const Duration(milliseconds: 100));
+
+ // Run benchmark for 2 seconds.
+ final double nsPerCall = measureFor(const Duration(seconds: 2));
+
+ // Report result.
+ print('$name(RunTimeRaw): $nsPerCall ns.');
+ }
+}
+
+class Constant1 extends MapLookupBenchmark {
+ const Constant1() : super('MapLookup.Constant1');
+
+ @override
+ Map<String, String> get myMap => const1;
+}
+
+class Final1 extends MapLookupBenchmark {
+ const Final1() : super('MapLookup.Final1');
+
+ @override
+ Map<String, String> get myMap => final1;
+}
+
+class Constant5 extends MapLookupBenchmark {
+ const Constant5() : super('MapLookup.Constant5');
+
+ @override
+ Map<String, String> get myMap => const5;
+}
+
+class Final5 extends MapLookupBenchmark {
+ const Final5() : super('MapLookup.Final5');
+
+ @override
+ Map<String, String> get myMap => final5;
+}
+
+class Constant10 extends MapLookupBenchmark {
+ const Constant10() : super('MapLookup.Constant10');
+
+ @override
+ Map<String, String> get myMap => const10;
+}
+
+class Final10 extends MapLookupBenchmark {
+ const Final10() : super('MapLookup.Final10');
+
+ @override
+ Map<String, String> get myMap => final10;
+}
+
+class Constant100 extends MapLookupBenchmark {
+ const Constant100() : super('MapLookup.Constant100');
+
+ @override
+ Map<String, String> get myMap => const100;
+}
+
+class Final100 extends MapLookupBenchmark {
+ const Final100() : super('MapLookup.Final100');
+
+ @override
+ Map<String, String> get myMap => final100;
+}
+
+void main() {
+ final benchmarks = [
+ () => const Constant1(),
+ () => const Constant5(),
+ () => const Constant10(),
+ () => const Constant100(),
+ () => const Final1(),
+ () => const Final5(),
+ () => const Final10(),
+ () => const Final100(),
+ ];
+ for (final benchmark in benchmarks) {
+ benchmark().report();
+ }
+}
diff --git a/benchmarks/MapLookup/dart/maps.dart b/benchmarks/MapLookup/dart/maps.dart
new file mode 100644
index 0000000..0817b17
--- /dev/null
+++ b/benchmarks/MapLookup/dart/maps.dart
@@ -0,0 +1,259 @@
+// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+const const1 = <String, String>{
+ '0': '1',
+};
+
+final final1 = <String, String>{
+ '0': '1',
+};
+
+const const5 = <String, String>{
+ '0': '1',
+ '1': '2',
+ '2': '3',
+ '3': '4',
+ '4': '5',
+};
+
+final final5 = <String, String>{
+ '0': '1',
+ '1': '2',
+ '2': '3',
+ '3': '4',
+ '4': '5',
+};
+
+const const10 = <String, String>{
+ '0': '1',
+ '1': '2',
+ '2': '3',
+ '3': '4',
+ '4': '5',
+ '5': '6',
+ '6': '7',
+ '7': '8',
+ '8': '9',
+ '9': '10',
+};
+
+final final10 = <String, String>{
+ '0': '1',
+ '1': '2',
+ '2': '3',
+ '3': '4',
+ '4': '5',
+ '5': '6',
+ '6': '7',
+ '7': '8',
+ '8': '9',
+ '9': '10',
+};
+
+const const100 = <String, String>{
+ '0': '1',
+ '1': '2',
+ '2': '3',
+ '3': '4',
+ '4': '5',
+ '5': '6',
+ '6': '7',
+ '7': '8',
+ '8': '9',
+ '9': '10',
+ '10': '11',
+ '11': '12',
+ '12': '13',
+ '13': '14',
+ '14': '15',
+ '15': '16',
+ '16': '17',
+ '17': '18',
+ '18': '19',
+ '19': '20',
+ '20': '21',
+ '21': '22',
+ '22': '23',
+ '23': '24',
+ '24': '25',
+ '25': '26',
+ '26': '27',
+ '27': '28',
+ '28': '29',
+ '29': '30',
+ '30': '31',
+ '31': '32',
+ '32': '33',
+ '33': '34',
+ '34': '35',
+ '35': '36',
+ '36': '37',
+ '37': '38',
+ '38': '39',
+ '39': '40',
+ '40': '41',
+ '41': '42',
+ '42': '43',
+ '43': '44',
+ '44': '45',
+ '45': '46',
+ '46': '47',
+ '47': '48',
+ '48': '49',
+ '49': '50',
+ '50': '51',
+ '51': '52',
+ '52': '53',
+ '53': '54',
+ '54': '55',
+ '55': '56',
+ '56': '57',
+ '57': '58',
+ '58': '59',
+ '59': '60',
+ '60': '61',
+ '61': '62',
+ '62': '63',
+ '63': '64',
+ '64': '65',
+ '65': '66',
+ '66': '67',
+ '67': '68',
+ '68': '69',
+ '69': '70',
+ '70': '71',
+ '71': '72',
+ '72': '73',
+ '73': '74',
+ '74': '75',
+ '75': '76',
+ '76': '77',
+ '77': '78',
+ '78': '79',
+ '79': '80',
+ '80': '81',
+ '81': '82',
+ '82': '83',
+ '83': '84',
+ '84': '85',
+ '85': '86',
+ '86': '87',
+ '87': '88',
+ '88': '89',
+ '89': '90',
+ '90': '91',
+ '91': '92',
+ '92': '93',
+ '93': '94',
+ '94': '95',
+ '95': '96',
+ '96': '97',
+ '97': '98',
+ '98': '99',
+ '99': '100',
+};
+
+final final100 = <String, String>{
+ '0': '1',
+ '1': '2',
+ '2': '3',
+ '3': '4',
+ '4': '5',
+ '5': '6',
+ '6': '7',
+ '7': '8',
+ '8': '9',
+ '9': '10',
+ '10': '11',
+ '11': '12',
+ '12': '13',
+ '13': '14',
+ '14': '15',
+ '15': '16',
+ '16': '17',
+ '17': '18',
+ '18': '19',
+ '19': '20',
+ '20': '21',
+ '21': '22',
+ '22': '23',
+ '23': '24',
+ '24': '25',
+ '25': '26',
+ '26': '27',
+ '27': '28',
+ '28': '29',
+ '29': '30',
+ '30': '31',
+ '31': '32',
+ '32': '33',
+ '33': '34',
+ '34': '35',
+ '35': '36',
+ '36': '37',
+ '37': '38',
+ '38': '39',
+ '39': '40',
+ '40': '41',
+ '41': '42',
+ '42': '43',
+ '43': '44',
+ '44': '45',
+ '45': '46',
+ '46': '47',
+ '47': '48',
+ '48': '49',
+ '49': '50',
+ '50': '51',
+ '51': '52',
+ '52': '53',
+ '53': '54',
+ '54': '55',
+ '55': '56',
+ '56': '57',
+ '57': '58',
+ '58': '59',
+ '59': '60',
+ '60': '61',
+ '61': '62',
+ '62': '63',
+ '63': '64',
+ '64': '65',
+ '65': '66',
+ '66': '67',
+ '67': '68',
+ '68': '69',
+ '69': '70',
+ '70': '71',
+ '71': '72',
+ '72': '73',
+ '73': '74',
+ '74': '75',
+ '75': '76',
+ '76': '77',
+ '77': '78',
+ '78': '79',
+ '79': '80',
+ '80': '81',
+ '81': '82',
+ '82': '83',
+ '83': '84',
+ '84': '85',
+ '85': '86',
+ '86': '87',
+ '87': '88',
+ '88': '89',
+ '89': '90',
+ '90': '91',
+ '91': '92',
+ '92': '93',
+ '93': '94',
+ '94': '95',
+ '95': '96',
+ '96': '97',
+ '97': '98',
+ '98': '99',
+ '99': '100',
+};
diff --git a/benchmarks/MapLookup/dart2/MapLookup.dart b/benchmarks/MapLookup/dart2/MapLookup.dart
new file mode 100644
index 0000000..d7593f8
--- /dev/null
+++ b/benchmarks/MapLookup/dart2/MapLookup.dart
@@ -0,0 +1,131 @@
+// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// Benchmark for https://github.com/dart-lang/sdk/issues/45908.
+//
+// Measures the average time needed for a lookup in Maps.
+
+import 'dart:math';
+
+import 'maps.dart';
+
+abstract class MapLookupBenchmark {
+ final String name;
+ const MapLookupBenchmark(this.name);
+
+ Map<String, String> get myMap;
+
+ // Returns the number of nanoseconds per call.
+ double measureFor(Duration duration) {
+ final map = myMap;
+
+ // Prevent `sw.elapsedMicroseconds` from dominating with maps with a
+ // small number of elements.
+ final int batching = max(1000 ~/ map.length, 1);
+
+ int numberOfLookups = 0;
+ int totalMicroseconds = 0;
+
+ final sw = Stopwatch()..start();
+ final durationInMicroseconds = duration.inMicroseconds;
+
+ do {
+ for (int i = 0; i < batching; i++) {
+ String? k = '0';
+ while (k != null) {
+ k = map[k];
+ }
+ numberOfLookups += map.length;
+ }
+ totalMicroseconds = sw.elapsedMicroseconds;
+ } while (totalMicroseconds < durationInMicroseconds);
+
+ final int totalNanoseconds = sw.elapsed.inMicroseconds * 1000;
+ return totalNanoseconds / numberOfLookups;
+ }
+
+ // Runs warmup phase, runs benchmark and reports result.
+ void report() {
+ // Warmup for 100 ms.
+ measureFor(const Duration(milliseconds: 100));
+
+ // Run benchmark for 2 seconds.
+ final double nsPerCall = measureFor(const Duration(seconds: 2));
+
+ // Report result.
+ print('$name(RunTimeRaw): $nsPerCall ns.');
+ }
+}
+
+class Constant1 extends MapLookupBenchmark {
+ const Constant1() : super('MapLookup.Constant1');
+
+ @override
+ Map<String, String> get myMap => const1;
+}
+
+class Final1 extends MapLookupBenchmark {
+ const Final1() : super('MapLookup.Final1');
+
+ @override
+ Map<String, String> get myMap => final1;
+}
+
+class Constant5 extends MapLookupBenchmark {
+ const Constant5() : super('MapLookup.Constant5');
+
+ @override
+ Map<String, String> get myMap => const5;
+}
+
+class Final5 extends MapLookupBenchmark {
+ const Final5() : super('MapLookup.Final5');
+
+ @override
+ Map<String, String> get myMap => final5;
+}
+
+class Constant10 extends MapLookupBenchmark {
+ const Constant10() : super('MapLookup.Constant10');
+
+ @override
+ Map<String, String> get myMap => const10;
+}
+
+class Final10 extends MapLookupBenchmark {
+ const Final10() : super('MapLookup.Final10');
+
+ @override
+ Map<String, String> get myMap => final10;
+}
+
+class Constant100 extends MapLookupBenchmark {
+ const Constant100() : super('MapLookup.Constant100');
+
+ @override
+ Map<String, String> get myMap => const100;
+}
+
+class Final100 extends MapLookupBenchmark {
+ const Final100() : super('MapLookup.Final100');
+
+ @override
+ Map<String, String> get myMap => final100;
+}
+
+void main() {
+ final benchmarks = [
+ () => const Constant1(),
+ () => const Constant5(),
+ () => const Constant10(),
+ () => const Constant100(),
+ () => const Final1(),
+ () => const Final5(),
+ () => const Final10(),
+ () => const Final100(),
+ ];
+ for (final benchmark in benchmarks) {
+ benchmark().report();
+ }
+}
diff --git a/benchmarks/MapLookup/dart2/maps.dart b/benchmarks/MapLookup/dart2/maps.dart
new file mode 100644
index 0000000..0817b17
--- /dev/null
+++ b/benchmarks/MapLookup/dart2/maps.dart
@@ -0,0 +1,259 @@
+// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+const const1 = <String, String>{
+ '0': '1',
+};
+
+final final1 = <String, String>{
+ '0': '1',
+};
+
+const const5 = <String, String>{
+ '0': '1',
+ '1': '2',
+ '2': '3',
+ '3': '4',
+ '4': '5',
+};
+
+final final5 = <String, String>{
+ '0': '1',
+ '1': '2',
+ '2': '3',
+ '3': '4',
+ '4': '5',
+};
+
+const const10 = <String, String>{
+ '0': '1',
+ '1': '2',
+ '2': '3',
+ '3': '4',
+ '4': '5',
+ '5': '6',
+ '6': '7',
+ '7': '8',
+ '8': '9',
+ '9': '10',
+};
+
+final final10 = <String, String>{
+ '0': '1',
+ '1': '2',
+ '2': '3',
+ '3': '4',
+ '4': '5',
+ '5': '6',
+ '6': '7',
+ '7': '8',
+ '8': '9',
+ '9': '10',
+};
+
+const const100 = <String, String>{
+ '0': '1',
+ '1': '2',
+ '2': '3',
+ '3': '4',
+ '4': '5',
+ '5': '6',
+ '6': '7',
+ '7': '8',
+ '8': '9',
+ '9': '10',
+ '10': '11',
+ '11': '12',
+ '12': '13',
+ '13': '14',
+ '14': '15',
+ '15': '16',
+ '16': '17',
+ '17': '18',
+ '18': '19',
+ '19': '20',
+ '20': '21',
+ '21': '22',
+ '22': '23',
+ '23': '24',
+ '24': '25',
+ '25': '26',
+ '26': '27',
+ '27': '28',
+ '28': '29',
+ '29': '30',
+ '30': '31',
+ '31': '32',
+ '32': '33',
+ '33': '34',
+ '34': '35',
+ '35': '36',
+ '36': '37',
+ '37': '38',
+ '38': '39',
+ '39': '40',
+ '40': '41',
+ '41': '42',
+ '42': '43',
+ '43': '44',
+ '44': '45',
+ '45': '46',
+ '46': '47',
+ '47': '48',
+ '48': '49',
+ '49': '50',
+ '50': '51',
+ '51': '52',
+ '52': '53',
+ '53': '54',
+ '54': '55',
+ '55': '56',
+ '56': '57',
+ '57': '58',
+ '58': '59',
+ '59': '60',
+ '60': '61',
+ '61': '62',
+ '62': '63',
+ '63': '64',
+ '64': '65',
+ '65': '66',
+ '66': '67',
+ '67': '68',
+ '68': '69',
+ '69': '70',
+ '70': '71',
+ '71': '72',
+ '72': '73',
+ '73': '74',
+ '74': '75',
+ '75': '76',
+ '76': '77',
+ '77': '78',
+ '78': '79',
+ '79': '80',
+ '80': '81',
+ '81': '82',
+ '82': '83',
+ '83': '84',
+ '84': '85',
+ '85': '86',
+ '86': '87',
+ '87': '88',
+ '88': '89',
+ '89': '90',
+ '90': '91',
+ '91': '92',
+ '92': '93',
+ '93': '94',
+ '94': '95',
+ '95': '96',
+ '96': '97',
+ '97': '98',
+ '98': '99',
+ '99': '100',
+};
+
+final final100 = <String, String>{
+ '0': '1',
+ '1': '2',
+ '2': '3',
+ '3': '4',
+ '4': '5',
+ '5': '6',
+ '6': '7',
+ '7': '8',
+ '8': '9',
+ '9': '10',
+ '10': '11',
+ '11': '12',
+ '12': '13',
+ '13': '14',
+ '14': '15',
+ '15': '16',
+ '16': '17',
+ '17': '18',
+ '18': '19',
+ '19': '20',
+ '20': '21',
+ '21': '22',
+ '22': '23',
+ '23': '24',
+ '24': '25',
+ '25': '26',
+ '26': '27',
+ '27': '28',
+ '28': '29',
+ '29': '30',
+ '30': '31',
+ '31': '32',
+ '32': '33',
+ '33': '34',
+ '34': '35',
+ '35': '36',
+ '36': '37',
+ '37': '38',
+ '38': '39',
+ '39': '40',
+ '40': '41',
+ '41': '42',
+ '42': '43',
+ '43': '44',
+ '44': '45',
+ '45': '46',
+ '46': '47',
+ '47': '48',
+ '48': '49',
+ '49': '50',
+ '50': '51',
+ '51': '52',
+ '52': '53',
+ '53': '54',
+ '54': '55',
+ '55': '56',
+ '56': '57',
+ '57': '58',
+ '58': '59',
+ '59': '60',
+ '60': '61',
+ '61': '62',
+ '62': '63',
+ '63': '64',
+ '64': '65',
+ '65': '66',
+ '66': '67',
+ '67': '68',
+ '68': '69',
+ '69': '70',
+ '70': '71',
+ '71': '72',
+ '72': '73',
+ '73': '74',
+ '74': '75',
+ '75': '76',
+ '76': '77',
+ '77': '78',
+ '78': '79',
+ '79': '80',
+ '80': '81',
+ '81': '82',
+ '82': '83',
+ '83': '84',
+ '84': '85',
+ '85': '86',
+ '86': '87',
+ '87': '88',
+ '88': '89',
+ '89': '90',
+ '90': '91',
+ '91': '92',
+ '92': '93',
+ '93': '94',
+ '94': '95',
+ '95': '96',
+ '96': '97',
+ '97': '98',
+ '98': '99',
+ '99': '100',
+};
diff --git a/benchmarks/MapLookup/generate_maps.dart b/benchmarks/MapLookup/generate_maps.dart
new file mode 100644
index 0000000..9086cd0
--- /dev/null
+++ b/benchmarks/MapLookup/generate_maps.dart
@@ -0,0 +1,42 @@
+// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:io';
+
+void main() {
+ final buffer = StringBuffer();
+ buffer.write('''
+// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+ ''');
+
+ generateMap(buffer, 'const1', 1, isConst: true);
+ generateMap(buffer, 'final1', 1, isConst: false);
+ generateMap(buffer, 'const5', 5, isConst: true);
+ generateMap(buffer, 'final5', 5, isConst: false);
+ generateMap(buffer, 'const10', 10, isConst: true);
+ generateMap(buffer, 'final10', 10, isConst: false);
+ generateMap(buffer, 'const100', 100, isConst: true);
+ generateMap(buffer, 'final100', 100, isConst: false);
+
+ for (final folder in ['dart', 'dart2']) {
+ final path = Platform.script.resolve('$folder/maps.dart').toFilePath();
+ File(path).writeAsStringSync(buffer.toString());
+ Process.runSync(Platform.executable, ['format', path]);
+ print('Generated $path.');
+ }
+}
+
+void generateMap(StringBuffer buffer, String name, int mapSize,
+ {bool isConst = true}) {
+ final constOrFinal = isConst ? 'const' : 'final';
+ buffer.write('$constOrFinal $name = <String, String>{');
+ for (int i = 0; i < mapSize; i++) {
+ buffer.write("'$i': '${i + 1}',");
+ }
+ buffer.write('};');
+ buffer.write('\n\n');
+}
diff --git a/pkg/front_end/lib/src/fasta/builder/builder.dart b/pkg/front_end/lib/src/fasta/builder/builder.dart
index fdd91f3..95953c7 100644
--- a/pkg/front_end/lib/src/fasta/builder/builder.dart
+++ b/pkg/front_end/lib/src/fasta/builder/builder.dart
@@ -12,9 +12,9 @@
/// block scopes.
Builder? next;
- Builder get parent;
+ Builder? get parent;
- Uri get fileUri;
+ Uri? get fileUri;
int get charOffset;
diff --git a/pkg/front_end/lib/src/fasta/builder/modifier_builder.dart b/pkg/front_end/lib/src/fasta/builder/modifier_builder.dart
index 8836414..fae5ee3 100644
--- a/pkg/front_end/lib/src/fasta/builder/modifier_builder.dart
+++ b/pkg/front_end/lib/src/fasta/builder/modifier_builder.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
library fasta.modifier_builder;
import '../modifier.dart';
@@ -11,7 +9,7 @@
import 'builder.dart';
abstract class ModifierBuilder implements Builder {
- String get name;
+ String? get name;
bool get isNative;
}
@@ -23,16 +21,17 @@
String get debugName;
@override
- Builder parent;
+ Builder? parent;
@override
final int charOffset;
@override
- final Uri fileUri;
+ final Uri? fileUri;
- ModifierBuilderImpl(this.parent, this.charOffset, [Uri fileUri])
- : fileUri = fileUri ?? parent?.fileUri;
+ ModifierBuilderImpl(Builder? parent, this.charOffset, [Uri? fileUri])
+ : this.fileUri = fileUri ?? parent?.fileUri,
+ this.parent = parent;
@override
bool get isConst => (modifiers & constMask) != 0;
diff --git a/pkg/front_end/lib/src/fasta/builder/name_iterator.dart b/pkg/front_end/lib/src/fasta/builder/name_iterator.dart
index 653a49b..165dfb3 100644
--- a/pkg/front_end/lib/src/fasta/builder/name_iterator.dart
+++ b/pkg/front_end/lib/src/fasta/builder/name_iterator.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
library fasta.name_iterator;
import 'builder.dart';
diff --git a/pkg/front_end/lib/src/fasta/builder/variable_builder.dart b/pkg/front_end/lib/src/fasta/builder/variable_builder.dart
index 17eb7f2..cc006cb 100644
--- a/pkg/front_end/lib/src/fasta/builder/variable_builder.dart
+++ b/pkg/front_end/lib/src/fasta/builder/variable_builder.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
library fasta.kernel_variable_builder;
import 'package:kernel/ast.dart' show VariableDeclaration;
diff --git a/pkg/front_end/lib/src/fasta/kernel/kernel_variable_builder.dart b/pkg/front_end/lib/src/fasta/kernel/kernel_variable_builder.dart
index 31afc39..c3400b1 100644
--- a/pkg/front_end/lib/src/fasta/kernel/kernel_variable_builder.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/kernel_variable_builder.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
library fasta.kernel_variable_builder;
import 'package:kernel/ast.dart' show VariableDeclaration;
diff --git a/pkg/front_end/testcases/general/crashes/crash_06/main.dart b/pkg/front_end/testcases/general/crashes/crash_06/main.dart
new file mode 100644
index 0000000..244d94c
--- /dev/null
+++ b/pkg/front_end/testcases/general/crashes/crash_06/main.dart
@@ -0,0 +1,2 @@
+mixin A on C, D {}
+class B extends C with D, A {}
\ No newline at end of file
diff --git a/pkg/front_end/testcases/general/crashes/crash_06/main.dart.textual_outline.expect b/pkg/front_end/testcases/general/crashes/crash_06/main.dart.textual_outline.expect
new file mode 100644
index 0000000..10cc2df
--- /dev/null
+++ b/pkg/front_end/testcases/general/crashes/crash_06/main.dart.textual_outline.expect
@@ -0,0 +1,3 @@
+mixin A on C, D {}
+
+class B extends C with D, A {}
diff --git a/pkg/front_end/testcases/general/crashes/crash_06/main.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/general/crashes/crash_06/main.dart.textual_outline_modelled.expect
new file mode 100644
index 0000000..b89fdbe
--- /dev/null
+++ b/pkg/front_end/testcases/general/crashes/crash_06/main.dart.textual_outline_modelled.expect
@@ -0,0 +1,3 @@
+class B extends C with D, A {}
+
+mixin A on C, D {}
diff --git a/pkg/front_end/testcases/incremental.status b/pkg/front_end/testcases/incremental.status
index afed71c..7edb02b 100644
--- a/pkg/front_end/testcases/incremental.status
+++ b/pkg/front_end/testcases/incremental.status
@@ -6,3 +6,5 @@
# http://dartbug.com/41812#issuecomment-684825703
strongmode_mixins_2: Crash
+
+crash_07: Crash
\ No newline at end of file
diff --git a/pkg/front_end/testcases/incremental/crash_07.yaml b/pkg/front_end/testcases/incremental/crash_07.yaml
new file mode 100644
index 0000000..ed141b7
--- /dev/null
+++ b/pkg/front_end/testcases/incremental/crash_07.yaml
@@ -0,0 +1,19 @@
+# Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE.md file.
+
+# Reproduce a crash.
+
+type: newworld
+worlds:
+ - entry: main.dart
+ errors: true
+ sources:
+ main.dart: |
+ import 'lib.dart';
+ import 'nonexistingfile.dart';
+ class A implements B {}
+ lib.dart: |
+ class B implements C<NonExistingClass> {}
+ class C<E> {}
+ expectedLibraryCount: 2
diff --git a/pkg/front_end/testcases/incremental/crash_07.yaml.world.1.expect b/pkg/front_end/testcases/incremental/crash_07.yaml.world.1.expect
new file mode 100644
index 0000000..9464e91
--- /dev/null
+++ b/pkg/front_end/testcases/incremental/crash_07.yaml.world.1.expect
@@ -0,0 +1,72 @@
+main = <No Member>;
+library from "org-dartlang-test:///lib.dart" as lib {
+//
+// Problems in library:
+//
+// org-dartlang-test:///lib.dart:1:22: Error: Type 'NonExistingClass' not found.
+// class B implements C<NonExistingClass> {}
+// ^^^^^^^^^^^^^^^^
+//
+
+ class B extends dart.core::Object implements lib::C<invalid-type> {
+ synthetic constructor •() → lib::B*
+ : super dart.core::Object::•()
+ ;
+ abstract member-signature get _identityHashCode() → dart.core::int*; -> dart.core::Object::_identityHashCode
+ abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → dart.core::bool*; -> dart.core::Object::_instanceOf
+ abstract member-signature method _simpleInstanceOf(dynamic type) → dart.core::bool*; -> dart.core::Object::_simpleInstanceOf
+ abstract member-signature method _simpleInstanceOfTrue(dynamic type) → dart.core::bool*; -> dart.core::Object::_simpleInstanceOfTrue
+ abstract member-signature method _simpleInstanceOfFalse(dynamic type) → dart.core::bool*; -> dart.core::Object::_simpleInstanceOfFalse
+ abstract member-signature operator ==(dynamic other) → dart.core::bool*; -> dart.core::Object::==
+ abstract member-signature get hashCode() → dart.core::int*; -> dart.core::Object::hashCode
+ abstract member-signature method toString() → dart.core::String*; -> dart.core::Object::toString
+ abstract member-signature method noSuchMethod(dart.core::Invocation* invocation) → dynamic; -> dart.core::Object::noSuchMethod
+ abstract member-signature get runtimeType() → dart.core::Type*; -> dart.core::Object::runtimeType
+ }
+ class C<E extends dart.core::Object* = dynamic> extends dart.core::Object {
+ synthetic constructor •() → lib::C<lib::C::E*>*
+ : super dart.core::Object::•()
+ ;
+ abstract member-signature get _identityHashCode() → dart.core::int*; -> dart.core::Object::_identityHashCode
+ abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → dart.core::bool*; -> dart.core::Object::_instanceOf
+ abstract member-signature method _simpleInstanceOf(dynamic type) → dart.core::bool*; -> dart.core::Object::_simpleInstanceOf
+ abstract member-signature method _simpleInstanceOfTrue(dynamic type) → dart.core::bool*; -> dart.core::Object::_simpleInstanceOfTrue
+ abstract member-signature method _simpleInstanceOfFalse(dynamic type) → dart.core::bool*; -> dart.core::Object::_simpleInstanceOfFalse
+ abstract member-signature operator ==(dynamic other) → dart.core::bool*; -> dart.core::Object::==
+ abstract member-signature get hashCode() → dart.core::int*; -> dart.core::Object::hashCode
+ abstract member-signature method toString() → dart.core::String*; -> dart.core::Object::toString
+ abstract member-signature method noSuchMethod(dart.core::Invocation* invocation) → dynamic; -> dart.core::Object::noSuchMethod
+ abstract member-signature get runtimeType() → dart.core::Type*; -> dart.core::Object::runtimeType
+ }
+}
+library from "org-dartlang-test:///main.dart" as main {
+
+ import "org-dartlang-test:///lib.dart";
+ import "org-dartlang-test:///nonexistingfile.dart";
+
+ class A extends dart.core::Object implements lib::B {
+ synthetic constructor •() → main::A*
+ : super dart.core::Object::•()
+ ;
+ abstract member-signature get _identityHashCode() → dart.core::int*; -> dart.core::Object::_identityHashCode
+ abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → dart.core::bool*; -> dart.core::Object::_instanceOf
+ abstract member-signature method _simpleInstanceOf(dynamic type) → dart.core::bool*; -> dart.core::Object::_simpleInstanceOf
+ abstract member-signature method _simpleInstanceOfTrue(dynamic type) → dart.core::bool*; -> dart.core::Object::_simpleInstanceOfTrue
+ abstract member-signature method _simpleInstanceOfFalse(dynamic type) → dart.core::bool*; -> dart.core::Object::_simpleInstanceOfFalse
+ abstract member-signature operator ==(dynamic other) → dart.core::bool*; -> dart.core::Object::==
+ abstract member-signature get hashCode() → dart.core::int*; -> dart.core::Object::hashCode
+ abstract member-signature method toString() → dart.core::String*; -> dart.core::Object::toString
+ abstract member-signature method noSuchMethod(dart.core::Invocation* invocation) → dynamic; -> dart.core::Object::noSuchMethod
+ abstract member-signature get runtimeType() → dart.core::Type*; -> dart.core::Object::runtimeType
+ }
+}
+library from "org-dartlang-test:///nonexistingfile.dart" as non {
+//
+// Problems in library:
+//
+// org-dartlang-test:///main.dart:2:8: Error: Error when reading 'org-dartlang-test:///nonexistingfile.dart': File org-dartlang-test:///nonexistingfile.dart does not exist.
+// import 'nonexistingfile.dart';
+// ^
+//
+
+}
diff --git a/pkg/front_end/testcases/incremental/type_change_on_recompile.yaml b/pkg/front_end/testcases/incremental/type_change_on_recompile.yaml
new file mode 100644
index 0000000..40aae93
--- /dev/null
+++ b/pkg/front_end/testcases/incremental/type_change_on_recompile.yaml
@@ -0,0 +1,49 @@
+# Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE.md file.
+
+# Reproduce a inconsistency on recompile.
+# Currently the first compile produces
+#
+# abstract class _A&B&C&D extends main::_A&B&C implements main::D /*isAnonymousMixin,isEliminatedMixin*/ {
+# synthetic constructor named(dynamic _field) → main::_A&B&C&D*
+# : super main::_A&B&C::named(_field)
+# ;
+# }
+#
+# and the second compile produces
+# abstract class _A&B&C&D extends main::_A&B&C implements main::D /*isAnonymousMixin,isEliminatedMixin*/ {
+# synthetic constructor named(lib::E* _field) → main::_A&B&C&D*
+# : super main::_A&B&C::named(_field)
+# ;
+# }
+#
+# i.e. the `field` goes from type `dynamic` to type `lib::E*`.
+
+type: newworld
+worlds:
+ - entry: main.dart
+ sources:
+ main.dart: |
+ import 'lib.dart';
+ class A extends B with C, D {
+ A(E parameter) : super.named(parameter);
+ }
+ mixin C { }
+ mixin D { }
+ lib.dart: |
+ class E {}
+ abstract class B {
+ final E _field;
+ B.named(this._field);
+ }
+ expectedLibraryCount: 2
+
+ - entry: main.dart
+ worldType: updated
+ expectInitializeFromDill: false
+ invalidate:
+ - main.dart
+ expectedLibraryCount: 2
+ expectsRebuildBodiesOnly: false
+
diff --git a/pkg/front_end/testcases/incremental/type_change_on_recompile.yaml.world.1.expect b/pkg/front_end/testcases/incremental/type_change_on_recompile.yaml.world.1.expect
new file mode 100644
index 0000000..5938335
--- /dev/null
+++ b/pkg/front_end/testcases/incremental/type_change_on_recompile.yaml.world.1.expect
@@ -0,0 +1,79 @@
+main = <No Member>;
+library from "org-dartlang-test:///lib.dart" as lib {
+
+ class E extends dart.core::Object {
+ synthetic constructor •() → lib::E*
+ : super dart.core::Object::•()
+ ;
+ abstract member-signature get _identityHashCode() → dart.core::int*; -> dart.core::Object::_identityHashCode
+ abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → dart.core::bool*; -> dart.core::Object::_instanceOf
+ abstract member-signature method _simpleInstanceOf(dynamic type) → dart.core::bool*; -> dart.core::Object::_simpleInstanceOf
+ abstract member-signature method _simpleInstanceOfTrue(dynamic type) → dart.core::bool*; -> dart.core::Object::_simpleInstanceOfTrue
+ abstract member-signature method _simpleInstanceOfFalse(dynamic type) → dart.core::bool*; -> dart.core::Object::_simpleInstanceOfFalse
+ abstract member-signature operator ==(dynamic other) → dart.core::bool*; -> dart.core::Object::==
+ abstract member-signature get hashCode() → dart.core::int*; -> dart.core::Object::hashCode
+ abstract member-signature method toString() → dart.core::String*; -> dart.core::Object::toString
+ abstract member-signature method noSuchMethod(dart.core::Invocation* invocation) → dynamic; -> dart.core::Object::noSuchMethod
+ abstract member-signature get runtimeType() → dart.core::Type*; -> dart.core::Object::runtimeType
+ }
+ abstract class B extends dart.core::Object {
+ final field lib::E* _field;
+ constructor named(lib::E* _field) → lib::B*
+ : lib::B::_field = _field, super dart.core::Object::•()
+ ;
+ abstract member-signature get _identityHashCode() → dart.core::int*; -> dart.core::Object::_identityHashCode
+ abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → dart.core::bool*; -> dart.core::Object::_instanceOf
+ abstract member-signature method _simpleInstanceOf(dynamic type) → dart.core::bool*; -> dart.core::Object::_simpleInstanceOf
+ abstract member-signature method _simpleInstanceOfTrue(dynamic type) → dart.core::bool*; -> dart.core::Object::_simpleInstanceOfTrue
+ abstract member-signature method _simpleInstanceOfFalse(dynamic type) → dart.core::bool*; -> dart.core::Object::_simpleInstanceOfFalse
+ abstract member-signature operator ==(dynamic other) → dart.core::bool*; -> dart.core::Object::==
+ abstract member-signature get hashCode() → dart.core::int*; -> dart.core::Object::hashCode
+ abstract member-signature method toString() → dart.core::String*; -> dart.core::Object::toString
+ abstract member-signature method noSuchMethod(dart.core::Invocation* invocation) → dynamic; -> dart.core::Object::noSuchMethod
+ abstract member-signature get runtimeType() → dart.core::Type*; -> dart.core::Object::runtimeType
+ }
+}
+library from "org-dartlang-test:///main.dart" as main {
+
+ import "org-dartlang-test:///lib.dart";
+
+ abstract class _A&B&C extends lib::B implements main::C /*isAnonymousMixin,isEliminatedMixin*/ {
+ synthetic constructor named(lib::E* _field) → main::_A&B&C*
+ : super lib::B::named(_field)
+ ;
+ }
+ abstract class _A&B&C&D extends main::_A&B&C implements main::D /*isAnonymousMixin,isEliminatedMixin*/ {
+ synthetic constructor named(dynamic _field) → main::_A&B&C&D*
+ : super main::_A&B&C::named(_field)
+ ;
+ }
+ class A extends main::_A&B&C&D {
+ constructor •(lib::E* parameter) → main::A*
+ : super main::_A&B&C&D::named(parameter)
+ ;
+ }
+ abstract class C extends dart.core::Object /*isMixinDeclaration*/ {
+ abstract member-signature get _identityHashCode() → dart.core::int*; -> dart.core::Object::_identityHashCode
+ abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → dart.core::bool*; -> dart.core::Object::_instanceOf
+ abstract member-signature method _simpleInstanceOf(dynamic type) → dart.core::bool*; -> dart.core::Object::_simpleInstanceOf
+ abstract member-signature method _simpleInstanceOfTrue(dynamic type) → dart.core::bool*; -> dart.core::Object::_simpleInstanceOfTrue
+ abstract member-signature method _simpleInstanceOfFalse(dynamic type) → dart.core::bool*; -> dart.core::Object::_simpleInstanceOfFalse
+ abstract member-signature operator ==(dynamic other) → dart.core::bool*; -> dart.core::Object::==
+ abstract member-signature get hashCode() → dart.core::int*; -> dart.core::Object::hashCode
+ abstract member-signature method toString() → dart.core::String*; -> dart.core::Object::toString
+ abstract member-signature method noSuchMethod(dart.core::Invocation* invocation) → dynamic; -> dart.core::Object::noSuchMethod
+ abstract member-signature get runtimeType() → dart.core::Type*; -> dart.core::Object::runtimeType
+ }
+ abstract class D extends dart.core::Object /*isMixinDeclaration*/ {
+ abstract member-signature get _identityHashCode() → dart.core::int*; -> dart.core::Object::_identityHashCode
+ abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → dart.core::bool*; -> dart.core::Object::_instanceOf
+ abstract member-signature method _simpleInstanceOf(dynamic type) → dart.core::bool*; -> dart.core::Object::_simpleInstanceOf
+ abstract member-signature method _simpleInstanceOfTrue(dynamic type) → dart.core::bool*; -> dart.core::Object::_simpleInstanceOfTrue
+ abstract member-signature method _simpleInstanceOfFalse(dynamic type) → dart.core::bool*; -> dart.core::Object::_simpleInstanceOfFalse
+ abstract member-signature operator ==(dynamic other) → dart.core::bool*; -> dart.core::Object::==
+ abstract member-signature get hashCode() → dart.core::int*; -> dart.core::Object::hashCode
+ abstract member-signature method toString() → dart.core::String*; -> dart.core::Object::toString
+ abstract member-signature method noSuchMethod(dart.core::Invocation* invocation) → dynamic; -> dart.core::Object::noSuchMethod
+ abstract member-signature get runtimeType() → dart.core::Type*; -> dart.core::Object::runtimeType
+ }
+}
diff --git a/pkg/front_end/testcases/incremental/type_change_on_recompile.yaml.world.2.expect b/pkg/front_end/testcases/incremental/type_change_on_recompile.yaml.world.2.expect
new file mode 100644
index 0000000..38493c4
--- /dev/null
+++ b/pkg/front_end/testcases/incremental/type_change_on_recompile.yaml.world.2.expect
@@ -0,0 +1,79 @@
+main = <No Member>;
+library from "org-dartlang-test:///lib.dart" as lib {
+
+ class E extends dart.core::Object {
+ synthetic constructor •() → lib::E*
+ : super dart.core::Object::•()
+ ;
+ abstract member-signature get _identityHashCode() → dart.core::int*; -> dart.core::Object::_identityHashCode
+ abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → dart.core::bool*; -> dart.core::Object::_instanceOf
+ abstract member-signature method _simpleInstanceOf(dynamic type) → dart.core::bool*; -> dart.core::Object::_simpleInstanceOf
+ abstract member-signature method _simpleInstanceOfTrue(dynamic type) → dart.core::bool*; -> dart.core::Object::_simpleInstanceOfTrue
+ abstract member-signature method _simpleInstanceOfFalse(dynamic type) → dart.core::bool*; -> dart.core::Object::_simpleInstanceOfFalse
+ abstract member-signature operator ==(dynamic other) → dart.core::bool*; -> dart.core::Object::==
+ abstract member-signature get hashCode() → dart.core::int*; -> dart.core::Object::hashCode
+ abstract member-signature method toString() → dart.core::String*; -> dart.core::Object::toString
+ abstract member-signature method noSuchMethod(dart.core::Invocation* invocation) → dynamic; -> dart.core::Object::noSuchMethod
+ abstract member-signature get runtimeType() → dart.core::Type*; -> dart.core::Object::runtimeType
+ }
+ abstract class B extends dart.core::Object {
+ final field lib::E* _field;
+ constructor named(lib::E* _field) → lib::B*
+ : lib::B::_field = _field, super dart.core::Object::•()
+ ;
+ abstract member-signature get _identityHashCode() → dart.core::int*; -> dart.core::Object::_identityHashCode
+ abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → dart.core::bool*; -> dart.core::Object::_instanceOf
+ abstract member-signature method _simpleInstanceOf(dynamic type) → dart.core::bool*; -> dart.core::Object::_simpleInstanceOf
+ abstract member-signature method _simpleInstanceOfTrue(dynamic type) → dart.core::bool*; -> dart.core::Object::_simpleInstanceOfTrue
+ abstract member-signature method _simpleInstanceOfFalse(dynamic type) → dart.core::bool*; -> dart.core::Object::_simpleInstanceOfFalse
+ abstract member-signature operator ==(dynamic other) → dart.core::bool*; -> dart.core::Object::==
+ abstract member-signature get hashCode() → dart.core::int*; -> dart.core::Object::hashCode
+ abstract member-signature method toString() → dart.core::String*; -> dart.core::Object::toString
+ abstract member-signature method noSuchMethod(dart.core::Invocation* invocation) → dynamic; -> dart.core::Object::noSuchMethod
+ abstract member-signature get runtimeType() → dart.core::Type*; -> dart.core::Object::runtimeType
+ }
+}
+library from "org-dartlang-test:///main.dart" as main {
+
+ import "org-dartlang-test:///lib.dart";
+
+ abstract class _A&B&C extends lib::B implements main::C /*isAnonymousMixin,isEliminatedMixin*/ {
+ synthetic constructor named(lib::E* _field) → main::_A&B&C*
+ : super lib::B::named(_field)
+ ;
+ }
+ abstract class _A&B&C&D extends main::_A&B&C implements main::D /*isAnonymousMixin,isEliminatedMixin*/ {
+ synthetic constructor named(lib::E* _field) → main::_A&B&C&D*
+ : super main::_A&B&C::named(_field)
+ ;
+ }
+ class A extends main::_A&B&C&D {
+ constructor •(lib::E* parameter) → main::A*
+ : super main::_A&B&C&D::named(parameter)
+ ;
+ }
+ abstract class C extends dart.core::Object /*isMixinDeclaration*/ {
+ abstract member-signature get _identityHashCode() → dart.core::int*; -> dart.core::Object::_identityHashCode
+ abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → dart.core::bool*; -> dart.core::Object::_instanceOf
+ abstract member-signature method _simpleInstanceOf(dynamic type) → dart.core::bool*; -> dart.core::Object::_simpleInstanceOf
+ abstract member-signature method _simpleInstanceOfTrue(dynamic type) → dart.core::bool*; -> dart.core::Object::_simpleInstanceOfTrue
+ abstract member-signature method _simpleInstanceOfFalse(dynamic type) → dart.core::bool*; -> dart.core::Object::_simpleInstanceOfFalse
+ abstract member-signature operator ==(dynamic other) → dart.core::bool*; -> dart.core::Object::==
+ abstract member-signature get hashCode() → dart.core::int*; -> dart.core::Object::hashCode
+ abstract member-signature method toString() → dart.core::String*; -> dart.core::Object::toString
+ abstract member-signature method noSuchMethod(dart.core::Invocation* invocation) → dynamic; -> dart.core::Object::noSuchMethod
+ abstract member-signature get runtimeType() → dart.core::Type*; -> dart.core::Object::runtimeType
+ }
+ abstract class D extends dart.core::Object /*isMixinDeclaration*/ {
+ abstract member-signature get _identityHashCode() → dart.core::int*; -> dart.core::Object::_identityHashCode
+ abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → dart.core::bool*; -> dart.core::Object::_instanceOf
+ abstract member-signature method _simpleInstanceOf(dynamic type) → dart.core::bool*; -> dart.core::Object::_simpleInstanceOf
+ abstract member-signature method _simpleInstanceOfTrue(dynamic type) → dart.core::bool*; -> dart.core::Object::_simpleInstanceOfTrue
+ abstract member-signature method _simpleInstanceOfFalse(dynamic type) → dart.core::bool*; -> dart.core::Object::_simpleInstanceOfFalse
+ abstract member-signature operator ==(dynamic other) → dart.core::bool*; -> dart.core::Object::==
+ abstract member-signature get hashCode() → dart.core::int*; -> dart.core::Object::hashCode
+ abstract member-signature method toString() → dart.core::String*; -> dart.core::Object::toString
+ abstract member-signature method noSuchMethod(dart.core::Invocation* invocation) → dynamic; -> dart.core::Object::noSuchMethod
+ abstract member-signature get runtimeType() → dart.core::Type*; -> dart.core::Object::runtimeType
+ }
+}
diff --git a/pkg/front_end/testcases/outline.status b/pkg/front_end/testcases/outline.status
index b9f3dfa..b866349 100644
--- a/pkg/front_end/testcases/outline.status
+++ b/pkg/front_end/testcases/outline.status
@@ -14,6 +14,7 @@
general/covariant_field: TypeCheckError
general/crashes/crash_02/main: Crash
general/crashes/crash_04/main: Crash
+general/crashes/crash_06/main: Crash
general/getter_vs_setter_type: TypeCheckError
general/infer_field_from_multiple: TypeCheckError
general/invalid_operator: TypeCheckError
diff --git a/pkg/front_end/testcases/text_serialization.status b/pkg/front_end/testcases/text_serialization.status
index a31c85f..6d4e214 100644
--- a/pkg/front_end/testcases/text_serialization.status
+++ b/pkg/front_end/testcases/text_serialization.status
@@ -31,6 +31,7 @@
general/covariant_generic: RuntimeError
general/crashes/crash_02/main: Crash
general/crashes/crash_04/main: Crash
+general/crashes/crash_06/main: Crash
general/duplicated_declarations: TypeCheckError
general/duplicated_field_initializer: RuntimeError
general/error_locations/error_location_01: RuntimeError
diff --git a/pkg/front_end/testcases/weak.status b/pkg/front_end/testcases/weak.status
index cf57e3c..751db7e 100644
--- a/pkg/front_end/testcases/weak.status
+++ b/pkg/front_end/testcases/weak.status
@@ -36,6 +36,7 @@
general/covariant_generic: RuntimeError
general/crashes/crash_02/main: Crash
general/crashes/crash_04/main: Crash
+general/crashes/crash_06/main: Crash
general/duplicated_declarations: TypeCheckError
general/duplicated_field_initializer: RuntimeError
general/error_locations/error_location_01: RuntimeError
diff --git a/runtime/vm/service.cc b/runtime/vm/service.cc
index 00032a4..729c187 100644
--- a/runtime/vm/service.cc
+++ b/runtime/vm/service.cc
@@ -4234,6 +4234,70 @@
PrintSuccess(js);
}
+#if defined(HOST_OS_LINUX) || defined(HOST_OS_ANDROID)
+struct VMMapping {
+ char path[256];
+ size_t size;
+};
+
+static void AddVMMappings(JSONArray* rss_children) {
+ FILE* fp = fopen("/proc/self/smaps", "r");
+ if (fp == nullptr) {
+ return;
+ }
+
+ MallocGrowableArray<VMMapping> mappings(10);
+ char line[256];
+ char path[256];
+ char property[32];
+ size_t start, end, size;
+ while (fgets(line, sizeof(line), fp) != nullptr) {
+ if (sscanf(line, "%zx-%zx", &start, &end) == 2) {
+ // Mapping line.
+ strncpy(path, strrchr(line, ' ') + 1, sizeof(path));
+ int len = strlen(path);
+ if ((len > 0) && path[len - 1] == '\n') {
+ path[len - 1] = 0;
+ }
+ } else if (sscanf(line, "%s%zd", property, &size) == 2) {
+ // Property line.
+ // Skipping a few paths to avoid double counting:
+ // (deleted) - memfd dual mapping in Dart heap
+ // [heap] - sbrk area, should already included with malloc
+ // <empty> - anonymous mappings, mostly in Dart heap
+ if ((strcmp(property, "Rss:") == 0) && (size != 0) &&
+ (strcmp(path, "(deleted)") != 0) && (strcmp(path, "[heap]") != 0) &&
+ (strcmp(path, "") != 0)) {
+ bool updated = false;
+ for (intptr_t i = 0; i < mappings.length(); i++) {
+ if (strcmp(mappings[i].path, path) == 0) {
+ mappings[i].size += size;
+ updated = true;
+ break;
+ }
+ }
+ if (!updated) {
+ VMMapping mapping;
+ strncpy(mapping.path, path, sizeof(mapping.path));
+ mapping.size = size;
+ mappings.Add(mapping);
+ }
+ }
+ }
+ }
+ fclose(fp);
+
+ for (intptr_t i = 0; i < mappings.length(); i++) {
+ JSONObject mapping(rss_children);
+ mapping.AddProperty("name", mappings[i].path);
+ mapping.AddProperty("description",
+ "Mapped file / shared library / executable");
+ mapping.AddProperty64("size", mappings[i].size * KB);
+ JSONArray(&mapping, "children");
+ }
+}
+#endif
+
static intptr_t GetProcessMemoryUsageHelper(JSONStream* js) {
JSONObject response(js);
response.AddProperty("type", "ProcessMemoryUsage");
@@ -4335,6 +4399,8 @@
vm.AddProperty64("size", vm_size);
}
+ // On Android, malloc is better labeled by /proc/self/smaps.
+#if !defined(HOST_OS_ANDROID)
intptr_t used, capacity;
const char* implementation;
if (MallocHooks::GetStats(&used, &capacity, &implementation)) {
@@ -4360,6 +4426,12 @@
JSONArray(&malloc_free, "children");
}
}
+#endif
+
+#if defined(HOST_OS_LINUX) || defined(HOST_OS_ANDROID)
+ AddVMMappings(&rss_children);
+#endif
+ // TODO(46166): Implement for other operating systems.
return vm_size;
}
diff --git a/tests/co19_2/co19_2-kernel.status b/tests/co19_2/co19_2-kernel.status
index 8f395a7..5caa9d0 100644
--- a/tests/co19_2/co19_2-kernel.status
+++ b/tests/co19_2/co19_2-kernel.status
@@ -8,8 +8,6 @@
LibTest/isolate/SendPort/send_A01_t03: Crash
[ $compiler == fasta ]
-Language/Statements/For/syntax_t13: Crash # Assertion error: kernel_shadow_ast.dart: 'receiver == null': is not true.
-Language/Statements/For/syntax_t20: Crash # Assertion error: kernel_shadow_ast.dart: 'receiver == null': is not true.
LanguageFeatures/Constant-update-2018/NewOperators_A01_t06/none: Crash
[ $runtime == vm ]
diff --git a/tools/VERSION b/tools/VERSION
index 6c4cf62..91be7bf 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
MAJOR 2
MINOR 14
PATCH 0
-PRERELEASE 159
+PRERELEASE 160
PRERELEASE_PATCH 0
\ No newline at end of file