Version 2.14.0-85.0.dev
Merge commit '06fabd0410db7fbcac03efc418ede8e53d94eb37' into 'dev'
diff --git a/.dart_tool/package_config.json b/.dart_tool/package_config.json
index d0ee842..6cc4287 100644
--- a/.dart_tool/package_config.json
+++ b/.dart_tool/package_config.json
@@ -11,7 +11,7 @@
"constraint, update this by running tools/generate_package_config.dart."
],
"configVersion": 2,
- "generated": "2021-05-03T18:00:16.673010",
+ "generated": "2021-05-05T10:52:59.908934",
"generator": "tools/generate_package_config.dart",
"packages": [
{
@@ -253,18 +253,6 @@
"languageVersion": "2.3"
},
{
- "name": "devtools_server",
- "rootUri": "../third_party/devtools/devtools_server",
- "packageUri": "lib/",
- "languageVersion": "2.6"
- },
- {
- "name": "devtools_shared",
- "rootUri": "../third_party/devtools/devtools_shared",
- "packageUri": "lib/",
- "languageVersion": "2.3"
- },
- {
"name": "diagnostic",
"rootUri": "../pkg/diagnostic",
"packageUri": "lib/",
@@ -455,12 +443,6 @@
"languageVersion": "2.2"
},
{
- "name": "mustache",
- "rootUri": "../third_party/pkg/mustache",
- "packageUri": "lib/",
- "languageVersion": "2.0"
- },
- {
"name": "native_stack_traces",
"rootUri": "../pkg/native_stack_traces",
"packageUri": "lib/",
@@ -650,12 +632,6 @@
"languageVersion": "2.12"
},
{
- "name": "stagehand",
- "rootUri": "../third_party/pkg/stagehand",
- "packageUri": "lib/",
- "languageVersion": "2.10"
- },
- {
"name": "status_file",
"rootUri": "../pkg/status_file",
"packageUri": "lib/",
diff --git a/.packages b/.packages
index 1631e03..7cbfb89 100644
--- a/.packages
+++ b/.packages
@@ -21,7 +21,6 @@
benchmark_harness:third_party/pkg/benchmark_harness/lib
boolean_selector:third_party/pkg/boolean_selector/lib
build_integration:pkg/build_integration/lib
-browser_launcher:third_party/pkg/browser_launcher/lib
charcode:third_party/pkg/charcode/lib
cli_util:third_party/pkg/cli_util/lib
collection:third_party/pkg/collection/lib
@@ -38,7 +37,6 @@
dartdoc:third_party/pkg/dartdoc/lib
dds:pkg/dds/lib
dev_compiler:pkg/dev_compiler/lib
-devtools_shared:third_party/devtools/devtools_shared/lib
diagnostic:pkg/diagnostic/lib
expect:pkg/expect/lib
ffi:third_party/pkg/ffi/lib
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0c0ae9b..cb0efef 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -14,6 +14,13 @@
daylight saving changes that are not precisely one hour.
(No change on the Web which uses the JavaScript `Date` object.)
+#### `dart:typed_data`
+
+* **BREAKING CHANGE** (https://github.com/dart-lang/sdk/issues/45115)
+ Most types exposed by this library can no longer be extended, implemented
+ or mixed-in. The affected types are `ByteBuffer`, `TypedData` and *all*
+ its subclasses, `Int32x4`, `Float32x4`, `Float64x2` and `Endian.
+
#### `dart:web_sql`
* `dart:web_sql` is marked deprecated and will be removed in an upcoming
@@ -24,7 +31,6 @@
was abandoned more than 5 years ago and is not supported by most browsers.
The `dart:web_sql` library has been documented as unsupported and deprecated
for many years as well and but wasn't annotated properly until now.
-
### Dart VM
* **Breaking Change** [#45071][]: `Dart_NewWeakPersistentHandle`'s and
@@ -5741,4 +5747,4 @@
compression.
* `dart:isolate`: `Isolate.spawnUri` added the optional `packageRoot` argument,
- which controls how it resolves `package:` URIs.
\ No newline at end of file
+ which controls how it resolves `package:` URIs.
diff --git a/DEPS b/DEPS
index 1124ea3..92a018b 100644
--- a/DEPS
+++ b/DEPS
@@ -80,10 +80,9 @@
"boringssl_gen_rev": "7322fc15cc065d8d2957fccce6b62a509dc4d641",
"boringssl_rev" : "1607f54fed72c6589d560254626909a64124f091",
"browser-compat-data_tag": "v1.0.22",
- "browser_launcher_rev": "12ab9f351a44ac803de9bc17bb2180bb312a9dd7",
"charcode_rev": "bcd8a12c315b7a83390e4865ad847ecd9344cba2",
"chrome_rev" : "19997",
- "cli_util_rev" : "50cc840b146615899e97b892578848401b2028d5",
+ "cli_util_rev" : "8a73cd7eca373ff71d290ccf47d4829e5ca44209",
"clock_rev" : "a494269254ba978e7ef8f192c5f7fec3fc05b9d3",
"collection_rev": "9967dcd3d7645db6de48d5abfab3018bb0c84236",
"convert_rev": "a60156c6efd653657c8926b5788219ed609917d7",
@@ -106,6 +105,7 @@
"dart_style_rev": "f17c23e0eea9a870601c19d904e2a9c1a7c81470",
"chromedriver_tag": "83.0.4103.39",
+ "browser_launcher_rev": "12ab9f351a44ac803de9bc17bb2180bb312a9dd7",
"dartdoc_rev" : "505f163f7cb48e917503e4a23fbff1227e08b263",
"devtools_rev" : "12ad5341ae0a275042c84a4e7be9a6c98db65612",
"jsshell_tag": "version:88.0",
@@ -320,9 +320,6 @@
Var('chromium_git') + '/external/github.com/mdn/browser-compat-data' +
"@" + Var("browser-compat-data_tag"),
- Var("dart_root") + "/third_party/pkg/browser_launcher":
- Var("dart_git") + "browser_launcher.git" + "@" + Var("browser_launcher_rev"),
-
Var("dart_root") + "/third_party/tcmalloc/gperftools":
Var('chromium_git') + '/external/github.com/gperftools/gperftools.git' +
"@" + Var("gperftools_revision"),
@@ -339,6 +336,9 @@
Var("dart_root") + "/third_party/pkg/boolean_selector":
Var("dart_git") + "boolean_selector.git" +
"@" + Var("boolean_selector_rev"),
+ Var("dart_root") + "/third_party/pkg/browser_launcher":
+ Var("dart_git") + "browser_launcher.git" +
+ "@" + Var("browser_launcher_rev"),
Var("dart_root") + "/third_party/pkg/charcode":
Var("dart_git") + "charcode.git" + "@" + Var("charcode_rev"),
Var("dart_root") + "/third_party/pkg/cli_util":
diff --git a/pkg/analyzer/lib/src/dart/element/type_provider.dart b/pkg/analyzer/lib/src/dart/element/type_provider.dart
index 2831cb48..dbc4a34 100644
--- a/pkg/analyzer/lib/src/dart/element/type_provider.dart
+++ b/pkg/analyzer/lib/src/dart/element/type_provider.dart
@@ -11,11 +11,13 @@
const Map<String, Set<String>> _nonSubtypableClassMap = {
'dart:async': _nonSubtypableDartAsyncClassNames,
'dart:core': _nonSubtypableDartCoreClassNames,
+ 'dart:typed_data': _nonSubtypableDartTypedDataClassNames,
};
const Set<String> _nonSubtypableClassNames = {
..._nonSubtypableDartCoreClassNames,
..._nonSubtypableDartAsyncClassNames,
+ ..._nonSubtypableDartTypedDataClassNames,
};
const Set<String> _nonSubtypableDartAsyncClassNames = {
@@ -31,6 +33,46 @@
'String',
};
+const Set<String> _nonSubtypableDartTypedDataClassNames = {
+ 'ByteBuffer',
+ 'ByteData',
+ 'Endian',
+ 'Float32List',
+ 'Float32x4',
+ 'Float32x4List',
+ 'Float64List',
+ 'Float64x2',
+ 'Float64x2List',
+ 'Int16List',
+ 'Int32List',
+ 'Int32x4',
+ 'Int32x4List',
+ 'Int64List',
+ 'Int8List',
+ 'TypedData',
+ 'Uint16List',
+ 'Uint32List',
+ 'Uint64List',
+ 'Uint8ClampedList',
+ 'Uint8List',
+ 'UnmodifiableByteBufferView',
+ 'UnmodifiableByteDataView',
+ 'UnmodifiableFloat32ListView',
+ 'UnmodifiableFloat32x4ListView',
+ 'UnmodifiableFloat64ListView',
+ 'UnmodifiableFloat64x2ListView',
+ 'UnmodifiableInt16ListView',
+ 'UnmodifiableInt32ListView',
+ 'UnmodifiableInt32x4ListView',
+ 'UnmodifiableInt64ListView',
+ 'UnmodifiableInt8ListView',
+ 'UnmodifiableUint16ListView',
+ 'UnmodifiableUint32ListView',
+ 'UnmodifiableUint64ListView',
+ 'UnmodifiableUint8ClampedListView',
+ 'UnmodifiableUint8ListView',
+};
+
/// Provide common functionality shared by the various TypeProvider
/// implementations.
abstract class TypeProviderBase implements TypeProvider {
diff --git a/pkg/analyzer/lib/src/dart/resolver/extension_member_resolver.dart b/pkg/analyzer/lib/src/dart/resolver/extension_member_resolver.dart
index e78d21f..ad735aa 100644
--- a/pkg/analyzer/lib/src/dart/resolver/extension_member_resolver.dart
+++ b/pkg/analyzer/lib/src/dart/resolver/extension_member_resolver.dart
@@ -79,9 +79,8 @@
[
name,
noneMoreSpecific
- .map((e) => "'${e.extension.name ?? '<unnamed>'}'")
- .toList()
- .commaSeparatedWithAnd,
+ .map((e) => e.extension.name ?? '<unnamed>')
+ .quotedAndCommaSeparatedWithAnd,
],
);
return ResolutionResult.ambiguous;
diff --git a/pkg/analyzer/lib/src/utilities/extensions/string.dart b/pkg/analyzer/lib/src/utilities/extensions/string.dart
index 6651cd7..a6ad2d8 100644
--- a/pkg/analyzer/lib/src/utilities/extensions/string.dart
+++ b/pkg/analyzer/lib/src/utilities/extensions/string.dart
@@ -2,59 +2,76 @@
// 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.
-extension ListOfStringExtension on List<String> {
- /// Produce a comma-separated representation of this list, with the last
+extension IterableOfStringExtension on Iterable<String> {
+ /// Produce a comma-separated representation of this iterable, with the last
/// element preceded by 'and' when there are more than two elements in this
- /// list.
+ /// iterable.
String get commaSeparatedWithAnd => _commaSeparated('and');
- /// Produce a comma-separated representation of this list, with the last
+ /// Produce a comma-separated representation of this iterable, with the last
/// element preceded by 'or' when there are more than two elements in this
- /// list.
+ /// iterable.
String get commaSeparatedWithOr => _commaSeparated('or');
- /// Produce a comma-separated representation of this list, with the last
+ /// Produce a comma-separated representation of this iterable, with the last
/// element preceded by 'and' when there are more than two elements in this
- /// list, and a pair of single quotes surrounding each element.
+ /// iterable, and a pair of single quotes surrounding each element.
String get quotedAndCommaSeparatedWithAnd =>
_commaSeparated('and', quoted: true);
- /// Produce a comma-separated representation of this list, with the last
+ /// Produce a comma-separated representation of this iterable, with the last
/// element preceded by the [conjunction] when there are more than two
- /// elements in this list.
+ /// elements in this iterable.
///
/// Each element is surrounded by a pair of single quotes if [quoted] is true.
String _commaSeparated(String conjunction, {bool quoted = false}) {
- if (length == 0) {
+ var iterator = this.iterator;
+
+ // If has zero elements.
+ if (!iterator.moveNext()) {
return '';
- } else if (length == 1) {
- return quoted ? "'${this[0]}'" : this[0];
- } else if (length == 2) {
+ }
+ var first = iterator.current;
+
+ // If has one element.
+ if (!iterator.moveNext()) {
+ return quoted ? "'$first'" : first;
+ }
+ var second = iterator.current;
+
+ // If has two elements.
+ if (!iterator.moveNext()) {
return quoted
- ? "'${this[0]}' $conjunction '${this[1]}'"
- : '${this[0]} $conjunction ${this[1]}';
- } else {
- var buffer = StringBuffer();
- for (int i = 0; i < length - 1; i++) {
- if (quoted) {
- buffer.write("'");
- }
- buffer.write(this[i]);
- if (quoted) {
- buffer.write("'");
- }
- buffer.write(', ');
- }
- buffer.write(conjunction);
- buffer.write(' ');
- if (quoted) {
- buffer.write("'");
- }
- buffer.write(this[length - 1]);
- if (quoted) {
- buffer.write("'");
- }
- return buffer.toString();
+ ? "'$first' $conjunction '$second'"
+ : '$first $conjunction $second';
+ }
+ var third = iterator.current;
+
+ var buffer = StringBuffer();
+ _writeElement(buffer, first, quoted);
+ buffer.write(', ');
+ _writeElement(buffer, second, quoted);
+
+ var nextToWrite = third;
+ while (iterator.moveNext()) {
+ buffer.write(', ');
+ _writeElement(buffer, nextToWrite, quoted);
+ nextToWrite = iterator.current;
+ }
+ buffer.write(', ');
+ buffer.write(conjunction);
+ buffer.write(' ');
+ _writeElement(buffer, nextToWrite, quoted);
+ return buffer.toString();
+ }
+
+ void _writeElement(StringBuffer buffer, String element, bool quoted) {
+ if (quoted) {
+ buffer.write("'");
+ }
+ buffer.write(element);
+ if (quoted) {
+ buffer.write("'");
}
}
}
diff --git a/pkg/analyzer/test/src/utilities/extensions/string_test.dart b/pkg/analyzer/test/src/utilities/extensions/string_test.dart
index ccf3226..c6c480b 100644
--- a/pkg/analyzer/test/src/utilities/extensions/string_test.dart
+++ b/pkg/analyzer/test/src/utilities/extensions/string_test.dart
@@ -8,12 +8,12 @@
main() {
defineReflectiveSuite(() {
- defineReflectiveTests(ListOfStringExtensionTest);
+ defineReflectiveTests(IterableOfStringExtensionTest);
});
}
@reflectiveTest
-class ListOfStringExtensionTest {
+class IterableOfStringExtensionTest {
void test_commaSeparatedWithAnd_five() {
expect(<String>['a', 'b', 'c', 'd', 'e'].commaSeparatedWithAnd,
'a, b, c, d, and e');
@@ -27,6 +27,13 @@
expect(<String>['a', 'b', 'c'].commaSeparatedWithAnd, 'a, b, and c');
}
+ void test_commaSeparatedWithAnd_three_iterable() {
+ expect(
+ <String>['a', 'b', 'c'].reversed.commaSeparatedWithAnd,
+ 'c, b, and a',
+ );
+ }
+
void test_commaSeparatedWithAnd_two() {
expect(<String>['a', 'b'].commaSeparatedWithAnd, 'a and b');
}
diff --git a/pkg/compiler/lib/src/kernel/dart2js_target.dart b/pkg/compiler/lib/src/kernel/dart2js_target.dart
index c10c0e9..a048dea 100644
--- a/pkg/compiler/lib/src/kernel/dart2js_target.dart
+++ b/pkg/compiler/lib/src/kernel/dart2js_target.dart
@@ -115,8 +115,11 @@
@override
bool mayDefineRestrictedType(Uri uri) =>
- uri.scheme == 'dart' &&
- (uri.path == 'core' || uri.path == '_interceptors');
+ uri.isScheme('dart') &&
+ (uri.path == 'core' ||
+ uri.path == 'typed_data' ||
+ uri.path == '_interceptors' ||
+ uri.path == '_native_typed_data');
@override
bool allowPlatformPrivateLibraryAccess(Uri importer, Uri imported) =>
diff --git a/pkg/dartdev/lib/dartdev.dart b/pkg/dartdev/lib/dartdev.dart
index 5e581c5..b72fbba 100644
--- a/pkg/dartdev/lib/dartdev.dart
+++ b/pkg/dartdev/lib/dartdev.dart
@@ -40,8 +40,7 @@
args = args
.where(
(element) => !(element.contains('--observe') ||
- element.contains('--enable-vm-service') ||
- element.contains('--devtools')),
+ element.contains('--enable-vm-service')),
)
.toList();
}
diff --git a/pkg/dartdev/lib/src/commands/run.dart b/pkg/dartdev/lib/src/commands/run.dart
index d996c3c..db32bfe 100644
--- a/pkg/dartdev/lib/src/commands/run.dart
+++ b/pkg/dartdev/lib/src/commands/run.dart
@@ -158,10 +158,6 @@
hide: !verbose,
negatable: false,
help: 'Enables tracing of library and script loading.',
- )
- ..addFlag(
- 'debug-dds',
- hide: true,
);
addExperimentalFlags(argParser, verbose);
}
@@ -183,18 +179,13 @@
String launchDdsArg = argResults['launch-dds'];
String ddsHost = '';
String ddsPort = '';
-
- // TODO(bkonyi): allow for users to choose not to launch DevTools
- // See https://github.com/dart-lang/sdk/issues/45867.
- const bool launchDevTools = true;
bool launchDds = false;
if (launchDdsArg != null) {
launchDds = true;
- final ddsUrl = launchDdsArg.split('\\:');
+ final ddsUrl = launchDdsArg.split(':');
ddsHost = ddsUrl[0];
ddsPort = ddsUrl[1];
}
- final bool debugDds = argResults['debug-dds'];
bool disableServiceAuthCodes = argResults['disable-service-auth-codes'];
@@ -207,12 +198,7 @@
if (launchDds) {
debugSession = _DebuggingSession();
if (!await debugSession.start(
- ddsHost,
- ddsPort,
- disableServiceAuthCodes,
- launchDevTools,
- debugDds,
- )) {
+ ddsHost, ddsPort, disableServiceAuthCodes)) {
return errorExitCode;
}
}
@@ -256,19 +242,10 @@
class _DebuggingSession {
Future<bool> start(
- String host,
- String port,
- bool disableServiceAuthCodes,
- bool enableDevTools,
- bool debugDds,
- ) async {
- final sdkDir = dirname(sdk.dart);
- final fullSdk = sdkDir.endsWith('bin');
- final ddsSnapshot = fullSdk
+ String host, String port, bool disableServiceAuthCodes) async {
+ final ddsSnapshot = (dirname(sdk.dart).endsWith('bin'))
? sdk.ddsSnapshot
- : absolute(sdkDir, 'gen', 'dds.dart.snapshot');
- final devToolsBinaries =
- fullSdk ? sdk.devToolsBinaries : absolute(sdkDir, 'devtools');
+ : absolute(dirname(sdk.dart), 'gen', 'dds.dart.snapshot');
if (!Sdk.checkArtifactExists(ddsSnapshot)) {
return false;
}
@@ -279,51 +256,30 @@
serviceInfo = await Service.getInfo();
}
final process = await Process.start(
- sdk.dart,
- [
- if (debugDds) '--enable-vm-service=0',
- ddsSnapshot,
- serviceInfo.serverUri.toString(),
- host,
- port,
- disableServiceAuthCodes.toString(),
- enableDevTools.toString(),
- devToolsBinaries,
- debugDds.toString(),
- ],
- mode: ProcessStartMode.detachedWithStdio,
- );
+ sdk.dart,
+ [
+ if (dirname(sdk.dart).endsWith('bin'))
+ sdk.ddsSnapshot
+ else
+ absolute(dirname(sdk.dart), 'gen', 'dds.dart.snapshot'),
+ serviceInfo.serverUri.toString(),
+ host,
+ port,
+ disableServiceAuthCodes.toString(),
+ ],
+ mode: ProcessStartMode.detachedWithStdio);
final completer = Completer<void>();
- const devToolsMessagePrefix =
- 'The Dart DevTools debugger and profiler is available at:';
- if (debugDds) {
- StreamSubscription stdoutSub;
- stdoutSub = process.stdout.transform(utf8.decoder).listen((event) {
- if (event.startsWith(devToolsMessagePrefix)) {
- final ddsDebuggingUri = event.split(' ').last;
- print(
- 'A DevTools debugger for DDS is available at: $ddsDebuggingUri',
- );
- stdoutSub.cancel();
- }
- });
- }
- StreamSubscription stderrSub;
- stderrSub = process.stderr.transform(utf8.decoder).listen((event) {
- final result = json.decode(event) as Map<String, dynamic>;
- final state = result['state'];
- if (state == 'started') {
- if (result.containsKey('devToolsUri')) {
- final devToolsUri = result['devToolsUri'];
- print('$devToolsMessagePrefix $devToolsUri');
- }
- stderrSub.cancel();
+ StreamSubscription sub;
+ sub = process.stderr.transform(utf8.decoder).listen((event) {
+ if (event == 'DDS started') {
+ sub.cancel();
completer.complete();
- } else {
- stderrSub.cancel();
- completer.completeError(
+ } else if (event.contains('Failed to start DDS')) {
+ sub.cancel();
+ completer.completeError(event.replaceAll(
+ 'Failed to start DDS',
'Could not start Observatory HTTP server',
- );
+ ));
}
});
try {
diff --git a/pkg/dartdev/lib/src/sdk.dart b/pkg/dartdev/lib/src/sdk.dart
index 426f810..3e8a12a 100644
--- a/pkg/dartdev/lib/src/sdk.dart
+++ b/pkg/dartdev/lib/src/sdk.dart
@@ -68,13 +68,6 @@
'dds.dart.snapshot',
);
- String get devToolsBinaries => path.absolute(
- sdkPath,
- 'bin',
- 'resources',
- 'devtools',
- );
-
String get pubSnapshot => path.absolute(
sdkPath,
'bin',
diff --git a/pkg/dartdev/test/commands/run_test.dart b/pkg/dartdev/test/commands/run_test.dart
index 58a4d56..b8cc5e8 100644
--- a/pkg/dartdev/test/commands/run_test.dart
+++ b/pkg/dartdev/test/commands/run_test.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.
-import 'dart:async';
-import 'dart:convert';
import 'dart:io';
import 'package:path/path.dart' as path;
@@ -302,61 +300,4 @@
expect(result.stderr, isEmpty);
expect(result.exitCode, 0);
});
-
- group('DevTools', () {
- const devToolsMessagePrefix =
- 'The Dart DevTools debugger and profiler is available at: http://127.0.0.1:';
-
- test('spawn simple', () async {
- p = project(mainSrc: "void main() { print('Hello World'); }");
- ProcessResult result = p.runSync([
- 'run',
- '--enable-vm-service',
- p.relativeFilePath,
- ]);
- expect(result.stdout, contains(devToolsMessagePrefix));
- });
-
- test('implicit spawn', () async {
- p = project(mainSrc: "void main() { print('Hello World'); }");
- ProcessResult result = p.runSync([
- '--enable-vm-service',
- p.relativeFilePath,
- ]);
- expect(result.stdout, contains(devToolsMessagePrefix));
- });
-
- test(
- 'spawn via SIGQUIT',
- () async {
- p = project(
- mainSrc:
- 'void main() { print("ready"); int i = 0; while(true) { i++; } }',
- );
- Process process = await p.start([
- p.relativeFilePath,
- ]);
-
- final readyCompleter = Completer<void>();
- final completer = Completer<void>();
-
- StreamSubscription sub;
- sub = process.stdout.transform(utf8.decoder).listen((event) async {
- if (event.contains('ready')) {
- readyCompleter.complete();
- } else if (event.contains(devToolsMessagePrefix)) {
- await sub.cancel();
- completer.complete();
- }
- });
- // Wait for process to start.
- await readyCompleter.future;
- process.kill(ProcessSignal.sigquit);
- await completer.future;
- process.kill();
- },
- // No support for SIGQUIT on Windows.
- skip: Platform.isWindows,
- );
- });
}
diff --git a/pkg/dds/CHANGELOG.md b/pkg/dds/CHANGELOG.md
index b39156e..3db7549 100644
--- a/pkg/dds/CHANGELOG.md
+++ b/pkg/dds/CHANGELOG.md
@@ -1,5 +1,4 @@
-# 1.8.0-dev
-- Add support for launching DevTools from DDS.
+# 1.7.7-dev
- Fixed issue where two clients subscribing to the same stream in close succession
could result in DDS sending multiple `streamListen` requests to the VM service.
diff --git a/pkg/dds/bin/dds.dart b/pkg/dds/bin/dds.dart
index 45673f5..9937d26 100644
--- a/pkg/dds/bin/dds.dart
+++ b/pkg/dds/bin/dds.dart
@@ -4,7 +4,6 @@
// @dart=2.10
-import 'dart:convert';
import 'dart:io';
import 'package:dds/dds.dart';
@@ -17,9 +16,6 @@
/// - DDS bind address
/// - DDS port
/// - Disable service authentication codes
-/// - Start DevTools
-/// - DevTools build directory
-/// - Enable logging
Future<void> main(List<String> args) async {
if (args.isEmpty) return;
@@ -41,37 +37,16 @@
port: int.parse(args[2]),
);
final disableServiceAuthCodes = args[3] == 'true';
-
- final startDevTools = args[4] == 'true';
- Uri devToolsBuildDirectory;
- if (args[5].isNotEmpty) {
- devToolsBuildDirectory = Uri.file(args[5]);
- }
- final logRequests = args[6] == 'true';
try {
// TODO(bkonyi): add retry logic similar to that in vmservice_server.dart
// See https://github.com/dart-lang/sdk/issues/43192.
- final dds = await DartDevelopmentService.startDartDevelopmentService(
+ await DartDevelopmentService.startDartDevelopmentService(
remoteVmServiceUri,
serviceUri: serviceUri,
enableAuthCodes: !disableServiceAuthCodes,
- devToolsConfiguration: startDevTools
- ? DevToolsConfiguration(
- enable: startDevTools,
- customBuildDirectoryPath: devToolsBuildDirectory,
- )
- : null,
- logRequests: logRequests,
);
- stderr.write(json.encode({
- 'state': 'started',
- if (dds.devToolsUri != null) 'devToolsUri': dds.devToolsUri.toString(),
- }));
- } catch (e, st) {
- stderr.write(json.encode({
- 'state': 'error',
- 'error': '$e',
- 'stacktrace': '$st',
- }));
+ stderr.write('DDS started');
+ } catch (e) {
+ stderr.writeln('Failed to start DDS:\n$e');
}
}
diff --git a/pkg/dds/lib/dds.dart b/pkg/dds/lib/dds.dart
index f0e913b..f7c7a05 100644
--- a/pkg/dds/lib/dds.dart
+++ b/pkg/dds/lib/dds.dart
@@ -44,8 +44,6 @@
Uri serviceUri,
bool enableAuthCodes = true,
bool ipv6 = false,
- DevToolsConfiguration devToolsConfiguration = const DevToolsConfiguration(),
- bool logRequests = false,
}) async {
if (remoteVmServiceUri == null) {
throw ArgumentError.notNull('remoteVmServiceUri');
@@ -82,8 +80,6 @@
serviceUri,
enableAuthCodes,
ipv6,
- devToolsConfiguration,
- logRequests,
);
await service.startService();
return service;
@@ -129,11 +125,6 @@
/// Returns `null` if the service is not running.
Uri get wsUri;
- /// The HTTP [Uri] of the hosted DevTools instance.
- ///
- /// Returns `null` if DevTools is not running.
- Uri get devToolsUri;
-
/// Set to `true` if this instance of [DartDevelopmentService] is accepting
/// requests.
bool get isRunning;
@@ -177,13 +168,3 @@
final int errorCode;
final String message;
}
-
-class DevToolsConfiguration {
- const DevToolsConfiguration({
- this.enable = false,
- this.customBuildDirectoryPath,
- });
-
- final bool enable;
- final Uri customBuildDirectoryPath;
-}
diff --git a/pkg/dds/lib/src/client.dart b/pkg/dds/lib/src/client.dart
index 9ceb162..f81bd25 100644
--- a/pkg/dds/lib/src/client.dart
+++ b/pkg/dds/lib/src/client.dart
@@ -21,25 +21,27 @@
/// Representation of a single DDS client which manages the connection and
/// DDS request intercepting / forwarding.
class DartDevelopmentServiceClient {
- DartDevelopmentServiceClient.fromWebSocket(
+ factory DartDevelopmentServiceClient.fromWebSocket(
DartDevelopmentService dds,
WebSocketChannel ws,
json_rpc.Peer vmServicePeer,
- ) : this._(
- dds,
- ws,
- vmServicePeer,
- );
+ ) =>
+ DartDevelopmentServiceClient._(
+ dds,
+ ws,
+ vmServicePeer,
+ );
- DartDevelopmentServiceClient.fromSSEConnection(
+ factory DartDevelopmentServiceClient.fromSSEConnection(
DartDevelopmentService dds,
SseConnection sse,
json_rpc.Peer vmServicePeer,
- ) : this._(
- dds,
- sse,
- vmServicePeer,
- );
+ ) =>
+ DartDevelopmentServiceClient._(
+ dds,
+ sse,
+ vmServicePeer,
+ );
DartDevelopmentServiceClient._(
this.dds,
diff --git a/pkg/dds/lib/src/constants.dart b/pkg/dds/lib/src/constants.dart
index b69ae7c..2466390 100644
--- a/pkg/dds/lib/src/constants.dart
+++ b/pkg/dds/lib/src/constants.dart
@@ -16,10 +16,6 @@
};
}
-// Give connections time to reestablish before considering them closed.
-// Required to reestablish connections killed by UberProxy.
-const sseKeepAlive = Duration(seconds: 30);
-
abstract class PauseTypeMasks {
static const pauseOnStartMask = 1 << 0;
static const pauseOnReloadMask = 1 << 1;
diff --git a/pkg/dds/lib/src/dds_impl.dart b/pkg/dds/lib/src/dds_impl.dart
index 85be647..db355fb 100644
--- a/pkg/dds/lib/src/dds_impl.dart
+++ b/pkg/dds/lib/src/dds_impl.dart
@@ -24,8 +24,6 @@
import 'binary_compatible_peer.dart';
import 'client.dart';
import 'client_manager.dart';
-import 'constants.dart';
-import 'devtools/devtools_handler.dart';
import 'expression_evaluator.dart';
import 'isolate_manager.dart';
import 'stream_manager.dart';
@@ -53,13 +51,7 @@
class DartDevelopmentServiceImpl implements DartDevelopmentService {
DartDevelopmentServiceImpl(
- this._remoteVmServiceUri,
- this._uri,
- this._authCodesEnabled,
- this._ipv6,
- this._devToolsConfiguration,
- this.shouldLogRequests,
- ) {
+ this._remoteVmServiceUri, this._uri, this._authCodesEnabled, this._ipv6) {
_clientManager = ClientManager(this);
_expressionEvaluator = ExpressionEvaluator(this);
_isolateManager = IsolateManager(this);
@@ -121,26 +113,20 @@
(_ipv6 ? InternetAddress.loopbackIPv6 : InternetAddress.loopbackIPv4)
.host;
final port = uri?.port ?? 0;
- final pipeline = const Pipeline();
- if (shouldLogRequests) {
- pipeline.addMiddleware(
- logRequests(
- logger: (String message, bool isError) {
- print('Log: $message');
- },
- ),
- );
- }
- pipeline.addMiddleware(_authCodeMiddleware);
- final handler = pipeline.addHandler(_handlers().handler);
+
// Start the DDS server.
- _server = await io.serve(handler, host, port);
+ _server = await io.serve(
+ const Pipeline()
+ .addMiddleware(_authCodeMiddleware)
+ .addHandler(_handlers().handler),
+ host,
+ port);
final tmpUri = Uri(
scheme: 'http',
host: host,
port: _server.port,
- path: '$authCode/',
+ path: '$_authCode/',
);
// Notify the VM service that this client is DDS and that it should close
@@ -171,7 +157,7 @@
return;
}
_shuttingDown = true;
- // Don't accept any more HTTP requests.
+ // Don't accept anymore HTTP requests.
await _server?.close();
// Close connections to clients.
@@ -211,7 +197,7 @@
return forbidden;
}
final authToken = pathSegments[0];
- if (authToken != authCode) {
+ if (authToken != _authCode) {
return forbidden;
}
// Creates a new request with the authentication code stripped from
@@ -247,12 +233,18 @@
});
Handler _sseHandler() {
- final handler = SseHandler(
- authCodesEnabled
- ? Uri.parse('/$authCode/$_kSseHandlerPath')
- : Uri.parse('/$_kSseHandlerPath'),
- keepAlive: sseKeepAlive,
- );
+ // Give connections time to reestablish before considering them closed.
+ // Required to reestablish connections killed by UberProxy.
+ const keepAlive = Duration(seconds: 30);
+ final handler = authCodesEnabled
+ ? SseHandler(
+ Uri.parse('/$_authCode/$_kSseHandlerPath'),
+ keepAlive: keepAlive,
+ )
+ : SseHandler(
+ Uri.parse('/$_kSseHandlerPath'),
+ keepAlive: keepAlive,
+ );
handler.connections.rest.listen((sseConnection) {
final client = DartDevelopmentServiceClient.fromSSEConnection(
@@ -267,18 +259,10 @@
}
Handler _httpHandler() {
- if (_devToolsConfiguration != null && _devToolsConfiguration.enable) {
- // Install the DevTools handlers and forward any unhandled HTTP requests to
- // the VM service.
- final buildDir =
- _devToolsConfiguration.customBuildDirectoryPath?.toFilePath();
- return devtoolsHandler(
- dds: this,
- buildDir: buildDir,
- notFoundHandler: proxyHandler(remoteVmServiceUri),
- );
- }
- return proxyHandler(remoteVmServiceUri);
+ // DDS doesn't support any HTTP requests itself, so we just forward all of
+ // them to the VM service.
+ final cascade = Cascade().add(proxyHandler(remoteVmServiceUri));
+ return cascade.handler;
}
List<String> _cleanupPathSegments(Uri uri) {
@@ -312,43 +296,14 @@
return uri.replace(scheme: 'sse', pathSegments: pathSegments);
}
- Uri _toDevTools(Uri uri) {
- // The DevTools URI is a bit strange as the query parameters appear after
- // the fragment. There's no nice way to encode the query parameters
- // properly, so we create another Uri just to grab the formatted query.
- // The result will need to have '/?' prepended when being used as the
- // fragment to get the correct format.
- final query = Uri(
- queryParameters: {
- 'uri': wsUri.toString(),
- },
- ).query;
- return Uri(
- scheme: 'http',
- host: uri.host,
- port: uri.port,
- pathSegments: [
- ...uri.pathSegments.where(
- (e) => e.isNotEmpty,
- ),
- 'devtools',
- '',
- ],
- fragment: '/?$query',
- );
- }
-
String getNamespace(DartDevelopmentServiceClient client) =>
clientManager.clients.keyOf(client);
@override
bool get authCodesEnabled => _authCodesEnabled;
final bool _authCodesEnabled;
- String get authCode => _authCode;
String _authCode;
- final bool shouldLogRequests;
-
@override
Uri get remoteVmServiceUri => _remoteVmServiceUri;
@@ -358,21 +313,17 @@
@override
Uri get uri => _uri;
- Uri _uri;
@override
Uri get sseUri => _toSse(_uri);
Uri get wsUri => _toWebSocket(_uri);
-
- Uri get devToolsUri => _toDevTools(_uri);
+ Uri _uri;
final bool _ipv6;
bool get isRunning => _uri != null;
- final DevToolsConfiguration _devToolsConfiguration;
-
Future<void> get done => _done.future;
Completer _done = Completer<void>();
bool _shuttingDown = false;
diff --git a/pkg/dds/lib/src/devtools/devtools_client.dart b/pkg/dds/lib/src/devtools/devtools_client.dart
deleted file mode 100644
index 5f8670e..0000000
--- a/pkg/dds/lib/src/devtools/devtools_client.dart
+++ /dev/null
@@ -1,96 +0,0 @@
-// 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.
-
-// @dart=2.9
-
-import 'dart:async';
-
-import 'package:json_rpc_2/src/server.dart' as json_rpc;
-import 'package:sse/src/server/sse_handler.dart';
-import 'package:stream_channel/stream_channel.dart';
-
-import 'server_api.dart';
-
-class LoggingMiddlewareSink<S> implements StreamSink<S> {
- LoggingMiddlewareSink(this.sink);
-
- @override
- void add(S event) {
- print('DevTools SSE response: $event');
- sink.add(event);
- }
-
- @override
- void addError(Object error, [StackTrace stackTrace]) {
- print('DevTools SSE error response: $error');
- sink.addError(error);
- }
-
- @override
- Future addStream(Stream<S> stream) {
- return sink.addStream(stream);
- }
-
- @override
- Future close() => sink.close();
-
- @override
- Future get done => sink.done;
-
- final StreamSink sink;
-}
-
-/// Represents a DevTools client connection to the DevTools server API.
-class DevToolsClient {
- DevToolsClient.fromSSEConnection(
- SseConnection sse,
- bool loggingEnabled,
- ) {
- Stream<String> stream = sse.stream;
- StreamSink sink = sse.sink;
-
- if (loggingEnabled) {
- stream = stream.map<String>((String e) {
- print('DevTools SSE request: $e');
- return e;
- });
- sink = LoggingMiddlewareSink(sink);
- }
-
- _server = json_rpc.Server(
- StreamChannel(stream, sink),
- strictProtocolChecks: false,
- );
- _registerJsonRpcMethods();
- _server.listen();
- }
-
- void _registerJsonRpcMethods() {
- _server.registerMethod('connected', (parameters) {
- // Nothing to do here.
- });
-
- _server.registerMethod('currentPage', (parameters) {
- // Nothing to do here.
- });
-
- _server.registerMethod('disconnected', (parameters) {
- // Nothing to do here.
- });
-
- _server.registerMethod('getPreferenceValue', (parameters) {
- final key = parameters['key'].asString;
- final value = ServerApi.devToolsPreferences.properties[key];
- return value;
- });
-
- _server.registerMethod('setPreferenceValue', (parameters) {
- final key = parameters['key'].asString;
- final value = parameters['value'].value;
- ServerApi.devToolsPreferences.properties[key] = value;
- });
- }
-
- json_rpc.Server _server;
-}
diff --git a/pkg/dds/lib/src/devtools/devtools_handler.dart b/pkg/dds/lib/src/devtools/devtools_handler.dart
deleted file mode 100644
index a0a4bf1..0000000
--- a/pkg/dds/lib/src/devtools/devtools_handler.dart
+++ /dev/null
@@ -1,87 +0,0 @@
-// 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.
-
-// @dart=2.9
-
-import 'dart:async';
-
-import 'package:dds/src/constants.dart';
-import 'package:meta/meta.dart';
-import 'package:shelf/shelf.dart';
-import 'package:shelf_static/shelf_static.dart';
-import 'package:sse/server/sse_handler.dart';
-
-import '../dds_impl.dart';
-import 'devtools_client.dart';
-import 'server_api.dart';
-
-/// Returns a [Handler] which handles serving DevTools and the DevTools server
-/// API under $DDS_URI/devtools/.
-///
-/// [buildDir] is the path to the pre-compiled DevTools instance to be served.
-///
-/// [notFoundHandler] is a [Handler] to which requests that could not be handled
-/// by the DevTools handler are forwarded (e.g., a proxy to the VM service).
-FutureOr<Handler> devtoolsHandler({
- @required DartDevelopmentServiceImpl dds,
- @required String buildDir,
- @required Handler notFoundHandler,
-}) {
- // Serves the web assets for DevTools.
- final devtoolsAssetHandler = createStaticHandler(
- buildDir,
- defaultDocument: 'index.html',
- );
-
- // Support DevTools client-server interface via SSE.
- // Note: the handler path needs to match the full *original* path, not the
- // current request URL (we remove '/devtools' in the initial router but we
- // need to include it here).
- const devToolsSseHandlerPath = '/devtools/api/sse';
- final devToolsApiHandler = SseHandler(
- dds.authCodesEnabled
- ? Uri.parse('/${dds.authCode}$devToolsSseHandlerPath')
- : Uri.parse(devToolsSseHandlerPath),
- keepAlive: sseKeepAlive,
- );
-
- devToolsApiHandler.connections.rest.listen(
- (sseConnection) => DevToolsClient.fromSSEConnection(
- sseConnection,
- dds.shouldLogRequests,
- ),
- );
-
- final devtoolsHandler = (Request request) {
- // If the request isn't of the form api/<method> assume it's a request for
- // DevTools assets.
- if (request.url.pathSegments.length < 2 ||
- request.url.pathSegments.first != 'api') {
- return devtoolsAssetHandler(request);
- }
- final method = request.url.pathSegments[1];
- if (method == 'ping') {
- // Note: we have an 'OK' body response, otherwise the response has an
- // incorrect status code (204 instead of 200).
- return Response.ok('OK');
- }
- if (method == 'sse') {
- return devToolsApiHandler.handler(request);
- }
- if (!ServerApi.canHandle(request)) {
- return Response.notFound('$method is not a valid API');
- }
- return ServerApi.handle(request);
- };
-
- return (request) {
- final pathSegments = request.url.pathSegments;
- if (pathSegments.isEmpty || pathSegments.first != 'devtools') {
- return notFoundHandler(request);
- }
- // Forward all requests to /devtools/* to the DevTools handler.
- request = request.change(path: 'devtools');
- return devtoolsHandler(request);
- };
-}
diff --git a/pkg/dds/lib/src/devtools/file_system.dart b/pkg/dds/lib/src/devtools/file_system.dart
deleted file mode 100644
index 9a05de7..0000000
--- a/pkg/dds/lib/src/devtools/file_system.dart
+++ /dev/null
@@ -1,84 +0,0 @@
-// Copyright 2021 The Chromium Authors. 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
-
-// TODO(bkonyi): remove once package:devtools_server_api is available
-// See https://github.com/flutter/devtools/issues/2958.
-
-import 'dart:convert';
-import 'dart:io';
-
-import 'package:path/path.dart' as path;
-
-import 'usage.dart';
-
-class LocalFileSystem {
- static String _userHomeDir() {
- final String envKey =
- Platform.operatingSystem == 'windows' ? 'APPDATA' : 'HOME';
- final String value = Platform.environment[envKey];
- return value == null ? '.' : value;
- }
-
- /// Returns the path to the DevTools storage directory.
- static String devToolsDir() {
- return path.join(_userHomeDir(), '.flutter-devtools');
- }
-
- /// Moves the .devtools file to ~/.flutter-devtools/.devtools if the .devtools file
- /// exists in the user's home directory.
- static void maybeMoveLegacyDevToolsStore() {
- final file = File(path.join(_userHomeDir(), DevToolsUsage.storeName));
- if (file.existsSync()) {
- ensureDevToolsDirectory();
- file.copySync(path.join(devToolsDir(), DevToolsUsage.storeName));
- file.deleteSync();
- }
- }
-
- /// Creates the ~/.flutter-devtools directory if it does not already exist.
- static void ensureDevToolsDirectory() {
- Directory('${LocalFileSystem.devToolsDir()}').createSync();
- }
-
- /// Returns a DevTools file from the given path.
- ///
- /// Only files within ~/.flutter-devtools/ can be accessed.
- static File devToolsFileFromPath(String pathFromDevToolsDir) {
- if (pathFromDevToolsDir.contains('..')) {
- // The passed in path should not be able to walk up the directory tree
- // outside of the ~/.flutter-devtools/ directory.
- return null;
- }
- ensureDevToolsDirectory();
- final file = File(path.join(devToolsDir(), pathFromDevToolsDir));
- if (!file.existsSync()) {
- return null;
- }
- return file;
- }
-
- /// Returns a DevTools file from the given path as encoded json.
- ///
- /// Only files within ~/.flutter-devtools/ can be accessed.
- static String devToolsFileAsJson(String pathFromDevToolsDir) {
- final file = devToolsFileFromPath(pathFromDevToolsDir);
- if (file == null) return null;
-
- final fileName = path.basename(file.path);
- if (!fileName.endsWith('.json')) return null;
-
- final content = file.readAsStringSync();
- final json = jsonDecode(content);
- json['lastModifiedTime'] = file.lastModifiedSync().toString();
- return jsonEncode(json);
- }
-
- /// Whether the flutter store file exists.
- static bool flutterStoreExists() {
- final flutterStore = File('${_userHomeDir()}/.flutter');
- return flutterStore.existsSync();
- }
-}
diff --git a/pkg/dds/lib/src/devtools/server_api.dart b/pkg/dds/lib/src/devtools/server_api.dart
deleted file mode 100644
index b866f44..0000000
--- a/pkg/dds/lib/src/devtools/server_api.dart
+++ /dev/null
@@ -1,230 +0,0 @@
-// Copyright 2021 The Chromium Authors. 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
-
-// TODO(bkonyi): remove once package:devtools_server_api is available
-// See https://github.com/flutter/devtools/issues/2958.
-
-import 'dart:async';
-import 'dart:convert';
-import 'dart:io';
-
-import 'package:devtools_shared/devtools_shared.dart';
-import 'package:shelf/shelf.dart' as shelf;
-
-import 'file_system.dart';
-import 'usage.dart';
-
-/// The DevTools server API.
-///
-/// This defines endpoints that serve all requests that come in over api/.
-class ServerApi {
- static const errorNoActiveSurvey = 'ERROR: setActiveSurvey not called.';
-
- /// Determines whether or not [request] is an API call.
- static bool canHandle(shelf.Request request) {
- return request.url.path.startsWith(apiPrefix);
- }
-
- /// Handles all requests.
- ///
- /// To override an API call, pass in a subclass of [ServerApi].
- static FutureOr<shelf.Response> handle(
- shelf.Request request, [
- ServerApi api,
- ]) {
- api ??= ServerApi();
- switch (request.url.path) {
- // ----- Flutter Tool GA store. -----
- case apiGetFlutterGAEnabled:
- // Is Analytics collection enabled?
- return api.getCompleted(
- request,
- json.encode(FlutterUsage.doesStoreExist ? _usage.enabled : null),
- );
- case apiGetFlutterGAClientId:
- // Flutter Tool GA clientId - ONLY get Flutter's clientId if enabled is
- // true.
- return (FlutterUsage.doesStoreExist)
- ? api.getCompleted(
- request,
- json.encode(_usage.enabled ? _usage.clientId : null),
- )
- : api.getCompleted(
- request,
- json.encode(null),
- );
-
- // ----- DevTools GA store. -----
-
- case apiResetDevTools:
- _devToolsUsage.reset();
- return api.getCompleted(request, json.encode(true));
- case apiGetDevToolsFirstRun:
- // Has DevTools been run first time? To bring up welcome screen.
- return api.getCompleted(
- request,
- json.encode(_devToolsUsage.isFirstRun),
- );
- case apiGetDevToolsEnabled:
- // Is DevTools Analytics collection enabled?
- return api.getCompleted(request, json.encode(_devToolsUsage.enabled));
- case apiSetDevToolsEnabled:
- // Enable or disable DevTools analytics collection.
- final queryParams = request.requestedUri.queryParameters;
- if (queryParams.containsKey(devToolsEnabledPropertyName)) {
- _devToolsUsage.enabled =
- json.decode(queryParams[devToolsEnabledPropertyName]);
- }
- return api.setCompleted(request, json.encode(_devToolsUsage.enabled));
-
- // ----- DevTools survey store. -----
-
- case apiSetActiveSurvey:
- // Assume failure.
- bool result = false;
-
- // Set the active survey used to store subsequent apiGetSurveyActionTaken,
- // apiSetSurveyActionTaken, apiGetSurveyShownCount, and
- // apiIncrementSurveyShownCount calls.
- final queryParams = request.requestedUri.queryParameters;
- if (queryParams.keys.length == 1 &&
- queryParams.containsKey(activeSurveyName)) {
- final String theSurveyName = queryParams[activeSurveyName];
-
- // Set the current activeSurvey.
- _devToolsUsage.activeSurvey = theSurveyName;
- result = true;
- }
-
- return api.getCompleted(request, json.encode(result));
- case apiGetSurveyActionTaken:
- // Request setActiveSurvey has not been requested.
- if (_devToolsUsage.activeSurvey == null) {
- return api.badRequest('$errorNoActiveSurvey '
- '- $apiGetSurveyActionTaken');
- }
- // SurveyActionTaken has the survey been acted upon (taken or dismissed)
- return api.getCompleted(
- request,
- json.encode(_devToolsUsage.surveyActionTaken),
- );
- // TODO(terry): remove the query param logic for this request.
- // setSurveyActionTaken should only be called with the value of true, so
- // we can remove the extra complexity.
- case apiSetSurveyActionTaken:
- // Request setActiveSurvey has not been requested.
- if (_devToolsUsage.activeSurvey == null) {
- return api.badRequest('$errorNoActiveSurvey '
- '- $apiSetSurveyActionTaken');
- }
- // Set the SurveyActionTaken.
- // Has the survey been taken or dismissed..
- final queryParams = request.requestedUri.queryParameters;
- if (queryParams.containsKey(surveyActionTakenPropertyName)) {
- _devToolsUsage.surveyActionTaken =
- json.decode(queryParams[surveyActionTakenPropertyName]);
- }
- return api.setCompleted(
- request,
- json.encode(_devToolsUsage.surveyActionTaken),
- );
- case apiGetSurveyShownCount:
- // Request setActiveSurvey has not been requested.
- if (_devToolsUsage.activeSurvey == null) {
- return api.badRequest('$errorNoActiveSurvey '
- '- $apiGetSurveyShownCount');
- }
- // SurveyShownCount how many times have we asked to take survey.
- return api.getCompleted(
- request,
- json.encode(_devToolsUsage.surveyShownCount),
- );
- case apiIncrementSurveyShownCount:
- // Request setActiveSurvey has not been requested.
- if (_devToolsUsage.activeSurvey == null) {
- return api.badRequest('$errorNoActiveSurvey '
- '- $apiIncrementSurveyShownCount');
- }
- // Increment the SurveyShownCount, we've asked about the survey.
- _devToolsUsage.incrementSurveyShownCount();
- return api.getCompleted(
- request,
- json.encode(_devToolsUsage.surveyShownCount),
- );
- case apiGetBaseAppSizeFile:
- final queryParams = request.requestedUri.queryParameters;
- if (queryParams.containsKey(baseAppSizeFilePropertyName)) {
- final filePath = queryParams[baseAppSizeFilePropertyName];
- final fileJson = LocalFileSystem.devToolsFileAsJson(filePath);
- if (fileJson == null) {
- return api.badRequest('No JSON file available at $filePath.');
- }
- return api.getCompleted(request, fileJson);
- }
- return api.badRequest('Request for base app size file does not '
- 'contain a query parameter with the expected key: '
- '$baseAppSizeFilePropertyName');
- case apiGetTestAppSizeFile:
- final queryParams = request.requestedUri.queryParameters;
- if (queryParams.containsKey(testAppSizeFilePropertyName)) {
- final filePath = queryParams[testAppSizeFilePropertyName];
- final fileJson = LocalFileSystem.devToolsFileAsJson(filePath);
- if (fileJson == null) {
- return api.badRequest('No JSON file available at $filePath.');
- }
- return api.getCompleted(request, fileJson);
- }
- return api.badRequest('Request for test app size file does not '
- 'contain a query parameter with the expected key: '
- '$testAppSizeFilePropertyName');
- default:
- return api.notImplemented(request);
- }
- }
-
- // Accessing Flutter usage file e.g., ~/.flutter.
- // NOTE: Only access the file if it exists otherwise Flutter Tool hasn't yet
- // been run.
- static final FlutterUsage _usage =
- FlutterUsage.doesStoreExist ? FlutterUsage() : null;
-
- // Accessing DevTools usage file e.g., ~/.devtools
- static final DevToolsUsage _devToolsUsage = DevToolsUsage();
-
- static DevToolsUsage get devToolsPreferences => _devToolsUsage;
-
- /// Logs a page view in the DevTools server.
- ///
- /// In the open-source version of DevTools, Google Analytics handles this
- /// without any need to involve the server.
- FutureOr<shelf.Response> logScreenView(shelf.Request request) =>
- notImplemented(request);
-
- /// Return the value of the property.
- FutureOr<shelf.Response> getCompleted(shelf.Request request, String value) =>
- shelf.Response.ok('$value');
-
- /// Return the value of the property after the property value has been set.
- FutureOr<shelf.Response> setCompleted(shelf.Request request, String value) =>
- shelf.Response.ok('$value');
-
- /// A [shelf.Response] for API calls that encountered a request problem e.g.,
- /// setActiveSurvey not called.
- ///
- /// This is a 400 Bad Request response.
- FutureOr<shelf.Response> badRequest([String logError]) {
- if (logError != null) print(logError);
- return shelf.Response(HttpStatus.badRequest);
- }
-
- /// A [shelf.Response] for API calls that have not been implemented in this
- /// server.
- ///
- /// This is a no-op 204 No Content response because returning 404 Not Found
- /// creates unnecessary noise in the console.
- FutureOr<shelf.Response> notImplemented(shelf.Request request) =>
- shelf.Response(HttpStatus.noContent);
-}
diff --git a/pkg/dds/lib/src/devtools/usage.dart b/pkg/dds/lib/src/devtools/usage.dart
deleted file mode 100644
index afa35d7..0000000
--- a/pkg/dds/lib/src/devtools/usage.dart
+++ /dev/null
@@ -1,236 +0,0 @@
-// Copyright 2021 The Chromium Authors. 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
-
-// TODO(bkonyi): remove once package:devtools_server_api is available
-// See https://github.com/flutter/devtools/issues/2958.
-
-import 'dart:convert';
-import 'dart:io';
-
-import 'package:path/path.dart' as path;
-import 'package:usage/usage_io.dart';
-
-import 'file_system.dart';
-
-/// Access the file '~/.flutter'.
-class FlutterUsage {
- /// Create a new Usage instance; [versionOverride] and [configDirOverride] are
- /// used for testing.
- FlutterUsage({
- String settingsName = 'flutter',
- String versionOverride,
- String configDirOverride,
- }) {
- _analytics = AnalyticsIO('', settingsName, '');
- }
-
- Analytics _analytics;
-
- /// Does the .flutter store exist?
- static bool get doesStoreExist {
- return LocalFileSystem.flutterStoreExists();
- }
-
- bool get isFirstRun => _analytics.firstRun;
-
- bool get enabled => _analytics.enabled;
-
- set enabled(bool value) => _analytics.enabled = value;
-
- String get clientId => _analytics.clientId;
-}
-
-// Access the DevTools on disk store (~/.devtools/.devtools).
-class DevToolsUsage {
- /// Create a new Usage instance; [versionOverride] and [configDirOverride] are
- /// used for testing.
- DevToolsUsage({
- String versionOverride,
- String configDirOverride,
- }) {
- LocalFileSystem.maybeMoveLegacyDevToolsStore();
- properties = IOPersistentProperties(
- storeName,
- documentDirPath: LocalFileSystem.devToolsDir(),
- );
- }
-
- static const storeName = '.devtools';
-
- /// The activeSurvey is the property name of a top-level property
- /// existing or created in the file ~/.devtools
- /// If the property doesn't exist it is created with default survey values:
- ///
- /// properties[activeSurvey]['surveyActionTaken'] = false;
- /// properties[activeSurvey]['surveyShownCount'] = 0;
- ///
- /// It is a requirement that the API apiSetActiveSurvey must be called before
- /// calling any survey method on DevToolsUsage (addSurvey, rewriteActiveSurvey,
- /// surveyShownCount, incrementSurveyShownCount, or surveyActionTaken).
- String _activeSurvey;
-
- IOPersistentProperties properties;
-
- static const _surveyActionTaken = 'surveyActionTaken';
- static const _surveyShownCount = 'surveyShownCount';
-
- void reset() {
- properties.remove('firstRun');
- properties['enabled'] = false;
- }
-
- bool get isFirstRun {
- properties['firstRun'] = properties['firstRun'] == null;
- return properties['firstRun'];
- }
-
- bool get enabled {
- if (properties['enabled'] == null) {
- properties['enabled'] = false;
- }
-
- return properties['enabled'];
- }
-
- set enabled(bool value) {
- properties['enabled'] = value;
- return properties['enabled'];
- }
-
- bool surveyNameExists(String surveyName) => properties[surveyName] != null;
-
- void _addSurvey(String surveyName) {
- assert(activeSurvey != null);
- assert(activeSurvey == surveyName);
- rewriteActiveSurvey(false, 0);
- }
-
- String get activeSurvey => _activeSurvey;
-
- set activeSurvey(String surveyName) {
- assert(surveyName != null);
- _activeSurvey = surveyName;
-
- if (!surveyNameExists(activeSurvey)) {
- // Create the survey if property is non-existent in ~/.devtools
- _addSurvey(activeSurvey);
- }
- }
-
- /// Need to rewrite the entire survey structure for property to be persisted.
- void rewriteActiveSurvey(bool actionTaken, int shownCount) {
- assert(activeSurvey != null);
- properties[activeSurvey] = {
- _surveyActionTaken: actionTaken,
- _surveyShownCount: shownCount,
- };
- }
-
- int get surveyShownCount {
- assert(activeSurvey != null);
- final prop = properties[activeSurvey];
- if (prop[_surveyShownCount] == null) {
- rewriteActiveSurvey(prop[_surveyActionTaken], 0);
- }
- return properties[activeSurvey][_surveyShownCount];
- }
-
- void incrementSurveyShownCount() {
- assert(activeSurvey != null);
- surveyShownCount; // Ensure surveyShownCount has been initialized.
- final prop = properties[activeSurvey];
- rewriteActiveSurvey(prop[_surveyActionTaken], prop[_surveyShownCount] + 1);
- }
-
- bool get surveyActionTaken {
- assert(activeSurvey != null);
- return properties[activeSurvey][_surveyActionTaken] == true;
- }
-
- set surveyActionTaken(bool value) {
- assert(activeSurvey != null);
- final prop = properties[activeSurvey];
- rewriteActiveSurvey(value, prop[_surveyShownCount]);
- }
-}
-
-abstract class PersistentProperties {
- PersistentProperties(this.name);
-
- final String name;
-
- dynamic operator [](String key);
-
- void operator []=(String key, dynamic value);
-
- /// Re-read settings from the backing store.
- ///
- /// May be a no-op on some platforms.
- void syncSettings();
-}
-
-const JsonEncoder _jsonEncoder = JsonEncoder.withIndent(' ');
-
-class IOPersistentProperties extends PersistentProperties {
- IOPersistentProperties(
- String name, {
- String documentDirPath,
- }) : super(name) {
- final String fileName = name.replaceAll(' ', '_');
- documentDirPath ??= LocalFileSystem.devToolsDir();
- _file = File(path.join(documentDirPath, fileName));
- if (!_file.existsSync()) {
- _file.createSync(recursive: true);
- }
- syncSettings();
- }
-
- IOPersistentProperties.fromFile(File file) : super(path.basename(file.path)) {
- _file = file;
- if (!_file.existsSync()) {
- _file.createSync(recursive: true);
- }
- syncSettings();
- }
-
- File _file;
-
- Map _map;
-
- @override
- dynamic operator [](String key) => _map[key];
-
- @override
- void operator []=(String key, dynamic value) {
- if (value == null && !_map.containsKey(key)) return;
- if (_map[key] == value) return;
-
- if (value == null) {
- _map.remove(key);
- } else {
- _map[key] = value;
- }
-
- try {
- _file.writeAsStringSync(_jsonEncoder.convert(_map) + '\n');
- } catch (_) {}
- }
-
- @override
- void syncSettings() {
- try {
- String contents = _file.readAsStringSync();
- if (contents.isEmpty) contents = '{}';
- _map = jsonDecode(contents);
- } catch (_) {
- _map = {};
- }
- }
-
- void remove(String propertyName) {
- _map.remove(propertyName);
- }
-}
diff --git a/pkg/dds/pubspec.yaml b/pkg/dds/pubspec.yaml
index a69236c..221e3df 100644
--- a/pkg/dds/pubspec.yaml
+++ b/pkg/dds/pubspec.yaml
@@ -3,7 +3,7 @@
A library used to spawn the Dart Developer Service, used to communicate with
a Dart VM Service instance.
-version: 1.8.0-dev
+version: 1.7.6
homepage: https://github.com/dart-lang/sdk/tree/master/pkg/dds
@@ -12,21 +12,18 @@
dependencies:
async: ^2.4.1
- devtools_shared: ^2.0.0
json_rpc_2: ^2.2.0
meta: ^1.1.8
- path: ^1.8.0
pedantic: ^1.7.0
shelf: ^1.0.0
shelf_proxy: ^1.0.0
- shelf_static: ^1.0.0-dev
shelf_web_socket: ^1.0.0
sse: ^3.7.0
stream_channel: ^2.0.0
- usage: ^4.0.0
vm_service: ^6.0.1-nullsafety.0
web_socket_channel: ^2.0.0
dev_dependencies:
+ shelf_static: ^1.0.0
test: ^1.0.0
webdriver: ^3.0.0
diff --git a/pkg/dev_compiler/lib/src/kernel/target.dart b/pkg/dev_compiler/lib/src/kernel/target.dart
index 473b404..aab6be3 100644
--- a/pkg/dev_compiler/lib/src/kernel/target.dart
+++ b/pkg/dev_compiler/lib/src/kernel/target.dart
@@ -108,8 +108,11 @@
@override
bool mayDefineRestrictedType(Uri uri) =>
- uri.scheme == 'dart' &&
- (uri.path == 'core' || uri.path == '_interceptors');
+ uri.isScheme('dart') &&
+ (uri.path == 'core' ||
+ uri.path == 'typed_data' ||
+ uri.path == '_interceptors' ||
+ uri.path == '_native_typed_data');
/// Returns [true] if [uri] represents a test script has been whitelisted to
/// import private platform libraries.
diff --git a/pkg/front_end/lib/src/fasta/denylisted_classes.dart b/pkg/front_end/lib/src/fasta/denylisted_classes.dart
index c722cbe..345ec12 100644
--- a/pkg/front_end/lib/src/fasta/denylisted_classes.dart
+++ b/pkg/front_end/lib/src/fasta/denylisted_classes.dart
@@ -11,3 +11,44 @@
"String",
"Null"
];
+
+// List of special classes in dart:typed_data that can't be subclassed.
+const List<String> denylistedTypedDataClasses = [
+ "ByteBuffer",
+ "ByteData",
+ "Endian",
+ "Float32List",
+ "Float32x4",
+ "Float32x4List",
+ "Float64List",
+ "Float64x2",
+ "Float64x2List",
+ "Int16List",
+ "Int32List",
+ "Int32x4",
+ "Int32x4List",
+ "Int64List",
+ "Int8List",
+ "TypedData",
+ "Uint16List",
+ "Uint32List",
+ "Uint64List",
+ "Uint8ClampedList",
+ "Uint8List",
+ "UnmodifiableByteBufferView",
+ "UnmodifiableByteDataView",
+ "UnmodifiableFloat32ListView",
+ "UnmodifiableFloat32x4ListView",
+ "UnmodifiableFloat64ListView",
+ "UnmodifiableFloat64x2ListView",
+ "UnmodifiableInt16ListView",
+ "UnmodifiableInt32ListView",
+ "UnmodifiableInt32x4ListView",
+ "UnmodifiableInt64ListView",
+ "UnmodifiableInt8ListView",
+ "UnmodifiableUint16ListView",
+ "UnmodifiableUint32ListView",
+ "UnmodifiableUint64ListView",
+ "UnmodifiableUint8ClampedListView",
+ "UnmodifiableUint8ListView",
+];
diff --git a/pkg/front_end/lib/src/fasta/loader.dart b/pkg/front_end/lib/src/fasta/loader.dart
index c7d3cbe..98d86e8 100644
--- a/pkg/front_end/lib/src/fasta/loader.dart
+++ b/pkg/front_end/lib/src/fasta/loader.dart
@@ -85,6 +85,7 @@
final Set<String> seenMessages = new Set<String>();
LibraryBuilder coreLibrary;
+ LibraryBuilder typedDataLibrary;
/// The first library that we've been asked to compile. When compiling a
/// program (aka script), this is the library that should have a main method.
@@ -209,8 +210,12 @@
packageLanguageVersionProblem, 0, noLength, library.fileUri);
}
- if (uri.scheme == "dart" && uri.path == "core") {
- coreLibrary = library;
+ if (uri.scheme == "dart") {
+ if (uri.path == "core") {
+ coreLibrary = library;
+ } else if (uri.path == "typed_data") {
+ typedDataLibrary = library;
+ }
}
if (library.loader != this) {
if (coreLibrary == library) {
@@ -231,8 +236,8 @@
if (coreLibrary == library) {
target.loadExtraRequiredLibraries(this);
}
- if (target.backendTarget
- .mayDefineRestrictedType(origin?.importUri ?? uri)) {
+ Uri libraryUri = origin?.importUri ?? uri;
+ if (target.backendTarget.mayDefineRestrictedType(libraryUri)) {
library.mayImplementRestrictedTypes = true;
}
if (uri.scheme == "dart") {
diff --git a/pkg/front_end/lib/src/fasta/source/source_loader.dart b/pkg/front_end/lib/src/fasta/source/source_loader.dart
index 675dee4..03c4d7d 100644
--- a/pkg/front_end/lib/src/fasta/source/source_loader.dart
+++ b/pkg/front_end/lib/src/fasta/source/source_loader.dart
@@ -67,7 +67,8 @@
import '../../base/nnbd_mode.dart';
-import '../denylisted_classes.dart' show denylistedCoreClasses;
+import '../denylisted_classes.dart'
+ show denylistedCoreClasses, denylistedTypedDataClasses;
import '../builder/builder.dart';
import '../builder/class_builder.dart';
@@ -805,6 +806,14 @@
denyListedClasses.add(coreLibrary
.lookupLocalMember(denylistedCoreClasses[i], required: true));
}
+ if (typedDataLibrary != null) {
+ for (int i = 0; i < denylistedTypedDataClasses.length; i++) {
+ // Allow the member to not exist. If it doesn't, nobody can extend it.
+ Builder member = typedDataLibrary
+ .lookupLocalMember(denylistedTypedDataClasses[i], required: false);
+ if (member != null) denyListedClasses.add(member);
+ }
+ }
// Sort the classes topologically.
Set<SourceClassBuilder> topologicallySortedClasses =
diff --git a/pkg/front_end/test/spell_checking_list_code.txt b/pkg/front_end/test/spell_checking_list_code.txt
index 42782a9..a1b8799 100644
--- a/pkg/front_end/test/spell_checking_list_code.txt
+++ b/pkg/front_end/test/spell_checking_list_code.txt
@@ -183,6 +183,7 @@
claimed
claims
clamp
+clamped
clarification
clashes
class's
@@ -446,7 +447,12 @@
fishythefish
fixnum
fleshed
+float32
+float32x
+float32x4
float64
+float64x
+float64x2
floitsch
flowed
flushed
@@ -583,6 +589,12 @@
inst
instanceof
instantiator
+int16
+int32
+int32x
+int32x4
+int64
+int8
integrate
intentionally
interim
@@ -1270,6 +1282,7 @@
uint
uint16
uint32
+uint64
uint8
umbrella
un
@@ -1309,6 +1322,7 @@
unlinked
unlower
unmark
+unmodifiable
unneeded
unordered
unpaired
diff --git a/pkg/kernel/binary.md b/pkg/kernel/binary.md
index c891128..e501474 100644
--- a/pkg/kernel/binary.md
+++ b/pkg/kernel/binary.md
@@ -788,7 +788,6 @@
Byte tag = 126;
FileOffset fileOffset;
Expression receiver;
- DartType functionType;
}
type LocalFunctionInvocation extends Expression {
diff --git a/pkg/kernel/lib/target/targets.dart b/pkg/kernel/lib/target/targets.dart
index 6069ec8..c84fd53 100644
--- a/pkg/kernel/lib/target/targets.dart
+++ b/pkg/kernel/lib/target/targets.dart
@@ -273,10 +273,10 @@
/// Whether a platform library may define a restricted type, such as `bool`,
/// `int`, `double`, `num`, and `String`.
///
- /// By default only `dart:core` may define restricted types, but some target
- /// implementations override this.
+ /// By default only `dart:core` and `dart:typed_data` may define restricted
+ /// types, but some target implementations override this.
bool mayDefineRestrictedType(Uri uri) =>
- uri.scheme == 'dart' && uri.path == 'core';
+ uri.isScheme('dart') && (uri.path == 'core' || uri.path == 'typed_data');
/// Whether a library is allowed to import a platform private library.
///
diff --git a/runtime/bin/main.cc b/runtime/bin/main.cc
index 95c7166..ee35109 100644
--- a/runtime/bin/main.cc
+++ b/runtime/bin/main.cc
@@ -553,12 +553,13 @@
vm_service_server_port = 0;
}
- // We do not want to wait for DDS to advertise availability of VM service in
- // the following scenarios:
- // - The DartDev CLI is disabled (CLI isolate starts DDS) and VM service is
- // enabled.
- // TODO(bkonyi): do we want to tie DevTools / DDS to the CLI in the long run?
- bool wait_for_dds_to_advertise_service = !Options::disable_dart_dev();
+ // We do not want to wait for DDS to advertise availability of VM service in the
+ // following scenarios:
+ // - When the VM service is disabled (can be started at a later time via SIGQUIT).
+ // - The DartDev CLI is disabled (CLI isolate starts DDS) and VM service is enabled.
+ bool wait_for_dds_to_advertise_service =
+ !Options::disable_dart_dev() && Options::enable_vm_service();
+
// Load embedder specific bits and return.
if (!VmService::Setup(
Options::disable_dart_dev() ? Options::vm_service_server_ip()
diff --git a/runtime/bin/main_options.cc b/runtime/bin/main_options.cc
index 77b794c..e60f6c8 100644
--- a/runtime/bin/main_options.cc
+++ b/runtime/bin/main_options.cc
@@ -583,7 +583,7 @@
run_command = true;
}
if (!Options::disable_dart_dev() && enable_vm_service_ && run_command) {
- const char* dds_format_str = "--launch-dds=%s\\:%d";
+ const char* dds_format_str = "--launch-dds=%s:%d";
size_t size =
snprintf(nullptr, 0, dds_format_str, vm_service_server_ip(),
vm_service_server_port());
@@ -603,7 +603,6 @@
first_option = false;
}
}
-
// Verify consistency of arguments.
// snapshot_depfile is an alias for depfile. Passing them both is an error.
diff --git a/runtime/tests/vm/dart/transferable_throws_test.dart b/runtime/tests/vm/dart/transferable_throws_test.dart
index e649a86..67cba0a 100644
--- a/runtime/tests/vm/dart/transferable_throws_test.dart
+++ b/runtime/tests/vm/dart/transferable_throws_test.dart
@@ -95,10 +95,6 @@
void operator []=(int index, T value) {}
}
-class MyTypedData implements TypedData {
- noSuchMethod(_) {}
-}
-
main() async {
await throwsIfMaterializeAfterSend();
await throwsIfSendMoreThanOnce();
@@ -118,6 +114,4 @@
Expect.throwsTypeError(
() => TransferableTypedData.fromList(MyList<Uint8List>()));
}
- Expect.throwsArgumentError(
- () => TransferableTypedData.fromList([MyTypedData()]));
}
diff --git a/runtime/tests/vm/dart_2/transferable_throws_test.dart b/runtime/tests/vm/dart_2/transferable_throws_test.dart
index 7052072..95d1e09 100644
--- a/runtime/tests/vm/dart_2/transferable_throws_test.dart
+++ b/runtime/tests/vm/dart_2/transferable_throws_test.dart
@@ -95,10 +95,6 @@
void operator []=(int index, T value) {}
}
-class MyTypedData implements TypedData {
- noSuchMethod(_) {}
-}
-
main() async {
await throwsIfMaterializeAfterSend();
await throwsIfSendMoreThanOnce();
@@ -110,6 +106,4 @@
Expect.throwsArgumentError(() => TransferableTypedData.fromList([null]));
Expect.throwsArgumentError(
() => TransferableTypedData.fromList(MyList<Uint8List>()));
- Expect.throwsArgumentError(
- () => TransferableTypedData.fromList([MyTypedData()]));
}
diff --git a/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc b/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc
index 123a0a2..2ce3561 100644
--- a/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc
+++ b/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc
@@ -1131,8 +1131,20 @@
return BuildVariableSet(payload, position);
case kPropertyGet:
return BuildPropertyGet(position);
+ case kInstanceGet:
+ return BuildInstanceGet(position);
+ case kDynamicGet:
+ return BuildDynamicGet(position);
+ case kInstanceTearOff:
+ return BuildInstanceTearOff(position);
+ case kFunctionTearOff:
+ return BuildFunctionTearOff(position);
case kPropertySet:
return BuildPropertySet(position);
+ case kInstanceSet:
+ return BuildInstanceSet(position);
+ case kDynamicSet:
+ return BuildDynamicSet(position);
case kSuperPropertyGet:
return BuildSuperPropertyGet(position);
case kSuperPropertySet:
@@ -1142,7 +1154,17 @@
case kStaticSet:
return BuildStaticSet(position);
case kMethodInvocation:
- return BuildMethodInvocation(position);
+ case kInstanceInvocation:
+ case kDynamicInvocation:
+ return BuildMethodInvocation(position, tag);
+ case kLocalFunctionInvocation:
+ return BuildLocalFunctionInvocation(position);
+ case kFunctionInvocation:
+ return BuildFunctionInvocation(position);
+ case kEqualsCall:
+ return BuildEqualsCall(position);
+ case kEqualsNull:
+ return BuildEqualsNull(position);
case kSuperMethodInvocation:
return BuildSuperMethodInvocation(position);
case kStaticInvocation:
@@ -1218,15 +1240,13 @@
case kConstSetLiteral:
case kConstMapLiteral:
case kSymbolLiteral:
- // Const invocations and const literals are removed by the
- // constant evaluator.
case kListConcatenation:
case kSetConcatenation:
case kMapConcatenation:
case kInstanceCreation:
case kFileUriExpression:
- // Collection concatenation, instance creation operations and
- // in-expression URI changes are internal to the front end and
+ case kStaticTearOff:
+ // These nodes are internal to the front end and
// removed by the constant evaluator.
default:
ReportUnexpectedTag("expression", tag);
@@ -2155,6 +2175,7 @@
return instructions;
}
+
Fragment StreamingFlowGraphBuilder::BuildPropertyGet(TokenPosition* p) {
const intptr_t offset = ReaderOffset() - 1; // Include the tag.
const TokenPosition position = ReadPosition(); // read position.
@@ -2227,6 +2248,212 @@
return instructions;
}
+Fragment StreamingFlowGraphBuilder::BuildInstanceGet(TokenPosition* p) {
+ const intptr_t offset = ReaderOffset() - 1; // Include the tag.
+ ReadByte(); // read kind.
+ const TokenPosition position = ReadPosition(); // read position.
+ if (p != nullptr) *p = position;
+
+ const DirectCallMetadata direct_call =
+ direct_call_metadata_helper_.GetDirectTargetForPropertyGet(offset);
+ const InferredTypeMetadata result_type =
+ inferred_type_metadata_helper_.GetInferredType(offset);
+
+ Fragment instructions = BuildExpression(); // read receiver.
+
+ LocalVariable* receiver = nullptr;
+ if (direct_call.check_receiver_for_null_) {
+ // Duplicate receiver for CheckNull before it is consumed by PushArgument.
+ receiver = MakeTemporary();
+ instructions += LoadLocal(receiver);
+ }
+
+ const String& getter_name = ReadNameAsGetterName(); // read name.
+ SkipDartType(); // read result_type.
+ const NameIndex itarget_name =
+ ReadInterfaceMemberNameReference(); // read interface_target_reference.
+ ASSERT(!H.IsRoot(itarget_name) && H.IsGetter(itarget_name));
+ const auto& interface_target = Function::ZoneHandle(
+ Z, H.LookupMethodByMember(itarget_name, H.DartGetterName(itarget_name)));
+ ASSERT(getter_name.ptr() == interface_target.name());
+
+ if (direct_call.check_receiver_for_null_) {
+ instructions += CheckNull(position, receiver, getter_name);
+ }
+
+ if (!direct_call.target_.IsNull()) {
+ ASSERT(CompilerState::Current().is_aot());
+ instructions +=
+ StaticCall(position, direct_call.target_, 1, Array::null_array(),
+ ICData::kNoRebind, &result_type);
+ } else {
+ const intptr_t kTypeArgsLen = 0;
+ const intptr_t kNumArgsChecked = 1;
+ instructions +=
+ InstanceCall(position, getter_name, Token::kGET, kTypeArgsLen, 1,
+ Array::null_array(), kNumArgsChecked, interface_target,
+ Function::null_function(), &result_type);
+ }
+
+ if (direct_call.check_receiver_for_null_) {
+ instructions += DropTempsPreserveTop(1); // Drop receiver, preserve result.
+ }
+
+ return instructions;
+}
+
+Fragment StreamingFlowGraphBuilder::BuildDynamicGet(TokenPosition* p) {
+ const intptr_t offset = ReaderOffset() - 1; // Include the tag.
+ ReadByte(); // read kind.
+ const TokenPosition position = ReadPosition(); // read position.
+ if (p != nullptr) *p = position;
+
+ const DirectCallMetadata direct_call =
+ direct_call_metadata_helper_.GetDirectTargetForPropertyGet(offset);
+ const InferredTypeMetadata result_type =
+ inferred_type_metadata_helper_.GetInferredType(offset);
+
+ Fragment instructions = BuildExpression(); // read receiver.
+
+ LocalVariable* receiver = nullptr;
+ if (direct_call.check_receiver_for_null_) {
+ // Duplicate receiver for CheckNull before it is consumed by PushArgument.
+ receiver = MakeTemporary();
+ instructions += LoadLocal(receiver);
+ }
+
+ const String& getter_name = ReadNameAsGetterName(); // read name.
+
+ if (direct_call.check_receiver_for_null_) {
+ instructions += CheckNull(position, receiver, getter_name);
+ }
+
+ const auto& mangled_name = String::ZoneHandle(
+ Z, Function::CreateDynamicInvocationForwarderName(getter_name));
+ const Function* direct_call_target = &direct_call.target_;
+ if (!direct_call_target->IsNull()) {
+ direct_call_target = &Function::ZoneHandle(
+ direct_call.target_.GetDynamicInvocationForwarder(mangled_name));
+ }
+
+ if (!direct_call_target->IsNull()) {
+ ASSERT(CompilerState::Current().is_aot());
+ instructions +=
+ StaticCall(position, *direct_call_target, 1, Array::null_array(),
+ ICData::kNoRebind, &result_type);
+ } else {
+ const intptr_t kTypeArgsLen = 0;
+ const intptr_t kNumArgsChecked = 1;
+ instructions += InstanceCall(position, mangled_name, Token::kGET,
+ kTypeArgsLen, 1, Array::null_array(),
+ kNumArgsChecked, Function::null_function(),
+ Function::null_function(), &result_type);
+ }
+
+ if (direct_call.check_receiver_for_null_) {
+ instructions += DropTempsPreserveTop(1); // Drop receiver, preserve result.
+ }
+
+ return instructions;
+}
+
+Fragment StreamingFlowGraphBuilder::BuildInstanceTearOff(TokenPosition* p) {
+ const intptr_t offset = ReaderOffset() - 1; // Include the tag.
+ ReadByte(); // read kind.
+ const TokenPosition position = ReadPosition(); // read position.
+ if (p != nullptr) *p = position;
+
+ const DirectCallMetadata direct_call =
+ direct_call_metadata_helper_.GetDirectTargetForPropertyGet(offset);
+ const InferredTypeMetadata result_type =
+ inferred_type_metadata_helper_.GetInferredType(offset);
+
+ Fragment instructions = BuildExpression(); // read receiver.
+
+ LocalVariable* receiver = nullptr;
+ if (direct_call.check_receiver_for_null_) {
+ // Duplicate receiver for CheckNull before it is consumed by PushArgument.
+ receiver = MakeTemporary();
+ instructions += LoadLocal(receiver);
+ }
+
+ const String& getter_name = ReadNameAsGetterName(); // read name.
+ SkipDartType(); // read result_type.
+ const NameIndex itarget_name =
+ ReadInterfaceMemberNameReference(); // read interface_target_reference.
+ ASSERT(!H.IsRoot(itarget_name) && H.IsMethod(itarget_name));
+ const auto& tearoff_interface_target = Function::ZoneHandle(
+ Z, H.LookupMethodByMember(itarget_name, H.DartMethodName(itarget_name)));
+
+ if (direct_call.check_receiver_for_null_) {
+ instructions += CheckNull(position, receiver, getter_name);
+ }
+
+ if (!direct_call.target_.IsNull()) {
+ ASSERT(CompilerState::Current().is_aot());
+ instructions +=
+ StaticCall(position, direct_call.target_, 1, Array::null_array(),
+ ICData::kNoRebind, &result_type);
+ } else {
+ const intptr_t kTypeArgsLen = 0;
+ const intptr_t kNumArgsChecked = 1;
+ instructions += InstanceCall(position, getter_name, Token::kGET,
+ kTypeArgsLen, 1, Array::null_array(),
+ kNumArgsChecked, Function::null_function(),
+ tearoff_interface_target, &result_type);
+ }
+
+ if (direct_call.check_receiver_for_null_) {
+ instructions += DropTempsPreserveTop(1); // Drop receiver, preserve result.
+ }
+
+ return instructions;
+}
+
+Fragment StreamingFlowGraphBuilder::BuildFunctionTearOff(TokenPosition* p) {
+ const intptr_t offset = ReaderOffset() - 1; // Include the tag.
+ const TokenPosition position = ReadPosition(); // read position.
+ if (p != nullptr) *p = position;
+
+ const DirectCallMetadata direct_call =
+ direct_call_metadata_helper_.GetDirectTargetForPropertyGet(offset);
+ const InferredTypeMetadata result_type =
+ inferred_type_metadata_helper_.GetInferredType(offset);
+
+ Fragment instructions = BuildExpression(); // read receiver.
+
+ LocalVariable* receiver = nullptr;
+ if (direct_call.check_receiver_for_null_) {
+ // Duplicate receiver for CheckNull before it is consumed by PushArgument.
+ receiver = MakeTemporary();
+ instructions += LoadLocal(receiver);
+ }
+
+ if (direct_call.check_receiver_for_null_) {
+ instructions += CheckNull(position, receiver, Symbols::GetCall());
+ }
+
+ if (!direct_call.target_.IsNull()) {
+ ASSERT(CompilerState::Current().is_aot());
+ instructions +=
+ StaticCall(position, direct_call.target_, 1, Array::null_array(),
+ ICData::kNoRebind, &result_type);
+ } else {
+ const intptr_t kTypeArgsLen = 0;
+ const intptr_t kNumArgsChecked = 1;
+ instructions += InstanceCall(position, Symbols::GetCall(), Token::kGET,
+ kTypeArgsLen, 1, Array::null_array(),
+ kNumArgsChecked, Function::null_function(),
+ Function::null_function(), &result_type);
+ }
+
+ if (direct_call.check_receiver_for_null_) {
+ instructions += DropTempsPreserveTop(1); // Drop receiver, preserve result.
+ }
+
+ return instructions;
+}
+
Fragment StreamingFlowGraphBuilder::BuildPropertySet(TokenPosition* p) {
const intptr_t offset = ReaderOffset() - 1; // Include the tag.
@@ -2322,6 +2549,171 @@
return instructions;
}
+Fragment StreamingFlowGraphBuilder::BuildInstanceSet(TokenPosition* p) {
+ const intptr_t offset = ReaderOffset() - 1; // Include the tag.
+ ReadByte(); // read kind.
+
+ const DirectCallMetadata direct_call =
+ direct_call_metadata_helper_.GetDirectTargetForPropertySet(offset);
+ const CallSiteAttributesMetadata call_site_attributes =
+ call_site_attributes_metadata_helper_.GetCallSiteAttributes(offset);
+ const InferredTypeMetadata inferred_type =
+ inferred_type_metadata_helper_.GetInferredType(offset);
+
+ // True if callee can skip argument type checks.
+ bool is_unchecked_call = inferred_type.IsSkipCheck();
+ if (call_site_attributes.receiver_type != nullptr &&
+ call_site_attributes.receiver_type->HasTypeClass() &&
+ !Class::Handle(call_site_attributes.receiver_type->type_class())
+ .IsGeneric()) {
+ is_unchecked_call = true;
+ }
+
+ Fragment instructions(MakeTemp());
+ LocalVariable* variable = MakeTemporary();
+
+ const TokenPosition position = ReadPosition(); // read position.
+ if (p != nullptr) *p = position;
+
+ if (PeekTag() == kThisExpression) {
+ is_unchecked_call = true;
+ }
+ instructions += BuildExpression(); // read receiver.
+
+ LocalVariable* receiver = nullptr;
+ if (direct_call.check_receiver_for_null_) {
+ // Duplicate receiver for CheckNull before it is consumed by PushArgument.
+ receiver = MakeTemporary();
+ instructions += LoadLocal(receiver);
+ }
+
+ const String& setter_name = ReadNameAsSetterName(); // read name.
+
+ instructions += BuildExpression(); // read value.
+ instructions += StoreLocal(TokenPosition::kNoSource, variable);
+
+ const NameIndex itarget_name =
+ ReadInterfaceMemberNameReference(); // read interface_target_reference.
+ ASSERT(!H.IsRoot(itarget_name));
+ const auto& interface_target = Function::ZoneHandle(
+ Z, H.LookupMethodByMember(itarget_name, H.DartSetterName(itarget_name)));
+ ASSERT(setter_name.ptr() == interface_target.name());
+
+ if (direct_call.check_receiver_for_null_) {
+ instructions += CheckNull(position, receiver, setter_name);
+ }
+
+ if (!direct_call.target_.IsNull()) {
+ ASSERT(CompilerState::Current().is_aot());
+ instructions +=
+ StaticCall(position, direct_call.target_, 2, Array::null_array(),
+ ICData::kNoRebind, /*result_type=*/nullptr,
+ /*type_args_count=*/0,
+ /*use_unchecked_entry=*/is_unchecked_call);
+ } else {
+ const intptr_t kTypeArgsLen = 0;
+ const intptr_t kNumArgsChecked = 1;
+
+ instructions += InstanceCall(
+ position, setter_name, Token::kSET, kTypeArgsLen, 2,
+ Array::null_array(), kNumArgsChecked, interface_target,
+ Function::null_function(),
+ /*result_type=*/nullptr,
+ /*use_unchecked_entry=*/is_unchecked_call, &call_site_attributes);
+ }
+
+ instructions += Drop(); // Drop result of the setter invocation.
+
+ if (direct_call.check_receiver_for_null_) {
+ instructions += Drop(); // Drop receiver.
+ }
+
+ return instructions;
+}
+
+Fragment StreamingFlowGraphBuilder::BuildDynamicSet(TokenPosition* p) {
+ const intptr_t offset = ReaderOffset() - 1; // Include the tag.
+ ReadByte(); // read kind.
+
+ const DirectCallMetadata direct_call =
+ direct_call_metadata_helper_.GetDirectTargetForPropertySet(offset);
+ const CallSiteAttributesMetadata call_site_attributes =
+ call_site_attributes_metadata_helper_.GetCallSiteAttributes(offset);
+ const InferredTypeMetadata inferred_type =
+ inferred_type_metadata_helper_.GetInferredType(offset);
+
+ // True if callee can skip argument type checks.
+ bool is_unchecked_call = inferred_type.IsSkipCheck();
+ if (call_site_attributes.receiver_type != nullptr &&
+ call_site_attributes.receiver_type->HasTypeClass() &&
+ !Class::Handle(call_site_attributes.receiver_type->type_class())
+ .IsGeneric()) {
+ is_unchecked_call = true;
+ }
+
+ Fragment instructions(MakeTemp());
+ LocalVariable* variable = MakeTemporary();
+
+ const TokenPosition position = ReadPosition(); // read position.
+ if (p != nullptr) *p = position;
+
+ if (PeekTag() == kThisExpression) {
+ is_unchecked_call = true;
+ }
+ instructions += BuildExpression(); // read receiver.
+
+ LocalVariable* receiver = nullptr;
+ if (direct_call.check_receiver_for_null_) {
+ // Duplicate receiver for CheckNull before it is consumed by PushArgument.
+ receiver = MakeTemporary();
+ instructions += LoadLocal(receiver);
+ }
+
+ const String& setter_name = ReadNameAsSetterName(); // read name.
+
+ instructions += BuildExpression(); // read value.
+ instructions += StoreLocal(TokenPosition::kNoSource, variable);
+
+ if (direct_call.check_receiver_for_null_) {
+ instructions += CheckNull(position, receiver, setter_name);
+ }
+
+ const Function* direct_call_target = &direct_call.target_;
+ const auto& mangled_name = String::ZoneHandle(
+ Z, Function::CreateDynamicInvocationForwarderName(setter_name));
+ if (!direct_call_target->IsNull()) {
+ direct_call_target = &Function::ZoneHandle(
+ direct_call.target_.GetDynamicInvocationForwarder(mangled_name));
+ }
+
+ if (!direct_call_target->IsNull()) {
+ ASSERT(CompilerState::Current().is_aot());
+ instructions +=
+ StaticCall(position, *direct_call_target, 2, Array::null_array(),
+ ICData::kNoRebind, /*result_type=*/nullptr,
+ /*type_args_count=*/0,
+ /*use_unchecked_entry=*/is_unchecked_call);
+ } else {
+ const intptr_t kTypeArgsLen = 0;
+ const intptr_t kNumArgsChecked = 1;
+
+ instructions += InstanceCall(
+ position, mangled_name, Token::kSET, kTypeArgsLen, 2,
+ Array::null_array(), kNumArgsChecked, Function::null_function(),
+ Function::null_function(),
+ /*result_type=*/nullptr,
+ /*use_unchecked_entry=*/is_unchecked_call, &call_site_attributes);
+ }
+
+ instructions += Drop(); // Drop result of the setter invocation.
+
+ if (direct_call.check_receiver_for_null_) {
+ instructions += Drop(); // Drop receiver.
+ }
+
+ return instructions;
+}
+
static Function& GetNoSuchMethodOrDie(Thread* thread,
Zone* zone,
const Class& klass) {
@@ -2641,10 +3033,20 @@
}
}
-Fragment StreamingFlowGraphBuilder::BuildMethodInvocation(TokenPosition* p) {
+Fragment StreamingFlowGraphBuilder::BuildMethodInvocation(TokenPosition* p,
+ Tag tag) {
+ ASSERT((tag == kMethodInvocation) || (tag == kInstanceInvocation) ||
+ (tag == kDynamicInvocation));
const intptr_t offset = ReaderOffset() - 1; // Include the tag.
- const uint8_t flags = ReadFlags(); // read flags.
+ if ((tag == kInstanceInvocation) || (tag == kDynamicInvocation)) {
+ ReadByte(); // read kind.
+ }
+
+ // read flags.
+ const uint8_t flags =
+ ((tag == kMethodInvocation) || (tag == kInstanceInvocation)) ? ReadFlags()
+ : 0;
const bool is_invariant = (flags & kMethodInvocationFlagInvariant) != 0;
const TokenPosition position = ReadPosition(); // read position.
@@ -2759,9 +3161,15 @@
checked_argument_count = argument_count;
}
+ if (tag == kInstanceInvocation) {
+ SkipDartType(); // read function_type.
+ }
+
const Function* interface_target = &Function::null_function();
const NameIndex itarget_name =
- ReadInterfaceMemberNameReference(); // read interface_target_reference.
+ ((tag == kMethodInvocation) || (tag == kInstanceInvocation))
+ ? ReadInterfaceMemberNameReference()
+ : NameIndex(); // read interface_target_reference.
// TODO(dartbug.com/34497): Once front-end desugars calls via
// fields/getters, filtering of field and getter interface targets here
// can be turned into assertions.
@@ -2846,6 +3254,191 @@
return instructions;
}
+Fragment StreamingFlowGraphBuilder::BuildLocalFunctionInvocation(
+ TokenPosition* p) {
+ const TokenPosition position = ReadPosition();
+ if (p != nullptr) *p = position;
+ // read variable kernel position.
+ const intptr_t variable_kernel_position = ReadUInt();
+ ReadUInt(); // read relative variable index.
+
+ LocalVariable* variable = LookupVariable(variable_kernel_position);
+ ASSERT(!variable->is_late());
+
+ Fragment instructions;
+
+ // Type arguments.
+ intptr_t type_args_len = 0;
+ {
+ AlternativeReadingScope alt(&reader_);
+ ReadUInt(); // read argument count.
+ intptr_t list_length = ReadListLength(); // read types list length.
+ if (list_length > 0) {
+ const TypeArguments& type_arguments =
+ T.BuildTypeArguments(list_length); // read types.
+ instructions += TranslateInstantiatedTypeArguments(type_arguments);
+ }
+ type_args_len = list_length;
+ }
+
+ // Receiver (closure).
+ instructions += LoadLocal(variable);
+
+ intptr_t argument_count;
+ intptr_t positional_argument_count;
+ Array& argument_names = Array::ZoneHandle(Z);
+ instructions +=
+ BuildArguments(&argument_names, &argument_count,
+ &positional_argument_count); // read arguments.
+ ++argument_count; // include receiver
+
+ SkipDartType(); // read function_type.
+
+ // Lookup the function in the closure.
+ instructions += LoadLocal(variable);
+ instructions += LoadNativeField(Slot::Closure_function());
+ if (parsed_function()->function().is_debuggable()) {
+ ASSERT(!parsed_function()->function().is_native());
+ instructions += DebugStepCheck(position);
+ }
+ instructions +=
+ B->ClosureCall(position, type_args_len, argument_count, argument_names,
+ /*use_unchecked_entry=*/true);
+ return instructions;
+}
+
+Fragment StreamingFlowGraphBuilder::BuildFunctionInvocation(TokenPosition* p) {
+ const intptr_t offset = ReaderOffset() - 1; // Include the tag.
+ const FunctionAccessKind function_access_kind =
+ static_cast<FunctionAccessKind>(ReadByte()); // read kind.
+ const TokenPosition position = ReadPosition(); // read position.
+ if (p != nullptr) *p = position;
+
+ const InferredTypeMetadata result_type =
+ inferred_type_metadata_helper_.GetInferredType(offset);
+ const CallSiteAttributesMetadata call_site_attributes =
+ call_site_attributes_metadata_helper_.GetCallSiteAttributes(offset);
+
+ const bool is_unchecked_closure_call =
+ (function_access_kind == FunctionAccessKind::kFunctionType);
+ Fragment instructions;
+
+ instructions += BuildExpression(); // read receiver.
+ LocalVariable* receiver_temp = MakeTemporary();
+
+ // Type arguments.
+ intptr_t type_args_len = 0;
+ {
+ AlternativeReadingScope alt(&reader_);
+ ReadUInt(); // read argument count.
+ intptr_t list_length = ReadListLength(); // read types list length.
+ if (list_length > 0) {
+ const TypeArguments& type_arguments =
+ T.BuildTypeArguments(list_length); // read types.
+ instructions += TranslateInstantiatedTypeArguments(type_arguments);
+ }
+ type_args_len = list_length;
+ }
+
+ // Receiver (closure).
+ instructions += LoadLocal(receiver_temp);
+
+ intptr_t argument_count;
+ intptr_t positional_argument_count;
+ Array& argument_names = Array::ZoneHandle(Z);
+ instructions +=
+ BuildArguments(&argument_names, &argument_count,
+ &positional_argument_count); // read arguments.
+ ++argument_count; // include receiver
+
+ SkipDartType(); // read function_type.
+
+ if (is_unchecked_closure_call) {
+ instructions += CheckNull(position, receiver_temp, Symbols::Call(),
+ /*clear_temp=*/false);
+ // Lookup the function in the closure.
+ instructions += LoadLocal(receiver_temp);
+ instructions += LoadNativeField(Slot::Closure_function());
+ if (parsed_function()->function().is_debuggable()) {
+ ASSERT(!parsed_function()->function().is_native());
+ instructions += DebugStepCheck(position);
+ }
+ instructions +=
+ B->ClosureCall(position, type_args_len, argument_count, argument_names,
+ /*use_unchecked_entry=*/true);
+ } else {
+ instructions += InstanceCall(
+ position, Symbols::DynamicCall(), Token::kILLEGAL, type_args_len,
+ argument_count, argument_names, 1, Function::null_function(),
+ Function::null_function(), &result_type,
+ /*use_unchecked_entry=*/false, &call_site_attributes,
+ result_type.ReceiverNotInt());
+ }
+ instructions += DropTempsPreserveTop(1);
+ return instructions;
+}
+
+Fragment StreamingFlowGraphBuilder::BuildEqualsCall(TokenPosition* p) {
+ const intptr_t offset = ReaderOffset() - 1; // Include the tag.
+ const TokenPosition position = ReadPosition(); // read position.
+ if (p != nullptr) *p = position;
+
+ const DirectCallMetadata direct_call =
+ direct_call_metadata_helper_.GetDirectTargetForMethodInvocation(offset);
+ ASSERT(!direct_call.check_receiver_for_null_);
+ const InferredTypeMetadata result_type =
+ inferred_type_metadata_helper_.GetInferredType(offset);
+ const CallSiteAttributesMetadata call_site_attributes =
+ call_site_attributes_metadata_helper_.GetCallSiteAttributes(offset);
+
+ Fragment instructions;
+ instructions += BuildExpression(); // read left.
+ instructions += BuildExpression(); // read right.
+ SkipDartType(); // read function_type.
+
+ const NameIndex itarget_name =
+ ReadInterfaceMemberNameReference(); // read interface_target_reference.
+ const auto& interface_target = Function::ZoneHandle(
+ Z,
+ H.LookupMethodByMember(itarget_name, H.DartProcedureName(itarget_name)));
+ ASSERT(interface_target.name() == Symbols::EqualOperator().ptr());
+
+ const intptr_t kTypeArgsLen = 0;
+ const intptr_t kNumArgs = 2;
+ const intptr_t kNumCheckedArgs = 2;
+
+ if (!direct_call.target_.IsNull()) {
+ ASSERT(CompilerState::Current().is_aot());
+ instructions +=
+ StaticCall(position, direct_call.target_, kNumArgs, Array::null_array(),
+ ICData::kNoRebind, &result_type, kTypeArgsLen,
+ /*use_unchecked_entry=*/true);
+ } else {
+ instructions += InstanceCall(
+ position, Symbols::EqualOperator(), Token::kEQ, kTypeArgsLen, kNumArgs,
+ Array::null_array(), kNumCheckedArgs, interface_target,
+ Function::null_function(), &result_type,
+ /*use_unchecked_entry=*/true, &call_site_attributes,
+ result_type.ReceiverNotInt());
+ }
+
+ return instructions;
+}
+
+Fragment StreamingFlowGraphBuilder::BuildEqualsNull(TokenPosition* p) {
+ const TokenPosition position = ReadPosition(); // read position.
+ if (p != nullptr) *p = position;
+ Fragment instructions;
+ instructions += BuildExpression(); // read expression.
+ instructions += NullConstant();
+ if (parsed_function()->function().is_debuggable()) {
+ instructions += DebugStepCheck(position);
+ }
+ instructions +=
+ StrictCompare(position, Token::kEQ_STRICT, /*number_check=*/false);
+ return instructions;
+}
+
Fragment StreamingFlowGraphBuilder::BuildSuperMethodInvocation(
TokenPosition* p) {
const intptr_t offset = ReaderOffset() - 1; // Include the tag.
diff --git a/runtime/vm/compiler/frontend/kernel_binary_flowgraph.h b/runtime/vm/compiler/frontend/kernel_binary_flowgraph.h
index 47f5bca..c11dc7d 100644
--- a/runtime/vm/compiler/frontend/kernel_binary_flowgraph.h
+++ b/runtime/vm/compiler/frontend/kernel_binary_flowgraph.h
@@ -274,7 +274,13 @@
Fragment BuildVariableSetImpl(TokenPosition position,
intptr_t variable_kernel_position);
Fragment BuildPropertyGet(TokenPosition* position);
+ Fragment BuildInstanceGet(TokenPosition* position);
+ Fragment BuildDynamicGet(TokenPosition* position);
+ Fragment BuildInstanceTearOff(TokenPosition* position);
+ Fragment BuildFunctionTearOff(TokenPosition* position);
Fragment BuildPropertySet(TokenPosition* position);
+ Fragment BuildInstanceSet(TokenPosition* position);
+ Fragment BuildDynamicSet(TokenPosition* position);
Fragment BuildAllocateInvocationMirrorCall(TokenPosition position,
const String& name,
intptr_t num_type_arguments,
@@ -286,7 +292,11 @@
Fragment BuildSuperPropertySet(TokenPosition* position);
Fragment BuildStaticGet(TokenPosition* position);
Fragment BuildStaticSet(TokenPosition* position);
- Fragment BuildMethodInvocation(TokenPosition* position);
+ Fragment BuildMethodInvocation(TokenPosition* position, Tag tag);
+ Fragment BuildLocalFunctionInvocation(TokenPosition* position);
+ Fragment BuildFunctionInvocation(TokenPosition* position);
+ Fragment BuildEqualsCall(TokenPosition* position);
+ Fragment BuildEqualsNull(TokenPosition* position);
Fragment BuildSuperMethodInvocation(TokenPosition* position);
Fragment BuildStaticInvocation(TokenPosition* position);
Fragment BuildConstructorInvocation(TokenPosition* position);
diff --git a/runtime/vm/compiler/frontend/kernel_fingerprints.cc b/runtime/vm/compiler/frontend/kernel_fingerprints.cc
index 5d5890f..4b0426c 100644
--- a/runtime/vm/compiler/frontend/kernel_fingerprints.cc
+++ b/runtime/vm/compiler/frontend/kernel_fingerprints.cc
@@ -379,6 +379,32 @@
BuildHash(ReadNameAsGetterName().Hash()); // read name.
CalculateGetterNameFingerprint(); // read interface_target_reference.
return;
+ case kInstanceGet:
+ ReadByte(); // read kind.
+ ReadPosition(); // read position.
+ CalculateExpressionFingerprint(); // read receiver.
+ BuildHash(ReadNameAsGetterName().Hash()); // read name.
+ SkipDartType(); // read result_type.
+ CalculateGetterNameFingerprint(); // read interface_target_reference.
+ return;
+ case kDynamicGet:
+ ReadByte(); // read kind.
+ ReadPosition(); // read position.
+ CalculateExpressionFingerprint(); // read receiver.
+ BuildHash(ReadNameAsGetterName().Hash()); // read name.
+ return;
+ case kInstanceTearOff:
+ ReadByte(); // read kind.
+ ReadPosition(); // read position.
+ CalculateExpressionFingerprint(); // read receiver.
+ BuildHash(ReadNameAsGetterName().Hash()); // read name.
+ SkipDartType(); // read result_type.
+ CalculateGetterNameFingerprint(); // read interface_target_reference.
+ return;
+ case kFunctionTearOff:
+ ReadPosition(); // read position.
+ CalculateExpressionFingerprint(); // read receiver.
+ return;
case kPropertySet:
ReadPosition(); // read position.
CalculateExpressionFingerprint(); // read receiver.
@@ -386,6 +412,21 @@
CalculateExpressionFingerprint(); // read value.
CalculateSetterNameFingerprint(); // read interface_target_reference.
return;
+ case kInstanceSet:
+ ReadByte(); // read kind.
+ ReadPosition(); // read position.
+ CalculateExpressionFingerprint(); // read receiver.
+ BuildHash(ReadNameAsSetterName().Hash()); // read name.
+ CalculateExpressionFingerprint(); // read value.
+ CalculateSetterNameFingerprint(); // read interface_target_reference.
+ return;
+ case kDynamicSet:
+ ReadByte(); // read kind.
+ ReadPosition(); // read position.
+ CalculateExpressionFingerprint(); // read receiver.
+ BuildHash(ReadNameAsSetterName().Hash()); // read name.
+ CalculateExpressionFingerprint(); // read value.
+ return;
case kSuperPropertyGet:
ReadPosition(); // read position.
BuildHash(ReadNameAsGetterName().Hash()); // read name.
@@ -414,6 +455,48 @@
CalculateArgumentsFingerprint(); // read arguments.
CalculateMethodNameFingerprint(); // read interface_target_reference.
return;
+ case kInstanceInvocation:
+ ReadByte(); // read kind.
+ ReadFlags(); // read flags.
+ ReadPosition(); // read position.
+ CalculateExpressionFingerprint(); // read receiver.
+ BuildHash(ReadNameAsMethodName().Hash()); // read name.
+ CalculateArgumentsFingerprint(); // read arguments.
+ SkipDartType(); // read function_type.
+ CalculateMethodNameFingerprint(); // read interface_target_reference.
+ return;
+ case kDynamicInvocation:
+ ReadByte(); // read kind.
+ ReadPosition(); // read position.
+ CalculateExpressionFingerprint(); // read receiver.
+ BuildHash(ReadNameAsMethodName().Hash()); // read name.
+ CalculateArgumentsFingerprint(); // read arguments.
+ return;
+ case kLocalFunctionInvocation:
+ ReadPosition(); // read position.
+ ReadUInt(); // read variable kernel position.
+ ReadUInt(); // read relative variable index.
+ CalculateArgumentsFingerprint(); // read arguments.
+ SkipDartType(); // read function_type.
+ return;
+ case kFunctionInvocation:
+ BuildHash(ReadByte()); // read kind.
+ ReadPosition(); // read position.
+ CalculateExpressionFingerprint(); // read receiver.
+ CalculateArgumentsFingerprint(); // read arguments.
+ SkipDartType(); // read function_type.
+ return;
+ case kEqualsCall:
+ ReadPosition(); // read position.
+ CalculateExpressionFingerprint(); // read left.
+ CalculateExpressionFingerprint(); // read right.
+ SkipDartType(); // read function_type.
+ CalculateMethodNameFingerprint(); // read interface_target_reference.
+ return;
+ case kEqualsNull:
+ ReadPosition(); // read position.
+ CalculateExpressionFingerprint(); // read expression.
+ return;
case kSuperMethodInvocation:
ReadPosition(); // read position.
BuildHash(ReadNameAsMethodName().Hash()); // read name.
@@ -558,15 +641,13 @@
case kConstSetLiteral:
case kConstMapLiteral:
case kSymbolLiteral:
- // Const invocations and const literals are removed by the
- // constant evaluator.
case kListConcatenation:
case kSetConcatenation:
case kMapConcatenation:
case kInstanceCreation:
case kFileUriExpression:
- // Collection concatenation, instance creation operations and
- // in-expression URI changes are internal to the front end and
+ case kStaticTearOff:
+ // These nodes are internal to the front end and
// removed by the constant evaluator.
default:
ReportUnexpectedTag("expression", tag);
diff --git a/runtime/vm/compiler/frontend/kernel_translation_helper.cc b/runtime/vm/compiler/frontend/kernel_translation_helper.cc
index f786a81..8dd8f8a 100644
--- a/runtime/vm/compiler/frontend/kernel_translation_helper.cc
+++ b/runtime/vm/compiler/frontend/kernel_translation_helper.cc
@@ -2315,6 +2315,32 @@
SkipName(); // read name.
SkipInterfaceMemberNameReference(); // read interface_target_reference.
return;
+ case kInstanceGet:
+ ReadByte(); // read kind.
+ ReadPosition(); // read position.
+ SkipExpression(); // read receiver.
+ SkipName(); // read name.
+ SkipDartType(); // read result_type.
+ SkipInterfaceMemberNameReference(); // read interface_target_reference.
+ return;
+ case kDynamicGet:
+ ReadByte(); // read kind.
+ ReadPosition(); // read position.
+ SkipExpression(); // read receiver.
+ SkipName(); // read name.
+ return;
+ case kInstanceTearOff:
+ ReadByte(); // read kind.
+ ReadPosition(); // read position.
+ SkipExpression(); // read receiver.
+ SkipName(); // read name.
+ SkipDartType(); // read result_type.
+ SkipInterfaceMemberNameReference(); // read interface_target_reference.
+ return;
+ case kFunctionTearOff:
+ ReadPosition(); // read position.
+ SkipExpression(); // read receiver.
+ return;
case kPropertySet:
ReadPosition(); // read position.
SkipExpression(); // read receiver.
@@ -2322,6 +2348,21 @@
SkipExpression(); // read value.
SkipInterfaceMemberNameReference(); // read interface_target_reference.
return;
+ case kInstanceSet:
+ ReadByte(); // read kind.
+ ReadPosition(); // read position.
+ SkipExpression(); // read receiver.
+ SkipName(); // read name.
+ SkipExpression(); // read value.
+ SkipInterfaceMemberNameReference(); // read interface_target_reference.
+ return;
+ case kDynamicSet:
+ ReadByte(); // read kind.
+ ReadPosition(); // read position.
+ SkipExpression(); // read receiver.
+ SkipName(); // read name.
+ SkipExpression(); // read value.
+ return;
case kSuperPropertyGet:
ReadPosition(); // read position.
SkipName(); // read name.
@@ -2350,6 +2391,48 @@
SkipArguments(); // read arguments.
SkipInterfaceMemberNameReference(); // read interface_target_reference.
return;
+ case kInstanceInvocation:
+ ReadByte(); // read kind.
+ ReadFlags(); // read flags.
+ ReadPosition(); // read position.
+ SkipExpression(); // read receiver.
+ SkipName(); // read name.
+ SkipArguments(); // read arguments.
+ SkipDartType(); // read function_type.
+ SkipInterfaceMemberNameReference(); // read interface_target_reference.
+ return;
+ case kDynamicInvocation:
+ ReadByte(); // read kind.
+ ReadPosition(); // read position.
+ SkipExpression(); // read receiver.
+ SkipName(); // read name.
+ SkipArguments(); // read arguments.
+ return;
+ case kLocalFunctionInvocation:
+ ReadPosition(); // read position.
+ ReadUInt(); // read variable kernel position.
+ ReadUInt(); // read relative variable index.
+ SkipArguments(); // read arguments.
+ SkipDartType(); // read function_type.
+ return;
+ case kFunctionInvocation:
+ ReadByte(); // read kind.
+ ReadPosition(); // read position.
+ SkipExpression(); // read receiver.
+ SkipArguments(); // read arguments.
+ SkipDartType(); // read function_type.
+ return;
+ case kEqualsCall:
+ ReadPosition(); // read position.
+ SkipExpression(); // read left.
+ SkipExpression(); // read right.
+ SkipDartType(); // read function_type.
+ SkipInterfaceMemberNameReference(); // read interface_target_reference.
+ return;
+ case kEqualsNull:
+ ReadPosition(); // read position.
+ SkipExpression(); // read expression.
+ return;
case kSuperMethodInvocation:
ReadPosition(); // read position.
SkipName(); // read name.
@@ -2490,15 +2573,13 @@
case kConstSetLiteral:
case kConstMapLiteral:
case kSymbolLiteral:
- // Const invocations and const literals are removed by the
- // constant evaluator.
case kListConcatenation:
case kSetConcatenation:
case kMapConcatenation:
case kInstanceCreation:
case kFileUriExpression:
- // Collection concatenation, instance creation operations and
- // in-expression URI changes are internal to the front end and
+ case kStaticTearOff:
+ // These nodes are internal to the front end and
// removed by the constant evaluator.
default:
ReportUnexpectedTag("expression", tag);
diff --git a/runtime/vm/compiler/frontend/scope_builder.cc b/runtime/vm/compiler/frontend/scope_builder.cc
index 81730a0..27be5e5 100644
--- a/runtime/vm/compiler/frontend/scope_builder.cc
+++ b/runtime/vm/compiler/frontend/scope_builder.cc
@@ -693,6 +693,34 @@
// read interface_target_reference.
helper_.SkipInterfaceMemberNameReference();
return;
+ case kInstanceGet:
+ helper_.ReadByte(); // read kind.
+ helper_.ReadPosition(); // read position.
+ VisitExpression(); // read receiver.
+ helper_.SkipName(); // read name.
+ helper_.SkipDartType(); // read result_type.
+ // read interface_target_reference.
+ helper_.SkipInterfaceMemberNameReference();
+ return;
+ case kDynamicGet:
+ helper_.ReadByte(); // read kind.
+ helper_.ReadPosition(); // read position.
+ VisitExpression(); // read receiver.
+ helper_.SkipName(); // read name.
+ return;
+ case kInstanceTearOff:
+ helper_.ReadByte(); // read kind.
+ helper_.ReadPosition(); // read position.
+ VisitExpression(); // read receiver.
+ helper_.SkipName(); // read name.
+ helper_.SkipDartType(); // read result_type.
+ // read interface_target_reference.
+ helper_.SkipInterfaceMemberNameReference();
+ return;
+ case kFunctionTearOff:
+ helper_.ReadPosition(); // read position.
+ VisitExpression(); // read receiver.
+ return;
case kPropertySet:
helper_.ReadPosition(); // read position.
VisitExpression(); // read receiver.
@@ -701,6 +729,22 @@
// read interface_target_reference.
helper_.SkipInterfaceMemberNameReference();
return;
+ case kInstanceSet:
+ helper_.ReadByte(); // read kind.
+ helper_.ReadPosition(); // read position.
+ VisitExpression(); // read receiver.
+ helper_.SkipName(); // read name.
+ VisitExpression(); // read value.
+ // read interface_target_reference.
+ helper_.SkipInterfaceMemberNameReference();
+ return;
+ case kDynamicSet:
+ helper_.ReadByte(); // read kind.
+ helper_.ReadPosition(); // read position.
+ VisitExpression(); // read receiver.
+ helper_.SkipName(); // read name.
+ VisitExpression(); // read value.
+ return;
case kSuperPropertyGet:
HandleLoadReceiver();
helper_.ReadPosition(); // read position.
@@ -732,6 +776,53 @@
// read interface_target_reference.
helper_.SkipInterfaceMemberNameReference();
return;
+ case kInstanceInvocation:
+ helper_.ReadByte(); // read kind.
+ helper_.ReadFlags(); // read flags.
+ helper_.ReadPosition(); // read position.
+ VisitExpression(); // read receiver.
+ helper_.SkipName(); // read name.
+ VisitArguments(); // read arguments.
+ helper_.SkipDartType(); // read function_type.
+ // read interface_target_reference.
+ helper_.SkipInterfaceMemberNameReference();
+ return;
+ case kDynamicInvocation:
+ helper_.ReadByte(); // read kind.
+ helper_.ReadPosition(); // read position.
+ VisitExpression(); // read receiver.
+ helper_.SkipName(); // read name.
+ VisitArguments(); // read arguments.
+ return;
+ case kLocalFunctionInvocation: {
+ helper_.ReadPosition(); // read position.
+ intptr_t variable_kernel_offset =
+ helper_.ReadUInt(); // read variable kernel position.
+ helper_.ReadUInt(); // read relative variable index.
+ VisitArguments(); // read arguments.
+ helper_.SkipDartType(); // read function_type.
+ VisitVariableGet(variable_kernel_offset);
+ return;
+ }
+ case kFunctionInvocation:
+ helper_.ReadByte(); // read kind.
+ helper_.ReadPosition(); // read position.
+ VisitExpression(); // read receiver.
+ VisitArguments(); // read arguments.
+ helper_.SkipDartType(); // read function_type.
+ return;
+ case kEqualsCall:
+ helper_.ReadPosition(); // read position.
+ VisitExpression(); // read left.
+ VisitExpression(); // read right.
+ helper_.SkipDartType(); // read function_type.
+ // read interface_target_reference.
+ helper_.SkipInterfaceMemberNameReference();
+ return;
+ case kEqualsNull:
+ helper_.ReadPosition(); // read position.
+ VisitExpression(); // read expression.
+ return;
case kSuperMethodInvocation:
HandleLoadReceiver();
helper_.ReadPosition(); // read position.
@@ -914,15 +1005,13 @@
case kConstSetLiteral:
case kConstMapLiteral:
case kSymbolLiteral:
- // Const invocations and const literals are removed by the
- // constant evaluator.
case kListConcatenation:
case kSetConcatenation:
case kMapConcatenation:
case kInstanceCreation:
case kFileUriExpression:
- // Collection concatenation, instance creation operations and
- // in-expression URI changes are internal to the front end and
+ case kStaticTearOff:
+ // These nodes are internal to the front end and
// removed by the constant evaluator.
default:
ReportUnexpectedTag("expression", tag);
diff --git a/runtime/vm/kernel_binary.h b/runtime/vm/kernel_binary.h
index c7b1fe5..6b6878f 100644
--- a/runtime/vm/kernel_binary.h
+++ b/runtime/vm/kernel_binary.h
@@ -214,6 +214,14 @@
kIsRequired = 1 << 0,
};
+// Keep in sync with package:kernel/lib/ast.dart
+enum class FunctionAccessKind {
+ kFunction,
+ kFunctionType,
+ kInapplicable,
+ kNullable,
+};
+
static const int SpecializedIntLiteralBias = 3;
static const int LibraryCountFieldCountFromEnd = 1;
static const int KernelFormatVersionOffset = 4;
diff --git a/sdk/BUILD.gn b/sdk/BUILD.gn
index 1390092..15a1abf 100644
--- a/sdk/BUILD.gn
+++ b/sdk/BUILD.gn
@@ -252,18 +252,6 @@
},
]
-# This rule copies the pre-built DevTools application to
-# bin/resources/devtools/
-copy_tree_specs += [
- {
- target = "copy_prebuilt_devtools"
- visibility = [ ":create_common_sdk" ]
- source = "../third_party/devtools/web"
- dest = "$root_out_dir/dart-sdk/bin/resources/devtools"
- ignore_patterns = "{}"
- },
-]
-
# This loop generates rules to copy libraries to lib/
foreach(library, _full_sdk_libraries) {
copy_tree_specs += [
@@ -823,7 +811,6 @@
":copy_libraries_dart",
":copy_libraries_specification",
":copy_license",
- ":copy_prebuilt_devtools",
":copy_readme",
":copy_vm_dill_files",
":write_dartdoc_options",
diff --git a/sdk/lib/_internal/vm/bin/vmservice_io.dart b/sdk/lib/_internal/vm/bin/vmservice_io.dart
index 833e5a2..d1f8a5d 100644
--- a/sdk/lib/_internal/vm/bin/vmservice_io.dart
+++ b/sdk/lib/_internal/vm/bin/vmservice_io.dart
@@ -43,7 +43,6 @@
// HTTP server.
Server? server;
Future<Server>? serverFuture;
-_DebuggingSession? ddsInstance;
Server _lazyServerBoot() {
var localServer = server;
@@ -59,90 +58,6 @@
return localServer;
}
-/// Responsible for launching a DevTools instance when the service is started
-/// via SIGQUIT.
-class _DebuggingSession {
- Future<bool> start(
- String host,
- String port,
- bool disableServiceAuthCodes,
- bool enableDevTools,
- ) async {
- final dartPath = Uri.parse(Platform.resolvedExecutable);
- final dartDir = [
- '', // Include leading '/'
- ...dartPath.pathSegments.sublist(
- 0,
- dartPath.pathSegments.length - 1,
- ),
- ].join('/');
-
- final fullSdk = dartDir.endsWith('bin');
-
- final ddsSnapshot = [
- dartDir,
- fullSdk ? 'snapshots' : 'gen',
- 'dds.dart.snapshot',
- ].join('/');
-
- final devToolsBinaries = [
- dartDir,
- if (fullSdk) 'resources',
- 'devtools',
- ].join('/');
-
- const enableLogging = false;
- _process = await Process.start(
- dartPath.toString(),
- [
- ddsSnapshot,
- server!.serverAddress!.toString(),
- host,
- port,
- disableServiceAuthCodes.toString(),
- enableDevTools.toString(),
- devToolsBinaries,
- enableLogging.toString(),
- ],
- mode: ProcessStartMode.detachedWithStdio,
- );
- final completer = Completer<void>();
- late StreamSubscription stderrSub;
- stderrSub = _process!.stderr.transform(utf8.decoder).listen((event) {
- final result = json.decode(event) as Map<String, dynamic>;
- final state = result['state'];
- if (state == 'started') {
- if (result.containsKey('devToolsUri')) {
- // NOTE: update pkg/dartdev/lib/src/commands/run.dart if this message
- // is changed to ensure consistency.
- const devToolsMessagePrefix =
- 'The Dart DevTools debugger and profiler is available at:';
- final devToolsUri = result['devToolsUri'];
- print('$devToolsMessagePrefix $devToolsUri');
- }
- stderrSub.cancel();
- completer.complete();
- } else {
- stderrSub.cancel();
- completer.completeError(
- 'Could not start Observatory HTTP server',
- );
- }
- });
- try {
- await completer.future;
- return true;
- } catch (e) {
- stderr.write(e);
- return false;
- }
- }
-
- void shutdown() => _process!.kill();
-
- Process? _process;
-}
-
Future cleanupCallback() async {
// Cancel the sigquit subscription.
if (_signalSubscription != null) {
@@ -306,6 +221,10 @@
_server.acceptNewWebSocketConnections = enable;
}
+void _clearFuture(_) {
+ serverFuture = null;
+}
+
_onSignal(ProcessSignal signal) {
if (serverFuture != null) {
// Still waiting.
@@ -314,21 +233,9 @@
final _server = _lazyServerBoot();
// Toggle HTTP server.
if (_server.running) {
- _server.shutdown(true).then((_) async {
- ddsInstance?.shutdown();
- await VMService().clearState();
- serverFuture = null;
- });
+ _server.shutdown(true).then(_clearFuture);
} else {
- _server.startup().then((_) {
- ddsInstance = _DebuggingSession()
- ..start(
- _server._ip,
- _server._port.toString(),
- false,
- true,
- );
- });
+ _server.startup().then(_clearFuture);
}
}
diff --git a/sdk/lib/_internal/vm/bin/vmservice_server.dart b/sdk/lib/_internal/vm/bin/vmservice_server.dart
index f5742ed..69aa7f8 100644
--- a/sdk/lib/_internal/vm/bin/vmservice_server.dart
+++ b/sdk/lib/_internal/vm/bin/vmservice_server.dart
@@ -26,9 +26,9 @@
socket.done.then((_) => close());
}
- Future<void> disconnect() async {
+ disconnect() {
if (socket != null) {
- await socket.close();
+ socket.close();
}
}
@@ -102,8 +102,8 @@
HttpRequestClient(this.request, VMService service)
: super(service, sendEvents: false);
- Future<void> disconnect() async {
- await request.response.close();
+ disconnect() {
+ request.response.close();
close();
}
diff --git a/sdk/lib/vmservice/vmservice.dart b/sdk/lib/vmservice/vmservice.dart
index d492dcf..a3f7e8b 100644
--- a/sdk/lib/vmservice/vmservice.dart
+++ b/sdk/lib/vmservice/vmservice.dart
@@ -411,16 +411,6 @@
replyPort.send(bytes);
}
- Future<void> clearState() async {
- // Create a copy of the set as a list because client.disconnect() will
- // alter the connected clients set.
- final clientsList = clients.toList();
- for (final client in clientsList) {
- await client.disconnect();
- }
- devfs.cleanup();
- }
-
Future _exit() async {
isExiting = true;
@@ -433,7 +423,14 @@
// Close receive ports.
isolateControlPort.close();
scriptLoadPort.close();
- await clearState();
+
+ // Create a copy of the set as a list because client.disconnect() will
+ // alter the connected clients set.
+ final clientsList = clients.toList();
+ for (final client in clientsList) {
+ client.disconnect();
+ }
+ devfs.cleanup();
final cleanup = VMServiceEmbedderHooks.cleanup;
if (cleanup != null) {
await cleanup();
diff --git a/tests/lib/typed_data/restricted_types_error_test.dart b/tests/lib/typed_data/restricted_types_error_test.dart
new file mode 100644
index 0000000..02b5721
--- /dev/null
+++ b/tests/lib/typed_data/restricted_types_error_test.dart
@@ -0,0 +1,361 @@
+// 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:typed_data';
+
+abstract class CEByteBuffer extends ByteBuffer {}
+// ^
+// [cfe] 'ByteBuffer' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CIByteBuffer implements ByteBuffer {}
+// ^
+// [cfe] 'ByteBuffer' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CMByteBuffer with ByteBuffer {}
+// ^
+// [cfe] 'ByteBuffer' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CETypedData extends TypedData {}
+// ^
+// [cfe] 'TypedData' is restricted and can't be extended or implemented.
+// ^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CITypedData implements TypedData {}
+// ^
+// [cfe] 'TypedData' is restricted and can't be extended or implemented.
+// ^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CMTypedData with TypedData {}
+// ^
+// [cfe] 'TypedData' is restricted and can't be extended or implemented.
+// ^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CIByteData implements ByteData {}
+// ^
+// [cfe] 'ByteData' is restricted and can't be extended or implemented.
+// ^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CMByteData with ByteData {}
+// ^
+// [cfe] 'ByteData' is restricted and can't be extended or implemented.
+// ^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CIInt8List implements Int8List {}
+// ^
+// [cfe] 'Int8List' is restricted and can't be extended or implemented.
+// ^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CMInt8List with Int8List {}
+// ^
+// [cfe] 'Int8List' is restricted and can't be extended or implemented.
+// ^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CIUint8List implements Uint8List {}
+// ^
+// [cfe] 'Uint8List' is restricted and can't be extended or implemented.
+// ^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CMUint8List with Uint8List {}
+// ^
+// [cfe] 'Uint8List' is restricted and can't be extended or implemented.
+// ^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class Uint8CIClampedList implements Uint8ClampedList {}
+// ^
+// [cfe] 'Uint8ClampedList' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class Uint8CMClampedList with Uint8ClampedList {}
+// ^
+// [cfe] 'Uint8ClampedList' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CIInt16List implements Int16List {}
+// ^
+// [cfe] 'Int16List' is restricted and can't be extended or implemented.
+// ^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CMInt16List with Int16List {}
+// ^
+// [cfe] 'Int16List' is restricted and can't be extended or implemented.
+// ^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CIUint16List implements Uint16List {}
+// ^
+// [cfe] 'Uint16List' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CMUint16List with Uint16List {}
+// ^
+// [cfe] 'Uint16List' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CIInt32List implements Int32List {}
+// ^
+// [cfe] 'Int32List' is restricted and can't be extended or implemented.
+// ^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CMInt32List with Int32List {}
+// ^
+// [cfe] 'Int32List' is restricted and can't be extended or implemented.
+// ^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CIUint32List implements Uint32List {}
+// ^
+// [cfe] 'Uint32List' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CMUint32List with Uint32List {}
+// ^
+// [cfe] 'Uint32List' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CIInt64List implements Int64List {}
+// ^
+// [cfe] 'Int64List' is restricted and can't be extended or implemented.
+// ^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CMInt64List with Int64List {}
+// ^
+// [cfe] 'Int64List' is restricted and can't be extended or implemented.
+// ^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CIUint64List implements Uint64List {}
+// ^
+// [cfe] 'Uint64List' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CMUint64List with Uint64List {}
+// ^
+// [cfe] 'Uint64List' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CIFloat32List implements Float32List {}
+// ^
+// [cfe] 'Float32List' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CMFloat32List with Float32List {}
+// ^
+// [cfe] 'Float32List' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CIFloat64List implements Float64List {}
+// ^
+// [cfe] 'Float64List' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CMFloat64List with Float64List {}
+// ^
+// [cfe] 'Float64List' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CIInt32x4List implements Int32x4List {}
+// ^
+// [cfe] 'Int32x4List' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CMInt32x4List with Int32x4List {}
+// ^
+// [cfe] 'Int32x4List' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CIFloat32x4List implements Float32x4List {}
+// ^
+// [cfe] 'Float32x4List' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CMFloat32x4List with Float32x4List {}
+// ^
+// [cfe] 'Float32x4List' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CIFloat64x2List implements Float64x2List {}
+// ^
+// [cfe] 'Float64x2List' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CMFloat64x2List with Float64x2List {}
+// ^
+// [cfe] 'Float64x2List' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CIInt32x4 implements Int32x4 {}
+// ^
+// [cfe] 'Int32x4' is restricted and can't be extended or implemented.
+// ^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CMInt32x4 with Int32x4 {}
+// ^
+// [cfe] 'Int32x4' is restricted and can't be extended or implemented.
+// ^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CIFloat32x4 implements Float32x4 {}
+// ^
+// [cfe] 'Float32x4' is restricted and can't be extended or implemented.
+// ^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CMFloat32x4 with Float32x4 {}
+// ^
+// [cfe] 'Float32x4' is restricted and can't be extended or implemented.
+// ^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CIFloat64x2 implements Float64x2 {}
+// ^
+// [cfe] 'Float64x2' is restricted and can't be extended or implemented.
+// ^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CMFloat64x2 with Float64x2 {}
+// ^
+// [cfe] 'Float64x2' is restricted and can't be extended or implemented.
+// ^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+// Endian cannot be used as a superclass or mixin.
+
+abstract class CIEndian implements Endian {}
+// ^
+// [cfe] 'Endian' is restricted and can't be extended or implemented.
+// ^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CIUnByteBufferView implements UnmodifiableByteBufferView {}
+// ^
+// [cfe] 'UnmodifiableByteBufferView' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^^^^^^^^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CIUnByteDataView implements UnmodifiableByteDataView {}
+// ^
+// [cfe] 'UnmodifiableByteDataView' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^^^^^^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CIUnInt8LV implements UnmodifiableInt8ListView {}
+// ^
+// [cfe] 'UnmodifiableInt8ListView' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^^^^^^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CIUnUint8LV implements UnmodifiableUint8ListView {}
+// ^
+// [cfe] 'UnmodifiableUint8ListView' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^^^^^^^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CIUnUint8ClampedLV implements UnmodifiableUint8ClampedListView {}
+// ^
+// [cfe] 'UnmodifiableUint8ClampedListView' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CIUnInt16LV implements UnmodifiableInt16ListView {}
+// ^
+// [cfe] 'UnmodifiableInt16ListView' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^^^^^^^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CIUnUint16LV implements UnmodifiableUint16ListView {}
+// ^
+// [cfe] 'UnmodifiableUint16ListView' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^^^^^^^^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CIUnInt32LV implements UnmodifiableInt32ListView {}
+// ^
+// [cfe] 'UnmodifiableInt32ListView' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^^^^^^^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CIUnUint32LV implements UnmodifiableUint32ListView {}
+// ^
+// [cfe] 'UnmodifiableUint32ListView' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^^^^^^^^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CIUnInt64LV implements UnmodifiableInt64ListView {}
+// ^
+// [cfe] 'UnmodifiableInt64ListView' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^^^^^^^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CIUnUint64LV implements UnmodifiableUint64ListView {}
+// ^
+// [cfe] 'UnmodifiableUint64ListView' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^^^^^^^^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CIUnFloat32LV implements UnmodifiableFloat32ListView {}
+// ^
+// [cfe] 'UnmodifiableFloat32ListView' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CIUnFloat64LV implements UnmodifiableFloat64ListView {}
+// ^
+// [cfe] 'UnmodifiableFloat64ListView' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CIUnInt32x4LV implements UnmodifiableInt32x4ListView {}
+// ^
+// [cfe] 'UnmodifiableInt32x4ListView' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CIUnFloat32x4LV implements UnmodifiableFloat32x4ListView {}
+// ^
+// [cfe] 'UnmodifiableFloat32x4ListView' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CIUnFloat64x2LV implements UnmodifiableFloat64x2ListView {}
+// ^
+// [cfe] 'UnmodifiableFloat64x2ListView' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
diff --git a/tests/lib_2/typed_data/restricted_types_error_test.dart b/tests/lib_2/typed_data/restricted_types_error_test.dart
new file mode 100644
index 0000000..02b5721
--- /dev/null
+++ b/tests/lib_2/typed_data/restricted_types_error_test.dart
@@ -0,0 +1,361 @@
+// 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:typed_data';
+
+abstract class CEByteBuffer extends ByteBuffer {}
+// ^
+// [cfe] 'ByteBuffer' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CIByteBuffer implements ByteBuffer {}
+// ^
+// [cfe] 'ByteBuffer' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CMByteBuffer with ByteBuffer {}
+// ^
+// [cfe] 'ByteBuffer' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CETypedData extends TypedData {}
+// ^
+// [cfe] 'TypedData' is restricted and can't be extended or implemented.
+// ^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CITypedData implements TypedData {}
+// ^
+// [cfe] 'TypedData' is restricted and can't be extended or implemented.
+// ^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CMTypedData with TypedData {}
+// ^
+// [cfe] 'TypedData' is restricted and can't be extended or implemented.
+// ^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CIByteData implements ByteData {}
+// ^
+// [cfe] 'ByteData' is restricted and can't be extended or implemented.
+// ^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CMByteData with ByteData {}
+// ^
+// [cfe] 'ByteData' is restricted and can't be extended or implemented.
+// ^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CIInt8List implements Int8List {}
+// ^
+// [cfe] 'Int8List' is restricted and can't be extended or implemented.
+// ^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CMInt8List with Int8List {}
+// ^
+// [cfe] 'Int8List' is restricted and can't be extended or implemented.
+// ^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CIUint8List implements Uint8List {}
+// ^
+// [cfe] 'Uint8List' is restricted and can't be extended or implemented.
+// ^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CMUint8List with Uint8List {}
+// ^
+// [cfe] 'Uint8List' is restricted and can't be extended or implemented.
+// ^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class Uint8CIClampedList implements Uint8ClampedList {}
+// ^
+// [cfe] 'Uint8ClampedList' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class Uint8CMClampedList with Uint8ClampedList {}
+// ^
+// [cfe] 'Uint8ClampedList' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CIInt16List implements Int16List {}
+// ^
+// [cfe] 'Int16List' is restricted and can't be extended or implemented.
+// ^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CMInt16List with Int16List {}
+// ^
+// [cfe] 'Int16List' is restricted and can't be extended or implemented.
+// ^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CIUint16List implements Uint16List {}
+// ^
+// [cfe] 'Uint16List' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CMUint16List with Uint16List {}
+// ^
+// [cfe] 'Uint16List' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CIInt32List implements Int32List {}
+// ^
+// [cfe] 'Int32List' is restricted and can't be extended or implemented.
+// ^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CMInt32List with Int32List {}
+// ^
+// [cfe] 'Int32List' is restricted and can't be extended or implemented.
+// ^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CIUint32List implements Uint32List {}
+// ^
+// [cfe] 'Uint32List' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CMUint32List with Uint32List {}
+// ^
+// [cfe] 'Uint32List' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CIInt64List implements Int64List {}
+// ^
+// [cfe] 'Int64List' is restricted and can't be extended or implemented.
+// ^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CMInt64List with Int64List {}
+// ^
+// [cfe] 'Int64List' is restricted and can't be extended or implemented.
+// ^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CIUint64List implements Uint64List {}
+// ^
+// [cfe] 'Uint64List' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CMUint64List with Uint64List {}
+// ^
+// [cfe] 'Uint64List' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CIFloat32List implements Float32List {}
+// ^
+// [cfe] 'Float32List' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CMFloat32List with Float32List {}
+// ^
+// [cfe] 'Float32List' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CIFloat64List implements Float64List {}
+// ^
+// [cfe] 'Float64List' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CMFloat64List with Float64List {}
+// ^
+// [cfe] 'Float64List' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CIInt32x4List implements Int32x4List {}
+// ^
+// [cfe] 'Int32x4List' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CMInt32x4List with Int32x4List {}
+// ^
+// [cfe] 'Int32x4List' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CIFloat32x4List implements Float32x4List {}
+// ^
+// [cfe] 'Float32x4List' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CMFloat32x4List with Float32x4List {}
+// ^
+// [cfe] 'Float32x4List' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CIFloat64x2List implements Float64x2List {}
+// ^
+// [cfe] 'Float64x2List' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CMFloat64x2List with Float64x2List {}
+// ^
+// [cfe] 'Float64x2List' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CIInt32x4 implements Int32x4 {}
+// ^
+// [cfe] 'Int32x4' is restricted and can't be extended or implemented.
+// ^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CMInt32x4 with Int32x4 {}
+// ^
+// [cfe] 'Int32x4' is restricted and can't be extended or implemented.
+// ^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CIFloat32x4 implements Float32x4 {}
+// ^
+// [cfe] 'Float32x4' is restricted and can't be extended or implemented.
+// ^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CMFloat32x4 with Float32x4 {}
+// ^
+// [cfe] 'Float32x4' is restricted and can't be extended or implemented.
+// ^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CIFloat64x2 implements Float64x2 {}
+// ^
+// [cfe] 'Float64x2' is restricted and can't be extended or implemented.
+// ^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CMFloat64x2 with Float64x2 {}
+// ^
+// [cfe] 'Float64x2' is restricted and can't be extended or implemented.
+// ^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+// Endian cannot be used as a superclass or mixin.
+
+abstract class CIEndian implements Endian {}
+// ^
+// [cfe] 'Endian' is restricted and can't be extended or implemented.
+// ^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CIUnByteBufferView implements UnmodifiableByteBufferView {}
+// ^
+// [cfe] 'UnmodifiableByteBufferView' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^^^^^^^^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CIUnByteDataView implements UnmodifiableByteDataView {}
+// ^
+// [cfe] 'UnmodifiableByteDataView' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^^^^^^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CIUnInt8LV implements UnmodifiableInt8ListView {}
+// ^
+// [cfe] 'UnmodifiableInt8ListView' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^^^^^^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CIUnUint8LV implements UnmodifiableUint8ListView {}
+// ^
+// [cfe] 'UnmodifiableUint8ListView' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^^^^^^^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CIUnUint8ClampedLV implements UnmodifiableUint8ClampedListView {}
+// ^
+// [cfe] 'UnmodifiableUint8ClampedListView' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CIUnInt16LV implements UnmodifiableInt16ListView {}
+// ^
+// [cfe] 'UnmodifiableInt16ListView' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^^^^^^^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CIUnUint16LV implements UnmodifiableUint16ListView {}
+// ^
+// [cfe] 'UnmodifiableUint16ListView' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^^^^^^^^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CIUnInt32LV implements UnmodifiableInt32ListView {}
+// ^
+// [cfe] 'UnmodifiableInt32ListView' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^^^^^^^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CIUnUint32LV implements UnmodifiableUint32ListView {}
+// ^
+// [cfe] 'UnmodifiableUint32ListView' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^^^^^^^^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CIUnInt64LV implements UnmodifiableInt64ListView {}
+// ^
+// [cfe] 'UnmodifiableInt64ListView' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^^^^^^^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CIUnUint64LV implements UnmodifiableUint64ListView {}
+// ^
+// [cfe] 'UnmodifiableUint64ListView' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^^^^^^^^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CIUnFloat32LV implements UnmodifiableFloat32ListView {}
+// ^
+// [cfe] 'UnmodifiableFloat32ListView' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CIUnFloat64LV implements UnmodifiableFloat64ListView {}
+// ^
+// [cfe] 'UnmodifiableFloat64ListView' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CIUnInt32x4LV implements UnmodifiableInt32x4ListView {}
+// ^
+// [cfe] 'UnmodifiableInt32x4ListView' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CIUnFloat32x4LV implements UnmodifiableFloat32x4ListView {}
+// ^
+// [cfe] 'UnmodifiableFloat32x4ListView' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
+
+abstract class CIUnFloat64x2LV implements UnmodifiableFloat64x2ListView {}
+// ^
+// [cfe] 'UnmodifiableFloat64x2ListView' is restricted and can't be extended or implemented.
+// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_DISALLOWED_TYPE
diff --git a/third_party/devtools/update.sh b/third_party/devtools/update.sh
index 077d758..a69f6ee 100755
--- a/third_party/devtools/update.sh
+++ b/third_party/devtools/update.sh
@@ -30,11 +30,12 @@
# to serve from DDS.
mkdir cipd_package
cp -R packages/devtools/build/ cipd_package/web
+cp -r packages/devtools_server cipd_package
cp -r packages/devtools_shared cipd_package
cipd create \
-name dart/third_party/flutter/devtools \
-in cipd_package \
-install-mode copy \
- -tag git_revision:$1
+ -tag revision:$1
diff --git a/tools/VERSION b/tools/VERSION
index f487dbc..22a5d08 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
MAJOR 2
MINOR 14
PATCH 0
-PRERELEASE 84
+PRERELEASE 85
PRERELEASE_PATCH 0
\ No newline at end of file
diff --git a/tools/bots/test_matrix.json b/tools/bots/test_matrix.json
index bfa020b..bf63fe3 100644
--- a/tools/bots/test_matrix.json
+++ b/tools/bots/test_matrix.json
@@ -322,7 +322,6 @@
"xcodebuild/ReleaseSIMARM64C/",
"xcodebuild/ReleaseX64/",
"xcodebuild/ReleaseX64C/",
- "pkg/",
"samples/",
"samples_2/",
"samples-dev/",
@@ -330,7 +329,6 @@
"third_party/android_tools/sdk/platform-tools/adb",
"third_party/android_tools/ndk/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-android-strip",
"third_party/android_tools/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-strip",
- "third_party/devtools/",
"third_party/webdriver/",
"third_party/pkg/",
"third_party/pkg_tested/",
@@ -3381,6 +3379,21 @@
},
"steps": [
{
+ "name": "validate pkg/ pubspec files",
+ "script": "tools/sdks/dart-sdk/bin/dart",
+ "arguments": [
+ "tools/package_deps/bin/package_deps.dart"
+ ]
+ },
+ {
+ "name": "validate .dart_tool/package_config.json",
+ "script": "tools/sdks/dart-sdk/bin/dart",
+ "arguments": [
+ "tools/generate_package_config.dart",
+ "--check"
+ ]
+ },
+ {
"name": "build dart",
"script": "tools/build.py",
"arguments": [
@@ -3389,13 +3402,6 @@
]
},
{
- "name": "validate pkg/ pubspec files",
- "script": "out/ReleaseX64/dart-sdk/bin/dart",
- "arguments": [
- "tools/package_deps/bin/package_deps.dart"
- ]
- },
- {
"name": "validate SDK API docs",
"script": "out/ReleaseX64/dart-sdk/bin/dartdoc",
"arguments": [
diff --git a/tools/generate_package_config.dart b/tools/generate_package_config.dart
index 4cf47e0..8d4ed5b 100644
--- a/tools/generate_package_config.dart
+++ b/tools/generate_package_config.dart
@@ -57,8 +57,6 @@
packageDirectory(
'runtime/observatory_2/tests/service_2/observatory_test_package_2'),
packageDirectory('sdk/lib/_internal/sdk_library_metadata'),
- packageDirectory('third_party/devtools/devtools_server'),
- packageDirectory('third_party/devtools/devtools_shared'),
packageDirectory('third_party/pkg/protobuf/protobuf'),
packageDirectory('tools/package_deps'),
];
@@ -104,7 +102,8 @@
exit(0);
} else {
print("Package config out of date");
- print("Run `dart tools/generate_package_config.dart` to update");
+ print("Run `gclient sync -D && dart tools/generate_package_config.dart` "
+ "to update.");
exit(1);
}
}
diff --git a/tools/spec_parser/Dart.g b/tools/spec_parser/Dart.g
index 0da4bd2..f166720 100644
--- a/tools/spec_parser/Dart.g
+++ b/tools/spec_parser/Dart.g
@@ -1120,7 +1120,7 @@
;
partHeader
- : metadata PART OF identifier ('.' identifier)* ';'
+ : metadata PART OF (dottedIdentifierList | uri)';'
;
partDeclaration
diff --git a/utils/dartdev/BUILD.gn b/utils/dartdev/BUILD.gn
index 3ce3bc3..7f33d99 100644
--- a/utils/dartdev/BUILD.gn
+++ b/utils/dartdev/BUILD.gn
@@ -2,14 +2,12 @@
# 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("../../build/dart/copy_tree.gni")
import("../application_snapshot.gni")
group("dartdev") {
public_deps = [
":copy_dartdev_kernel",
":copy_dartdev_snapshot",
- ":copy_prebuilt_devtools",
]
}
@@ -41,15 +39,3 @@
deps = [ "../dds:dds" ]
output = "$root_gen_dir/dartdev.dart.snapshot"
}
-
-copy_trees("copy_prebuilt_devtools") {
- sources = [
- {
- target = "copy_prebuilt_devtools"
- visibility = [ ":dartdev" ]
- source = "../../third_party/devtools/web"
- dest = "$root_out_dir/devtools"
- ignore_patterns = "{}"
- },
- ]
-}