Skip to content

Commit ad8c447

Browse files
author
Dart CI
committed
Version 2.18.0-245.0.dev
Merge commit '99919c69ba1f374a8d793bcfe43e2a1702a1b82b' into 'dev'
2 parents 47bb748 + 99919c6 commit ad8c447

File tree

11 files changed

+229
-130
lines changed

11 files changed

+229
-130
lines changed

pkg/_fe_analyzer_shared/lib/src/flow_analysis/flow_analysis.dart

Lines changed: 96 additions & 98 deletions
Large diffs are not rendered by default.

pkg/_fe_analyzer_shared/test/mini_ast.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -247,9 +247,9 @@ abstract class Expression extends Node {
247247
}
248248

249249
/// Test harness for creating flow analysis tests. This class implements all
250-
/// the [TypeOperations] needed by flow analysis, as well as other methods
251-
/// needed for testing.
252-
class Harness extends TypeOperations<Var, Type> {
250+
/// the [Operations] needed by flow analysis, as well as other methods needed
251+
/// for testing.
252+
class Harness extends Operations<Var, Type> {
253253
static const Map<String, bool> _coreSubtypes = const {
254254
'bool <: int': false,
255255
'bool <: Object': true,
@@ -1486,7 +1486,7 @@ class _MiniAstTypeAnalyzer {
14861486
var rightType = analyzeExpression(rhs);
14871487
flow.ifNullExpression_end();
14881488
return leastUpperBound(
1489-
flow.typeOperations.promoteToNonNull(leftType), rightType);
1489+
flow.operations.promoteToNonNull(leftType), rightType);
14901490
}
14911491

14921492
void analyzeIfStatement(Statement node, Expression condition,
@@ -1520,7 +1520,7 @@ class _MiniAstTypeAnalyzer {
15201520
Type analyzeNonNullAssert(Expression node, Expression expression) {
15211521
var type = analyzeExpression(expression);
15221522
flow.nonNullAssert_end(expression);
1523-
return flow.typeOperations.promoteToNonNull(type);
1523+
return flow.operations.promoteToNonNull(type);
15241524
}
15251525

15261526
Type analyzeNullLiteral(Expression node) {

pkg/analyzer/lib/src/dart/resolver/flow_analysis_visitor.dart

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class FlowAnalysisDataForTesting {
5959
/// be extracted.
6060
class FlowAnalysisHelper {
6161
/// The reused instance for creating new [FlowAnalysis] instances.
62-
final TypeSystemTypeOperations _typeOperations;
62+
final TypeSystemOperations _typeOperations;
6363

6464
/// Precomputed sets of potentially assigned variables.
6565
AssignedVariables<AstNode, PromotableElement>? assignedVariables;
@@ -82,7 +82,7 @@ class FlowAnalysisHelper {
8282

8383
FlowAnalysisHelper(TypeSystemImpl typeSystem, bool retainDataForTesting,
8484
FeatureSet featureSet)
85-
: this._(TypeSystemTypeOperations(typeSystem),
85+
: this._(TypeSystemOperations(typeSystem),
8686
retainDataForTesting ? FlowAnalysisDataForTesting() : null,
8787
isNonNullableByDefault: featureSet.isEnabled(Feature.non_nullable),
8888
respectImplicitlyTypedVarInitializers:
@@ -375,11 +375,10 @@ class FlowAnalysisHelperForMigration extends FlowAnalysisHelper {
375375
}
376376
}
377377

378-
class TypeSystemTypeOperations
379-
extends TypeOperations<PromotableElement, DartType> {
378+
class TypeSystemOperations extends Operations<PromotableElement, DartType> {
380379
final TypeSystemImpl typeSystem;
381380

382-
TypeSystemTypeOperations(this.typeSystem);
381+
TypeSystemOperations(this.typeSystem);
383382

384383
@override
385384
TypeClassification classifyType(DartType type) {

pkg/dart2native/lib/dart2native_macho.dart

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -369,15 +369,20 @@ Future writeAppendedMachOExecutable(
369369
// Thus, to sign the binary, the developer must force signature overwriting.
370370
final signingProcess = await Process.run('codesign', args);
371371
if (signingProcess.exitCode != 0) {
372-
print('Failed to replace the dartaotruntime signature, ');
373-
print('subcommand terminated with exit code ${signingProcess.exitCode}.');
372+
stderr
373+
..write('Failed to replace the dartaotruntime signature, ')
374+
..write('subcommand terminated with exit code ')
375+
..write(signingProcess.exitCode)
376+
..writeln('.');
374377
if (signingProcess.stdout.isNotEmpty) {
375-
print('Subcommand stdout:');
376-
print(signingProcess.stdout);
378+
stderr
379+
..writeln('Subcommand stdout:')
380+
..writeln(signingProcess.stdout);
377381
}
378382
if (signingProcess.stderr.isNotEmpty) {
379-
print('Subcommand stderr:');
380-
print(signingProcess.stderr);
383+
stderr
384+
..writeln('Subcommand stderr:')
385+
..writeln(signingProcess.stderr);
381386
}
382387
throw 'Could not sign the new executable';
383388
}

pkg/front_end/lib/src/fasta/type_inference/type_inference_engine.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,10 +260,10 @@ class FlowAnalysisResult {
260260
}
261261

262262
/// CFE-specific implementation of [TypeOperations].
263-
class TypeOperationsCfe extends TypeOperations<VariableDeclaration, DartType> {
263+
class OperationsCfe extends Operations<VariableDeclaration, DartType> {
264264
final TypeEnvironment typeEnvironment;
265265

266-
TypeOperationsCfe(this.typeEnvironment);
266+
OperationsCfe(this.typeEnvironment);
267267

268268
@override
269269
TypeClassification classifyType(DartType? type) {

pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -228,16 +228,14 @@ class TypeInferrerImpl implements TypeInferrer {
228228

229229
@override
230230
late final FlowAnalysis<TreeNode, Statement, Expression, VariableDeclaration,
231-
DartType> flowAnalysis =
232-
libraryBuilder.isNonNullableByDefault
233-
? new FlowAnalysis(
234-
new TypeOperationsCfe(engine.typeSchemaEnvironment),
235-
assignedVariables,
236-
respectImplicitlyTypedVarInitializers:
237-
libraryBuilder.libraryFeatures.constructorTearoffs.isEnabled)
238-
: new FlowAnalysis.legacy(
239-
new TypeOperationsCfe(engine.typeSchemaEnvironment),
240-
assignedVariables);
231+
DartType> flowAnalysis = libraryBuilder
232+
.isNonNullableByDefault
233+
? new FlowAnalysis(
234+
new OperationsCfe(engine.typeSchemaEnvironment), assignedVariables,
235+
respectImplicitlyTypedVarInitializers:
236+
libraryBuilder.libraryFeatures.constructorTearoffs.isEnabled)
237+
: new FlowAnalysis.legacy(
238+
new OperationsCfe(engine.typeSchemaEnvironment), assignedVariables);
241239

242240
@override
243241
final AssignedVariables<TreeNode, VariableDeclaration> assignedVariables;

pkg/nnbd_migration/lib/src/decorated_type_operations.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ import 'package:nnbd_migration/src/edge_origin.dart';
1111
import 'package:nnbd_migration/src/nullability_node.dart';
1212
import 'package:nnbd_migration/src/variables.dart';
1313

14-
/// [TypeOperations] that works with [DecoratedType]s.
14+
/// [Operations] that works with [DecoratedType]s.
1515
class DecoratedTypeOperations
16-
implements TypeOperations<PromotableElement, DecoratedType> {
16+
implements Operations<PromotableElement, DecoratedType> {
1717
final TypeSystem _typeSystem;
1818
final Variables? _variableRepository;
1919
final NullabilityGraph _graph;
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
4+
5+
// VMOptions=--use_slow_path --stress_write_barrier_elimination
6+
7+
// Test that array allocation in noSuchMethod dispatcher is preserving the
8+
// length register correctly.
9+
10+
import 'dart:async';
11+
12+
import 'package:expect/expect.dart';
13+
14+
final List<dynamic> list = <dynamic>[];
15+
16+
final List<int> invocations = <int>[];
17+
18+
abstract class B {
19+
void someMethod(int v);
20+
}
21+
22+
class A {
23+
noSuchMethod(Invocation i) {
24+
Expect.equals(#someMethod, i.memberName);
25+
invocations.add(i.positionalArguments[0] as int);
26+
}
27+
}
28+
29+
class C implements B {
30+
void someMethod(int v) {
31+
invocations.add(v);
32+
}
33+
}
34+
35+
void main() {
36+
for (var i = 0; i < 10; i++) {
37+
list.add(A());
38+
list.add(C());
39+
}
40+
41+
for (var i = 0; i < list.length; i++) {
42+
list[i].someMethod(i);
43+
}
44+
45+
Expect.equals(list.length, invocations.length);
46+
for (var i = 0; i < list.length; i++) {
47+
Expect.equals(i, invocations[i]);
48+
}
49+
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
4+
// @dart=2.9
5+
6+
// VMOptions=--use_slow_path --stress_write_barrier_elimination
7+
8+
// Test that array allocation in noSuchMethod dispatcher is preserving the
9+
// length register correctly.
10+
11+
import 'dart:async';
12+
13+
import 'package:expect/expect.dart';
14+
15+
final List<dynamic> list = <dynamic>[];
16+
17+
final List<int> invocations = <int>[];
18+
19+
abstract class B {
20+
void someMethod(int v);
21+
}
22+
23+
class A {
24+
noSuchMethod(Invocation i) {
25+
Expect.equals(#someMethod, i.memberName);
26+
invocations.add(i.positionalArguments[0] as int);
27+
}
28+
}
29+
30+
class C implements B {
31+
void someMethod(int v) {
32+
invocations.add(v);
33+
}
34+
}
35+
36+
void main() {
37+
for (var i = 0; i < 10; i++) {
38+
list.add(A());
39+
list.add(C());
40+
}
41+
42+
for (var i = 0; i < list.length; i++) {
43+
list[i].someMethod(i);
44+
}
45+
46+
Expect.equals(list.length, invocations.length);
47+
for (var i = 0; i < list.length; i++) {
48+
Expect.equals(i, invocations[i]);
49+
}
50+
}

runtime/vm/compiler/stub_code_compiler_arm.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ void StubCodeCompiler::EnsureIsNewOrRemembered(Assembler* assembler,
4646
{
4747
LeafRuntimeScope rt(assembler,
4848
/*frame_size=*/0,
49-
/*preserve_registers=*/false);
49+
/*preserve_registers=*/preserve_registers);
5050
// [R0] already contains first argument.
5151
__ mov(R1, Operand(THR));
5252
rt.Call(kEnsureRememberedAndMarkingDeferredRuntimeEntry, 2);

tools/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ CHANNEL dev
2727
MAJOR 2
2828
MINOR 18
2929
PATCH 0
30-
PRERELEASE 244
30+
PRERELEASE 245
3131
PRERELEASE_PATCH 0

0 commit comments

Comments
 (0)