Skip to content

Commit

Permalink
Version 3.4.0-166.0.dev
Browse files Browse the repository at this point in the history
Merge b6aa297 into dev
  • Loading branch information
Dart CI committed Feb 22, 2024
2 parents cb82075 + b6aa297 commit 561cbc6
Show file tree
Hide file tree
Showing 24 changed files with 129 additions and 131 deletions.
2 changes: 1 addition & 1 deletion DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ vars = {
"co19_rev": "867d139b3169fc131488e893ec1133dc98cc3aa0",

# The internal benchmarks to use. See go/dart-benchmarks-internal
"benchmarks_internal_rev": "3e58fcfa1464ffd7b1d3edc7a8d5d9a24a321c5d",
"benchmarks_internal_rev": "175974d2b43dae39c380fc5f7f583a377cd3c11d",
"checkout_benchmarks_internal": False,

# Checkout the flute benchmark only when benchmarking.
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/Iterators/dart/Iterators.dart
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ void pollute() {
///
/// Run benchmarks with name containing all the dot-separated words in the
/// selector, so `--Set.const` will run benchmark
/// 'Iterators.const.Set.int.N`, and `--2.UpTo` will select
/// `Iterators.const.Set.int.N`, and `--2.UpTo` will select
/// `Iterators.UpTo.2`. Each selector is matched independently, and if
/// selectors are used, only benchmarks matching some selector are run.
///
Expand Down
7 changes: 0 additions & 7 deletions benchmarks/LongStringCompare/dart/LongStringCompare.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,6 @@ class LongStringCompare extends BenchmarkBase {
s.add(single + '!' + single);
}

@override
void warmup() {
for (int i = 0; i < reps / 2; i++) {
run();
}
}

@override
void run() {
for (int i = 0; i < reps; i++) {
Expand Down
7 changes: 0 additions & 7 deletions benchmarks/MD5/dart/md5.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,6 @@ class MD5Bench extends BenchmarkBase {
: data = List<int>.generate(size, (i) => i % 256, growable: false),
super('MD5');

@override
void warmup() {
for (int i = 0; i < 4; i++) {
run();
}
}

@override
void run() {
final hash = md5.convert(data);
Expand Down
7 changes: 0 additions & 7 deletions benchmarks/MD5/dart2/md5.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,6 @@ class MD5Bench extends BenchmarkBase {
}
}

@override
void warmup() {
for (int i = 0; i < 4; i++) {
run();
}
}

@override
void run() {
final hash = md5.convert(data);
Expand Down
7 changes: 0 additions & 7 deletions benchmarks/SHA1/dart/sha1.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,6 @@ class SHA1Bench extends BenchmarkBase {
: data = List<int>.generate(size, (i) => i % 256, growable: false),
super('SHA1');

@override
void warmup() {
for (int i = 0; i < 4; i++) {
run();
}
}

@override
void run() {
final hash = sha1.convert(data);
Expand Down
7 changes: 0 additions & 7 deletions benchmarks/SHA1/dart2/sha1.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,6 @@ class SHA1Bench extends BenchmarkBase {
}
}

@override
void warmup() {
for (int i = 0; i < 4; i++) {
run();
}
}

@override
void run() {
final hash = sha1.convert(data);
Expand Down
7 changes: 0 additions & 7 deletions benchmarks/SHA256/dart/sha256.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,6 @@ class SHA256Bench extends BenchmarkBase {
: data = List<int>.generate(size, (i) => i % 256, growable: false),
super('SHA256');

@override
void warmup() {
for (int i = 0; i < 4; i++) {
run();
}
}

@override
void run() {
final hash = sha256.convert(data);
Expand Down
7 changes: 0 additions & 7 deletions benchmarks/SHA256/dart2/sha256.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,6 @@ class SHA256Bench extends BenchmarkBase {
}
}

@override
void warmup() {
for (int i = 0; i < 4; i++) {
run();
}
}

@override
void run() {
final hash = sha256.convert(data);
Expand Down
7 changes: 0 additions & 7 deletions benchmarks/TypedDataDuplicate/dart/TypedDataDuplicate.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,6 @@ abstract class Uint8ListCopyBenchmark extends BenchmarkBase {
}
}

@override
void warmup() {
for (var i = 0; i < 100; ++i) {
run();
}
}

@override
void teardown() {
for (var i = 0; i < size; ++i) {
Expand Down
7 changes: 0 additions & 7 deletions benchmarks/TypedDataDuplicate/dart2/TypedDataDuplicate.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,6 @@ abstract class Uint8ListCopyBenchmark extends BenchmarkBase {
}
}

@override
void warmup() {
for (var i = 0; i < 100; ++i) {
run();
}
}

@override
void teardown() {
for (var i = 0; i < size; ++i) {
Expand Down
9 changes: 3 additions & 6 deletions benchmarks/Utf8Decode/dart/Utf8Decode.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ class Utf8Decode extends BenchmarkBase {
String name = 'Utf8Decode.$language.';
name += size >= 1000000
? '${size ~/ 1000000}M'
: size >= 1000 ? '${size ~/ 1000}k' : '$size';
: size >= 1000
? '${size ~/ 1000}k'
: '$size';
if (allowMalformed) name += '.malformed';
return name;
}
Expand Down Expand Up @@ -93,11 +95,6 @@ class Utf8Decode extends BenchmarkBase {
run();
}

@override
void warmup() {
BenchmarkBase.measureFor(run, 1000);
}

@override
double measure() {
// Report time per input byte.
Expand Down
9 changes: 3 additions & 6 deletions benchmarks/Utf8Decode/dart2/Utf8Decode.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ class Utf8Decode extends BenchmarkBase {
String name = 'Utf8Decode.$language.';
name += size >= 1000000
? '${size ~/ 1000000}M'
: size >= 1000 ? '${size ~/ 1000}k' : '$size';
: size >= 1000
? '${size ~/ 1000}k'
: '$size';
if (allowMalformed) name += '.malformed';
return name;
}
Expand Down Expand Up @@ -95,11 +97,6 @@ class Utf8Decode extends BenchmarkBase {
run();
}

@override
void warmup() {
BenchmarkBase.measureFor(run, 1000);
}

@override
double measure() {
// Report time per input byte.
Expand Down
5 changes: 0 additions & 5 deletions benchmarks/Utf8DecodeComplex/dart/benchmarks.dart
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,6 @@ class Utf8DecodeBenchmarkBase extends BenchmarkBase {
run();
}

@override
void warmup() {
BenchmarkBase.measureFor(run, 100);
}

@override
double measure() {
// Report time per input byte.
Expand Down
5 changes: 0 additions & 5 deletions benchmarks/Utf8Encode/dart/Utf8Encode.dart
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,6 @@ class Utf8Encode extends BenchmarkBase {
run();
}

@override
void warmup() {
BenchmarkBase.measureFor(run, 1000);
}

@override
double measure() {
// Report time per input rune.
Expand Down
5 changes: 0 additions & 5 deletions benchmarks/Utf8Encode/dart2/Utf8Encode.dart
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,6 @@ class Utf8Encode extends BenchmarkBase {
run();
}

@override
void warmup() {
BenchmarkBase.measureFor(run, 1000);
}

@override
double measure() {
// Report time per input rune.
Expand Down
25 changes: 16 additions & 9 deletions pkg/_fe_analyzer_shared/lib/src/macros/executor/execute_macro.dart
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,7 @@ Future<MacroExecutionResult> executeTypesMacro(
builder.failWithException(e);
} else {
// Convert exceptions thrown by macro implementations into diagnostics.
builder.report(new Diagnostic(
new DiagnosticMessage('Unhandled error: $e\n' 'Stack trace:\n$s'),
Severity.error));
builder.report(_unexpectedExceptionDiagnostic(e, s));
}
}
return builder.result;
Expand Down Expand Up @@ -146,9 +144,7 @@ Future<MacroExecutionResult> executeDeclarationsMacro(Macro macro,
builder.failWithException(e);
} else {
// Convert exceptions thrown by macro implementations into diagnostics.
builder.report(new Diagnostic(
new DiagnosticMessage('Unhandled error: $e\n' 'Stack trace:\n$s'),
Severity.error));
builder.report(_unexpectedExceptionDiagnostic(e, s));
}
}
return builder.result;
Expand Down Expand Up @@ -223,10 +219,21 @@ Future<MacroExecutionResult> executeDefinitionMacro(Macro macro, Object target,
builder.failWithException(e);
} else {
// Convert exceptions thrown by macro implementations into diagnostics.
builder.report(new Diagnostic(
new DiagnosticMessage('Unhandled error: $e\n' 'Stack trace:\n$s'),
Severity.error));
builder.report(_unexpectedExceptionDiagnostic(e, s));
}
}
return builder.result;
}

// It's a bug in the macro but we need to show something to the user; put the
// debug detail in a context message and suggest reporting to the author.
Diagnostic _unexpectedExceptionDiagnostic(
Object thrown, StackTrace stackTrace) =>
new Diagnostic(
new DiagnosticMessage(
'Macro application failed due to a bug in the macro.'),
Severity.error,
contextMessages: [
new DiagnosticMessage('$thrown\n$stackTrace'),
],
correctionMessage: 'Try reporting the failure to the macro author.');
16 changes: 8 additions & 8 deletions pkg/analyzer/test/src/dart/resolution/macro_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ class A {}
18,
10,
messageContains: [
'Unhandled error',
'package:test/a.dart',
'unresolved',
'MyMacro',
'Macro application failed due to a bug in the macro.',
],
contextMessages: [
message('/home/test/lib/test.dart', 18, 10),
],
),
]);
Expand Down Expand Up @@ -908,10 +908,10 @@ class A {}
18,
10,
messageContains: [
'Unhandled error',
'package:test/a.dart',
'12345',
'MyMacro',
'Macro application failed due to a bug in the macro.'
],
contextMessages: [
message('/home/test/lib/test.dart', 18, 10),
],
),
]);
Expand Down
2 changes: 1 addition & 1 deletion pkg/analyzer/test/src/summary/element_text.dart
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,7 @@ class _ElementWriter {
validator(object.message);
} else {
final message = object.message;
const stackTraceText = 'Stack trace:';
const stackTraceText = '#0';
final stackTraceIndex = message.indexOf(stackTraceText);
if (stackTraceIndex >= 0) {
final end = stackTraceIndex + stackTraceText.length;
Expand Down
Loading

0 comments on commit 561cbc6

Please sign in to comment.