1
0
mirror of https://github.com/dart-lang/sdk synced 2024-07-03 08:19:13 +00:00

Trivial cleanup to make VSCode workspace for the SDK

free of diagnostics as long as you filter with "!TODO"

R=athom@google.com, jensj@google.com, natebiggs@google.com

Change-Id: I73cf3c5ef6dab81808330c4eb5f44cb62e753c81
Tested: manually verified that VSCode is warning free. No changes in functionality.
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/333903
Auto-Submit: Jacob Richman <jacobr@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Jacob Richman <jacobr@google.com>
This commit is contained in:
Jacob Richman 2023-11-07 17:49:53 +00:00 committed by Commit Queue
parent 51fa4aaac8
commit 933537b66b
26 changed files with 148 additions and 120 deletions

View File

@ -141,7 +141,7 @@ Future<int> currentHeapUsage(String wsUri) async {
final usage = await vmService.getIsolateGroupMemoryUsage(groupId); final usage = await vmService.getIsolateGroupMemoryUsage(groupId);
sum += usage.heapUsage! + usage.externalUsage!; sum += usage.heapUsage! + usage.externalUsage!;
} }
vmService.dispose(); unawaited(vmService.dispose());
return sum; return sum;
} }
@ -165,9 +165,12 @@ Future<List<String>> getGroupIds(vm_service.VmService vmService) async {
for (final groupRef in vm.isolateGroups!) { for (final groupRef in vm.isolateGroups!) {
final group = await vmService.getIsolateGroup(groupRef.id!); final group = await vmService.getIsolateGroup(groupRef.id!);
for (final isolateRef in group.isolates!) { for (final isolateRef in group.isolates!) {
final isolateOrSentinel = await vmService.getIsolate(isolateRef.id!); try {
if (isolateOrSentinel is vm_service.Isolate) { await vmService.getIsolate(isolateRef.id!);
groupIds.add(groupRef.id!); groupIds.add(groupRef.id!);
break;
} on vm_service.SentinelException catch (_) {
// Skip groups with only sentinels.
} }
} }
} }

View File

@ -4,6 +4,9 @@
// //
// Measure performance of string comparison. // Measure performance of string comparison.
// Using string interpolation could change what this test is measuring.
// ignore_for_file: prefer_interpolation_to_compose_strings
import 'package:benchmark_harness/benchmark_harness.dart'; import 'package:benchmark_harness/benchmark_harness.dart';
int equalCount = 0; int equalCount = 0;
@ -13,14 +16,14 @@ class LongStringCompare extends BenchmarkBase {
final List<String> s = []; final List<String> s = [];
String generateLongString(int lengthPower) { String generateLongString(int lengthPower) {
return "abc" * (1 << lengthPower) + "def"; return 'abc' * (1 << lengthPower) + 'def';
} }
LongStringCompare(int lengthPower, this.reps) LongStringCompare(int lengthPower, this.reps)
: super('LongStringCompare.${1 << lengthPower}.${reps}reps') { : super('LongStringCompare.${1 << lengthPower}.${reps}reps') {
final single = generateLongString(lengthPower); final single = generateLongString(lengthPower);
s.add(single + "." + single); s.add(single + '.' + single);
s.add(single + "!" + single); s.add(single + '!' + single);
} }
@override @override
@ -34,7 +37,7 @@ class LongStringCompare extends BenchmarkBase {
void run() { void run() {
for (int i = 0; i < reps; i++) { for (int i = 0; i < reps; i++) {
// Make string comparison code hoisting harder for the compiler to do. // Make string comparison code hoisting harder for the compiler to do.
bool comparison = s[i % 2] == s[(i + 1) % 2]; final bool comparison = s[i % 2] == s[(i + 1) % 2];
if (comparison) { if (comparison) {
equalCount++; equalCount++;
} }
@ -46,5 +49,5 @@ void main() {
LongStringCompare(1, 3000).report(); LongStringCompare(1, 3000).report();
LongStringCompare(5, 1000).report(); LongStringCompare(5, 1000).report();
LongStringCompare(10, 30).report(); LongStringCompare(10, 30).report();
if (equalCount > 0) throw StateError("Unexpected equalCount: $equalCount"); if (equalCount > 0) throw StateError('Unexpected equalCount: $equalCount');
} }

View File

@ -18,7 +18,9 @@ class Pair {
final int v0; final int v0;
final int v1; final int v1;
const Pair(this.v0, this.v1); const Pair(this.v0, this.v1);
@override
bool operator ==(other) => other is Pair && v0 == other.v0 && v1 == other.v1; bool operator ==(other) => other is Pair && v0 == other.v0 && v1 == other.v1;
@override
int get hashCode => Object.hash(v0, v1); int get hashCode => Object.hash(v0, v1);
} }
@ -30,7 +32,7 @@ List<Object> getPolymorphicListOfClass(
if (withValues) { if (withValues) {
return List<Pair>.generate(length, (i) => Pair(i, i), growable: growable); return List<Pair>.generate(length, (i) => Pair(i, i), growable: growable);
} else { } else {
return List<Pair>.filled(length, Pair(-1, -1), growable: growable); return List<Pair>.filled(length, const Pair(-1, -1), growable: growable);
} }
} else { } else {
return List<String>.filled(0, '', growable: growable); return List<String>.filled(0, '', growable: growable);
@ -89,7 +91,7 @@ class BenchListAddPolyClass extends BenchmarkBase {
list.add(Pair(i, i)); list.add(Pair(i, i));
} }
final int mid = (list[N ~/ 2] as Pair).v0; final int mid = (list[N ~/ 2] as Pair).v0;
if (mid != N ~/ 2) throw 'Bad result: ${mid}'; if (mid != N ~/ 2) throw 'Bad result: $mid';
} }
} }
@ -104,7 +106,7 @@ class BenchListAddPolyRecord extends BenchmarkBase {
list.add((i, i)); list.add((i, i));
} }
final int mid = (list[N ~/ 2] as (int, int)).$1; final int mid = (list[N ~/ 2] as (int, int)).$1;
if (mid != N ~/ 2) throw 'Bad result: ${mid}'; if (mid != N ~/ 2) throw 'Bad result: $mid';
} }
} }
@ -113,7 +115,7 @@ class BenchListSetIndexedClass extends BenchmarkBase {
@override @override
void run() { void run() {
final list = List<Pair>.filled(N, Pair(-1, -1), growable: false); final list = List<Pair>.filled(N, const Pair(-1, -1), growable: false);
for (int i = 0; i < N; ++i) { for (int i = 0; i < N; ++i) {
list[i] = Pair(i, i); list[i] = Pair(i, i);
} }
@ -146,7 +148,7 @@ class BenchListSetIndexedPolyClass extends BenchmarkBase {
list[i] = Pair(i, i); list[i] = Pair(i, i);
} }
final int mid = (list[N ~/ 2] as Pair).v0; final int mid = (list[N ~/ 2] as Pair).v0;
if (mid != N ~/ 2) throw 'Bad result: ${mid}'; if (mid != N ~/ 2) throw 'Bad result: $mid';
} }
} }
@ -162,7 +164,7 @@ class BenchListSetIndexedPolyRecord extends BenchmarkBase {
list[i] = (i, i); list[i] = (i, i);
} }
final int mid = (list[N ~/ 2] as (int, int)).$1; final int mid = (list[N ~/ 2] as (int, int)).$1;
if (mid != N ~/ 2) throw 'Bad result: ${mid}'; if (mid != N ~/ 2) throw 'Bad result: $mid';
} }
} }
@ -366,7 +368,7 @@ class BenchMapLookupClass extends BenchmarkBase {
for (int i = 0; i < N; ++i) { for (int i = 0; i < N; ++i) {
sum += map[Pair(i, i)]!; sum += map[Pair(i, i)]!;
} }
if (sum != SUM) throw 'Bad result: ${sum}'; if (sum != SUM) throw 'Bad result: $sum';
} }
} }
@ -383,7 +385,7 @@ class BenchMapLookupRecord extends BenchmarkBase {
for (int i = 0; i < N; ++i) { for (int i = 0; i < N; ++i) {
sum += map[(i, i)]!; sum += map[(i, i)]!;
} }
if (sum != SUM) throw 'Bad result: ${sum}'; if (sum != SUM) throw 'Bad result: $sum';
} }
} }
@ -426,7 +428,7 @@ class BenchSetLookupClass extends BenchmarkBase {
for (int i = 0; i < N; ++i) { for (int i = 0; i < N; ++i) {
sum += set.contains(Pair(i, i)) ? 1 : 0; sum += set.contains(Pair(i, i)) ? 1 : 0;
} }
if (sum != N ~/ 2) throw 'Bad result: ${sum}'; if (sum != N ~/ 2) throw 'Bad result: $sum';
} }
} }
@ -443,7 +445,7 @@ class BenchSetLookupRecord extends BenchmarkBase {
for (int i = 0; i < N; ++i) { for (int i = 0; i < N; ++i) {
sum += set.contains((i, i)) ? 1 : 0; sum += set.contains((i, i)) ? 1 : 0;
} }
if (sum != N ~/ 2) throw 'Bad result: ${sum}'; if (sum != N ~/ 2) throw 'Bad result: $sum';
} }
} }

