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

Commit a3736d4

Browse files
author
Dart CI
committed
Version 2.17.0-98.0.dev
Merge commit '20401b32ec009344287120d546c381815bdb7a48' into 'dev'
2 parents a15d19a + 20401b3 commit a3736d4

File tree

150 files changed

+2827
-1100
lines changed

Some content is hidden

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

150 files changed

+2827
-1100
lines changed

DEPS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ vars = {
9393
"collection_rev": "a4c941ab94044d118b2086a3f261c30377604127",
9494
"convert_rev": "e063fdca4bebffecbb5e6aa5525995120982d9ce",
9595
"crypto_rev": "b5024e4de2b1c474dd558bef593ddbf0bfade152",
96-
"csslib_rev": "158bfa94eed08c12c07a8ee0a3fded0ebdcd1fcb",
96+
"csslib_rev": "f746368a0a53cf8f68fd71b218239034e88841d5",
9797

9898
# Note: Updates to dart_style have to be coordinated with the infrastructure
9999
# team so that the internal formatter `tools/sdks/dart-sdk/bin/dart format`
@@ -130,7 +130,7 @@ vars = {
130130
"markupsafe_rev": "8f45f5cfa0009d2a70589bcda0349b8cb2b72783",
131131
"markdown_rev": "7479783f0493f6717e1d7ae31cb37d39a91026b2",
132132
"matcher_rev": "07595a7739d47a8315caba5a8e58fb9ae3d81261",
133-
"mime_rev": "c931f4bed87221beaece356494b43731445ce7b8",
133+
"mime_rev": "7f4252d469de032aa4df9f90e827dbac4b8efa48",
134134
"mockito_rev": "d39ac507483b9891165e422ec98d9fb480037c8b",
135135
"oauth2_rev": "7cd3284049fe5badbec9f2bea2afc41d14c01057",
136136
"package_config_rev": "8731bf10b5375542792a32a0f7c8a6f370583d96",

benchmarks/Iterators/dart/Iterators.dart

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,60 @@ class BenchmarkListIntGrowable extends MonoBenchmark {
331331
}
332332
}
333333

334+
class BenchmarkListIntSystem1 extends MonoBenchmark {
335+
// The List type here is not quite monomorphic. It is the choice between two
336+
// 'system' Lists: a const List and a growable List. It is quite common to
337+
// have growable and const lists at the same use-site (e.g. the const coming
338+
// from a default argument).
339+
//
340+
// Ideally some combination of the class heirarchy or compiler tricks would
341+
// ensure there is little cost of having this gentle polymorphism.
342+
BenchmarkListIntSystem1(int size)
343+
: _list1 = List.generate(size, (i) => i),
344+
_list2 = generateConstListOfInt(size),
345+
super('List.int.growable.and.const', size);
346+
347+
final List<int> _list1;
348+
final List<int> _list2;
349+
bool _flip = false;
350+
351+
@override
352+
void sinkMono() {
353+
_flip = !_flip;
354+
final list = _flip ? _list1 : _list2;
355+
for (final value in list) {
356+
sink = value;
357+
}
358+
}
359+
}
360+
361+
class BenchmarkListIntSystem2 extends MonoBenchmark {
362+
// The List type here is not quite monomorphic. It is the choice between two
363+
// 'system' Lists: a const List and a fixed-length List. It is quite common to
364+
// have fixed-length and const lists at the same use-site (e.g. the const
365+
// coming from a default argument).
366+
//
367+
// Ideally some combination of the class heirarchy or compiler tricks would
368+
// ensure there is little cost of having this gentle polymorphism.
369+
BenchmarkListIntSystem2(int size)
370+
: _list1 = List.generate(size, (i) => i, growable: false),
371+
_list2 = generateConstListOfInt(size),
372+
super('List.int.fixed.and.const', size);
373+
374+
final List<int> _list1;
375+
final List<int> _list2;
376+
bool _flip = false;
377+
378+
@override
379+
void sinkMono() {
380+
_flip = !_flip;
381+
final list = _flip ? _list1 : _list2;
382+
for (final value in list) {
383+
sink = value;
384+
}
385+
}
386+
}
387+
334388
/// A simple Iterable that yields the integers 0 through `length`.
335389
///
336390
/// This Iterable serves as the minimal interesting example to serve as a
@@ -492,6 +546,8 @@ void main(List<String> commandLineArguments) {
492546
Benchmark('Runes', size, (n) => generateString(n).runes),
493547
// ---
494548
BenchmarkListIntGrowable(size),
549+
BenchmarkListIntSystem1(size),
550+
BenchmarkListIntSystem2(size),
495551
Benchmark('List.int.growable', size,
496552
(n) => List<int>.of(UpTo(n), growable: true)),
497553
Benchmark('List.int.fixed', size,

benchmarks/Iterators/dart/data.dart

Lines changed: 38 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ Set<int> generateConstSetOfInt(int n) {
1212
(throw ArgumentError.value(n, 'n', 'size not supported'));
1313
}
1414

15+
List<int> generateConstListOfInt(int n) {
16+
return constListOfIntTable[n] ??
17+
(throw ArgumentError.value(n, 'n', 'size not supported'));
18+
}
19+
1520
const Map<int, Map<int, int>> constMapIntIntTable = {
1621
0: constMapIntInt0,
1722
1: constMapIntInt1,
@@ -136,104 +141,37 @@ const Set<int> constSetOfInt0 = {};
136141
const Set<int> constSetOfInt1 = {0};
137142
const Set<int> constSetOfInt2 = {0, 1};
138143
const Set<int> constSetOfInt100 = {
139-
0,
140-
1,
141-
2,
142-
3,
143-
4,
144-
5,
145-
6,
146-
7,
147-
8,
148-
9,
149-
10,
150-
11,
151-
12,
152-
13,
153-
14,
154-
15,
155-
16,
156-
17,
157-
18,
158-
19,
159-
20,
160-
21,
161-
22,
162-
23,
163-
24,
164-
25,
165-
26,
166-
27,
167-
28,
168-
29,
169-
30,
170-
31,
171-
32,
172-
33,
173-
34,
174-
35,
175-
36,
176-
37,
177-
38,
178-
39,
179-
40,
180-
41,
181-
42,
182-
43,
183-
44,
184-
45,
185-
46,
186-
47,
187-
48,
188-
49,
189-
50,
190-
51,
191-
52,
192-
53,
193-
54,
194-
55,
195-
56,
196-
57,
197-
58,
198-
59,
199-
60,
200-
61,
201-
62,
202-
63,
203-
64,
204-
65,
205-
66,
206-
67,
207-
68,
208-
69,
209-
70,
210-
71,
211-
72,
212-
73,
213-
74,
214-
75,
215-
76,
216-
77,
217-
78,
218-
79,
219-
80,
220-
81,
221-
82,
222-
83,
223-
84,
224-
85,
225-
86,
226-
87,
227-
88,
228-
89,
229-
90,
230-
91,
231-
92,
232-
93,
233-
94,
234-
95,
235-
96,
236-
97,
237-
98,
238-
99
144+
...{0, 1, 2, 3, 4, 5, 6, 7, 8, 9},
145+
...{10, 11, 12, 13, 14, 15, 16, 17, 18, 19},
146+
...{20, 21, 22, 23, 24, 25, 26, 27, 28, 29},
147+
...{30, 31, 32, 33, 34, 35, 36, 37, 38, 39},
148+
...{40, 41, 42, 43, 44, 45, 46, 47, 48, 49},
149+
...{50, 51, 52, 53, 54, 55, 56, 57, 58, 59},
150+
...{60, 61, 62, 63, 64, 65, 66, 67, 68, 69},
151+
...{70, 71, 72, 73, 74, 75, 76, 77, 78, 79},
152+
...{80, 81, 82, 83, 84, 85, 86, 87, 88, 89},
153+
...{90, 91, 92, 93, 94, 95, 96, 97, 98, 99}
239154
};
155+
156+
const Map<int, List<int>> constListOfIntTable = {
157+
0: constListOfInt0,
158+
1: constListOfInt1,
159+
2: constListOfInt2,
160+
100: constListOfInt100
161+
};
162+
163+
const List<int> constListOfInt0 = [];
164+
const List<int> constListOfInt1 = [0];
165+
const List<int> constListOfInt2 = [0, 1];
166+
const List<int> constListOfInt100 = [
167+
...[0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
168+
...[10, 11, 12, 13, 14, 15, 16, 17, 18, 19],
169+
...[20, 21, 22, 23, 24, 25, 26, 27, 28, 29],
170+
...[30, 31, 32, 33, 34, 35, 36, 37, 38, 39],
171+
...[40, 41, 42, 43, 44, 45, 46, 47, 48, 49],
172+
...[50, 51, 52, 53, 54, 55, 56, 57, 58, 59],
173+
...[60, 61, 62, 63, 64, 65, 66, 67, 68, 69],
174+
...[70, 71, 72, 73, 74, 75, 76, 77, 78, 79],
175+
...[80, 81, 82, 83, 84, 85, 86, 87, 88, 89],
176+
...[90, 91, 92, 93, 94, 95, 96, 97, 98, 99]
177+
];

pkg/_fe_analyzer_shared/analysis_options_no_lints.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ analyzer:
1919
- test/inference/inferred_type_arguments/data/**
2020
- test/inference/inferred_variable_types/data/**
2121
- test/inheritance/data/**
22+
- test/macros/api/**
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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+
import 'api_test_macro.dart';
6+
7+
main() {}
8+
9+
@ClassMacro()
10+
class Class1 {}
11+
12+
@ClassMacro()
13+
abstract class Class2 {}
14+
15+
@FunctionMacro()
16+
void topLevelFunction1(Class1 a, {Class1? b, required Class2? c}) {}
17+
18+
@FunctionMacro()
19+
external Class2 topLevelFunction2(Class1 a, [Class2? b]);

0 commit comments

Comments
 (0)