Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit f8c25b8

Browse files
author
Dart CI
committed
Version 2.13.0-162.0.dev
Merge commit 'e7d3a6027cd86e29f04f6137a65e67305e48b862' into 'dev'
2 parents 64202f2 + e7d3a60 commit f8c25b8

File tree

99 files changed

+2233
-713
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+2233
-713
lines changed

.dart_tool/package_config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"constraint, update this by running tools/generate_package_config.dart."
1212
],
1313
"configVersion": 2,
14-
"generated": "2021-03-19T12:24:33.467679",
14+
"generated": "2021-03-20T01:55:31.903271",
1515
"generator": "tools/generate_package_config.dart",
1616
"packages": [
1717
{

DEPS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ vars = {
4444
# co19 is a cipd package. Use update.sh in tests/co19[_2] to update these
4545
# hashes. It requires access to the dart-build-access group, which EngProd
4646
# has.
47-
"co19_rev": "ae818220b12ec9c2470519db2c7167cbe4745e12",
47+
"co19_rev": "fddb1dce948cec277bf3dc23b45ee95e761b89fe",
4848
"co19_2_rev": "cf6eed0535e45413672bb5bb6e65df9f59846372",
4949

5050
# The internal benchmarks to use. See go/dart-benchmarks-internal
@@ -101,7 +101,7 @@ vars = {
101101
"dart_style_tag": "2cf810073e0cc7e7ea05d3de51830e6fa6d62924",
102102

103103
"chromedriver_tag": "83.0.4103.39",
104-
"browser_launcher_rev": "74949f0c599095e6fac3cb4581ed4769167576c7",
104+
"browser_launcher_rev": "12ab9f351a44ac803de9bc17bb2180bb312a9dd7",
105105
"dartdoc_rev" : "174021f3d76c2a8500b54977c80f32c5bbc099f1",
106106
"ffi_rev": "f3346299c55669cc0db48afae85b8110088bf8da",
107107
"fixnum_rev": "16d3890c6dc82ca629659da1934e412292508bba",

pkg/analyzer/test/src/summary/resynthesize_common.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ abstract class AbstractResynthesizeTest with ResourceProviderMixin {
4343
DartUriResolver(sdk),
4444
PackageMapUriResolver(resourceProvider, {
4545
'test': [
46-
resourceProvider.getFolder('/home/test/lib'),
46+
getFolder('/home/test/lib'),
4747
],
4848
}),
4949
ResourceUriResolver(resourceProvider),

pkg/analyzer/test/src/workspace/bazel_watcher_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,10 @@ class BazelWatcherTest with ResourceProviderMixin {
160160
_MockPollTrigger? trigger1;
161161
_MockPollTrigger? trigger2;
162162
var triggerFactory = (String workspace) {
163-
if (workspace == '/workspace1') {
163+
if (workspace == convertPath('/workspace1')) {
164164
trigger1 = _MockPollTrigger();
165165
return trigger1!;
166-
} else if (workspace == '/workspace2') {
166+
} else if (workspace == convertPath('/workspace2')) {
167167
trigger2 = _MockPollTrigger();
168168
return trigger2!;
169169
} else {

pkg/compiler/lib/src/ir/static_type.dart

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,16 +1012,9 @@ abstract class StaticTypeVisitor extends StaticTypeBase {
10121012
// effectively final variable types and type promotion.
10131013
ir.DartType functionType = _computeInstanceInvocationType(
10141014
receiverType, interfaceTarget, node.arguments, argumentTypes);
1015-
if (functionType != node.functionType) {
1015+
if (functionType is ir.FunctionType && functionType != node.functionType) {
10161016
node.functionType = functionType;
1017-
// TODO(johnniwinther): To provide the static guarantee that arguments
1018-
// of a statically typed call have been checked against the parameter
1019-
// types we need to call [_updateMethodInvocationTarget]. This can create
1020-
// uses of type variables are not registered with the closure model so
1021-
// we skip it for now. Note that this invariant is not currently used
1022-
// in later phases since it wasn't provided for function invocations in
1023-
// the old method invocation encoding.
1024-
//_updateMethodInvocationTarget(node, argumentTypes, functionType);
1017+
_updateMethodInvocationTarget(node, argumentTypes, functionType);
10251018
}
10261019
ir.DartType returnType = _getFunctionReturnType(functionType);
10271020
receiverType = _narrowInstanceReceiver(node.interfaceTarget, receiverType);
@@ -1046,10 +1039,14 @@ abstract class StaticTypeVisitor extends StaticTypeBase {
10461039
(interfaceTarget is ir.Procedure && interfaceTarget.isGetter)) {
10471040
// This should actually be a function invocation of an instance get but
10481041
// this doesn't work for invocation of js-interop properties. We
1049-
// therefore use [ir.MethodInvocation] instead.
1050-
// TODO(johnniwinther): Use [ir.InstanceGetterInvocation] instead.
1051-
replacement = ir.MethodInvocation(
1052-
node.receiver, node.name, node.arguments, interfaceTarget)
1042+
// therefore use [ir.InstanceGetterInvocation] instead.
1043+
replacement = ir.InstanceGetterInvocation(
1044+
ir.InstanceAccessKind.Instance,
1045+
node.receiver,
1046+
node.name,
1047+
node.arguments,
1048+
interfaceTarget: interfaceTarget,
1049+
functionType: functionType is ir.FunctionType ? functionType : null)
10531050
..fileOffset = node.fileOffset;
10541051
} else {
10551052
replacement = ir.InstanceInvocation(ir.InstanceAccessKind.Instance,

pkg/compiler/test/analyses/analyze_test.dart

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,16 @@
44

55
// @dart = 2.7
66

7+
import 'dart:io' show exitCode;
8+
79
import "package:testing/src/run_tests.dart" as testing show main;
810

9-
main() {
11+
main() async {
1012
// This method is async, but keeps a port open to prevent the VM from exiting
1113
// prematurely.
12-
return testing.main(
14+
await testing.main(
1315
<String>["--config=pkg/compiler/testing.json", "--verbose", "analyze"]);
16+
if (exitCode != 0) {
17+
throw "Exit-code was $exitCode!";
18+
}
1419
}

pkg/dev_compiler/bin/dartdevc.dart

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,8 @@ Future main(List<String> args, [SendPort sendPort]) async {
3232
} else if (parsedArgs.isBatch) {
3333
await runBatch(parsedArgs);
3434
} else if (parsedArgs.isExpressionCompiler) {
35-
if (sendPort != null) {
36-
var receivePort = ReceivePort();
37-
sendPort.send(receivePort.sendPort);
38-
var worker = await ExpressionCompilerWorker.createFromArgs(
39-
parsedArgs.rest,
40-
requestStream: receivePort.cast<Map<String, dynamic>>(),
41-
sendResponse: sendPort.send);
42-
await worker.start();
43-
receivePort.close();
44-
} else {
45-
var worker =
46-
await ExpressionCompilerWorker.createFromArgs(parsedArgs.rest);
47-
await worker.start();
48-
}
35+
await ExpressionCompilerWorker.createAndStart(parsedArgs.rest,
36+
sendPort: sendPort);
4937
} else {
5038
var result = await compile(parsedArgs);
5139
exitCode = result.exitCode;

pkg/dev_compiler/lib/src/kernel/expression_compiler_worker.dart

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import 'dart:async';
88
import 'dart:convert';
99
import 'dart:io';
10+
import 'dart:isolate';
1011

1112
import 'package:args/args.dart';
1213
import 'package:build_integration/file_system/multi_root.dart';
@@ -54,7 +55,7 @@ import 'target.dart';
5455
///
5556
/// - debugger creates an isolate using dartdevc's main method with
5657
/// '--experimental-expression-compiler' flag and passes a send port
57-
/// to dartdevc for sending responces from the service to the debugger.
58+
/// to dartdevc for sending responses from the service to the debugger.
5859
///
5960
/// - dartdevc creates a new send port to receive requests on, and sends
6061
/// it back to the debugger, for sending requests to the service.
@@ -96,6 +97,48 @@ class ExpressionCompilerWorker {
9697
this.sendResponse,
9798
);
9899

100+
/// Create expression compiler worker from [args] and start it.
101+
///
102+
/// If [sendPort] is provided, creates a `receivePort` and sends it to
103+
/// the consumer to establish communication. Otherwise, uses stdin/stdout
104+
/// for communication with the consumer.
105+
///
106+
/// Details:
107+
///
108+
/// Consumer uses (`consumerSendPort`, `consumerReceivePort`) pair to
109+
/// send requests and receive responses:
110+
///
111+
/// `consumerReceivePort.sendport` = [sendPort]
112+
/// `consumerSendPort = receivePort.sendport`
113+
///
114+
/// Worker uses the opposite ports connected to the consumer ports -
115+
/// (`receivePort`, [sendPort]) to receive requests and send responses.
116+
///
117+
/// The worker stops on start failure or after the consumer closes its
118+
/// receive port corresponding to [sendPort].
119+
static Future<void> createAndStart(List<String> args,
120+
{SendPort sendPort}) async {
121+
if (sendPort != null) {
122+
var receivePort = ReceivePort();
123+
sendPort.send(receivePort.sendPort);
124+
try {
125+
var worker = await createFromArgs(args,
126+
requestStream: receivePort.cast<Map<String, dynamic>>(),
127+
sendResponse: sendPort.send);
128+
await worker.start();
129+
} catch (e, s) {
130+
sendPort
131+
.send({'exception': '$e', 'stackTrace': '$s', 'succeeded': false});
132+
rethrow;
133+
} finally {
134+
receivePort.close();
135+
}
136+
} else {
137+
var worker = await createFromArgs(args);
138+
await worker.start();
139+
}
140+
}
141+
99142
static Future<ExpressionCompilerWorker> createFromArgs(
100143
List<String> args, {
101144
Stream<Map<String, dynamic>> requestStream,
@@ -193,6 +236,9 @@ class ExpressionCompilerWorker {
193236
return processedOptions.loadSdkSummary(null);
194237
});
195238

239+
if (sdkComponent == null) {
240+
throw Exception('Could not load SDK component: $sdkSummary');
241+
}
196242
return ExpressionCompilerWorker._(processedOptions, compilerOptions,
197243
moduleFormat, sdkComponent, requestStream, sendResponse)
198244
.._updateCache(sdkComponent, dartSdkModule, true);

pkg/dev_compiler/lib/src/kernel/nullable_inference.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,11 @@ class NullableInference extends ExpressionVisitor<bool> {
144144
_invocationIsNullable(
145145
node.interfaceTarget, node.name.text, node, node.receiver);
146146

147+
@override
148+
bool visitInstanceGetterInvocation(InstanceGetterInvocation node) =>
149+
_invocationIsNullable(
150+
node.interfaceTarget, node.name.text, node, node.receiver);
151+
147152
@override
148153
bool visitDynamicInvocation(DynamicInvocation node) =>
149154
_invocationIsNullable(null, node.name.text, node, node.receiver);

pkg/dev_compiler/lib/src/kernel/target.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,12 @@ class _CovarianceTransformer extends RecursiveVisitor {
439439
super.visitInstanceInvocation(node);
440440
}
441441

442+
@override
443+
void visitInstanceGetterInvocation(InstanceGetterInvocation node) {
444+
_checkTarget(node.receiver, node.interfaceTarget);
445+
super.visitInstanceGetterInvocation(node);
446+
}
447+
442448
@override
443449
void visitInstanceTearOff(InstanceTearOff node) {
444450
_checkTearoff(node.interfaceTarget);

0 commit comments

Comments
 (0)