View File

@ -2,6 +2,8 @@
// for details. All rights reserved. Use of this source code is governed by a // 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. // BSD-style license that can be found in the LICENSE file.
// ignore_for_file: unused_field
typedef State = _Class; typedef State = _Class;
class _Class { class _Class {

View File

@ -2,6 +2,8 @@
// for details. All rights reserved. Use of this source code is governed by a // 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. // BSD-style license that can be found in the LICENSE file.
// ignore_for_file: unused_field
typedef State = _Strings; typedef State = _Strings;
class _Strings { class _Strings {

View File

@ -827,50 +827,50 @@ class Float64ListViewVarBench extends BenchmarkBase {
void main() { void main() {
final microBenchmarks = [ final microBenchmarks = [
() => Int8ListBench(), Int8ListBench.new,
() => Uint8ListBench(), Uint8ListBench.new,
() => Uint8ClampedListBench(), Uint8ClampedListBench.new,
() => Int16ListBench(), Int16ListBench.new,
() => Uint16ListBench(), Uint16ListBench.new,
() => Int32ListBench(), Int32ListBench.new,
() => Uint32ListBench(), Uint32ListBench.new,
() => Int64ListBench(), Int64ListBench.new,
() => Uint64ListBench(), Uint64ListBench.new,
() => Float32ListBench(), Float32ListBench.new,
() => Float64ListBench(), Float64ListBench.new,
() => Int8ListViewBench(), Int8ListViewBench.new,
() => Uint8ListViewBench(), Uint8ListViewBench.new,
() => Uint8ClampedListViewBench(), Uint8ClampedListViewBench.new,
() => Int16ListViewBench(), Int16ListViewBench.new,
() => Uint16ListViewBench(), Uint16ListViewBench.new,
() => Int32ListViewBench(), Int32ListViewBench.new,
() => Uint32ListViewBench(), Uint32ListViewBench.new,
() => Int64ListViewBench(), Int64ListViewBench.new,
() => Uint64ListViewBench(), Uint64ListViewBench.new,
() => Float32ListViewBench(), Float32ListViewBench.new,
() => Float64ListViewBench(), Float64ListViewBench.new,
() => Int8ListVarBench(), Int8ListVarBench.new,
() => Uint8ListVarBench(), Uint8ListVarBench.new,
() => Uint8ClampedListVarBench(), Uint8ClampedListVarBench.new,
() => Int16ListVarBench(), Int16ListVarBench.new,
() => Uint16ListVarBench(), Uint16ListVarBench.new,
() => Int32ListVarBench(), Int32ListVarBench.new,
() => Uint32ListVarBench(), Uint32ListVarBench.new,
() => Int64ListVarBench(), Int64ListVarBench.new,
() => Uint64ListVarBench(), Uint64ListVarBench.new,
() => Float32ListVarBench(), Float32ListVarBench.new,
() => Float64ListVarBench(), Float64ListVarBench.new,
() => Int8ListViewVarBench(), Int8ListViewVarBench.new,
() => Uint8ListViewVarBench(), Uint8ListViewVarBench.new,
() => Uint8ClampedListViewVarBench(), Uint8ClampedListViewVarBench.new,
() => Int16ListViewVarBench(), Int16ListViewVarBench.new,
() => Uint16ListViewVarBench(), Uint16ListViewVarBench.new,
() => Int32ListViewVarBench(), Int32ListViewVarBench.new,
() => Uint32ListViewVarBench(), Uint32ListViewVarBench.new,
() => Int64ListViewVarBench(), Int64ListViewVarBench.new,
() => Uint64ListViewVarBench(), Uint64ListViewVarBench.new,
() => Float32ListViewVarBench(), Float32ListViewVarBench.new,
() => Float64ListViewVarBench(), Float64ListViewVarBench.new,
]; ];
for (var mbm in microBenchmarks) { for (var mbm in microBenchmarks) {
mbm().report(); mbm().report();

View File

@ -6,11 +6,11 @@ import 'TypedDataCopyLib.dart';
void main() { void main() {
final benchmarks = [ final benchmarks = [
() => Int8ViewToInt8View(), Int8ViewToInt8View.new,
() => Int8ToInt8(), Int8ToInt8.new,
() => Int8ToUint8Clamped(), Int8ToUint8Clamped.new,
() => Int8ViewToInt8(), Int8ViewToInt8.new,
() => ByteSwap(), ByteSwap.new,
]; ];
// Run all the code to ensure consistent polymorphism in shared code. // Run all the code to ensure consistent polymorphism in shared code.

View File

@ -76,7 +76,7 @@ final class UiMatrix {
/// 0 0 0 1 /// 0 0 0 1
/// ///
/// If both `x` and `y` are zero, returns the [identity] constant. /// If both `x` and `y` are zero, returns the [identity] constant.
static UiMatrix translation2d({ required double dx, required double dy }) { static UiMatrix translation2d({required double dx, required double dy}) {
if (dx == 0 && dy == 0) { if (dx == 0 && dy == 0) {
return identity; return identity;
} }
@ -234,8 +234,12 @@ final class UiMatrix {
required double m11, required double m11,
required double m03, required double m03,
required double m13, required double m13,
_MatrixExtension? rest = null, _MatrixExtension? rest,
}) : _m00 = m00, _m11 = m11, _m03 = m03, _m13 = m13, _rest = rest; }) : _m00 = m00,
_m11 = m11,
_m03 = m03,
_m13 = m13,
_rest = rest;
final double _m00; final double _m00;
final double _m11; final double _m11;
@ -272,7 +276,7 @@ final class UiMatrix {
_MatrixExtension? rest; _MatrixExtension? rest;
if (otherRest != null || selfRest != null) { if (otherRest != null || selfRest != null) {
rest = (selfRest ?? _MatrixExtension._identityExtension) + rest = (selfRest ?? _MatrixExtension._identityExtension) +
(otherRest ?? _MatrixExtension._identityExtension); (otherRest ?? _MatrixExtension._identityExtension);
} }
return UiMatrix._( return UiMatrix._(
@ -310,11 +314,13 @@ final class UiMatrix {
m13: _m13 + _m11 * n13, m13: _m13 + _m11 * n13,
); );
} else { } else {
return _generalMultiply(this, selfRest, other, _MatrixExtension._identityExtension); return _generalMultiply(
this, selfRest, other, _MatrixExtension._identityExtension);
} }
} else { } else {
if (selfRest == null) { if (selfRest == null) {
return _generalMultiply(this, _MatrixExtension._identityExtension, other, otherRest); return _generalMultiply(
this, _MatrixExtension._identityExtension, other, otherRest);
} else { } else {
return _generalMultiply(this, selfRest, other, otherRest); return _generalMultiply(this, selfRest, other, otherRest);
} }
@ -356,8 +362,8 @@ final class UiMatrix {
return UiMatrix.simple2d( return UiMatrix.simple2d(
scaleX: a11 * invDet, scaleX: a11 * invDet,
scaleY: a00 * invDet, scaleY: a00 * invDet,
dx: - a11 * a30 * invDet, dx: -a11 * a30 * invDet,
dy: - a00 * a31 * invDet, dy: -a00 * a31 * invDet,
); );
} else { } else {
return _generalInvert(this, rest); return _generalInvert(this, rest);
@ -395,18 +401,18 @@ final class _MatrixExtension {
required double m31, required double m31,
required double m32, required double m32,
required double m33, required double m33,
}) : _m01 = m01, }) : _m01 = m01,
_m02 = m02, _m02 = m02,
_m10 = m10, _m10 = m10,
_m12 = m12, _m12 = m12,
_m20 = m20, _m20 = m20,
_m21 = m21, _m21 = m21,
_m22 = m22, _m22 = m22,
_m23 = m23, _m23 = m23,
_m30 = m30, _m30 = m30,
_m31 = m31, _m31 = m31,
_m32 = m32, _m32 = m32,
_m33 = m33; _m33 = m33;
final double _m01; final double _m01;
final double _m02; final double _m02;
@ -456,7 +462,8 @@ final class _MatrixExtension {
} }
} }
UiMatrix _generalMultiply(UiMatrix m, _MatrixExtension mExt, UiMatrix n, _MatrixExtension nExt) { UiMatrix _generalMultiply(
UiMatrix m, _MatrixExtension mExt, UiMatrix n, _MatrixExtension nExt) {
final double m00 = m._m00; final double m00 = m._m00;
final double m01 = mExt._m01; final double m01 = mExt._m01;
final double m02 = mExt._m02; final double m02 = mExt._m02;

View File

@ -39,10 +39,9 @@ linter:
- hash_and_equals - hash_and_equals
- implementation_imports - implementation_imports
#- invariant_booleans #- invariant_booleans
- iterable_contains_unrelated_type - collection_methods_unrelated_type
- library_names - library_names
- library_prefixes - library_prefixes
- list_remove_unrelated_type
#- literal_only_boolean_expressions #- literal_only_boolean_expressions
- no_adjacent_strings_in_list - no_adjacent_strings_in_list
- no_duplicate_case_values - no_duplicate_case_values

View File

@ -225,7 +225,7 @@ class NativeCodegenEnqueuer extends NativeEnqueuer {
_registerTypeUses(impactBuilder, _nativeClasses /*, 'forced'*/); _registerTypeUses(impactBuilder, _nativeClasses /*, 'forced'*/);
} }
// HACK - add all the resolved classes. // TODO: this code is a bit of a hack to add all the resolved classes.
Set<ClassEntity> matchingClasses = {}; Set<ClassEntity> matchingClasses = {};
for (ClassEntity classElement in _nativeClasses) { for (ClassEntity classElement in _nativeClasses) {
if (_unusedClasses.contains(classElement)) { if (_unusedClasses.contains(classElement)) {

View File

@ -108,12 +108,12 @@ class CommandOutput {
bool _didFail(TestCase testCase) => exitCode != 0 && !hasCrashed; bool _didFail(TestCase testCase) => exitCode != 0 && !hasCrashed;
bool get canRunDependentCommands { bool get canRunDependentCommands {
// FIXME(kustermann): We may need to change this // TODO(kustermann): We may need to change this
return !hasTimedOut && exitCode == 0; return !hasTimedOut && exitCode == 0;
} }
bool get successful { bool get successful {
// FIXME(kustermann): We may need to change this // TODO(kustermann): We may need to change this
return !hasTimedOut && exitCode == 0; return !hasTimedOut && exitCode == 0;
} }
@ -230,7 +230,7 @@ class BrowserTestJsonResult {
return types.any((type) => messagesByType[type]!.contains(message)); return types.any((type) => messagesByType[type]!.contains(message));
} }
// FIXME(kustermann,ricow): I think this functionality doesn't work in // TODO(kustermann,ricow): I think this functionality doesn't work in
// test_controller.js: So far I haven't seen anything being reported on // test_controller.js: So far I haven't seen anything being reported on
// "window.compilationerror" // "window.compilationerror"
if (occurred('window_compilationerror')) { if (occurred('window_compilationerror')) {

View File

@ -930,17 +930,21 @@ class _SnapshotGraph implements SnapshotGraph {
classes[0] = _SnapshotClass._new(this, 0, "Root", "", ""); classes[0] = _SnapshotClass._new(this, 0, "Root", "", "");
for (var cid = 1; cid <= K; cid++) { for (var cid = 1; cid <= K; cid++) {
// ignore: unused_local_variable
int flags = stream.readUnsigned(); int flags = stream.readUnsigned();
String name = stream.readUtf8(); String name = stream.readUtf8();
String libName = stream.readUtf8(); String libName = stream.readUtf8();
String libUri = stream.readUtf8(); String libUri = stream.readUtf8();
// ignore: unused_local_variable
String reserved = stream.readUtf8(); String reserved = stream.readUtf8();
final cls = _SnapshotClass._new(this, cid, name, libName, libUri); final cls = _SnapshotClass._new(this, cid, name, libName, libUri);
int edgeCount = stream.readUnsigned(); int edgeCount = stream.readUnsigned();
for (int i = 0; i < edgeCount; i++) { for (int i = 0; i < edgeCount; i++) {
// ignore: unused_local_variable
int flags = stream.readUnsigned(); int flags = stream.readUnsigned();
int index = stream.readUnsigned(); int index = stream.readUnsigned();
String fieldName = stream.readUtf8(); String fieldName = stream.readUtf8();
// ignore: unused_local_variable
String reserved = stream.readUtf8(); String reserved = stream.readUtf8();
cls.fields[index] = fieldName; cls.fields[index] = fieldName;
} }
@ -1051,6 +1055,7 @@ class _SnapshotGraph implements SnapshotGraph {
for (var i = 0; i < externalPropertyCount; i++) { for (var i = 0; i < externalPropertyCount; i++) {
final oid = stream.readUnsigned(); final oid = stream.readUnsigned();
final externalSize = stream.readUnsigned(); final externalSize = stream.readUnsigned();
// ignore: unused_local_variable
final name = stream.readUtf8(); final name = stream.readUtf8();
externalSizes[oid] += externalSize; externalSizes[oid] += externalSize;
} }

View File

@ -166,7 +166,7 @@ class VMPage extends MatchingPage {
app.events, app.events,
app.notifications, app.notifications,
new IsolateRepository(app.vm), new IsolateRepository(app.vm),
new IsolateGroupRepository(app.vm), new IsolateGroupRepository(),
_scriptRepository, _scriptRepository,
queue: app.queue) queue: app.queue)
.element .element

View File

@ -2942,6 +2942,7 @@ class DebuggerConsoleElement extends CustomElement implements Renderable {
DebuggerConsoleElement.created() : super.created('debugger-console'); DebuggerConsoleElement.created() : super.created('debugger-console');
/// Is [container] scrolled to the within [threshold] pixels of the bottom? /// Is [container] scrolled to the within [threshold] pixels of the bottom?
// ignore: unused_element
static bool _isScrolledToBottom(DivElement? container, [int threshold = 2]) { static bool _isScrolledToBottom(DivElement? container, [int threshold = 2]) {
if (container == null) { if (container == null) {
return false; return false;

View File

@ -309,7 +309,6 @@ class SnapshotClassDiff {
for (var classA in graphA.classes) { for (var classA in graphA.classes) {
var classDiff = new SnapshotClassDiff(); var classDiff = new SnapshotClassDiff();
var qualifiedName = classA.qualifiedName; var qualifiedName = classA.qualifiedName;
var name = classA.name;
classDiff._a = classA; classDiff._a = classA;
var classB = classesB[qualifiedName]; var classB = classesB[qualifiedName];
if (classB != null) { if (classB != null) {

View File

@ -62,7 +62,6 @@ class MetricGraphElement extends CustomElement implements Renderable {
message = 'min: $min, $message'; message = 'min: $min, $message';
message = message + ', max: $max'; message = message + ', max: $max';
final host = new DivElement();
children = <Element>[ children = <Element>[
new DivElement() new DivElement()
..classes = ['memberList'] ..classes = ['memberList']

View File

@ -240,7 +240,7 @@ class PersistentHandlesPageElement extends CustomElement implements Renderable {
]; ];
} }
Future _refresh({bool gc = false, bool reset = false}) async { Future _refresh() async {
_handles = null; _handles = null;
_r.dirty(); _r.dirty();
_handles = await _repository.get(_isolate); _handles = await _repository.get(_isolate);

View File

@ -5,9 +5,7 @@
part of repositories; part of repositories;
class IsolateGroupRepository extends M.IsolateGroupRepository { class IsolateGroupRepository extends M.IsolateGroupRepository {
final S.VM _vm; IsolateGroupRepository();
IsolateGroupRepository(this._vm);
Future<M.IsolateGroup> get(M.IsolateGroupRef i) async { Future<M.IsolateGroup> get(M.IsolateGroupRef i) async {
S.IsolateGroup isolateGroup = i as S.IsolateGroup; S.IsolateGroup isolateGroup = i as S.IsolateGroup;

View File

@ -6,9 +6,6 @@ part of repositories;
class TimelineRepository extends TimelineRepositoryBase class TimelineRepository extends TimelineRepositoryBase
implements M.TimelineRepository { implements M.TimelineRepository {
static const _kStackFrames = 'stackFrames';
static const _kTraceEvents = 'traceEvents';
Future<M.TimelineFlags> getFlags(M.VMRef ref) async { Future<M.TimelineFlags> getFlags(M.VMRef ref) async {
S.VM vm = ref as S.VM; S.VM vm = ref as S.VM;
S.ServiceMap response = S.ServiceMap response =

View File

@ -433,7 +433,7 @@ class DartApi {
} }
} }
final typeToLibraryMethods; final Map<DartType, List<DartLib>> typeToLibraryMethods;
} }
/// Class that generates a random, but runnable Dart program for fuzz testing. /// Class that generates a random, but runnable Dart program for fuzz testing.
@ -912,7 +912,7 @@ class DartFuzz {
emitMethods(classMethods[currentClassIndex!]); emitMethods(classMethods[currentClassIndex!]);
emitFunctionDefinition('run', () { emitFunctionDefinition('run', () {
if (i > 0) { if (i > 0) {
// FIXME(bkonyi): fix potential issue where we try to apply a class // TODO(bkonyi): fix potential issue where we try to apply a class
// as a mixin when it calls super. // as a mixin when it calls super.
emitLn('super.run();'); emitLn('super.run();');
} }
@ -1160,7 +1160,7 @@ class DartFuzz {
// Emit a throw statement. // Emit a throw statement.
bool emitThrow() { bool emitThrow() {
var tp; DartType tp;
do { do {
tp = oneOfSet(dartType.allTypes).toNonNullable(); tp = oneOfSet(dartType.allTypes).toNonNullable();
} while (tp == DartType.NULL); } while (tp == DartType.NULL);
@ -1680,7 +1680,7 @@ class DartFuzz {
} }
void emitCollection(int depth, DartType tp, {RhsFilter? rhsFilter}) { void emitCollection(int depth, DartType tp, {RhsFilter? rhsFilter}) {
var l, r; String l, r;
if (DartType.isListType(tp)) { if (DartType.isListType(tp)) {
var elementType = dartType.elementType(tp); var elementType = dartType.elementType(tp);
l = '<${elementType.dartName}>['; l = '<${elementType.dartName}>[';
@ -1708,7 +1708,8 @@ class DartFuzz {
} }
void emitConstCollection(int depth, DartType tp, {RhsFilter? rhsFilter}) { void emitConstCollection(int depth, DartType tp, {RhsFilter? rhsFilter}) {
var l, r, canHaveElements; String l, r;
bool canHaveElements;
if (DartType.isListType(tp)) { if (DartType.isListType(tp)) {
var elementType = dartType.elementType(tp); var elementType = dartType.elementType(tp);
l = 'const <${elementType.dartName}>['; l = 'const <${elementType.dartName}>[';
@ -2504,12 +2505,13 @@ void main(List<String> arguments) {
help: 'Bitmask indicating which expressions to omit' help: 'Bitmask indicating which expressions to omit'
'(Bit=1 omits)', '(Bit=1 omits)',
defaultsTo: '0'); defaultsTo: '0');
var results; final ArgResults results;
try { try {
results = parser.parse(arguments); results = parser.parse(arguments);
} catch (e) { } catch (e) {
print('Usage: dart dartfuzz.dart [OPTIONS] FILENAME\n${parser.usage}\n$e'); print('Usage: dart dartfuzz.dart [OPTIONS] FILENAME\n${parser.usage}\n$e');
exitCode = 255; exitCode = 255;
return;
} }
final seed = getSeed(results[kSeed]); final seed = getSeed(results[kSeed]);
final fp = results[kFp]; final fp = results[kFp];

View File

@ -2,7 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a // 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. // BSD-style license that can be found in the LICENSE file.
/// NOTE: this code has been generated automatically. // NOTE: this code has been generated automatically.
import 'dartfuzz_type_table.dart'; import 'dartfuzz_type_table.dart';

View File

@ -2,6 +2,8 @@
// for details. All rights reserved. Use of this source code is governed by a // 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. // BSD-style license that can be found in the LICENSE file.
// ignore_for_file: non_constant_identifier_names
import 'dart:io'; import 'dart:io';
import 'dart:isolate'; import 'dart:isolate';
import 'dart:math'; import 'dart:math';
@ -756,7 +758,7 @@ void main(List<String> arguments) {
help: 'path to output (ignored)', defaultsTo: null); help: 'path to output (ignored)', defaultsTo: null);
// Starts fuzz testing session. // Starts fuzz testing session.
var results; ArgResults results;
try { try {
results = parser.parse(arguments); results = parser.parse(arguments);
} catch (e) { } catch (e) {

View File

@ -1137,9 +1137,9 @@ void analyzeTypes(Set<InterfaceType> allTypes) {
} }
// Group current type with their respective type group. // Group current type with their respective type group.
if (iTyp.name == 'Set') setTypes.add(typName); if (iTyp.element.name == 'Set') setTypes.add(typName);
if (iTyp.name == 'List') listTypes.add(typName); if (iTyp.element.name == 'List') listTypes.add(typName);
if (iTyp.name == 'Map') mapTypes.add(typName); if (iTyp.element.name == 'Map') mapTypes.add(typName);
if (iTyp.typeArguments.length == 1) { if (iTyp.typeArguments.length == 1) {
// Analyze Array, List and Set types. // Analyze Array, List and Set types.
@ -1190,11 +1190,12 @@ void getParameterizedTypes(
// Out: types with no parameters. // Out: types with no parameters.
for (var tp in allTypes) { for (var tp in allTypes) {
if (tp.typeArguments.length == 1 && if (tp.typeArguments.length == 1 &&
(tp.typeArguments[0].name == 'E' || tp.typeArguments[0].name == 'T')) { (tp.typeArguments[0].element?.name == 'E' ||
tp.typeArguments[0].element?.name == 'T')) {
pTypes1.add(tp); pTypes1.add(tp);
} else if (tp.typeArguments.length == 2 && } else if (tp.typeArguments.length == 2 &&
tp.typeArguments[0].name == 'K' && tp.typeArguments[0].element?.name == 'K' &&
tp.typeArguments[1].name == 'V') { tp.typeArguments[1].element?.name == 'V') {
pTypes2.add(tp); pTypes2.add(tp);
} else { } else {
iTypes.add(tp); iTypes.add(tp);

View File

@ -23,11 +23,11 @@ class GenUtil {
} }
// Create an analyzer session. // Create an analyzer session.
static AnalysisSession createAnalysisSession([String? dart_top]) { static AnalysisSession createAnalysisSession([String? dartTop]) {
// Set paths. Note that for this particular use case, packageRoot can be // Set paths. Note that for this particular use case, packageRoot can be
// any directory. Here, we set it to the top of the SDK development, and // any directory. Here, we set it to the top of the SDK development, and
// derive the required sdkPath from there. // derive the required sdkPath from there.
final packageRoot = getTop(dart_top); final packageRoot = getTop(dartTop);
final sdkPath = '$packageRoot/sdk'; final sdkPath = '$packageRoot/sdk';
// This does most of the hard work of getting the analyzer configured // This does most of the hard work of getting the analyzer configured

View File

@ -7,6 +7,8 @@
// The PointerPointer and PointerStruct extension are written by hand since // The PointerPointer and PointerStruct extension are written by hand since
// those are not repetitive. // those are not repetitive.
// ignore_for_file: unused_local_variable
import 'dart:io'; import 'dart:io';
import 'package:args/args.dart'; import 'package:args/args.dart';

View File

@ -60,6 +60,10 @@
"third_party", "third_party",
"runtime/third_party", "runtime/third_party",
// This package depends on a package that will not be brought in as a
// dart-sdk dep. https://github.com/dart-lang/sdk/issues/50061
"runtime/tools/heapsnapshot",
// We probably can include 'lib', but it currently shows too many errors. // We probably can include 'lib', but it currently shows too many errors.
// We would need to ignore import_internal_library, and other warnings // We would need to ignore import_internal_library, and other warnings
// on a per-file basis, since the analyzer is designed to work with // on a per-file basis, since the analyzer is designed to work with