Version 2.17.0-257.0.dev
Merge commit 'd087f0334d5e5d98ee5346d6c7fc9f2de09e79d2' into 'dev'
diff --git a/pkg/analysis_server/lib/src/context_manager.dart b/pkg/analysis_server/lib/src/context_manager.dart
index 326c869..a7ea8fd 100644
--- a/pkg/analysis_server/lib/src/context_manager.dart
+++ b/pkg/analysis_server/lib/src/context_manager.dart
@@ -484,7 +484,9 @@
}
var optionsFile = analysisContext.contextRoot.optionsFile;
- if (optionsFile != null) {
+
+ if (optionsFile != null &&
+ analysisContext.contextRoot.isAnalyzed(optionsFile.path)) {
_analyzeAnalysisOptionsYaml(driver, optionsFile.path);
}
@@ -497,7 +499,8 @@
var pubspecFile =
rootFolder.getChildAssumingFile(file_paths.pubspecYaml);
- if (pubspecFile.exists) {
+ if (pubspecFile.exists &&
+ analysisContext.contextRoot.isAnalyzed(pubspecFile.path)) {
_analyzePubspecYaml(driver, pubspecFile.path);
}
}
diff --git a/pkg/analysis_server/test/domain_analysis_test.dart b/pkg/analysis_server/test/domain_analysis_test.dart
index 1ad43e5..8705302 100644
--- a/pkg/analysis_server/test/domain_analysis_test.dart
+++ b/pkg/analysis_server/test/domain_analysis_test.dart
@@ -1223,6 +1223,30 @@
]);
}
+ Future<void> test_setRoots_notDartFile_analysisOptions_excluded() async {
+ deleteTestPackageAnalysisOptionsFile();
+ var a_path = '$testPackageLibPath/a.dart';
+ var options_path = '$testPackageRootPath/analysis_options.yaml';
+
+ newFile2(a_path, 'error');
+
+ // 'analysis_options.yaml' that has an error and excludes itself.
+ newFile2(options_path, '''
+analyzer:
+ exclude:
+ - analysis_options.yaml
+ error:
+''');
+
+ await setRoots(included: [workspaceRootPath], excluded: []);
+ await server.onAnalysisComplete;
+
+ _assertAnalyzedFiles(
+ hasErrors: [a_path],
+ notAnalyzed: [options_path],
+ );
+ }
+
Future<void> test_setRoots_notDartFile_androidManifestXml() async {
var path = '$testPackageRootPath/AndroidManifest.xml';
@@ -1253,6 +1277,35 @@
assertHasErrors(path);
}
+ Future<void> test_setRoots_notDartFile_pubspec_excluded() async {
+ deleteTestPackageAnalysisOptionsFile();
+ var a_path = '$testPackageLibPath/a.dart';
+ var pubspec_path = '$testPackageRootPath/pubspec.yaml';
+ var options_path = '$testPackageRootPath/analysis_options.yaml';
+
+ newFile2(a_path, 'error');
+
+ writeTestPackagePubspecYamlFile('''
+name:
+ - error
+''');
+
+ // 'analysis_options.yaml' that excludes pubspec.yaml.
+ newFile2(options_path, '''
+analyzer:
+ exclude:
+ - pubspec.yaml
+''');
+
+ await setRoots(included: [workspaceRootPath], excluded: []);
+ await server.onAnalysisComplete;
+
+ _assertAnalyzedFiles(
+ hasErrors: [a_path],
+ notAnalyzed: [pubspec_path],
+ );
+ }
+
Future<void> test_setRoots_packageConfigJsonFile() async {
var aaaRootPath = '/packages/aaa';
var a_path = '$aaaRootPath/lib/a.dart';
diff --git a/pkg/analyzer/test/src/dart/analysis/context_root_test.dart b/pkg/analyzer/test/src/dart/analysis/context_root_test.dart
index 7f8f853..95d12bc 100644
--- a/pkg/analyzer/test/src/dart/analysis/context_root_test.dart
+++ b/pkg/analyzer/test/src/dart/analysis/context_root_test.dart
@@ -113,6 +113,26 @@
);
}
+ test_isAnalyzed_explicitlyExcluded_byFile() {
+ var excludePath = convertPath('/test/root/exclude/c.dart');
+ var siblingPath = convertPath('/test/root/exclude/d.dart');
+ contextRoot.excluded.add(newFile2(excludePath, ''));
+ expect(contextRoot.isAnalyzed(excludePath), isFalse);
+ expect(contextRoot.isAnalyzed(siblingPath), isTrue);
+ }
+
+ test_isAnalyzed_explicitlyExcluded_byFile_analysisOptions() {
+ var excludePath = convertPath('/test/root/analysis_options.yaml');
+ contextRoot.excluded.add(newFile2(excludePath, ''));
+ expect(contextRoot.isAnalyzed(excludePath), isFalse);
+ }
+
+ test_isAnalyzed_explicitlyExcluded_byFile_pubspec() {
+ var excludePath = convertPath('/test/root/pubspec.yaml');
+ contextRoot.excluded.add(newFile2(excludePath, ''));
+ expect(contextRoot.isAnalyzed(excludePath), isFalse);
+ }
+
test_isAnalyzed_explicitlyExcluded_byFolder() {
String excludePath = convertPath('/test/root/exclude');
String filePath = convertPath('/test/root/exclude/root.dart');
diff --git a/pkg/dds/test/devtools_server/devtools_server_driver.dart b/pkg/dds/test/devtools_server/devtools_server_driver.dart
index a5d44b8..9f56b81 100644
--- a/pkg/dds/test/devtools_server/devtools_server_driver.dart
+++ b/pkg/dds/test/devtools_server/devtools_server_driver.dart
@@ -66,7 +66,7 @@
final script =
Platform.script.resolveUri(Uri.parse('./serve_devtools.dart'));
final args = [
- script.path,
+ script.toFilePath(),
'--machine',
'--port',
'$port',
@@ -202,7 +202,7 @@
Future<void> startApp() async {
final appUri = Platform.script
.resolveUri(Uri.parse('../fixtures/empty_dart_app.dart'));
- appFixture = await CliAppFixture.create(appUri.path);
+ appFixture = await CliAppFixture.create(appUri.toFilePath());
// Track services method names as they're registered.
appFixture.serviceConnection
diff --git a/pkg/dds/test/devtools_server/serve_devtools.dart b/pkg/dds/test/devtools_server/serve_devtools.dart
index e44c4f8..7fbd12c 100644
--- a/pkg/dds/test/devtools_server/serve_devtools.dart
+++ b/pkg/dds/test/devtools_server/serve_devtools.dart
@@ -12,7 +12,7 @@
unawaited(
DevToolsServer().serveDevToolsWithArgs(
args,
- customDevToolsPath: devtoolsAppUri(prefix: '../../../../').path,
+ customDevToolsPath: devtoolsAppUri(prefix: '../../../../').toFilePath(),
),
);
}
diff --git a/pkg/dev_compiler/lib/src/js_ast/builder.dart b/pkg/dev_compiler/lib/src/js_ast/builder.dart
index 6ba6a81..5f0c23e 100644
--- a/pkg/dev_compiler/lib/src/js_ast/builder.dart
+++ b/pkg/dev_compiler/lib/src/js_ast/builder.dart
@@ -2,14 +2,11 @@
// 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.
-// ignore_for_file: always_declare_return_types
// ignore_for_file: library_prefixes
// ignore_for_file: non_constant_identifier_names
// ignore_for_file: omit_local_variable_types
-// ignore_for_file: prefer_collection_literals
// ignore_for_file: prefer_single_quotes
// ignore_for_file: unnecessary_brace_in_string_interps
-// ignore_for_file: unnecessary_new
/// Utilities for building JS ASTs at runtime. Contains a builder class and a
/// parser that parses part of the language.
@@ -325,7 +322,7 @@
return string(value, quote);
}
- var sb = new StringBuffer();
+ var sb = StringBuffer();
for (int rune in value.runes) {
final escape = _irregularEscape(rune, quote);
@@ -398,7 +395,7 @@
LiteralNumber number(num value) => LiteralNumber('$value');
LiteralNumber uint64(int value) {
- BigInt uint64Value = new BigInt.from(value).toUnsigned(64);
+ BigInt uint64Value = BigInt.from(value).toUnsigned(64);
return LiteralNumber('$uint64Value');
}
@@ -640,7 +637,7 @@
'/': 5,
'%': 5
};
- static final UNARY_OPERATORS = [
+ static final UNARY_OPERATORS = {
'++',
'--',
'+',
@@ -651,12 +648,12 @@
'void',
'delete',
'await'
- ].toSet();
+ };
static final ARROW_TOKEN = '=>';
static final ELLIPSIS_TOKEN = '...';
- static final OPERATORS_THAT_LOOK_LIKE_IDENTIFIERS = [
+ static final OPERATORS_THAT_LOOK_LIKE_IDENTIFIERS = {
'typeof',
'void',
'delete',
@@ -664,7 +661,7 @@
'instanceof',
'await',
'extends'
- ].toSet();
+ };
static int category(int code) {
if (code >= CATEGORIES.length) return OTHER;
diff --git a/pkg/dev_compiler/lib/src/js_ast/js_ast.dart b/pkg/dev_compiler/lib/src/js_ast/js_ast.dart
index d059a14..7fc3091 100644
--- a/pkg/dev_compiler/lib/src/js_ast/js_ast.dart
+++ b/pkg/dev_compiler/lib/src/js_ast/js_ast.dart
@@ -2,13 +2,9 @@
// 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
-
-// ignore_for_file: directives_ordering
-
library js_ast;
-export 'nodes.dart';
export 'builder.dart';
+export 'nodes.dart';
export 'printer.dart';
export 'template.dart';
diff --git a/pkg/dev_compiler/lib/src/js_ast/nodes.dart b/pkg/dev_compiler/lib/src/js_ast/nodes.dart
index cb6c11d..9d29e05 100644
--- a/pkg/dev_compiler/lib/src/js_ast/nodes.dart
+++ b/pkg/dev_compiler/lib/src/js_ast/nodes.dart
@@ -3,10 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
// ignore_for_file: always_declare_return_types
-// ignore_for_file: always_require_non_null_named_parameters
// ignore_for_file: omit_local_variable_types
-// ignore_for_file: prefer_final_fields
-// ignore_for_file: prefer_initializing_formals
// ignore_for_file: prefer_single_quotes
// ignore_for_file: unnecessary_this
@@ -1124,9 +1121,7 @@
class SimpleBindingPattern extends BindingPattern {
final Identifier name;
- SimpleBindingPattern(Identifier name)
- : name = name,
- super([DestructuredVariable(name: name)]);
+ SimpleBindingPattern(this.name) : super([DestructuredVariable(name: name)]);
@override
T accept<T>(NodeVisitor<T> visitor) =>
@@ -1406,7 +1401,7 @@
throw ArgumentError.value(name, "name", "not a valid identifier");
}
}
- static RegExp _identifierRE = RegExp(r'^[A-Za-z_$][A-Za-z_$0-9]*$');
+ static final RegExp _identifierRE = RegExp(r'^[A-Za-z_$][A-Za-z_$0-9]*$');
@override
bool shadows(Set<String> names) => names.contains(name);
diff --git a/pkg/dev_compiler/lib/src/js_ast/printer.dart b/pkg/dev_compiler/lib/src/js_ast/printer.dart
index adddaae..7a97ad3 100644
--- a/pkg/dev_compiler/lib/src/js_ast/printer.dart
+++ b/pkg/dev_compiler/lib/src/js_ast/printer.dart
@@ -5,13 +5,10 @@
// ignore_for_file: always_declare_return_types
// ignore_for_file: library_prefixes
// ignore_for_file: omit_local_variable_types
-// ignore_for_file: prefer_collection_literals
-// ignore_for_file: prefer_final_fields
// ignore_for_file: prefer_initializing_formals
// ignore_for_file: prefer_interpolation_to_compose_strings
// ignore_for_file: prefer_is_not_empty
// ignore_for_file: prefer_single_quotes
-// ignore_for_file: unnecessary_const
// ignore_for_file: use_function_type_syntax_for_parameters
library js_ast.printer;
@@ -89,7 +86,7 @@
// The current indentation level.
int _indentLevel = 0;
// A cache of all indentation strings used so far.
- List<String> _indentList = <String>[""];
+ final List<String> _indentList = [""];
/// Whether the next call to [indent] should just be a no-op.
bool _skipNextIndent = false;
@@ -610,15 +607,15 @@
out(")");
switch (fun.asyncModifier) {
- case const AsyncModifier.sync():
+ case AsyncModifier.sync():
break;
- case const AsyncModifier.async():
+ case AsyncModifier.async():
out(' async');
break;
- case const AsyncModifier.syncStar():
+ case AsyncModifier.syncStar():
out(' sync*');
break;
- case const AsyncModifier.asyncStar():
+ case AsyncModifier.asyncStar():
out(' async*');
break;
}
@@ -1452,8 +1449,8 @@
VarCollector()
: nested = false,
- vars = Set<String>(),
- params = Set<String>();
+ vars = {},
+ params = {};
void forEachVar(void fn(String v)) => vars.forEach(fn);
void forEachParam(void fn(String p)) => params.forEach(fn);
@@ -1632,7 +1629,7 @@
void enterScope(Node node) {
var vars = VarCollector();
node.accept(vars);
- maps.add(Map<String, String>());
+ maps.add({});
variableNumberStack.add(variableNumber);
parameterNumberStack.add(parameterNumber);
vars.forEachVar(declareVariable);
diff --git a/pkg/dev_compiler/lib/src/js_ast/template.dart b/pkg/dev_compiler/lib/src/js_ast/template.dart
index 9ceb51f..22d76d7 100644
--- a/pkg/dev_compiler/lib/src/js_ast/template.dart
+++ b/pkg/dev_compiler/lib/src/js_ast/template.dart
@@ -3,20 +3,17 @@
// BSD-style license that can be found in the LICENSE file.
// ignore_for_file: always_declare_return_types
-// ignore_for_file: avoid_returning_null_for_void
// ignore_for_file: omit_local_variable_types
-// ignore_for_file: prefer_collection_literals
// ignore_for_file: prefer_generic_function_type_aliases
// ignore_for_file: prefer_single_quotes
-// ignore_for_file: unnecessary_this
library js_ast.template;
import 'nodes.dart';
class TemplateManager {
- Map<String, Template> expressionTemplates = Map<String, Template>();
- Map<String, Template> statementTemplates = Map<String, Template>();
+ Map<String, Template> expressionTemplates = {};
+ Map<String, Template> statementTemplates = {};
TemplateManager();
@@ -817,13 +814,13 @@
@override
Instantiator<ArrayBindingPattern> visitArrayBindingPattern(
ArrayBindingPattern node) {
- List<Instantiator> makeVars = node.variables.map(this.visit).toList();
+ List<Instantiator> makeVars = node.variables.map(visit).toList();
return (a) => ArrayBindingPattern(splayNodes(makeVars, a));
}
@override
Instantiator visitObjectBindingPattern(ObjectBindingPattern node) {
- List<Instantiator> makeVars = node.variables.map(this.visit).toList();
+ List<Instantiator> makeVars = node.variables.map(visit).toList();
return (a) => ObjectBindingPattern(splayNodes(makeVars, a));
}
@@ -835,8 +832,8 @@
/// InterpolatedNodeAnalysis determines which AST trees contain
/// [InterpolatedNode]s, and the names of the named interpolated nodes.
class InterpolatedNodeAnalysis extends BaseVisitorVoid {
- final Set<Node> containsInterpolatedNode = Set<Node>();
- final Set<String> holeNames = Set<String>();
+ final Set<Node> containsInterpolatedNode = {};
+ final Set<String> holeNames = {};
int count = 0;
InterpolatedNodeAnalysis();
@@ -853,7 +850,6 @@
int before = count;
node.visitChildren(this);
if (count != before) containsInterpolatedNode.add(node);
- return null;
}
@override
diff --git a/pkg/dev_compiler/test/js/builder_test.dart b/pkg/dev_compiler/test/js/builder_test.dart
index acfb55c..9a1ac18 100644
--- a/pkg/dev_compiler/test/js/builder_test.dart
+++ b/pkg/dev_compiler/test/js/builder_test.dart
@@ -1,5 +1,3 @@
-// @dart = 2.9
-
import 'package:dev_compiler/src/js_ast/js_ast.dart';
import 'package:test/test.dart';
diff --git a/pkg/front_end/lib/src/fasta/source/source_constructor_builder.dart b/pkg/front_end/lib/src/fasta/source/source_constructor_builder.dart
index c433a3e..15e3b74 100644
--- a/pkg/front_end/lib/src/fasta/source/source_constructor_builder.dart
+++ b/pkg/front_end/lib/src/fasta/source/source_constructor_builder.dart
@@ -320,31 +320,6 @@
ConstructorBuilder? superTargetBuilder =
_computeSuperTargetBuilder(initializers);
- Constructor superTarget;
- List<FormalParameterBuilder>? superFormals;
- if (superTargetBuilder is DeclaredSourceConstructorBuilder) {
- superTarget = superTargetBuilder.constructor;
- superFormals = superTargetBuilder.formals!;
- } else if (superTargetBuilder is DillConstructorBuilder) {
- superTarget = superTargetBuilder.constructor;
- if (superTargetBuilder is SyntheticSourceConstructorBuilder) {
- superFormals = superTargetBuilder.formals;
- } else {
- // The error in this case should be reported elsewhere. Here we perform
- // a simple recovery.
- return performRecoveryForErroneousCase();
- }
- } else {
- // The error in this case should be reported elsewhere. Here we perform a
- // simple recovery.
- return performRecoveryForErroneousCase();
- }
-
- if (superFormals == null) {
- // The error in this case should be reported elsewhere. Here we perform a
- // simple recovery.
- return performRecoveryForErroneousCase();
- }
if (superTargetBuilder is DeclaredSourceConstructorBuilder) {
superTargetBuilder.inferFormalTypes(typeEnvironment);
@@ -356,6 +331,58 @@
}
}
+ Constructor superTarget;
+ List<FormalParameterBuilder>? superFormals;
+ FunctionNode? superConstructorFunction;
+ if (superTargetBuilder is DeclaredSourceConstructorBuilder) {
+ superTarget = superTargetBuilder.constructor;
+ superFormals = superTargetBuilder.formals!;
+ } else if (superTargetBuilder is DillConstructorBuilder) {
+ superTarget = superTargetBuilder.constructor;
+ if (superTargetBuilder is SyntheticSourceConstructorBuilder) {
+ superFormals = superTargetBuilder.formals;
+ } else {
+ superConstructorFunction = superTargetBuilder.function;
+ }
+ } else {
+ // The error in this case should be reported elsewhere. Here we perform a
+ // simple recovery.
+ return performRecoveryForErroneousCase();
+ }
+
+ List<DartType?> positionalSuperFormalType = [];
+ List<bool> positionalSuperFormalHasInitializer = [];
+ Map<String, DartType?> namedSuperFormalType = {};
+ Map<String, bool> namedSuperFormalHasInitializer = {};
+ if (superFormals != null) {
+ for (FormalParameterBuilder formal in superFormals) {
+ if (formal.isPositional) {
+ positionalSuperFormalType.add(formal.variable?.type);
+ positionalSuperFormalHasInitializer
+ .add(formal.hasDeclaredInitializer);
+ } else {
+ namedSuperFormalType[formal.name] = formal.variable?.type;
+ namedSuperFormalHasInitializer[formal.name] =
+ formal.hasDeclaredInitializer;
+ }
+ }
+ } else if (superConstructorFunction != null) {
+ for (VariableDeclaration formal
+ in superConstructorFunction.positionalParameters) {
+ positionalSuperFormalType.add(formal.type);
+ positionalSuperFormalHasInitializer.add(formal.initializer != null);
+ }
+ for (VariableDeclaration formal
+ in superConstructorFunction.namedParameters) {
+ namedSuperFormalType[formal.name!] = formal.type;
+ namedSuperFormalHasInitializer[formal.name!] =
+ formal.initializer != null;
+ }
+ } else {
+ // The error is reported elsewhere.
+ return performRecoveryForErroneousCase();
+ }
+
int superInitializingFormalIndex = -1;
List<int?>? positionalSuperParameters;
List<String>? namedSuperParameters;
@@ -373,33 +400,30 @@
superInitializingFormalIndex++;
bool hasImmediatelyDeclaredInitializer = formal.hasDeclaredInitializer;
- FormalParameterBuilder? correspondingSuperFormal;
-
+ DartType? correspondingSuperFormalType;
if (formal.isPositional) {
- if (superInitializingFormalIndex < superFormals.length) {
- correspondingSuperFormal =
- superFormals[superInitializingFormalIndex];
+ assert(positionalSuperFormalHasInitializer.length ==
+ positionalSuperFormalType.length);
+ if (superInitializingFormalIndex <
+ positionalSuperFormalHasInitializer.length) {
formal.hasDeclaredInitializer = hasImmediatelyDeclaredInitializer ||
- correspondingSuperFormal.hasDeclaredInitializer;
+ positionalSuperFormalHasInitializer[
+ superInitializingFormalIndex];
+ correspondingSuperFormalType =
+ positionalSuperFormalType[superInitializingFormalIndex];
if (!hasImmediatelyDeclaredInitializer && !formal.isRequired) {
(positionalSuperParameters ??= <int?>[]).add(formalIndex);
} else {
(positionalSuperParameters ??= <int?>[]).add(null);
}
} else {
- // TODO(cstefantsova): Report an error.
+ // The error is reported elsewhere.
}
} else {
- for (FormalParameterBuilder superFormal in superFormals) {
- if (superFormal.isNamed && superFormal.name == formal.name) {
- correspondingSuperFormal = superFormal;
- break;
- }
- }
-
- if (correspondingSuperFormal != null) {
+ if (namedSuperFormalHasInitializer[formal.name] != null) {
formal.hasDeclaredInitializer = hasImmediatelyDeclaredInitializer ||
- correspondingSuperFormal.hasDeclaredInitializer;
+ namedSuperFormalHasInitializer[formal.name]!;
+ correspondingSuperFormalType = namedSuperFormalType[formal.name];
if (!hasImmediatelyDeclaredInitializer && !formal.isNamedRequired) {
(namedSuperParameters ??= <String>[]).add(formal.name);
}
@@ -409,7 +433,7 @@
}
if (formal.type == null) {
- DartType? type = correspondingSuperFormal?.variable?.type;
+ DartType? type = correspondingSuperFormalType;
if (substitution.isNotEmpty && type != null) {
type = substitute(type, substitution);
}
diff --git a/pkg/front_end/testcases/incremental/super_key.yaml b/pkg/front_end/testcases/incremental/super_key.yaml
new file mode 100644
index 0000000..df78096
--- /dev/null
+++ b/pkg/front_end/testcases/incremental/super_key.yaml
@@ -0,0 +1,49 @@
+# Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE.md file.
+
+type: newworld
+target: DDC
+trackWidgetCreation: true
+worlds:
+ - entry: main.dart
+ sources:
+ main.dart: |
+ import 'package:flutter/src/widgets/framework.dart';
+ flutter/lib/src/widgets/framework.dart: |
+ abstract class Bar {
+ const Bar();
+ }
+ abstract class Widget extends Bar {
+ const Widget();
+ }
+ class Key {}
+ class StatefulWidget extends Widget {
+ final Key? key;
+
+ const StatefulWidget({this.key});
+ }
+ .dart_tool/package_config.json: |
+ {
+ "configVersion": 2,
+ "packages": [
+ {
+ "name": "flutter",
+ "rootUri": "../flutter",
+ "packageUri": "lib/"
+ }
+ ]
+ }
+ expectedLibraryCount: 2
+ - entry: main.dart
+ worldType: updated
+ invalidate:
+ - main.dart
+ expectInitializeFromDill: false
+ sources:
+ main.dart: |
+ import 'package:flutter/src/widgets/framework.dart';
+ class GalleryApp extends StatefulWidget {
+ const GalleryApp({super.key});
+ }
+ expectedLibraryCount: 2
diff --git a/pkg/front_end/testcases/incremental/super_key.yaml.world.1.expect b/pkg/front_end/testcases/incremental/super_key.yaml.world.1.expect
new file mode 100644
index 0000000..e84e96d
--- /dev/null
+++ b/pkg/front_end/testcases/incremental/super_key.yaml.world.1.expect
@@ -0,0 +1,37 @@
+main = <No Member>;
+library from "package:flutter/src/widgets/framework.dart" as fra {
+
+ abstract class Bar extends dart.core::Object /*hasConstConstructor*/ {
+ const constructor •() → fra::Bar
+ : super dart.core::Object::•()
+ ;
+ }
+ abstract class Widget extends fra::Bar /*hasConstConstructor*/ {
+ const constructor •() → fra::Widget
+ : super fra::Bar::•()
+ ;
+ }
+ class Key extends dart.core::Object {
+ synthetic constructor •() → fra::Key
+ : super dart.core::Object::•()
+ ;
+ static method _#new#tearOff() → fra::Key
+ return new fra::Key::•();
+ }
+ class StatefulWidget extends fra::Widget /*hasConstConstructor*/ {
+ final field fra::Key? key;
+ const constructor •({fra::Key? key = #C1}) → fra::StatefulWidget
+ : fra::StatefulWidget::key = key, super fra::Widget::•()
+ ;
+ static method _#new#tearOff({fra::Key? key = #C1}) → fra::StatefulWidget
+ return new fra::StatefulWidget::•(key: key);
+ }
+}
+library from "org-dartlang-test:///main.dart" as main {
+
+ import "package:flutter/src/widgets/framework.dart";
+
+}
+constants {
+ #C1 = null
+}
diff --git a/pkg/front_end/testcases/incremental/super_key.yaml.world.2.expect b/pkg/front_end/testcases/incremental/super_key.yaml.world.2.expect
new file mode 100644
index 0000000..09116a0
--- /dev/null
+++ b/pkg/front_end/testcases/incremental/super_key.yaml.world.2.expect
@@ -0,0 +1,44 @@
+main = <No Member>;
+library from "package:flutter/src/widgets/framework.dart" as fra {
+
+ abstract class Bar extends dart.core::Object /*hasConstConstructor*/ {
+ const constructor •() → fra::Bar
+ : super dart.core::Object::•()
+ ;
+ }
+ abstract class Widget extends fra::Bar /*hasConstConstructor*/ {
+ const constructor •() → fra::Widget
+ : super fra::Bar::•()
+ ;
+ }
+ class Key extends dart.core::Object {
+ synthetic constructor •() → fra::Key
+ : super dart.core::Object::•()
+ ;
+ static method _#new#tearOff() → fra::Key
+ return new fra::Key::•();
+ }
+ class StatefulWidget extends fra::Widget /*hasConstConstructor*/ {
+ final field fra::Key? key;
+ const constructor •({fra::Key? key = #C1}) → fra::StatefulWidget
+ : fra::StatefulWidget::key = key, super fra::Widget::•()
+ ;
+ static method _#new#tearOff({fra::Key? key = #C1}) → fra::StatefulWidget
+ return new fra::StatefulWidget::•(key: key);
+ }
+}
+library from "org-dartlang-test:///main.dart" as main {
+
+ import "package:flutter/src/widgets/framework.dart";
+
+ class GalleryApp extends fra::StatefulWidget /*hasConstConstructor*/ {
+ const constructor •({fra::Key? key = #C1}) → main::GalleryApp
+ : super fra::StatefulWidget::•(key: key)
+ ;
+ static method _#new#tearOff({fra::Key? key}) → main::GalleryApp
+ return new main::GalleryApp::•(key: key);
+ }
+}
+constants {
+ #C1 = null
+}
diff --git a/pkg/front_end/testcases/super_parameters/super_key/main.dart b/pkg/front_end/testcases/super_parameters/super_key/main.dart
new file mode 100644
index 0000000..4081eaf
--- /dev/null
+++ b/pkg/front_end/testcases/super_parameters/super_key/main.dart
@@ -0,0 +1,7 @@
+import 'main_lib.dart';
+
+class GalleryApp extends StatefulWidget {
+ const GalleryApp({super.key});
+}
+
+main() {}
diff --git a/pkg/front_end/testcases/super_parameters/super_key/main.dart.strong.expect b/pkg/front_end/testcases/super_parameters/super_key/main.dart.strong.expect
new file mode 100644
index 0000000..9afb427
--- /dev/null
+++ b/pkg/front_end/testcases/super_parameters/super_key/main.dart.strong.expect
@@ -0,0 +1,32 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+import "main_lib.dart" as mai;
+
+import "org-dartlang-testcase:///main_lib.dart";
+
+class GalleryApp extends mai::StatefulWidget /*hasConstConstructor*/ {
+ const constructor •({mai::Key? key = #C1}) → self::GalleryApp
+ : super mai::StatefulWidget::•(key: key)
+ ;
+}
+static method main() → dynamic {}
+
+library /*isNonNullableByDefault*/;
+import self as mai;
+import "dart:core" as core;
+
+class Key extends core::Object {
+ synthetic constructor •() → mai::Key
+ : super core::Object::•()
+ ;
+}
+class StatefulWidget extends core::Object /*hasConstConstructor*/ {
+ final field mai::Key? key;
+ const constructor •({mai::Key? key = #C1}) → mai::StatefulWidget
+ : mai::StatefulWidget::key = key, super core::Object::•()
+ ;
+}
+
+constants {
+ #C1 = null
+}
diff --git a/pkg/front_end/testcases/super_parameters/super_key/main.dart.strong.transformed.expect b/pkg/front_end/testcases/super_parameters/super_key/main.dart.strong.transformed.expect
new file mode 100644
index 0000000..9afb427
--- /dev/null
+++ b/pkg/front_end/testcases/super_parameters/super_key/main.dart.strong.transformed.expect
@@ -0,0 +1,32 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+import "main_lib.dart" as mai;
+
+import "org-dartlang-testcase:///main_lib.dart";
+
+class GalleryApp extends mai::StatefulWidget /*hasConstConstructor*/ {
+ const constructor •({mai::Key? key = #C1}) → self::GalleryApp
+ : super mai::StatefulWidget::•(key: key)
+ ;
+}
+static method main() → dynamic {}
+
+library /*isNonNullableByDefault*/;
+import self as mai;
+import "dart:core" as core;
+
+class Key extends core::Object {
+ synthetic constructor •() → mai::Key
+ : super core::Object::•()
+ ;
+}
+class StatefulWidget extends core::Object /*hasConstConstructor*/ {
+ final field mai::Key? key;
+ const constructor •({mai::Key? key = #C1}) → mai::StatefulWidget
+ : mai::StatefulWidget::key = key, super core::Object::•()
+ ;
+}
+
+constants {
+ #C1 = null
+}
diff --git a/pkg/front_end/testcases/super_parameters/super_key/main.dart.textual_outline.expect b/pkg/front_end/testcases/super_parameters/super_key/main.dart.textual_outline.expect
new file mode 100644
index 0000000..4081eaf
--- /dev/null
+++ b/pkg/front_end/testcases/super_parameters/super_key/main.dart.textual_outline.expect
@@ -0,0 +1,7 @@
+import 'main_lib.dart';
+
+class GalleryApp extends StatefulWidget {
+ const GalleryApp({super.key});
+}
+
+main() {}
diff --git a/pkg/front_end/testcases/super_parameters/super_key/main.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/super_parameters/super_key/main.dart.textual_outline_modelled.expect
new file mode 100644
index 0000000..4081eaf
--- /dev/null
+++ b/pkg/front_end/testcases/super_parameters/super_key/main.dart.textual_outline_modelled.expect
@@ -0,0 +1,7 @@
+import 'main_lib.dart';
+
+class GalleryApp extends StatefulWidget {
+ const GalleryApp({super.key});
+}
+
+main() {}
diff --git a/pkg/front_end/testcases/super_parameters/super_key/main.dart.weak.expect b/pkg/front_end/testcases/super_parameters/super_key/main.dart.weak.expect
new file mode 100644
index 0000000..9afb427
--- /dev/null
+++ b/pkg/front_end/testcases/super_parameters/super_key/main.dart.weak.expect
@@ -0,0 +1,32 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+import "main_lib.dart" as mai;
+
+import "org-dartlang-testcase:///main_lib.dart";
+
+class GalleryApp extends mai::StatefulWidget /*hasConstConstructor*/ {
+ const constructor •({mai::Key? key = #C1}) → self::GalleryApp
+ : super mai::StatefulWidget::•(key: key)
+ ;
+}
+static method main() → dynamic {}
+
+library /*isNonNullableByDefault*/;
+import self as mai;
+import "dart:core" as core;
+
+class Key extends core::Object {
+ synthetic constructor •() → mai::Key
+ : super core::Object::•()
+ ;
+}
+class StatefulWidget extends core::Object /*hasConstConstructor*/ {
+ final field mai::Key? key;
+ const constructor •({mai::Key? key = #C1}) → mai::StatefulWidget
+ : mai::StatefulWidget::key = key, super core::Object::•()
+ ;
+}
+
+constants {
+ #C1 = null
+}
diff --git a/pkg/front_end/testcases/super_parameters/super_key/main.dart.weak.modular.expect b/pkg/front_end/testcases/super_parameters/super_key/main.dart.weak.modular.expect
new file mode 100644
index 0000000..816dc6b
--- /dev/null
+++ b/pkg/front_end/testcases/super_parameters/super_key/main.dart.weak.modular.expect
@@ -0,0 +1,16 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+import "main_lib.dart" as mai;
+
+import "org-dartlang-testcase:///main_lib.dart";
+
+class GalleryApp extends mai::StatefulWidget /*hasConstConstructor*/ {
+ const constructor •({mai::Key? key = #C1}) → self::GalleryApp
+ : super mai::StatefulWidget::•(key: key)
+ ;
+}
+static method main() → dynamic {}
+
+constants {
+ #C1 = null
+}
diff --git a/pkg/front_end/testcases/super_parameters/super_key/main.dart.weak.outline.expect b/pkg/front_end/testcases/super_parameters/super_key/main.dart.weak.outline.expect
new file mode 100644
index 0000000..76d37eb
--- /dev/null
+++ b/pkg/front_end/testcases/super_parameters/super_key/main.dart.weak.outline.expect
@@ -0,0 +1,28 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+import "main_lib.dart" as mai;
+
+import "org-dartlang-testcase:///main_lib.dart";
+
+class GalleryApp extends mai::StatefulWidget /*hasConstConstructor*/ {
+ const constructor •({mai::Key? key}) → self::GalleryApp
+ : super mai::StatefulWidget::•(key: key)
+ ;
+}
+static method main() → dynamic
+ ;
+
+library /*isNonNullableByDefault*/;
+import self as mai;
+import "dart:core" as core;
+
+class Key extends core::Object {
+ synthetic constructor •() → mai::Key
+ ;
+}
+class StatefulWidget extends core::Object /*hasConstConstructor*/ {
+ final field mai::Key? key;
+ const constructor •({mai::Key? key}) → mai::StatefulWidget
+ : mai::StatefulWidget::key = key, super core::Object::•()
+ ;
+}
diff --git a/pkg/front_end/testcases/super_parameters/super_key/main.dart.weak.transformed.expect b/pkg/front_end/testcases/super_parameters/super_key/main.dart.weak.transformed.expect
new file mode 100644
index 0000000..9afb427
--- /dev/null
+++ b/pkg/front_end/testcases/super_parameters/super_key/main.dart.weak.transformed.expect
@@ -0,0 +1,32 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+import "main_lib.dart" as mai;
+
+import "org-dartlang-testcase:///main_lib.dart";
+
+class GalleryApp extends mai::StatefulWidget /*hasConstConstructor*/ {
+ const constructor •({mai::Key? key = #C1}) → self::GalleryApp
+ : super mai::StatefulWidget::•(key: key)
+ ;
+}
+static method main() → dynamic {}
+
+library /*isNonNullableByDefault*/;
+import self as mai;
+import "dart:core" as core;
+
+class Key extends core::Object {
+ synthetic constructor •() → mai::Key
+ : super core::Object::•()
+ ;
+}
+class StatefulWidget extends core::Object /*hasConstConstructor*/ {
+ final field mai::Key? key;
+ const constructor •({mai::Key? key = #C1}) → mai::StatefulWidget
+ : mai::StatefulWidget::key = key, super core::Object::•()
+ ;
+}
+
+constants {
+ #C1 = null
+}
diff --git a/pkg/front_end/testcases/super_parameters/super_key/main_lib.dart b/pkg/front_end/testcases/super_parameters/super_key/main_lib.dart
new file mode 100644
index 0000000..f6ee73d
--- /dev/null
+++ b/pkg/front_end/testcases/super_parameters/super_key/main_lib.dart
@@ -0,0 +1,7 @@
+class Key {}
+
+class StatefulWidget {
+ final Key? key;
+
+ const StatefulWidget({this.key});
+}
diff --git a/pkg/front_end/testcases/super_parameters/super_key/test.options b/pkg/front_end/testcases/super_parameters/super_key/test.options
new file mode 100644
index 0000000..bfe6dc8
--- /dev/null
+++ b/pkg/front_end/testcases/super_parameters/super_key/test.options
@@ -0,0 +1 @@
+main_lib.dart
\ No newline at end of file
diff --git a/pkg/pkg.status b/pkg/pkg.status
index 7122a64..2aef55f 100644
--- a/pkg/pkg.status
+++ b/pkg/pkg.status
@@ -145,8 +145,6 @@
vm_snapshot_analysis/test/*: SkipByDesign # Only meant to run on vm
[ $system == windows ]
-dds/test/devtools_server/devtools_server_connection_test: Skip # Issue 48528
-dds/test/devtools_server/devtools_server_test: Skip # Issue 48528
front_end/test/fasta/bootstrap_test: Skip # Issue 31902
front_end/test/fasta/strong_test: Pass, Slow, Timeout
front_end/test/fasta/text_serialization_test: Pass, Slow, Timeout
diff --git a/runtime/platform/globals.h b/runtime/platform/globals.h
index f2ede3d..0f8cabf 100644
--- a/runtime/platform/globals.h
+++ b/runtime/platform/globals.h
@@ -200,10 +200,10 @@
#elif defined(_M_IX86) || defined(__i386__)
#define HOST_ARCH_IA32 1
#define ARCH_IS_32_BIT 1
-#elif defined(__ARMEL__)
+#elif defined(_M_ARM) || defined(__ARMEL__)
#define HOST_ARCH_ARM 1
#define ARCH_IS_32_BIT 1
-#elif defined(__aarch64__)
+#elif defined(_M_ARM64) || defined(__aarch64__)
#define HOST_ARCH_ARM64 1
#define ARCH_IS_64_BIT 1
#elif defined(__riscv)
diff --git a/runtime/vm/compiler/assembler/assembler_arm64.cc b/runtime/vm/compiler/assembler/assembler_arm64.cc
index 359c6db..e42ac60 100644
--- a/runtime/vm/compiler/assembler/assembler_arm64.cc
+++ b/runtime/vm/compiler/assembler/assembler_arm64.cc
@@ -1610,6 +1610,10 @@
// frames before doing an overflow check.)
ldr(TMP, Address(thr, target::Thread::saved_stack_limit_offset()));
AddImmediate(CSP, TMP, -4096);
+
+ // TODO(47824): This will probably cause signal handlers on Windows to crash.
+ // Windows requires the stack to grow in order, one page at a time, but
+ // pushing CSP to near the stack limit likely skips over many pages.
}
void Assembler::RestoreCSP() {
diff --git a/runtime/vm/constants_arm.h b/runtime/vm/constants_arm.h
index 7406b47..18a2bc2 100644
--- a/runtime/vm/constants_arm.h
+++ b/runtime/vm/constants_arm.h
@@ -49,7 +49,7 @@
// The Linux/Android ABI and the iOS ABI differ in their choice of frame
// pointer, their treatment of R9, and the interprocedural stack alignment.
-// EABI (Linux, Android)
+// EABI (Linux, Android, Windows)
// See "Procedure Call Standard for the ARM Architecture".
// R0-R1: Argument / result / volatile
// R2-R3: Argument / volatile
@@ -61,9 +61,10 @@
// R15: Program counter
// Stack alignment: 4 bytes always, 8 bytes at public interfaces
-// Linux (Debian armhf) and Android also differ in whether floating point
-// arguments are passed in floating point registers. Linux uses hardfp and
-// Android uses softfp. See TargetCPUFeatures::hardfp_supported().
+// Linux (Debian armhf), Windows and Android also differ in whether floating
+// point arguments are passed in floating point registers. Linux and Windows
+// use hardfp and Android uses softfp. See
+// TargetCPUFeatures::hardfp_supported().
// iOS ABI
// See "iOS ABI Function Call Guide"
@@ -92,7 +93,7 @@
R8 = 8,
R9 = 9,
R10 = 10, // THR
- R11 = 11, // Linux FP
+ R11 = 11, // Linux/Android/Windows FP
R12 = 12, // IP aka TMP
R13 = 13, // SP
R14 = 14, // LR
diff --git a/runtime/vm/constants_arm64.h b/runtime/vm/constants_arm64.h
index 5be6e98..b09a94a 100644
--- a/runtime/vm/constants_arm64.h
+++ b/runtime/vm/constants_arm64.h
@@ -49,7 +49,7 @@
R15 = 15, // SP in Dart code.
R16 = 16, // IP0 aka TMP
R17 = 17, // IP1 aka TMP2
- R18 = 18, // reserved on iOS, shadow call stack on Fuchsia.
+ R18 = 18, // reserved on iOS, shadow call stack on Fuchsia, TEB on Windows.
R19 = 19,
R20 = 20,
R21 = 21, // DISPATCH_TABLE_REG
diff --git a/runtime/vm/cpu_arm.cc b/runtime/vm/cpu_arm.cc
index 284b62d..b18056a 100644
--- a/runtime/vm/cpu_arm.cc
+++ b/runtime/vm/cpu_arm.cc
@@ -16,6 +16,8 @@
#if defined(DART_HOST_OS_IOS)
#include <libkern/OSCacheControl.h>
+#elif defined(DART_HOST_OS_WINDOWS)
+#include <processthreadsapi.h>
#endif
#if !defined(TARGET_HOST_MISMATCH)
@@ -88,6 +90,10 @@
__builtin___clear_cache(beg, end);
#elif defined(DART_HOST_OS_ANDROID)
cacheflush(start, start + size, 0);
+#elif defined(DART_HOST_OS_WINDOWS)
+ BOOL result = FlushInstructionCache(
+ GetCurrentProcess(), reinterpret_cast<const void*>(start), size);
+ ASSERT(result != 0);
#else
#error FlushICache only tested/supported on Linux, Android and iOS
#endif
@@ -126,6 +132,16 @@
initialized_ = true;
#endif
}
+#elif DART_HOST_OS_WINDOWS
+void HostCPUFeatures::Init() {
+ hardware_ = "";
+ integer_division_supported_ = true;
+ neon_supported_ = true;
+ hardfp_supported_ = true;
+#if defined(DEBUG)
+ initialized_ = true;
+#endif
+}
#else // DART_HOST_OS_IOS
void HostCPUFeatures::Init() {
bool is_arm64 = false;
diff --git a/runtime/vm/cpu_arm64.cc b/runtime/vm/cpu_arm64.cc
index 23e9fee..1ae9f0d 100644
--- a/runtime/vm/cpu_arm64.cc
+++ b/runtime/vm/cpu_arm64.cc
@@ -22,6 +22,8 @@
#if defined(DART_HOST_OS_MACOS) || defined(DART_HOST_OS_IOS)
#include <libkern/OSCacheControl.h>
+#elif defined(DART_HOST_OS_WINDOWS)
+#include <processthreadsapi.h>
#endif
namespace dart {
@@ -52,6 +54,10 @@
zx_status_t result = zx_cache_flush(reinterpret_cast<const void*>(start),
size, ZX_CACHE_FLUSH_INSN);
ASSERT(result == ZX_OK);
+#elif defined(DART_HOST_OS_WINDOWS)
+ BOOL result = FlushInstructionCache(
+ GetCurrentProcess(), reinterpret_cast<const void*>(start), size);
+ ASSERT(result != 0);
#else
#error FlushICache not implemented for this OS
#endif
diff --git a/runtime/vm/os_thread_win.cc b/runtime/vm/os_thread_win.cc
index 98c95ed..0d0a742 100644
--- a/runtime/vm/os_thread_win.cc
+++ b/runtime/vm/os_thread_win.cc
@@ -172,14 +172,10 @@
}
bool OSThread::GetCurrentStackBounds(uword* lower, uword* upper) {
-// On Windows stack limits for the current thread are available in
-// the thread information block (TIB). Its fields can be accessed through
-// FS segment register on x86 and GS segment register on x86_64.
-#ifdef _WIN64
- *upper = static_cast<uword>(__readgsqword(offsetof(NT_TIB64, StackBase)));
-#else
- *upper = static_cast<uword>(__readfsdword(offsetof(NT_TIB, StackBase)));
-#endif
+ // On Windows stack limits for the current thread are available in
+ // the thread information block (TIB).
+ NT_TIB* tib = reinterpret_cast<NT_TIB*>(NtCurrentTeb());
+ *upper = reinterpret_cast<uword>(tib->StackBase);
// Notice that we cannot use the TIB's StackLimit for the stack end, as it
// tracks the end of the committed range. We're after the end of the reserved
// stack area (most of which will be uncommitted, most times).
diff --git a/tools/VERSION b/tools/VERSION
index 7b9e5d4..664d064 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
MAJOR 2
MINOR 17
PATCH 0
-PRERELEASE 256
+PRERELEASE 257
PRERELEASE_PATCH 0
\ No newline at end of file