Version 2.18.0-177.0.dev Merge commit '6970e0907bf2cabe0d3e5da0846616d3ce972471' into 'dev'
diff --git a/pkg/dart2wasm/lib/dispatch_table.dart b/pkg/dart2wasm/lib/dispatch_table.dart index f257241..06c6347 100644 --- a/pkg/dart2wasm/lib/dispatch_table.dart +++ b/pkg/dart2wasm/lib/dispatch_table.dart
@@ -294,7 +294,7 @@ void output() { w.Module m = translator.m; - w.Table wasmTable = m.addTable(table.length); + w.DefinedTable wasmTable = m.addTable(w.RefType.func(), table.length); for (int i = 0; i < table.length; i++) { Reference? target = table[i]; if (target != null) {
diff --git a/pkg/front_end/lib/src/api_unstable/bazel_worker.dart b/pkg/front_end/lib/src/api_unstable/bazel_worker.dart index 217bb40..f30a919 100644 --- a/pkg/front_end/lib/src/api_unstable/bazel_worker.dart +++ b/pkg/front_end/lib/src/api_unstable/bazel_worker.dart
@@ -60,9 +60,9 @@ Future<InitializedCompilerState> initializeIncrementalCompiler( InitializedCompilerState? oldState, Set<String> tags, - Uri sdkSummary, - Uri packagesFile, - Uri librariesSpecificationUri, + Uri? sdkSummary, + Uri? packagesFile, + Uri? librariesSpecificationUri, List<Uri> additionalDills, Map<Uri, List<int>> workerInputDigests, Target target, @@ -100,9 +100,9 @@ InitializedCompilerState initializeCompiler( InitializedCompilerState? oldState, - Uri sdkSummary, - Uri librariesSpecificationUri, - Uri packagesFile, + Uri? sdkSummary, + Uri? librariesSpecificationUri, + Uri? packagesFile, List<Uri> additionalDills, Target target, FileSystem fileSystem,
diff --git a/pkg/front_end/lib/src/api_unstable/modular_incremental_compilation.dart b/pkg/front_end/lib/src/api_unstable/modular_incremental_compilation.dart index 346a4ae..88b68de 100644 --- a/pkg/front_end/lib/src/api_unstable/modular_incremental_compilation.dart +++ b/pkg/front_end/lib/src/api_unstable/modular_incremental_compilation.dart
@@ -40,9 +40,9 @@ InitializedCompilerState? oldState, Set<String> tags, List<Component> outputLoadedAdditionalDills, - Uri sdkSummary, - Uri packagesFile, - Uri librariesSpecificationUri, + Uri? sdkSummary, + Uri? packagesFile, + Uri? librariesSpecificationUri, List<Uri> additionalDills, Map<Uri, List<int>> workerInputDigests, Target target, @@ -59,8 +59,9 @@ bool isRetry = false; while (true) { try { - final List<int>? sdkDigest = workerInputDigests[sdkSummary]; - if (sdkDigest == null) { + final List<int>? sdkDigest = + sdkSummary == null ? null : workerInputDigests[sdkSummary]; + if (sdkDigest == null && sdkSummary != null) { throw new StateError("Expected to get digest for $sdkSummary"); } @@ -69,7 +70,8 @@ Map<Uri, Uri> workerInputCacheLibs = oldState?.workerInputCacheLibs ?? new Map<Uri, Uri>(); - WorkerInputComponent? cachedSdkInput = workerInputCache[sdkSummary]; + WorkerInputComponent? cachedSdkInput = + sdkSummary == null ? null : workerInputCache[sdkSummary]; IncrementalCompiler incrementalCompiler; CompilerOptions options; @@ -84,8 +86,9 @@ explicitExperimentalFlags) || !equalMaps(oldState.options.environmentDefines, environmentDefines) || !equalSets(oldState.tags, tags) || - cachedSdkInput == null || - !digestsEqual(cachedSdkInput.digest, sdkDigest)) { + (sdkSummary != null && + (cachedSdkInput == null || + !digestsEqual(cachedSdkInput.digest, sdkDigest)))) { // No - or immediately not correct - previous state. // We'll load a new sdk, anything loaded already will have a wrong root. workerInputCache.clear(); @@ -107,28 +110,30 @@ ..nnbdMode = nnbdMode; processedOpts = new ProcessedOptions(options: options); - cachedSdkInput = new WorkerInputComponent( - sdkDigest, (await processedOpts.loadSdkSummary(null))!); - workerInputCache[sdkSummary] = cachedSdkInput; - for (Library lib in cachedSdkInput.component.libraries) { - if (workerInputCacheLibs.containsKey(lib.importUri)) { - throw new StateError("Duplicate sources in sdk."); + if (sdkSummary != null && sdkDigest != null) { + cachedSdkInput = new WorkerInputComponent( + sdkDigest, (await processedOpts.loadSdkSummary(null))!); + workerInputCache[sdkSummary] = cachedSdkInput; + for (Library lib in cachedSdkInput.component.libraries) { + if (workerInputCacheLibs.containsKey(lib.importUri)) { + throw new StateError("Duplicate sources in sdk."); + } + workerInputCacheLibs[lib.importUri] = sdkSummary; } - workerInputCacheLibs[lib.importUri] = sdkSummary; } incrementalCompiler = new IncrementalCompiler.fromComponent( new CompilerContext(processedOpts), - cachedSdkInput.component, + cachedSdkInput?.component, outlineOnly); } else { options = oldState.options; processedOpts = oldState.processedOpts; - Component sdkComponent = cachedSdkInput.component; + Component? sdkComponent = cachedSdkInput?.component; // Make sure the canonical name root knows about the sdk - otherwise we // won't be able to link to it when loading more outlines. - sdkComponent.adoptChildren(); + sdkComponent?.adoptChildren(); // TODO(jensj): This is - at least currently - necessary, // although it's not entirely obvious why. @@ -149,7 +154,7 @@ } // Then read all the input summary components. - CanonicalName nameRoot = cachedSdkInput.component.root; + CanonicalName? nameRoot = cachedSdkInput?.component.root; Map<Uri, Uri>? libraryToInputDill; if (trackNeededDillLibraries) { libraryToInputDill = new Map<Uri, Uri>();
diff --git a/pkg/frontend_server/lib/compute_kernel.dart b/pkg/frontend_server/lib/compute_kernel.dart index 2c70e9d..918c891 100644 --- a/pkg/frontend_server/lib/compute_kernel.dart +++ b/pkg/frontend_server/lib/compute_kernel.dart
@@ -2,8 +2,6 @@ // 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. -// @dart = 2.8 - /// A library to invoke the CFE to compute kernel summary files. /// /// Used by `utils/bazel/kernel_worker.dart`. @@ -119,7 +117,7 @@ class ComputeKernelResult { final bool succeeded; - final fe.InitializedCompilerState previousState; + final fe.InitializedCompilerState? previousState; ComputeKernelResult(this.succeeded, this.previousState); } @@ -134,9 +132,9 @@ /// Returns whether or not the summary was successfully output. Future<ComputeKernelResult> computeKernel(List<String> args, {bool isWorker: false, - StringBuffer outputBuffer, - Map<Uri, List<int>> inputDigests, - fe.InitializedCompilerState previousState}) async { + StringBuffer? outputBuffer, + Map<Uri, List<int>>? inputDigests, + fe.InitializedCompilerState? previousState}) async { inputDigests ??= <Uri, List<int>>{}; dynamic out = outputBuffer ?? stderr; bool succeeded = true; @@ -172,7 +170,7 @@ // TODO(sigmund,jakemac): make target mandatory. We allow null to be backwards // compatible while we migrate existing clients of this tool. var targetName = - (parsedArgs['target'] as String) ?? (summaryOnly ? 'ddc' : 'vm'); + (parsedArgs['target'] as String?) ?? (summaryOnly ? 'ddc' : 'vm'); var targetFlags = new TargetFlags( trackWidgetCreation: trackWidgetCreation, enableNullSafety: nnbdMode == fe.NnbdMode.Strong); @@ -225,6 +223,7 @@ break; default: out.writeln('error: unsupported target: $targetName'); + return ComputeKernelResult(false, previousState); } List<Uri> linkedInputs = @@ -239,6 +238,7 @@ var environmentDefines = _parseEnvironmentDefines(parsedArgs['define']); var verbose = parsedArgs['verbose'] as bool; var verbosity = fe.Verbosity.parseArgument(parsedArgs['verbosity']); + Uri? sdkSummaryUri = toUriNullable(parsedArgs['dart-sdk-summary']); if (parsedArgs['use-incremental-compiler']) { usingIncrementalCompiler = true; @@ -248,7 +248,9 @@ // fake input digests). if (!isWorker && inputDigests.isEmpty) { previousState = null; - inputDigests[toUri(parsedArgs['dart-sdk-summary'])] = const [0]; + if (sdkSummaryUri != null) { + inputDigests[sdkSummaryUri] = const [0]; + } for (Uri uri in summaryInputs) { inputDigests[uri] = const [0]; } @@ -265,9 +267,9 @@ "multiRootScheme=${fileSystem.markerScheme}", "multiRootRoots=${fileSystem.roots}", }, - toUri(parsedArgs['dart-sdk-summary']), - toUri(parsedArgs['packages-file']), - toUri(parsedArgs['libraries-file']), + sdkSummaryUri, + toUriNullable(parsedArgs['packages-file']), + toUriNullable(parsedArgs['libraries-file']), [...summaryInputs, ...linkedInputs], inputDigests, target, @@ -282,9 +284,9 @@ state = fe.initializeCompiler( // TODO(sigmund): pass an old state once we can make use of it. null, - toUri(parsedArgs['dart-sdk-summary']), - toUri(parsedArgs['libraries-file']), - toUri(parsedArgs['packages-file']), + sdkSummaryUri, + toUriNullable(parsedArgs['libraries-file']), + toUriNullable(parsedArgs['packages-file']), [...summaryInputs, ...linkedInputs], target, fileSystem, @@ -360,12 +362,12 @@ } } - List<int> kernel; + List<int>? kernel; bool wroteUsedDills = false; if (usingIncrementalCompiler) { state.options.onDiagnostic = onDiagnostic; IncrementalCompilerResult incrementalCompilerResult = - await state.incrementalCompiler.computeDelta( + await state.incrementalCompiler!.computeDelta( entryPoints: sources, fullComponent: true, trackNeededDillLibraries: recordUsedInputs); @@ -373,9 +375,9 @@ if (recordUsedInputs) { Set<Uri> usedOutlines = {}; - for (Library lib in incrementalCompilerResult.neededDillLibraries) { + for (Library lib in incrementalCompilerResult.neededDillLibraries!) { if (lib.importUri.isScheme("dart")) continue; - Uri uri = state.libraryToInputDill[lib.importUri]; + Uri? uri = state.libraryToInputDill![lib.importUri]; if (uri == null) { throw new StateError("Library ${lib.importUri} was recorded as used, " "but was not in the list of known libraries."); @@ -388,7 +390,7 @@ wroteUsedDills = true; } - kernel = await state.incrementalCompiler.context.runInContext((_) { + kernel = await state.incrementalCompiler!.context.runInContext((_) { if (summaryOnly) { incrementalComponent.uriToSource.clear(); incrementalComponent.problemsAsJson = null; @@ -412,13 +414,15 @@ kernel = await fe.compileSummary(state, sources, onDiagnostic, includeOffsets: false); } else { - Component component = await fe + Component? component = await fe .compileComponent(state, sources, onDiagnostic, buildSummary: summary); - kernel = fe.serializeComponent(component, - filter: excludeNonSources - ? (library) => sources.contains(library.importUri) - : null, - includeOffsets: true); + if (component != null) { + kernel = fe.serializeComponent(component, + filter: excludeNonSources + ? (library) => sources.contains(library.importUri) + : null, + includeOffsets: true); + } } state.options.onDiagnostic = null; // See http://dartbug.com/36983. @@ -467,8 +471,12 @@ : super(targetFlags); } -Uri toUri(String uriString) { +Uri? toUriNullable(String? uriString) { if (uriString == null) return null; + return toUri(uriString); +} + +Uri toUri(String uriString) { // Windows-style paths use '\', so convert them to '/' in case they've been // concatenated with Unix-style paths. return Uri.base.resolve(uriString.replaceAll("\\", "/"));
diff --git a/pkg/frontend_server/lib/src/strong_components.dart b/pkg/frontend_server/lib/src/strong_components.dart index 0711f2d..a436b7c 100644 --- a/pkg/frontend_server/lib/src/strong_components.dart +++ b/pkg/frontend_server/lib/src/strong_components.dart
@@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// @dart = 2.9 import 'package:kernel/ast.dart'; import 'package:kernel/util/graph.dart'; @@ -45,7 +44,7 @@ final Uri mainUri; /// The filesystem instance for resolving files. - final FileSystem fileSystem; + final FileSystem? fileSystem; /// The set of libraries for each module URI. /// @@ -68,10 +67,13 @@ } // If we don't have a file uri, just use the first library in the // component. - Library entrypoint = component.libraries.firstWhere( - (Library library) => - library.fileUri == mainUri || library.importUri == mainUri, - orElse: () => null); + Library? entrypoint; + for (Library library in component.libraries) { + if (library.fileUri == mainUri || library.importUri == mainUri) { + entrypoint = library; + break; + } + } if (entrypoint == null) { throw Exception('Could not find entrypoint ${mainUri} in Component.');
diff --git a/pkg/frontend_server/test/src/strong_components_test.dart b/pkg/frontend_server/test/src/strong_components_test.dart index 2281e82..9bb6596 100644 --- a/pkg/frontend_server/test/src/strong_components_test.dart +++ b/pkg/frontend_server/test/src/strong_components_test.dart
@@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// @dart = 2.9 import 'package:frontend_server/src/strong_components.dart'; import 'package:kernel/ast.dart'; import 'package:test/test.dart';
diff --git a/pkg/vm_service/test/async_single_step_exception_test.dart b/pkg/vm_service/test/async_single_step_exception_test.dart index 3a093de..31f5394 100644 --- a/pkg/vm_service/test/async_single_step_exception_test.dart +++ b/pkg/vm_service/test/async_single_step_exception_test.dart
@@ -1,20 +1,18 @@ // Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file // 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. -// -// VMOptions=--lazy-async-stacks import 'dart:developer'; import 'common/service_test_common.dart'; import 'common/test_helper.dart'; -const LINE_A = 20; -const LINE_B = 21; -const LINE_C = 26; -const LINE_D = 28; -const LINE_E = 31; -const LINE_F = 34; -const LINE_G = 36; +const LINE_A = 18; +const LINE_B = 19; +const LINE_C = 24; +const LINE_D = 26; +const LINE_E = 29; +const LINE_F = 32; +const LINE_G = 34; helper() async { print('helper'); // LINE_A.
diff --git a/pkg/vm_service/test/async_single_step_into_test.dart b/pkg/vm_service/test/async_single_step_into_test.dart index 604e00b..e5f77f7 100644 --- a/pkg/vm_service/test/async_single_step_into_test.dart +++ b/pkg/vm_service/test/async_single_step_into_test.dart
@@ -1,17 +1,15 @@ // Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file // 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. -// -// VMOptions=--lazy-async-stacks import 'dart:developer'; import 'common/service_test_common.dart'; import 'common/test_helper.dart'; -const LINE_A = 17; -const LINE_B = 18; -const LINE_C = 23; -const LINE_D = 24; +const LINE_A = 15; +const LINE_B = 16; +const LINE_C = 21; +const LINE_D = 22; helper() async { print('helper'); // LINE_A.
diff --git a/pkg/vm_service/test/async_single_step_out_test.dart b/pkg/vm_service/test/async_single_step_out_test.dart index 71f9517..c3da030 100644 --- a/pkg/vm_service/test/async_single_step_out_test.dart +++ b/pkg/vm_service/test/async_single_step_out_test.dart
@@ -1,18 +1,16 @@ // Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file // 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. -// -// VMOptions=--lazy-async-stacks import 'dart:developer'; import 'common/service_test_common.dart'; import 'common/test_helper.dart'; -const LINE_A = 18; -const LINE_B = 19; -const LINE_C = 24; -const LINE_D = 25; -const LINE_E = 26; +const LINE_A = 16; +const LINE_B = 17; +const LINE_C = 22; +const LINE_D = 23; +const LINE_E = 24; helper() async { print('helper'); // LINE_A.
diff --git a/pkg/vm_service/test/async_star_single_step_into_test.dart b/pkg/vm_service/test/async_star_single_step_into_test.dart index be3eba7..e722bbb 100644 --- a/pkg/vm_service/test/async_star_single_step_into_test.dart +++ b/pkg/vm_service/test/async_star_single_step_into_test.dart
@@ -1,20 +1,18 @@ // Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file // 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. -// -// VMOptions=--lazy-async-stacks import 'dart:developer'; import 'common/service_test_common.dart'; import 'common/test_helper.dart'; -const LINE_A = 20; -const LINE_B = 21; -const LINE_C = 25; -const LINE_D = 29; -const LINE_E = 35; -const LINE_F = 36; -const LINE_G = 27; +const LINE_A = 18; +const LINE_B = 19; +const LINE_C = 23; +const LINE_D = 27; +const LINE_E = 33; +const LINE_F = 34; +const LINE_G = 25; foobar() async* { yield 1; // LINE_A.
diff --git a/pkg/vm_service/test/async_star_step_out_test.dart b/pkg/vm_service/test/async_star_step_out_test.dart index 41d387f..b1eba2a 100644 --- a/pkg/vm_service/test/async_star_step_out_test.dart +++ b/pkg/vm_service/test/async_star_step_out_test.dart
@@ -1,22 +1,20 @@ // Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file // 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. -// -// VMOptions=--lazy-async-stacks import 'dart:developer'; import 'common/service_test_common.dart'; import 'common/test_helper.dart'; -const LINE_A = 22; -const LINE_B = 23; -const LINE_C = 27; -const LINE_D = 31; -const LINE_E = 38; -const LINE_F = 39; -const LINE_G = 40; -const LINE_H = 29; -const LINE_I = 33; +const LINE_A = 20; +const LINE_B = 21; +const LINE_C = 25; +const LINE_D = 29; +const LINE_E = 36; +const LINE_F = 37; +const LINE_G = 38; +const LINE_H = 27; +const LINE_I = 31; foobar() async* { yield 1; // LINE_A.
diff --git a/pkg/vm_service/test/async_step_out_test.dart b/pkg/vm_service/test/async_step_out_test.dart index e08ae35..7f37fe6 100644 --- a/pkg/vm_service/test/async_step_out_test.dart +++ b/pkg/vm_service/test/async_step_out_test.dart
@@ -1,19 +1,17 @@ // Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file // 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. -// -// VMOptions=--lazy-async-stacks import 'dart:developer'; import 'common/service_test_common.dart'; import 'common/test_helper.dart'; -const LINE_A = 19; -const LINE_B = 20; -const LINE_C = 21; -const LINE_D = 26; -const LINE_E = 27; -const LINE_F = 28; +const LINE_A = 17; +const LINE_B = 18; +const LINE_C = 19; +const LINE_D = 24; +const LINE_E = 25; +const LINE_F = 26; helper() async { await null; // LINE_A.
diff --git a/pkg/vm_service/test/awaiter_async_stack_contents_2_test.dart b/pkg/vm_service/test/awaiter_async_stack_contents_2_test.dart index 5cd7443..f5fb8d0 100644 --- a/pkg/vm_service/test/awaiter_async_stack_contents_2_test.dart +++ b/pkg/vm_service/test/awaiter_async_stack_contents_2_test.dart
@@ -2,7 +2,7 @@ // 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. // -// VMOptions=--async-debugger --verbose-debug --lazy-async-stacks +// VMOptions=--async-debugger --verbose-debug import 'dart:developer'; import 'package:test/test.dart';
diff --git a/pkg/vm_service/test/awaiter_async_stack_contents_test.dart b/pkg/vm_service/test/awaiter_async_stack_contents_test.dart index ac8ab8c..497a9f8 100644 --- a/pkg/vm_service/test/awaiter_async_stack_contents_test.dart +++ b/pkg/vm_service/test/awaiter_async_stack_contents_test.dart
@@ -2,7 +2,7 @@ // 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. // -// VMOptions=--async-debugger --verbose-debug --lazy-async-stacks +// VMOptions=--async-debugger --verbose-debug import 'dart:developer'; import 'package:test/test.dart';
diff --git a/pkg/vm_service/test/causal_async_stack_contents_test.dart b/pkg/vm_service/test/causal_async_stack_contents_test.dart index b28ece5..aad6986 100644 --- a/pkg/vm_service/test/causal_async_stack_contents_test.dart +++ b/pkg/vm_service/test/causal_async_stack_contents_test.dart
@@ -2,7 +2,7 @@ // 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. // -// VMOptions=--lazy-async-stacks --verbose_debug +// VMOptions=--verbose_debug import 'dart:developer'; import 'package:test/test.dart';
diff --git a/pkg/vm_service/test/causal_async_stack_presence_test.dart b/pkg/vm_service/test/causal_async_stack_presence_test.dart index 48bf16e..5eb2c46 100644 --- a/pkg/vm_service/test/causal_async_stack_presence_test.dart +++ b/pkg/vm_service/test/causal_async_stack_presence_test.dart
@@ -2,7 +2,7 @@ // 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. // -// VMOptions=--lazy-async-stacks --verbose_debug +// VMOptions=--verbose_debug import 'dart:developer'; import 'package:test/test.dart';
diff --git a/pkg/vm_service/test/causal_async_star_stack_contents_test.dart b/pkg/vm_service/test/causal_async_star_stack_contents_test.dart index 80f0a2d..3d0e892 100644 --- a/pkg/vm_service/test/causal_async_star_stack_contents_test.dart +++ b/pkg/vm_service/test/causal_async_star_stack_contents_test.dart
@@ -2,7 +2,7 @@ // 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. // -// VMOptions=--lazy-async-stacks --verbose_debug +// VMOptions=--verbose_debug import 'dart:developer'; import 'package:test/test.dart';
diff --git a/pkg/vm_service/test/causal_async_star_stack_presence_test.dart b/pkg/vm_service/test/causal_async_star_stack_presence_test.dart index 5ba0a7d..15dba5a 100644 --- a/pkg/vm_service/test/causal_async_star_stack_presence_test.dart +++ b/pkg/vm_service/test/causal_async_star_stack_presence_test.dart
@@ -2,7 +2,7 @@ // 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. // -// VMOptions=--lazy-async-stacks --verbose_debug +// VMOptions=--verbose_debug import 'dart:developer'; import 'package:test/test.dart';
diff --git a/pkg/vm_service/test/common/test_helper.dart b/pkg/vm_service/test/common/test_helper.dart index 9f46c4d..5363e31 100644 --- a/pkg/vm_service/test/common/test_helper.dart +++ b/pkg/vm_service/test/common/test_helper.dart
@@ -17,7 +17,7 @@ export 'service_test_common.dart' show IsolateTest, VMTest; /// The extra arguments to use -const List<String> extraDebuggingArgs = ['--lazy-async-stacks']; +const List<String> extraDebuggingArgs = []; /// Will be set to the http address of the VM's service protocol before /// any tests are invoked.
diff --git a/pkg/vm_service/test/eval_issue_49209_test.dart b/pkg/vm_service/test/eval_issue_49209_test.dart new file mode 100644 index 0000000..a0bbd56 --- /dev/null +++ b/pkg/vm_service/test/eval_issue_49209_test.dart
@@ -0,0 +1,49 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// 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. + +import 'dart:developer'; +import 'package:test/test.dart'; +import 'package:vm_service/vm_service.dart'; +import 'common/service_test_common.dart'; +import 'common/test_helper.dart'; + +void testFunction() { + final a = A<C>(); + print(a.runtimeType); + debugger(); +} + +class A<T> { + A(); +} + +class B<T> { + final T data; + B(this.data); +} + +class C extends B<C> { + C(C data) : super(data); +} + +var tests = <IsolateTest>[ + hasStoppedAtBreakpoint, + + // Evaluate against top frame. + (VmService service, IsolateRef isolateRef) async { + final isolateId = isolateRef.id!; + var topFrame = 0; + final dynamic result = await service.evaluateInFrame( + isolateId, topFrame, 'a.runtimeType.toString()'); + print(result); + expect(result.valueAsString, equals("A<C>")); + }, +]; + +main([args = const <String>[]]) => runIsolateTests( + args, + tests, + 'eval_issue_49209_test.dart', + testeeConcurrent: testFunction, + );
diff --git a/pkg/vm_service/test/get_stack_test.dart b/pkg/vm_service/test/get_stack_test.dart index f1df2ba..d1b42d3 100644 --- a/pkg/vm_service/test/get_stack_test.dart +++ b/pkg/vm_service/test/get_stack_test.dart
@@ -2,7 +2,7 @@ // 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. -// VMOptions=--lazy-async-stacks --verbose_debug +// VMOptions=--verbose_debug import 'dart:developer'; @@ -95,7 +95,7 @@ (VmService service, IsolateRef isolateRef) async { final result = await service.getStack(isolateRef.id!); - expect(result.frames, hasLength(10)); + expect(result.frames, hasLength(6)); expect(result.asyncCausalFrames, hasLength(26)); expect(result.awaiterFrames, hasLength(13)); @@ -105,10 +105,6 @@ [equals('Regular'), anything], // Internal mech. .. [equals('Regular'), anything], [equals('Regular'), anything], - [equals('Regular'), anything], - [equals('Regular'), anything], - [equals('Regular'), anything], - [equals('Regular'), anything], [equals('Regular'), endsWith(' _RawReceivePortImpl._handleMessage')], ]);
diff --git a/pkg/wasm_builder/lib/src/module.dart b/pkg/wasm_builder/lib/src/module.dart index f75618e..592b304 100644 --- a/pkg/wasm_builder/lib/src/module.dart +++ b/pkg/wasm_builder/lib/src/module.dart
@@ -27,6 +27,7 @@ BaseFunction? startFunction = null; bool anyFunctionsDefined = false; + bool anyTablesDefined = false; bool anyMemoriesDefined = false; bool anyGlobalsDefined = false; bool dataReferencedFromGlobalInitializer = false; @@ -48,6 +49,7 @@ /// All module imports (functions and globals). Iterable<Import> get imports => functions .whereType<Import>() + .followedBy(tables.whereType<Import>()) .followedBy(memories.whereType<Import>()) .followedBy(globals.whereType<Import>()); @@ -55,6 +57,9 @@ Iterable<DefinedFunction> get definedFunctions => functions.whereType<DefinedFunction>(); + /// All tables defined in the module. + Iterable<DefinedTable> get definedTables => tables.whereType<DefinedTable>(); + /// All memories defined in the module. Iterable<DefinedMemory> get definedMemories => memories.whereType<DefinedMemory>(); @@ -123,8 +128,9 @@ } /// Add a new table to the module. - Table addTable(int minSize, [int? maxSize]) { - final table = Table(tables.length, minSize, maxSize); + DefinedTable addTable(RefType type, int minSize, [int? maxSize]) { + anyTablesDefined = true; + final table = DefinedTable(tables.length, type, minSize, maxSize); tables.add(table); return table; } @@ -191,6 +197,22 @@ return function; } + /// Import a table into the module. + /// + /// All imported tables must be specified before any tables are declared + /// using [Module.addTable]. + ImportedTable importTable( + String module, String name, RefType type, int minSize, + [int? maxSize]) { + if (anyTablesDefined) { + throw "All table imports must be specified before any definitions."; + } + final table = + ImportedTable(module, name, tables.length, type, minSize, maxSize); + tables.add(table); + return table; + } + /// Import a memory into the module. /// /// All imported memories must be specified before any memories are declared @@ -233,6 +255,20 @@ _addExport(FunctionExport(name, function)); } + /// Export a table from the module. + /// + /// All exports must have unique names. + void exportTable(String name, Table table) { + _addExport(TableExport(name, table)); + } + + /// Export a memory from the module. + /// + /// All exports must have unique names. + void exportMemory(String name, Memory memory) { + _addExport(MemoryExport(name, memory)); + } + /// Export a global variable from the module. /// /// All exports must have unique names. @@ -303,7 +339,7 @@ } } -/// An (imported or defined) Wasm function. +/// An (imported or defined) function. abstract class BaseFunction { final int index; final FunctionType type; @@ -313,7 +349,7 @@ BaseFunction(this.index, this.type, this.functionName); } -/// A function defined in the module. +/// A function defined in a module. class DefinedFunction extends BaseFunction with SerializerMixin implements Serializable { @@ -323,9 +359,8 @@ /// The body of the function. late final Instructions body; - DefinedFunction(Module module, int index, FunctionType type, - [String? functionName]) - : super(index, type, functionName) { + DefinedFunction(Module module, super.index, super.type, + [super.functionName]) { for (ValueType paramType in type.inputs) { addLocal(paramType); } @@ -380,23 +415,18 @@ String toString() => "$index"; } -/// A table in a module. +/// An (imported or defined) table. class Table implements Serializable { final int index; + final RefType type; final int minSize; final int? maxSize; - final List<BaseFunction?> elements; - Table(this.index, this.minSize, this.maxSize) - : elements = List.filled(minSize, null); - - void setElement(int index, BaseFunction function) { - elements[index] = function; - } + Table(this.index, this.type, this.minSize, this.maxSize); @override void serialize(Serializer s) { - s.writeByte(0x70); // funcref + s.write(type); if (maxSize == null) { s.writeByte(0x00); s.writeUnsigned(minSize); @@ -408,7 +438,21 @@ } } -/// A memory in a module. +/// A table defined in a module. +class DefinedTable extends Table { + final List<BaseFunction?> elements; + + DefinedTable(super.index, super.type, super.minSize, super.maxSize) + : elements = List.filled(minSize, null); + + void setElement(int index, BaseFunction function) { + assert(type == RefType.func(), + "Elements are only supported for funcref tables"); + elements[index] = function; + } +} + +/// An (imported or defined) memory. class Memory { final int index; final bool shared; @@ -438,9 +482,9 @@ } } +/// A memory defined in a module. class DefinedMemory extends Memory implements Serializable { - DefinedMemory(int index, bool shared, int minSize, int? maxSize) - : super(index, shared, minSize, maxSize); + DefinedMemory(super.index, super.shared, super.minSize, super.maxSize); @override void serialize(Serializer s) => _serializeLimits(s); @@ -507,7 +551,7 @@ } } -/// An (imported or defined) global variable in a module. +/// An (imported or defined) global variable. abstract class Global { final int index; final GlobalType type; @@ -518,14 +562,13 @@ String toString() => "$index"; } -/// A global variable defined in the module. +/// A global variable defined in a module. class DefinedGlobal extends Global implements Serializable { final Instructions initializer; - DefinedGlobal(Module module, int index, GlobalType type) + DefinedGlobal(Module module, super.index, super.type) : initializer = - Instructions(module, [type.type], isGlobalInitializer: true), - super(index, type); + Instructions(module, [type.type], isGlobalInitializer: true); @override void serialize(Serializer s) { @@ -535,7 +578,7 @@ } } -/// Any import (function or global). +/// Any import (function, table, memory or global). abstract class Import implements Serializable { String get module; String get name; @@ -546,9 +589,8 @@ final String module; final String name; - ImportedFunction(this.module, this.name, int index, FunctionType type, - [String? functionName]) - : super(index, type, functionName); + ImportedFunction(this.module, this.name, super.index, super.type, + [super.functionName]); @override void serialize(Serializer s) { @@ -562,14 +604,30 @@ String toString() => "$module.$name"; } +/// An imported table. +class ImportedTable extends Table implements Import { + final String module; + final String name; + + ImportedTable(this.module, this.name, super.index, super.type, super.minSize, + super.maxSize); + + @override + void serialize(Serializer s) { + s.writeName(module); + s.writeName(name); + s.writeByte(0x01); + super.serialize(s); + } +} + /// An imported memory. class ImportedMemory extends Memory implements Import { final String module; final String name; - ImportedMemory( - this.module, this.name, int index, bool shared, int minSize, int? maxSize) - : super(index, shared, minSize, maxSize); + ImportedMemory(this.module, this.name, super.index, super.shared, + super.minSize, super.maxSize); @override void serialize(Serializer s) { @@ -585,8 +643,7 @@ final String module; final String name; - ImportedGlobal(this.module, this.name, int index, GlobalType type) - : super(index, type); + ImportedGlobal(this.module, this.name, super.index, super.type); @override void serialize(Serializer s) { @@ -606,7 +663,7 @@ class FunctionExport extends Export { final BaseFunction function; - FunctionExport(String name, this.function) : super(name); + FunctionExport(super.name, this.function); @override void serialize(Serializer s) { @@ -616,10 +673,36 @@ } } +class TableExport extends Export { + final Table table; + + TableExport(super.name, this.table); + + @override + void serialize(Serializer s) { + s.writeName(name); + s.writeByte(0x01); + s.writeUnsigned(table.index); + } +} + +class MemoryExport extends Export { + final Memory memory; + + MemoryExport(super.name, this.memory); + + @override + void serialize(Serializer s) { + s.writeName(name); + s.writeByte(0x02); + s.writeUnsigned(memory.index); + } +} + class GlobalExport extends Export { final Global global; - GlobalExport(String name, this.global) : super(name); + GlobalExport(super.name, this.global); @override void serialize(Serializer s) { @@ -651,7 +734,7 @@ } class TypeSection extends Section { - TypeSection(Module module) : super(module); + TypeSection(super.module); @override int get id => 1; @@ -669,7 +752,7 @@ } class ImportSection extends Section { - ImportSection(Module module) : super(module); + ImportSection(super.module); @override int get id => 2; @@ -684,7 +767,7 @@ } class FunctionSection extends Section { - FunctionSection(Module module) : super(module); + FunctionSection(super.module); @override int get id => 3; @@ -702,22 +785,22 @@ } class TableSection extends Section { - TableSection(Module module) : super(module); + TableSection(super.module); @override int get id => 4; @override - bool get isNotEmpty => module.tables.isNotEmpty; + bool get isNotEmpty => module.definedTables.isNotEmpty; @override void serializeContents() { - writeList(module.tables); + writeList(module.definedTables.toList()); } } class MemorySection extends Section { - MemorySection(Module module) : super(module); + MemorySection(super.module); @override int get id => 5; @@ -732,7 +815,7 @@ } class TagSection extends Section { - TagSection(Module module) : super(module); + TagSection(super.module); @override int get id => 13; @@ -747,7 +830,7 @@ } class GlobalSection extends Section { - GlobalSection(Module module) : super(module); + GlobalSection(super.module); @override int get id => 6; @@ -762,7 +845,7 @@ } class ExportSection extends Section { - ExportSection(Module module) : super(module); + ExportSection(super.module); @override int get id => 7; @@ -777,7 +860,7 @@ } class StartSection extends Section { - StartSection(Module module) : super(module); + StartSection(super.module); @override int get id => 8; @@ -800,10 +883,18 @@ @override void serialize(Serializer s) { - s.writeUnsigned(table.index); + if (table.index != 0) { + s.writeByte(0x02); + s.writeUnsigned(table.index); + } else { + s.writeByte(0x00); + } s.writeByte(0x41); // i32.const s.writeSigned(startIndex); s.writeByte(0x0B); // end + if (table.index != 0) { + s.writeByte(0x00); // elemkind + } s.writeUnsigned(entries.length); for (var entry in entries) { s.writeUnsigned(entry.index); @@ -812,21 +903,21 @@ } class ElementSection extends Section { - ElementSection(Module module) : super(module); + ElementSection(super.module); @override int get id => 9; @override bool get isNotEmpty => - module.tables.any((table) => table.elements.any((e) => e != null)); + module.definedTables.any((table) => table.elements.any((e) => e != null)); @override void serializeContents() { // Group nonempty element entries into contiguous stretches and serialize // each stretch as an element. List<_Element> elements = []; - for (Table table in module.tables) { + for (DefinedTable table in module.definedTables) { _Element? current = null; for (int i = 0; i < table.elements.length; i++) { BaseFunction? function = table.elements[i]; @@ -846,7 +937,7 @@ } class DataCountSection extends Section { - DataCountSection(Module module) : super(module); + DataCountSection(super.module); @override int get id => 12; @@ -861,7 +952,7 @@ } class CodeSection extends Section { - CodeSection(Module module) : super(module); + CodeSection(super.module); @override int get id => 10; @@ -876,7 +967,7 @@ } class DataSection extends Section { - DataSection(Module module) : super(module); + DataSection(super.module); @override int get id => 11; @@ -891,14 +982,14 @@ } abstract class CustomSection extends Section { - CustomSection(Module module) : super(module); + CustomSection(super.module); @override int get id => 0; } class NameSection extends CustomSection { - NameSection(Module module) : super(module); + NameSection(super.module); @override bool get isNotEmpty => module.functionNameCount > 0;
diff --git a/pkg/wasm_builder/lib/src/types.dart b/pkg/wasm_builder/lib/src/types.dart index 84494d3..8ed1f68 100644 --- a/pkg/wasm_builder/lib/src/types.dart +++ b/pkg/wasm_builder/lib/src/types.dart
@@ -415,8 +415,7 @@ final List<ValueType> inputs; final List<ValueType> outputs; - FunctionType(this.inputs, this.outputs, {HeapType? superType}) - : super(superType: superType); + FunctionType(this.inputs, this.outputs, {super.superType}); @override bool isStructuralSubtypeOf(HeapType other) { @@ -454,7 +453,7 @@ abstract class DataType extends DefType { final String name; - DataType(this.name, {HeapType? superType}) : super(superType: superType); + DataType(this.name, {super.superType}); @override String toString() => name; @@ -464,8 +463,7 @@ class StructType extends DataType { final List<FieldType> fields = []; - StructType(String name, {Iterable<FieldType>? fields, HeapType? superType}) - : super(name, superType: superType) { + StructType(super.name, {Iterable<FieldType>? fields, super.superType}) { if (fields != null) this.fields.addAll(fields); } @@ -499,8 +497,7 @@ class ArrayType extends DataType { late final FieldType elementType; - ArrayType(String name, {FieldType? elementType, HeapType? superType}) - : super(name, superType: superType) { + ArrayType(super.name, {FieldType? elementType, super.superType}) { if (elementType != null) this.elementType = elementType; } @@ -530,7 +527,7 @@ final T type; final bool mutable; - _WithMutability(this.type, this.mutable); + _WithMutability(this.type, {required this.mutable}); @override void serialize(Serializer s) { @@ -546,14 +543,14 @@ /// /// It consists of a type and a mutability. class GlobalType extends _WithMutability<ValueType> { - GlobalType(ValueType type, {bool mutable = true}) : super(type, mutable); + GlobalType(super.type, {super.mutable = true}); } /// A type for a struct field or an array element. /// /// It consists of a type and a mutability. class FieldType extends _WithMutability<StorageType> { - FieldType(StorageType type, {bool mutable = true}) : super(type, mutable); + FieldType(super.type, {super.mutable = true}); /// The `i8` storage type as a field type. FieldType.i8({bool mutable: true}) : this(PackedType.i8, mutable: mutable);
diff --git a/pkg/wasm_builder/lib/wasm_builder.dart b/pkg/wasm_builder/lib/wasm_builder.dart index 7dfeb68..7ad807b 100644 --- a/pkg/wasm_builder/lib/wasm_builder.dart +++ b/pkg/wasm_builder/lib/wasm_builder.dart
@@ -7,10 +7,15 @@ DataSegment, DefinedFunction, DefinedGlobal, + DefinedMemory, + DefinedTable, BaseFunction, Global, + Import, ImportedFunction, ImportedGlobal, + ImportedMemory, + ImportedTable, Local, Memory, Module,
diff --git a/pkg/wasm_builder/pubspec.yaml b/pkg/wasm_builder/pubspec.yaml index a4286a4..3d59b5a 100644 --- a/pkg/wasm_builder/pubspec.yaml +++ b/pkg/wasm_builder/pubspec.yaml
@@ -4,4 +4,4 @@ description: Generate binary Wasm modules environment: - sdk: '>=2.12.0' + sdk: '>=2.17.0'
diff --git a/runtime/bin/analyze_snapshot.cc b/runtime/bin/analyze_snapshot.cc index 1eb4c14c..5a9011e 100644 --- a/runtime/bin/analyze_snapshot.cc +++ b/runtime/bin/analyze_snapshot.cc
@@ -52,7 +52,6 @@ "following default flags: \n" "--enable_mirrors=false \n" "--background_compilation \n" -"--lazy_async_stacks \n" "--precompilation \n" " \n" "\n"); @@ -157,7 +156,6 @@ if (vm_options.count() == 0) { vm_options.AddArgument("--enable_mirrors=false"); vm_options.AddArgument("--background_compilation"); - vm_options.AddArgument("--lazy_async_stacks"); vm_options.AddArgument("--precompilation"); }
diff --git a/runtime/lib/stacktrace.cc b/runtime/lib/stacktrace.cc index da73ef8..af80ae5 100644 --- a/runtime/lib/stacktrace.cc +++ b/runtime/lib/stacktrace.cc
@@ -34,8 +34,9 @@ return StackTrace::New(code_array, pc_offset_array); } -static StackTracePtr CurrentSyncStackTraceLazy(Thread* thread, - intptr_t skip_frames = 1) { +// Gets current stack trace for `thread`. +static StackTracePtr CurrentStackTrace(Thread* thread, + intptr_t skip_frames = 1) { Zone* zone = thread->zone(); const auto& code_array = GrowableObjectArray::ZoneHandle( @@ -43,54 +44,19 @@ GrowableArray<uword> pc_offset_array; // Collect the frames. - StackTraceUtils::CollectFramesLazy(thread, code_array, &pc_offset_array, - skip_frames); + StackTraceUtils::CollectFrames(thread, code_array, &pc_offset_array, + skip_frames); return CreateStackTraceObject(zone, code_array, pc_offset_array); } -static StackTracePtr CurrentSyncStackTrace(Thread* thread, - intptr_t skip_frames = 1) { - Zone* zone = thread->zone(); - const Function& null_function = Function::ZoneHandle(zone); - - // Determine how big the stack trace is. - const intptr_t stack_trace_length = - StackTraceUtils::CountFrames(thread, skip_frames, null_function, nullptr); - - // Allocate once. - const Array& code_array = - Array::ZoneHandle(zone, Array::New(stack_trace_length)); - const TypedData& pc_offset_array = TypedData::ZoneHandle( - zone, TypedData::New(kUintPtrCid, stack_trace_length)); - - // Collect the frames. - const intptr_t collected_frames_count = StackTraceUtils::CollectFrames( - thread, code_array, pc_offset_array, 0, stack_trace_length, skip_frames); - - ASSERT(collected_frames_count == stack_trace_length); - - return StackTrace::New(code_array, pc_offset_array); -} - -// Gets current stack trace for `thread`. -static StackTracePtr CurrentStackTrace(Thread* thread, - bool for_async_function, - intptr_t skip_frames = 1) { - if (FLAG_lazy_async_stacks) { - return CurrentSyncStackTraceLazy(thread, skip_frames); - } - // Return the synchronous stack trace. - return CurrentSyncStackTrace(thread, skip_frames); -} - StackTracePtr GetStackTraceForException() { Thread* thread = Thread::Current(); - return CurrentStackTrace(thread, false, 0); + return CurrentStackTrace(thread, 0); } DEFINE_NATIVE_ENTRY(StackTrace_current, 0, 0) { - return CurrentStackTrace(thread, false); + return CurrentStackTrace(thread); } static void AppendFrames(const GrowableObjectArray& code_list,
diff --git a/runtime/observatory/tests/service/async_single_step_exception_test.dart b/runtime/observatory/tests/service/async_single_step_exception_test.dart index 544ba6f..2d9d6fb 100644 --- a/runtime/observatory/tests/service/async_single_step_exception_test.dart +++ b/runtime/observatory/tests/service/async_single_step_exception_test.dart
@@ -2,7 +2,7 @@ // 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. // -// VMOptions=--async-debugger --verbose-debug --lazy-async-stacks +// VMOptions=--async-debugger --verbose-debug import 'dart:developer'; import 'service_test_common.dart';
diff --git a/runtime/observatory/tests/service/async_single_step_into_test.dart b/runtime/observatory/tests/service/async_single_step_into_test.dart index 7477840..2685cac 100644 --- a/runtime/observatory/tests/service/async_single_step_into_test.dart +++ b/runtime/observatory/tests/service/async_single_step_into_test.dart
@@ -2,7 +2,7 @@ // 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. // -// VMOptions=--async-debugger --verbose-debug --lazy-async-stacks +// VMOptions=--async-debugger --verbose-debug import 'dart:developer'; import 'service_test_common.dart';
diff --git a/runtime/observatory/tests/service/async_single_step_out_test.dart b/runtime/observatory/tests/service/async_single_step_out_test.dart index e93c274..bf09b4d 100644 --- a/runtime/observatory/tests/service/async_single_step_out_test.dart +++ b/runtime/observatory/tests/service/async_single_step_out_test.dart
@@ -2,7 +2,7 @@ // 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. // -// VMOptions=--async-debugger --verbose-debug --lazy-async-stacks +// VMOptions=--async-debugger --verbose-debug import 'dart:developer'; import 'service_test_common.dart';
diff --git a/runtime/observatory/tests/service/async_star_single_step_into_test.dart b/runtime/observatory/tests/service/async_star_single_step_into_test.dart index ac8e6ba..1a3c2ad 100644 --- a/runtime/observatory/tests/service/async_star_single_step_into_test.dart +++ b/runtime/observatory/tests/service/async_star_single_step_into_test.dart
@@ -2,7 +2,7 @@ // 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. // -// VMOptions=--async-debugger --verbose-debug --lazy-async-stacks +// VMOptions=--async-debugger --verbose-debug import 'dart:developer'; import 'service_test_common.dart';
diff --git a/runtime/observatory/tests/service/async_star_step_out_test.dart b/runtime/observatory/tests/service/async_star_step_out_test.dart index 6e73174..f408caa 100644 --- a/runtime/observatory/tests/service/async_star_step_out_test.dart +++ b/runtime/observatory/tests/service/async_star_step_out_test.dart
@@ -2,7 +2,7 @@ // 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. // -// VMOptions=--async-debugger --verbose-debug --lazy-async-stacks +// VMOptions=--async-debugger --verbose-debug import 'dart:developer'; import 'service_test_common.dart';
diff --git a/runtime/observatory/tests/service/async_step_out_test.dart b/runtime/observatory/tests/service/async_step_out_test.dart index 4cce826..5359d1e 100644 --- a/runtime/observatory/tests/service/async_step_out_test.dart +++ b/runtime/observatory/tests/service/async_step_out_test.dart
@@ -2,7 +2,7 @@ // 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. // -// VMOptions=--async-debugger --verbose-debug --lazy-async-stacks +// VMOptions=--async-debugger --verbose-debug import 'dart:developer'; import 'service_test_common.dart';
diff --git a/runtime/observatory/tests/service/awaiter_async_stack_contents_2_test.dart b/runtime/observatory/tests/service/awaiter_async_stack_contents_2_test.dart index b2d2165..8016216 100644 --- a/runtime/observatory/tests/service/awaiter_async_stack_contents_2_test.dart +++ b/runtime/observatory/tests/service/awaiter_async_stack_contents_2_test.dart
@@ -2,7 +2,7 @@ // 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. // -// VMOptions=--async-debugger --verbose-debug --lazy-async-stacks +// VMOptions=--async-debugger --verbose-debug import 'dart:developer'; import 'package:observatory/models.dart' as M;
diff --git a/runtime/observatory/tests/service/awaiter_async_stack_contents_test.dart b/runtime/observatory/tests/service/awaiter_async_stack_contents_test.dart index 77eeed2..e3ea09c 100644 --- a/runtime/observatory/tests/service/awaiter_async_stack_contents_test.dart +++ b/runtime/observatory/tests/service/awaiter_async_stack_contents_test.dart
@@ -2,7 +2,7 @@ // 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. // -// VMOptions=--async-debugger --verbose-debug --lazy-async-stacks +// VMOptions=--async-debugger --verbose-debug import 'dart:developer'; import 'package:observatory/models.dart' as M;
diff --git a/runtime/observatory/tests/service/causal_async_stack_contents_test.dart b/runtime/observatory/tests/service/causal_async_stack_contents_test.dart index 3e4a8eb..6401df0 100644 --- a/runtime/observatory/tests/service/causal_async_stack_contents_test.dart +++ b/runtime/observatory/tests/service/causal_async_stack_contents_test.dart
@@ -2,7 +2,7 @@ // 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. // -// VMOptions=--lazy-async-stacks --verbose_debug +// VMOptions=--verbose_debug import 'dart:developer'; import 'package:observatory/models.dart' as M;
diff --git a/runtime/observatory/tests/service/causal_async_stack_presence_test.dart b/runtime/observatory/tests/service/causal_async_stack_presence_test.dart index 01331cd..008447e 100644 --- a/runtime/observatory/tests/service/causal_async_stack_presence_test.dart +++ b/runtime/observatory/tests/service/causal_async_stack_presence_test.dart
@@ -2,7 +2,7 @@ // 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. // -// VMOptions=--lazy-async-stacks --verbose_debug +// VMOptions=--verbose_debug import 'dart:developer'; import 'package:observatory/service_io.dart';
diff --git a/runtime/observatory/tests/service/causal_async_star_stack_contents_test.dart b/runtime/observatory/tests/service/causal_async_star_stack_contents_test.dart index 8d66a17a..d9f4a85 100644 --- a/runtime/observatory/tests/service/causal_async_star_stack_contents_test.dart +++ b/runtime/observatory/tests/service/causal_async_star_stack_contents_test.dart
@@ -2,7 +2,7 @@ // 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. // -// VMOptions=--lazy-async-stacks --verbose_debug +// VMOptions=--verbose_debug import 'dart:developer'; import 'package:observatory/models.dart' as M;
diff --git a/runtime/observatory/tests/service/causal_async_star_stack_presence_test.dart b/runtime/observatory/tests/service/causal_async_star_stack_presence_test.dart index 9b605cb..4015c42 100644 --- a/runtime/observatory/tests/service/causal_async_star_stack_presence_test.dart +++ b/runtime/observatory/tests/service/causal_async_star_stack_presence_test.dart
@@ -2,7 +2,7 @@ // 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. // -// VMOptions=--lazy-async-stacks --verbose_debug +// VMOptions=--verbose_debug import 'dart:developer'; import 'package:observatory/service_io.dart';
diff --git a/runtime/observatory/tests/service/get_stack_limit_rpc_test.dart b/runtime/observatory/tests/service/get_stack_limit_rpc_test.dart index b3e47e21..f8decf0 100644 --- a/runtime/observatory/tests/service/get_stack_limit_rpc_test.dart +++ b/runtime/observatory/tests/service/get_stack_limit_rpc_test.dart
@@ -2,8 +2,6 @@ // 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. -// VMOptions=--lazy-async-stacks - import 'dart:async'; import 'dart:developer'; @@ -53,7 +51,7 @@ var frames = stack['frames']; var asyncFrames = stack['asyncCausalFrames']; var awaiterFrames = stack['awaiterFrames']; - expect(frames.length, greaterThanOrEqualTo(20)); + expect(frames.length, greaterThanOrEqualTo(12)); expect(asyncFrames.length, greaterThan(frames.length)); expect(awaiterFrames.length, greaterThan(frames.length)); expect(stack['truncated'], false);
diff --git a/runtime/observatory/tests/service/next_through_simple_async_test.dart b/runtime/observatory/tests/service/next_through_simple_async_test.dart index bc2c3d5..7985874 100644 --- a/runtime/observatory/tests/service/next_through_simple_async_test.dart +++ b/runtime/observatory/tests/service/next_through_simple_async_test.dart
@@ -1,14 +1,12 @@ // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file // 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. -// -// VMOptions=--lazy-async-stacks import 'test_helper.dart'; import 'service_test_common.dart'; import 'dart:io'; -const int LINE_A = 14; +const int LINE_A = 12; const String file = "next_through_simple_async_test.dart"; code() async { // LINE_A
diff --git a/runtime/observatory/tests/service/next_through_simple_async_with_returns_test.dart b/runtime/observatory/tests/service/next_through_simple_async_with_returns_test.dart index 9a3f234..f402762 100644 --- a/runtime/observatory/tests/service/next_through_simple_async_with_returns_test.dart +++ b/runtime/observatory/tests/service/next_through_simple_async_with_returns_test.dart
@@ -1,14 +1,12 @@ // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file // 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. -// -// VMOptions=--lazy-async-stacks import 'test_helper.dart'; import 'service_test_common.dart'; import 'dart:io'; -const int LINE_A = 14; +const int LINE_A = 12; const String file = "next_through_simple_async_with_returns_test.dart"; code() async { // LINE_A
diff --git a/runtime/observatory/tests/service/pause_on_unhandled_async_exceptions2_test.dart b/runtime/observatory/tests/service/pause_on_unhandled_async_exceptions2_test.dart index 67f6901..4d06f0b 100644 --- a/runtime/observatory/tests/service/pause_on_unhandled_async_exceptions2_test.dart +++ b/runtime/observatory/tests/service/pause_on_unhandled_async_exceptions2_test.dart
@@ -2,8 +2,8 @@ // 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. // -// VMOptions=--async_debugger --lazy-async-stacks -// VMOptions=--async_debugger --lazy-async-stacks --optimization-counter-threshold=5 +// VMOptions=--async_debugger +// VMOptions=--async_debugger --optimization-counter-threshold=5 import 'package:observatory/service_io.dart'; import 'package:observatory/models.dart' as M;
diff --git a/runtime/observatory/tests/service/pause_on_unhandled_async_exceptions_test.dart b/runtime/observatory/tests/service/pause_on_unhandled_async_exceptions_test.dart index fe636dd..1770b56 100644 --- a/runtime/observatory/tests/service/pause_on_unhandled_async_exceptions_test.dart +++ b/runtime/observatory/tests/service/pause_on_unhandled_async_exceptions_test.dart
@@ -2,7 +2,7 @@ // 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. // -// VMOptions=--async_debugger --lazy-async-stacks +// VMOptions=--async_debugger import 'package:observatory/service_io.dart'; import 'package:observatory/models.dart' as M;
diff --git a/runtime/observatory/tests/service/test_helper.dart b/runtime/observatory/tests/service/test_helper.dart index bf6ce73..02a6b0a 100644 --- a/runtime/observatory/tests/service/test_helper.dart +++ b/runtime/observatory/tests/service/test_helper.dart
@@ -23,7 +23,7 @@ const String.fromEnvironment('SERVICE_RESPONSE_SIZES_DIR'); /// The extra arguments to use -const List<String> extraDebuggingArgs = ['--lazy-async-stacks']; +const List<String> extraDebuggingArgs = []; /// Will be set to the http address of the VM's service protocol before /// any tests are invoked.
diff --git a/runtime/observatory_2/tests/service_2/async_single_step_exception_test.dart b/runtime/observatory_2/tests/service_2/async_single_step_exception_test.dart index 9982e0c..fcfdbc9 100644 --- a/runtime/observatory_2/tests/service_2/async_single_step_exception_test.dart +++ b/runtime/observatory_2/tests/service_2/async_single_step_exception_test.dart
@@ -2,7 +2,7 @@ // 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. // -// VMOptions=--async-debugger --verbose-debug --lazy-async-stacks +// VMOptions=--async-debugger --verbose-debug import 'dart:developer'; import 'service_test_common.dart';
diff --git a/runtime/observatory_2/tests/service_2/async_single_step_into_test.dart b/runtime/observatory_2/tests/service_2/async_single_step_into_test.dart index 7477840..2685cac 100644 --- a/runtime/observatory_2/tests/service_2/async_single_step_into_test.dart +++ b/runtime/observatory_2/tests/service_2/async_single_step_into_test.dart
@@ -2,7 +2,7 @@ // 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. // -// VMOptions=--async-debugger --verbose-debug --lazy-async-stacks +// VMOptions=--async-debugger --verbose-debug import 'dart:developer'; import 'service_test_common.dart';
diff --git a/runtime/observatory_2/tests/service_2/async_single_step_out_test.dart b/runtime/observatory_2/tests/service_2/async_single_step_out_test.dart index e93c274..bf09b4d 100644 --- a/runtime/observatory_2/tests/service_2/async_single_step_out_test.dart +++ b/runtime/observatory_2/tests/service_2/async_single_step_out_test.dart
@@ -2,7 +2,7 @@ // 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. // -// VMOptions=--async-debugger --verbose-debug --lazy-async-stacks +// VMOptions=--async-debugger --verbose-debug import 'dart:developer'; import 'service_test_common.dart';
diff --git a/runtime/observatory_2/tests/service_2/async_star_single_step_into_test.dart b/runtime/observatory_2/tests/service_2/async_star_single_step_into_test.dart index ac8e6ba..1a3c2ad 100644 --- a/runtime/observatory_2/tests/service_2/async_star_single_step_into_test.dart +++ b/runtime/observatory_2/tests/service_2/async_star_single_step_into_test.dart
@@ -2,7 +2,7 @@ // 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. // -// VMOptions=--async-debugger --verbose-debug --lazy-async-stacks +// VMOptions=--async-debugger --verbose-debug import 'dart:developer'; import 'service_test_common.dart';
diff --git a/runtime/observatory_2/tests/service_2/async_star_step_out_test.dart b/runtime/observatory_2/tests/service_2/async_star_step_out_test.dart index 6e73174..f408caa 100644 --- a/runtime/observatory_2/tests/service_2/async_star_step_out_test.dart +++ b/runtime/observatory_2/tests/service_2/async_star_step_out_test.dart
@@ -2,7 +2,7 @@ // 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. // -// VMOptions=--async-debugger --verbose-debug --lazy-async-stacks +// VMOptions=--async-debugger --verbose-debug import 'dart:developer'; import 'service_test_common.dart';
diff --git a/runtime/observatory_2/tests/service_2/async_step_out_test.dart b/runtime/observatory_2/tests/service_2/async_step_out_test.dart index 4cce826..5359d1e 100644 --- a/runtime/observatory_2/tests/service_2/async_step_out_test.dart +++ b/runtime/observatory_2/tests/service_2/async_step_out_test.dart
@@ -2,7 +2,7 @@ // 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. // -// VMOptions=--async-debugger --verbose-debug --lazy-async-stacks +// VMOptions=--async-debugger --verbose-debug import 'dart:developer'; import 'service_test_common.dart';
diff --git a/runtime/observatory_2/tests/service_2/awaiter_async_stack_contents_2_test.dart b/runtime/observatory_2/tests/service_2/awaiter_async_stack_contents_2_test.dart index 0df05fd..55ccaa1 100644 --- a/runtime/observatory_2/tests/service_2/awaiter_async_stack_contents_2_test.dart +++ b/runtime/observatory_2/tests/service_2/awaiter_async_stack_contents_2_test.dart
@@ -2,7 +2,7 @@ // 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. // -// VMOptions=--async-debugger --verbose-debug --lazy-async-stacks +// VMOptions=--async-debugger --verbose-debug import 'dart:developer'; import 'package:observatory_2/models.dart' as M;
diff --git a/runtime/observatory_2/tests/service_2/awaiter_async_stack_contents_test.dart b/runtime/observatory_2/tests/service_2/awaiter_async_stack_contents_test.dart index 9e0f8f3..792d7d4 100644 --- a/runtime/observatory_2/tests/service_2/awaiter_async_stack_contents_test.dart +++ b/runtime/observatory_2/tests/service_2/awaiter_async_stack_contents_test.dart
@@ -2,7 +2,7 @@ // 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. // -// VMOptions=--async-debugger --verbose-debug --lazy-async-stacks +// VMOptions=--async-debugger --verbose-debug import 'dart:developer'; import 'package:observatory_2/models.dart' as M;
diff --git a/runtime/observatory_2/tests/service_2/causal_async_stack_contents_test.dart b/runtime/observatory_2/tests/service_2/causal_async_stack_contents_test.dart index 7523c0f..c80155c 100644 --- a/runtime/observatory_2/tests/service_2/causal_async_stack_contents_test.dart +++ b/runtime/observatory_2/tests/service_2/causal_async_stack_contents_test.dart
@@ -2,7 +2,7 @@ // 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. // -// VMOptions=--lazy-async-stacks --verbose_debug +// VMOptions=--verbose_debug import 'dart:developer'; import 'package:observatory_2/models.dart' as M;
diff --git a/runtime/observatory_2/tests/service_2/causal_async_stack_presence_test.dart b/runtime/observatory_2/tests/service_2/causal_async_stack_presence_test.dart index cd9ef6a..71cc1c8 100644 --- a/runtime/observatory_2/tests/service_2/causal_async_stack_presence_test.dart +++ b/runtime/observatory_2/tests/service_2/causal_async_stack_presence_test.dart
@@ -2,7 +2,7 @@ // 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. // -// VMOptions=--lazy-async-stacks --verbose_debug +// VMOptions=--verbose_debug import 'dart:developer'; import 'package:observatory_2/service_io.dart';
diff --git a/runtime/observatory_2/tests/service_2/causal_async_star_stack_contents_test.dart b/runtime/observatory_2/tests/service_2/causal_async_star_stack_contents_test.dart index 5044d57..5f715f8 100644 --- a/runtime/observatory_2/tests/service_2/causal_async_star_stack_contents_test.dart +++ b/runtime/observatory_2/tests/service_2/causal_async_star_stack_contents_test.dart
@@ -2,7 +2,7 @@ // 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. // -// VMOptions=--lazy-async-stacks --verbose_debug +// VMOptions=--verbose_debug import 'dart:developer'; import 'package:observatory_2/models.dart' as M;
diff --git a/runtime/observatory_2/tests/service_2/causal_async_star_stack_presence_test.dart b/runtime/observatory_2/tests/service_2/causal_async_star_stack_presence_test.dart index 8acf40d..fa3eb74 100644 --- a/runtime/observatory_2/tests/service_2/causal_async_star_stack_presence_test.dart +++ b/runtime/observatory_2/tests/service_2/causal_async_star_stack_presence_test.dart
@@ -2,7 +2,7 @@ // 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. // -// VMOptions=--lazy-async-stacks --verbose_debug +// VMOptions=--verbose_debug import 'dart:developer'; import 'package:observatory_2/service_io.dart';
diff --git a/runtime/observatory_2/tests/service_2/get_stack_limit_rpc_test.dart b/runtime/observatory_2/tests/service_2/get_stack_limit_rpc_test.dart index dc9f253..8570a28 100644 --- a/runtime/observatory_2/tests/service_2/get_stack_limit_rpc_test.dart +++ b/runtime/observatory_2/tests/service_2/get_stack_limit_rpc_test.dart
@@ -2,8 +2,6 @@ // 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. -// VMOptions=--lazy-async-stacks - import 'dart:async'; import 'dart:developer'; @@ -53,7 +51,7 @@ var frames = stack['frames']; var asyncFrames = stack['asyncCausalFrames']; var awaiterFrames = stack['awaiterFrames']; - expect(frames.length, greaterThanOrEqualTo(20)); + expect(frames.length, greaterThanOrEqualTo(12)); expect(asyncFrames.length, greaterThan(frames.length)); expect(awaiterFrames.length, greaterThan(frames.length)); expect(stack['truncated'], false);
diff --git a/runtime/observatory_2/tests/service_2/next_through_simple_async_test.dart b/runtime/observatory_2/tests/service_2/next_through_simple_async_test.dart index bc2c3d5..7985874 100644 --- a/runtime/observatory_2/tests/service_2/next_through_simple_async_test.dart +++ b/runtime/observatory_2/tests/service_2/next_through_simple_async_test.dart
@@ -1,14 +1,12 @@ // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file // 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. -// -// VMOptions=--lazy-async-stacks import 'test_helper.dart'; import 'service_test_common.dart'; import 'dart:io'; -const int LINE_A = 14; +const int LINE_A = 12; const String file = "next_through_simple_async_test.dart"; code() async { // LINE_A
diff --git a/runtime/observatory_2/tests/service_2/next_through_simple_async_with_returns_test.dart b/runtime/observatory_2/tests/service_2/next_through_simple_async_with_returns_test.dart index 9a3f234..f402762 100644 --- a/runtime/observatory_2/tests/service_2/next_through_simple_async_with_returns_test.dart +++ b/runtime/observatory_2/tests/service_2/next_through_simple_async_with_returns_test.dart
@@ -1,14 +1,12 @@ // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file // 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. -// -// VMOptions=--lazy-async-stacks import 'test_helper.dart'; import 'service_test_common.dart'; import 'dart:io'; -const int LINE_A = 14; +const int LINE_A = 12; const String file = "next_through_simple_async_with_returns_test.dart"; code() async { // LINE_A
diff --git a/runtime/observatory_2/tests/service_2/pause_on_unhandled_async_exceptions2_test.dart b/runtime/observatory_2/tests/service_2/pause_on_unhandled_async_exceptions2_test.dart index 50d9537..05f2e22 100644 --- a/runtime/observatory_2/tests/service_2/pause_on_unhandled_async_exceptions2_test.dart +++ b/runtime/observatory_2/tests/service_2/pause_on_unhandled_async_exceptions2_test.dart
@@ -2,8 +2,8 @@ // 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. // -// VMOptions=--async_debugger --lazy-async-stacks -// VMOptions=--async_debugger --lazy-async-stacks --optimization-counter-threshold=5 +// VMOptions=--async_debugger +// VMOptions=--async_debugger --optimization-counter-threshold=5 import 'package:observatory_2/service_io.dart'; import 'package:observatory_2/models.dart' as M;
diff --git a/runtime/observatory_2/tests/service_2/pause_on_unhandled_async_exceptions_test.dart b/runtime/observatory_2/tests/service_2/pause_on_unhandled_async_exceptions_test.dart index d179cb6..58dff1f 100644 --- a/runtime/observatory_2/tests/service_2/pause_on_unhandled_async_exceptions_test.dart +++ b/runtime/observatory_2/tests/service_2/pause_on_unhandled_async_exceptions_test.dart
@@ -2,7 +2,7 @@ // 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. // -// VMOptions=--async_debugger --lazy-async-stacks +// VMOptions=--async_debugger import 'package:observatory_2/service_io.dart'; import 'package:observatory_2/models.dart' as M;
diff --git a/runtime/observatory_2/tests/service_2/test_helper.dart b/runtime/observatory_2/tests/service_2/test_helper.dart index b2667bf..881b6b6 100644 --- a/runtime/observatory_2/tests/service_2/test_helper.dart +++ b/runtime/observatory_2/tests/service_2/test_helper.dart
@@ -25,7 +25,7 @@ const String.fromEnvironment('SERVICE_RESPONSE_SIZES_DIR'); /// The extra arguments to use -const List<String> extraDebuggingArgs = ['--lazy-async-stacks']; +const List<String> extraDebuggingArgs = []; /// Will be set to the http address of the VM's service protocol before /// any tests are invoked.
diff --git a/runtime/tests/vm/dart/causal_stacks/async_throws_stack_lazy_non_symbolic_test.dart b/runtime/tests/vm/dart/causal_stacks/async_throws_stack_lazy_non_symbolic_test.dart index d131340..67efb30 100644 --- a/runtime/tests/vm/dart/causal_stacks/async_throws_stack_lazy_non_symbolic_test.dart +++ b/runtime/tests/vm/dart/causal_stacks/async_throws_stack_lazy_non_symbolic_test.dart
@@ -2,7 +2,7 @@ // 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. // -// VMOptions=--dwarf-stack-traces --save-debugging-info=async_lazy_debug.so --lazy-async-stacks +// VMOptions=--dwarf-stack-traces --save-debugging-info=async_lazy_debug.so import 'dart:async'; import 'dart:io';
diff --git a/runtime/tests/vm/dart/causal_stacks/async_throws_stack_lazy_test.dart b/runtime/tests/vm/dart/causal_stacks/async_throws_stack_lazy_test.dart index 26805f1..830b54a 100644 --- a/runtime/tests/vm/dart/causal_stacks/async_throws_stack_lazy_test.dart +++ b/runtime/tests/vm/dart/causal_stacks/async_throws_stack_lazy_test.dart
@@ -1,8 +1,6 @@ // Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file // 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. -// -// VMOptions=--lazy-async-stacks import 'dart:async';
diff --git a/runtime/tests/vm/dart/causal_stacks/async_throws_stack_no_causal_non_symbolic_test.dart b/runtime/tests/vm/dart/causal_stacks/async_throws_stack_no_causal_non_symbolic_test.dart deleted file mode 100644 index c9dbb09..0000000 --- a/runtime/tests/vm/dart/causal_stacks/async_throws_stack_no_causal_non_symbolic_test.dart +++ /dev/null
@@ -1,17 +0,0 @@ -// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file -// 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. -// -// VMOptions=--dwarf-stack-traces --save-debugging-info=async_no_causal_debug.so --no-lazy-async-stacks - -import 'dart:async'; -import 'dart:io'; - -import 'utils.dart'; - -Future<void> main(List<String> args) async { - // We won't have access to the debugging info file on Android. - if (Platform.isAndroid) return; - - await doTestsNoCausalNoLazy('async_no_causal_debug.so'); -}
diff --git a/runtime/tests/vm/dart/causal_stacks/async_throws_stack_no_causal_test.dart b/runtime/tests/vm/dart/causal_stacks/async_throws_stack_no_causal_test.dart deleted file mode 100644 index 84848c9..0000000 --- a/runtime/tests/vm/dart/causal_stacks/async_throws_stack_no_causal_test.dart +++ /dev/null
@@ -1,11 +0,0 @@ -// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file -// 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. -// -// VMOptions=--no-lazy-async-stacks - -import 'dart:async'; - -import 'utils.dart'; - -Future<void> main(List<String> args) async => await doTestsNoCausalNoLazy();
diff --git a/runtime/tests/vm/dart/causal_stacks/flutter_regress_100441_test.dart b/runtime/tests/vm/dart/causal_stacks/flutter_regress_100441_test.dart index b5ff8ad..effb0aa 100644 --- a/runtime/tests/vm/dart/causal_stacks/flutter_regress_100441_test.dart +++ b/runtime/tests/vm/dart/causal_stacks/flutter_regress_100441_test.dart
@@ -1,8 +1,6 @@ // Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file // 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. -// -// VMOptions=--lazy-async-stacks import 'dart:async';
diff --git a/runtime/tests/vm/dart/causal_stacks/utils.dart b/runtime/tests/vm/dart/causal_stacks/utils.dart index 584fd6d..2269e31 100644 --- a/runtime/tests/vm/dart/causal_stacks/utils.dart +++ b/runtime/tests/vm/dart/causal_stacks/utils.dart
@@ -302,209 +302,6 @@ // Test "Suites": // ---- -// For: --no-lazy-async-stacks -Future<void> doTestsNoCausalNoLazy([String? debugInfoFilename]) async { - { - final expected = const <String>[ - r'^#0 throwSync \(.*/utils.dart:16(:3)?\)$', - r'^#1 allYield3 \(.*/utils.dart:39(:3)?\)$', - r'^#2 _RootZone.runUnary \(.+\)$', - // The rest are internal frames which we don't really care about. - IGNORE_REMAINING_STACK, - ]; - await doTestAwait(allYield, expected, debugInfoFilename); - await doTestAwaitThen(allYield, expected, debugInfoFilename); - await doTestAwaitCatchError(allYield, expected, debugInfoFilename); - } - - { - final expected = const <String>[ - r'^#0 throwSync \(.*/utils.dart:16(:3)?\)$', - r'^#1 noYields3 \(.*/utils.dart:54(:3)?\)$', - r'^#2 noYields2 \(.*/utils.dart:50(:9)?\)$', - r'^#3 noYields \(.*/utils.dart:46(:9)?\)$', - ]; - final postfix = const <String>[ - r'^#5 doTestsNoCausalNoLazy ', - r'^#6 _RootZone.runUnary \(.+\)$', - // The rest are internal frames which we don't really care about. - IGNORE_REMAINING_STACK, - ]; - await 0; // Don't let the `await do..`s chain together. - await doTestAwait( - noYields, - expected + - const <String>[ - r'^#4 doTestAwait ', - ] + - postfix, - debugInfoFilename); - await 0; // Don't let the `await do..`s chain together. - await doTestAwaitThen( - noYields, - expected + - const <String>[ - r'^#4 doTestAwaitThen ', - ] + - postfix, - debugInfoFilename); - await 0; // Don't let the `await do..`s chain together. - await doTestAwaitCatchError( - noYields, - expected + - const <String>[ - r'^#4 doTestAwaitCatchError ', - ] + - postfix, - debugInfoFilename); - } - - { - final expected = const <String>[ - r'^#0 throwAsync \(.*/utils.dart:21(:3)?\)$', - r'^#1 _RootZone.runUnary \(.+\)$', - // The rest are internal frames which we don't really care about. - IGNORE_REMAINING_STACK, - ]; - await doTestAwait(mixedYields, expected, debugInfoFilename); - await doTestAwaitThen(mixedYields, expected, debugInfoFilename); - await doTestAwaitCatchError(mixedYields, expected, debugInfoFilename); - } - - { - final expected = const <String>[ - r'^#0 throwAsync \(.*/utils.dart:21(:3)?\)$', - r'^#1 _RootZone.runUnary \(.+\)$', - // The rest are internal frames which we don't really care about. - IGNORE_REMAINING_STACK, - ]; - await doTestAwait(syncSuffix, expected, debugInfoFilename); - await doTestAwaitThen(syncSuffix, expected, debugInfoFilename); - await doTestAwaitCatchError(syncSuffix, expected, debugInfoFilename); - } - - { - final expected = const <String>[ - r'^#0 throwAsync \(.*/utils.dart:21(:3)?\)$', - r'^#1 _RootZone.runUnary \(.+\)$', - // The rest are internal frames which we don't really care about. - IGNORE_REMAINING_STACK, - ]; - await doTestAwait(nonAsyncNoStack, expected, debugInfoFilename); - await doTestAwaitThen(nonAsyncNoStack, expected, debugInfoFilename); - await doTestAwaitCatchError(nonAsyncNoStack, expected, debugInfoFilename); - } - - { - final expected = const <String>[ - r'^#0 throwSync \(.+/utils.dart:16(:3)?\)$', - r'^#1 asyncStarThrowSync \(.+/utils.dart:112(:11)?\)$', - r'^#2 _RootZone.runUnary \(.+\)$', - // The rest are internal frames which we don't really care about. - IGNORE_REMAINING_STACK, - ]; - await doTestAwait( - awaitEveryAsyncStarThrowSync, expected, debugInfoFilename); - await doTestAwaitThen( - awaitEveryAsyncStarThrowSync, expected, debugInfoFilename); - await doTestAwaitCatchError( - awaitEveryAsyncStarThrowSync, expected, debugInfoFilename); - } - - { - final expected = const <String>[ - r'^#0 throwAsync \(.*/utils.dart:21(:3)?\)$', - r'^#1 _RootZone.runUnary \(.+\)$', - // The rest are internal frames which we don't really care about. - IGNORE_REMAINING_STACK, - ]; - await doTestAwait( - awaitEveryAsyncStarThrowAsync, expected, debugInfoFilename); - await doTestAwaitThen( - awaitEveryAsyncStarThrowAsync, expected, debugInfoFilename); - await doTestAwaitCatchError( - awaitEveryAsyncStarThrowAsync, expected, debugInfoFilename); - } - - { - final expected = const <String>[ - r'^#0 throwAsync \(.*/utils.dart:21(:3)?\)$', - r'^#1 _RootZone.runUnary \(.+\)$', - // The rest are internal frames which we don't really care about. - IGNORE_REMAINING_STACK, - ]; - await doTestAwait(listenAsyncStarThrowAsync, expected, debugInfoFilename); - await doTestAwaitThen( - listenAsyncStarThrowAsync, expected, debugInfoFilename); - await doTestAwaitCatchError( - listenAsyncStarThrowAsync, expected, debugInfoFilename); - } - - { - final expected = const <String>[ - r'#0 throwSync \(.*/utils.dart:16(:3)?\)$', - r'#1 allYield3 \(.*/utils.dart:39(:3)?\)$', - r'#2 _rootRunUnary \(.+\)$', - // The rest are internal frames which we don't really care about. - IGNORE_REMAINING_STACK, - ]; - await doTestAwait(customErrorZone, expected, debugInfoFilename); - await doTestAwaitThen(customErrorZone, expected, debugInfoFilename); - await doTestAwaitCatchError(customErrorZone, expected, debugInfoFilename); - } - - { - final expected = const <String>[ - r'#0 throwAsync \(.*/utils.dart:21(:3)?\)$', - r'^#1 _RootZone.runUnary \(.+\)$', - // The rest are internal frames which we don't really care about. - IGNORE_REMAINING_STACK, - ]; - await doTestAwait(awaitTimeout, expected, debugInfoFilename); - await doTestAwaitThen(awaitTimeout, expected, debugInfoFilename); - await doTestAwaitCatchError(awaitTimeout, expected, debugInfoFilename); - } - - { - final expected = const <String>[ - r'#0 throwAsync \(.*/utils.dart:21(:3)?\)$', - r'^#1 _RootZone.runUnary \(.+\)$', - // The rest are internal frames which we don't really care about. - IGNORE_REMAINING_STACK, - ]; - await doTestAwait(awaitWait, expected, debugInfoFilename); - await doTestAwaitThen(awaitWait, expected, debugInfoFilename); - await doTestAwaitCatchError(awaitWait, expected, debugInfoFilename); - } - - { - final expected = const <String>[ - r'^#0 throwAsync \(.*/utils.dart:21(:3)?\)$', - r'^#1 _RootZone.runUnary \(.+\)$', - // The rest are internal frames which we don't really care about. - IGNORE_REMAINING_STACK, - ]; - await doTestAwait(futureSyncWhenComplete, expected, debugInfoFilename); - await doTestAwaitThen(futureSyncWhenComplete, expected, debugInfoFilename); - await doTestAwaitCatchError( - futureSyncWhenComplete, expected, debugInfoFilename); - } - - { - final expected = const <String>[ - r'^#0 throwSync \(.*/utils.dart:16(:3)?\)$', - r'^#1 futureThen.<anonymous closure> \(.*/utils.dart:187(:5)?\)$', - r'^#2 _RootZone.runUnary \(.+\)$', - // The rest are internal frames which we don't really care about. - IGNORE_REMAINING_STACK, - ]; - await doTestAwait(futureThen, expected, debugInfoFilename); - await doTestAwaitThen(futureThen, expected, debugInfoFilename); - await doTestAwaitCatchError(futureThen, expected, debugInfoFilename); - } -} - -// For: --lazy-async-stacks Future<void> doTestsLazy([String? debugInfoFilename]) async { // allYield {
diff --git a/runtime/tests/vm/dart/regress40189_test.dart b/runtime/tests/vm/dart/regress40189_test.dart index f857e5b..f37839a 100644 --- a/runtime/tests/vm/dart/regress40189_test.dart +++ b/runtime/tests/vm/dart/regress40189_test.dart
@@ -1,8 +1,6 @@ // Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file // 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. -// -// VMOptions=--lazy-async-stacks import "package:expect/expect.dart";
diff --git a/runtime/tests/vm/dart_2/causal_stacks/async_throws_stack_lazy_non_symbolic_test.dart b/runtime/tests/vm/dart_2/causal_stacks/async_throws_stack_lazy_non_symbolic_test.dart index d4d9e46..af20a8f 100644 --- a/runtime/tests/vm/dart_2/causal_stacks/async_throws_stack_lazy_non_symbolic_test.dart +++ b/runtime/tests/vm/dart_2/causal_stacks/async_throws_stack_lazy_non_symbolic_test.dart
@@ -2,7 +2,7 @@ // 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. // -// VMOptions=--dwarf-stack-traces --save-debugging-info=async_lazy_debug.so --lazy-async-stacks +// VMOptions=--dwarf-stack-traces --save-debugging-info=async_lazy_debug.so // @dart = 2.9
diff --git a/runtime/tests/vm/dart_2/causal_stacks/async_throws_stack_lazy_test.dart b/runtime/tests/vm/dart_2/causal_stacks/async_throws_stack_lazy_test.dart index ff202c8..00c1459 100644 --- a/runtime/tests/vm/dart_2/causal_stacks/async_throws_stack_lazy_test.dart +++ b/runtime/tests/vm/dart_2/causal_stacks/async_throws_stack_lazy_test.dart
@@ -1,8 +1,6 @@ // Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file // 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. -// -// VMOptions=--lazy-async-stacks // @dart = 2.9
diff --git a/runtime/tests/vm/dart_2/causal_stacks/async_throws_stack_no_causal_non_symbolic_test.dart b/runtime/tests/vm/dart_2/causal_stacks/async_throws_stack_no_causal_non_symbolic_test.dart deleted file mode 100644 index a84014e..0000000 --- a/runtime/tests/vm/dart_2/causal_stacks/async_throws_stack_no_causal_non_symbolic_test.dart +++ /dev/null
@@ -1,19 +0,0 @@ -// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file -// 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. -// -// VMOptions=--dwarf-stack-traces --save-debugging-info=async_no_causal_debug.so --no-lazy-async-stacks - -// @dart = 2.9 - -import 'dart:async'; -import 'dart:io'; - -import 'utils.dart'; - -Future<void> main(List<String> args) async { - // We won't have access to the debugging info file on Android. - if (Platform.isAndroid) return; - - await doTestsNoCausalNoLazy('async_no_causal_debug.so'); -}
diff --git a/runtime/tests/vm/dart_2/causal_stacks/async_throws_stack_no_causal_test.dart b/runtime/tests/vm/dart_2/causal_stacks/async_throws_stack_no_causal_test.dart deleted file mode 100644 index 3afda58..0000000 --- a/runtime/tests/vm/dart_2/causal_stacks/async_throws_stack_no_causal_test.dart +++ /dev/null
@@ -1,13 +0,0 @@ -// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file -// 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. -// -// VMOptions=--no-lazy-async-stacks - -// @dart = 2.9 - -import 'dart:async'; - -import 'utils.dart'; - -Future<void> main(List<String> args) async => await doTestsNoCausalNoLazy();
diff --git a/runtime/tests/vm/dart_2/causal_stacks/flutter_regress_100441_test.dart b/runtime/tests/vm/dart_2/causal_stacks/flutter_regress_100441_test.dart index 2d4d2ef..e6a749d 100644 --- a/runtime/tests/vm/dart_2/causal_stacks/flutter_regress_100441_test.dart +++ b/runtime/tests/vm/dart_2/causal_stacks/flutter_regress_100441_test.dart
@@ -1,8 +1,6 @@ // Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file // 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. -// -// VMOptions=--lazy-async-stacks // @dart = 2.9 import 'dart:async';
diff --git a/runtime/tests/vm/dart_2/causal_stacks/utils.dart b/runtime/tests/vm/dart_2/causal_stacks/utils.dart index 5ae06ed..d7c80d1 100644 --- a/runtime/tests/vm/dart_2/causal_stacks/utils.dart +++ b/runtime/tests/vm/dart_2/causal_stacks/utils.dart
@@ -304,209 +304,6 @@ // Test "Suites": // ---- -// For: --no-lazy-async-stacks -Future<void> doTestsNoCausalNoLazy([String debugInfoFilename]) async { - { - final expected = const <String>[ - r'^#0 throwSync \(.*/utils.dart:18(:3)?\)$', - r'^#1 allYield3 \(.*/utils.dart:41(:3)?\)$', - r'^#2 _RootZone.runUnary \(.+\)$', - // The rest are internal frames which we don't really care about. - IGNORE_REMAINING_STACK, - ]; - await doTestAwait(allYield, expected, debugInfoFilename); - await doTestAwaitThen(allYield, expected, debugInfoFilename); - await doTestAwaitCatchError(allYield, expected, debugInfoFilename); - } - - { - final expected = const <String>[ - r'^#0 throwSync \(.*/utils.dart:18(:3)?\)$', - r'^#1 noYields3 \(.*/utils.dart:56(:3)?\)$', - r'^#2 noYields2 \(.*/utils.dart:52(:9)?\)$', - r'^#3 noYields \(.*/utils.dart:48(:9)?\)$', - ]; - final postfix = const <String>[ - r'^#5 doTestsNoCausalNoLazy ', - r'^#6 _RootZone.runUnary ', - // The rest are internal frames which we don't really care about. - IGNORE_REMAINING_STACK, - ]; - await 0; // Don't let the `await do..`s chain together. - await doTestAwait( - noYields, - expected + - const <String>[ - r'^#4 doTestAwait ', - ] + - postfix, - debugInfoFilename); - await 0; // Don't let the `await do..`s chain together. - await doTestAwaitThen( - noYields, - expected + - const <String>[ - r'^#4 doTestAwaitThen ', - ] + - postfix, - debugInfoFilename); - await 0; // Don't let the `await do..`s chain together. - await doTestAwaitCatchError( - noYields, - expected + - const <String>[ - r'^#4 doTestAwaitCatchError ', - ] + - postfix, - debugInfoFilename); - } - - { - final expected = const <String>[ - r'^#0 throwAsync \(.*/utils.dart:23(:3)?\)$', - r'^#1 _RootZone.runUnary \(.+\)$', - // The rest are internal frames which we don't really care about. - IGNORE_REMAINING_STACK, - ]; - await doTestAwait(mixedYields, expected, debugInfoFilename); - await doTestAwaitThen(mixedYields, expected, debugInfoFilename); - await doTestAwaitCatchError(mixedYields, expected, debugInfoFilename); - } - - { - final expected = const <String>[ - r'^#0 throwAsync \(.*/utils.dart:23(:3)?\)$', - r'^#1 _RootZone.runUnary \(.+\)$', - // The rest are internal frames which we don't really care about. - IGNORE_REMAINING_STACK, - ]; - await doTestAwait(syncSuffix, expected, debugInfoFilename); - await doTestAwaitThen(syncSuffix, expected, debugInfoFilename); - await doTestAwaitCatchError(syncSuffix, expected, debugInfoFilename); - } - - { - final expected = const <String>[ - r'^#0 throwAsync \(.*/utils.dart:23(:3)?\)$', - r'^#1 _RootZone.runUnary \(.+\)$', - // The rest are internal frames which we don't really care about. - IGNORE_REMAINING_STACK, - ]; - await doTestAwait(nonAsyncNoStack, expected, debugInfoFilename); - await doTestAwaitThen(nonAsyncNoStack, expected, debugInfoFilename); - await doTestAwaitCatchError(nonAsyncNoStack, expected, debugInfoFilename); - } - - { - final expected = const <String>[ - r'^#0 throwSync \(.+/utils.dart:18(:3)?\)$', - r'^#1 asyncStarThrowSync \(.+/utils.dart:114(:11)?\)$', - r'^#2 _RootZone.runUnary \(.+\)$', - // The rest are internal frames which we don't really care about. - IGNORE_REMAINING_STACK, - ]; - await doTestAwait( - awaitEveryAsyncStarThrowSync, expected, debugInfoFilename); - await doTestAwaitThen( - awaitEveryAsyncStarThrowSync, expected, debugInfoFilename); - await doTestAwaitCatchError( - awaitEveryAsyncStarThrowSync, expected, debugInfoFilename); - } - - { - final expected = const <String>[ - r'^#0 throwAsync \(.*/utils.dart:23(:3)?\)$', - r'^#1 _RootZone.runUnary \(.+\)$', - // The rest are internal frames which we don't really care about. - IGNORE_REMAINING_STACK, - ]; - await doTestAwait( - awaitEveryAsyncStarThrowAsync, expected, debugInfoFilename); - await doTestAwaitThen( - awaitEveryAsyncStarThrowAsync, expected, debugInfoFilename); - await doTestAwaitCatchError( - awaitEveryAsyncStarThrowAsync, expected, debugInfoFilename); - } - - { - final expected = const <String>[ - r'^#0 throwAsync \(.*/utils.dart:23(:3)?\)$', - r'^#1 _RootZone.runUnary \(.+\)$', - // The rest are internal frames which we don't really care about. - IGNORE_REMAINING_STACK, - ]; - await doTestAwait(listenAsyncStarThrowAsync, expected, debugInfoFilename); - await doTestAwaitThen( - listenAsyncStarThrowAsync, expected, debugInfoFilename); - await doTestAwaitCatchError( - listenAsyncStarThrowAsync, expected, debugInfoFilename); - } - - { - final expected = const <String>[ - r'#0 throwSync \(.*/utils.dart:18(:3)?\)$', - r'#1 allYield3 \(.*/utils.dart:41(:3)?\)$', - r'#2 _rootRunUnary ', - // The rest are internal frames which we don't really care about. - IGNORE_REMAINING_STACK, - ]; - await doTestAwait(customErrorZone, expected, debugInfoFilename); - await doTestAwaitThen(customErrorZone, expected, debugInfoFilename); - await doTestAwaitCatchError(customErrorZone, expected, debugInfoFilename); - } - - { - final expected = const <String>[ - r'#0 throwAsync \(.*/utils.dart:23(:3)?\)$', - r'^#1 _RootZone.runUnary \(.+\)$', - // The rest are internal frames which we don't really care about. - IGNORE_REMAINING_STACK, - ]; - await doTestAwait(awaitTimeout, expected, debugInfoFilename); - await doTestAwaitThen(awaitTimeout, expected, debugInfoFilename); - await doTestAwaitCatchError(awaitTimeout, expected, debugInfoFilename); - } - - { - final expected = const <String>[ - r'#0 throwAsync \(.*/utils.dart:23(:3)?\)$', - r'^#1 _RootZone.runUnary \(.+\)$', - // The rest are internal frames which we don't really care about. - IGNORE_REMAINING_STACK, - ]; - await doTestAwait(awaitWait, expected, debugInfoFilename); - await doTestAwaitThen(awaitWait, expected, debugInfoFilename); - await doTestAwaitCatchError(awaitWait, expected, debugInfoFilename); - } - - { - final expected = const <String>[ - r'^#0 throwAsync \(.*/utils.dart:23(:3)?\)$', - r'^#1 _RootZone.runUnary \(.+\)$', - // The rest are internal frames which we don't really care about. - IGNORE_REMAINING_STACK, - ]; - await doTestAwait(futureSyncWhenComplete, expected, debugInfoFilename); - await doTestAwaitThen(futureSyncWhenComplete, expected, debugInfoFilename); - await doTestAwaitCatchError( - futureSyncWhenComplete, expected, debugInfoFilename); - } - - { - final expected = const <String>[ - r'^#0 throwSync \(.*/utils.dart:18(:3)?\)$', - r'^#1 futureThen.<anonymous closure> \(.*/utils.dart:189(:5)?\)$', - r'^#2 _RootZone.runUnary \(.+\)$', - // The rest are internal frames which we don't really care about. - IGNORE_REMAINING_STACK, - ]; - await doTestAwait(futureThen, expected, debugInfoFilename); - await doTestAwaitThen(futureThen, expected, debugInfoFilename); - await doTestAwaitCatchError(futureThen, expected, debugInfoFilename); - } -} - -// For: --lazy-async-stacks Future<void> doTestsLazy([String debugInfoFilename]) async { // allYield {
diff --git a/runtime/tests/vm/dart_2/regress40189_test.dart b/runtime/tests/vm/dart_2/regress40189_test.dart index cbc9f45..348e1ec 100644 --- a/runtime/tests/vm/dart_2/regress40189_test.dart +++ b/runtime/tests/vm/dart_2/regress40189_test.dart
@@ -1,8 +1,6 @@ // Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file // 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. -// -// VMOptions=--lazy-async-stacks // @dart = 2.9
diff --git a/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc b/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc index 529c56d..0ccfd45 100644 --- a/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc +++ b/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc
@@ -5639,7 +5639,7 @@ // Note: Is..() methods use the modifiers set above, so order // matters. if (function.IsAsyncClosure() || function.IsAsyncGenClosure()) { - function.set_is_inlinable(!FLAG_lazy_async_stacks); + function.set_is_inlinable(false); } ASSERT(!function.IsCompactAsyncFunction()); ASSERT(!function.IsCompactAsyncStarFunction());
diff --git a/runtime/vm/compiler/frontend/scope_builder.cc b/runtime/vm/compiler/frontend/scope_builder.cc index 5151145..2db5f8f 100644 --- a/runtime/vm/compiler/frontend/scope_builder.cc +++ b/runtime/vm/compiler/frontend/scope_builder.cc
@@ -1384,7 +1384,7 @@ // Lift the special async vars out of the function body scope, into the // outer function declaration scope. // This way we can allocate them in the outermost context at fixed indices, - // allowing support for --lazy-async-stacks implementation to find awaiters. + // allowing support for async stack traces implementation to find awaiters. if (name.Equals(Symbols::AwaitJumpVar()) || name.Equals(Symbols::AsyncFuture()) || name.Equals(Symbols::is_sync()) || name.Equals(Symbols::Controller())) {
diff --git a/runtime/vm/compiler/jit/compiler.cc b/runtime/vm/compiler/jit/compiler.cc index 5dacd56..bcfe3c9 100644 --- a/runtime/vm/compiler/jit/compiler.cc +++ b/runtime/vm/compiler/jit/compiler.cc
@@ -102,7 +102,6 @@ FLAG_reorder_basic_blocks = true; FLAG_use_field_guards = false; FLAG_use_cha_deopt = false; - FLAG_lazy_async_stacks = true; #if !defined(PRODUCT) && !defined(DART_PRECOMPILED_RUNTIME) // Set flags affecting runtime accordingly for gen_snapshot.
diff --git a/runtime/vm/debugger.cc b/runtime/vm/debugger.cc index 31cc36f..ec145d7 100644 --- a/runtime/vm/debugger.cc +++ b/runtime/vm/debugger.cc
@@ -1966,13 +1966,6 @@ } DebuggerStackTrace* DebuggerStackTrace::CollectAsyncCausal() { - if (FLAG_lazy_async_stacks) { - return CollectAsyncLazy(); - } - return nullptr; -} - -DebuggerStackTrace* DebuggerStackTrace::CollectAsyncLazy() { Thread* thread = Thread::Current(); Zone* zone = thread->zone(); Isolate* isolate = thread->isolate(); @@ -1996,9 +1989,8 @@ &inlined_code, &deopt_frame); }; - StackTraceUtils::CollectFramesLazy(thread, code_array, &pc_offset_array, - /*skip_frames=*/0, &on_sync_frame, - &has_async); + StackTraceUtils::CollectFrames(thread, code_array, &pc_offset_array, + /*skip_frames=*/0, &on_sync_frame, &has_async); // If the entire stack is sync, return no (async) trace. if (!has_async) { @@ -4072,31 +4064,29 @@ } // We need to manually set a synthetic breakpoint for async_op before entry. - if (FLAG_lazy_async_stacks) { - // async and async* functions always contain synthetic async_ops. - if ((frame->function().IsAsyncFunction() || - frame->function().IsAsyncGenerator()) && - !frame->function().IsSuspendableFunction()) { - ASSERT(!frame->GetSavedCurrentContext().IsNull()); - ASSERT(frame->GetSavedCurrentContext().num_variables() > - Context::kAsyncFutureIndex); + // async and async* functions always contain synthetic async_ops. + if ((frame->function().IsAsyncFunction() || + frame->function().IsAsyncGenerator()) && + !frame->function().IsSuspendableFunction()) { + ASSERT(!frame->GetSavedCurrentContext().IsNull()); + ASSERT(frame->GetSavedCurrentContext().num_variables() > + Context::kAsyncFutureIndex); - const Object& async_future = Object::Handle( - frame->GetSavedCurrentContext().At(Context::kAsyncFutureIndex)); + const Object& async_future = Object::Handle( + frame->GetSavedCurrentContext().At(Context::kAsyncFutureIndex)); - // Only set breakpoint when entering async_op the first time. - // :async_future should be uninitialised at this point: - if (async_future.IsNull()) { - const Function& async_op = Function::Handle( - ClosureFunctionsCache::GetUniqueInnerClosure(frame->function())); - if (!async_op.IsNull()) { - SetBreakpointAtAsyncOp(async_op); - // After setting the breakpoint we stop stepping and continue the - // debugger until the next breakpoint, to step over all the - // synthetic code. - Continue(); - return Error::null(); - } + // Only set breakpoint when entering async_op the first time. + // :async_future should be uninitialised at this point: + if (async_future.IsNull()) { + const Function& async_op = Function::Handle( + ClosureFunctionsCache::GetUniqueInnerClosure(frame->function())); + if (!async_op.IsNull()) { + SetBreakpointAtAsyncOp(async_op); + // After setting the breakpoint we stop stepping and continue the + // debugger until the next breakpoint, to step over all the + // synthetic code. + Continue(); + return Error::null(); } } }
diff --git a/runtime/vm/debugger.h b/runtime/vm/debugger.h index 47e701f..56dfd6d 100644 --- a/runtime/vm/debugger.h +++ b/runtime/vm/debugger.h
@@ -524,7 +524,6 @@ Array* deopt_frame); static DebuggerStackTrace* CollectAsyncCausal(); - static DebuggerStackTrace* CollectAsyncLazy(); ZoneGrowableArray<ActivationFrame*> trace_;
diff --git a/runtime/vm/flag_list.h b/runtime/vm/flag_list.h index 462413c..46a7bd5 100644 --- a/runtime/vm/flag_list.h +++ b/runtime/vm/flag_list.h
@@ -64,7 +64,6 @@ P(code_comments, bool, false, "Include comments into code and disassembly.") \ P(dwarf_stack_traces_mode, bool, false, \ "Use --[no-]dwarf-stack-traces instead.") \ - P(lazy_async_stacks, bool, true, "Reconstruct async stacks from listeners") \ P(lazy_dispatchers, bool, true, "Generate dispatchers lazily") \ R(dedup_instructions, true, bool, false, \ "Canonicalize instructions when precompiling.") @@ -135,6 +134,7 @@ P(idle_duration_micros, int, 500 * kMicrosecondsPerMillisecond, \ "Allow idle tasks to run for this long.") \ P(interpret_irregexp, bool, false, "Use irregexp bytecode interpreter") \ + P(lazy_async_stacks, bool, true, "Obsolete, ignored.") \ P(link_natives_lazily, bool, false, "Link native calls lazily") \ R(log_marker_tasks, false, bool, false, \ "Log debugging information for old gen GC marking tasks.") \
diff --git a/runtime/vm/kernel_loader.cc b/runtime/vm/kernel_loader.cc index ee8d3a6..e37a681 100644 --- a/runtime/vm/kernel_loader.cc +++ b/runtime/vm/kernel_loader.cc
@@ -2056,17 +2056,17 @@ switch (function_node_helper.dart_async_marker_) { case FunctionNodeHelper::kSyncStar: function.set_modifier(UntaggedFunction::kSyncGen); - function.set_is_visible(!FLAG_lazy_async_stacks); + function.set_is_visible(false); break; case FunctionNodeHelper::kAsync: function.set_modifier(UntaggedFunction::kAsync); - function.set_is_inlinable(!FLAG_lazy_async_stacks); - function.set_is_visible(!FLAG_lazy_async_stacks); + function.set_is_inlinable(false); + function.set_is_visible(false); break; case FunctionNodeHelper::kAsyncStar: function.set_modifier(UntaggedFunction::kAsyncGen); - function.set_is_inlinable(!FLAG_lazy_async_stacks); - function.set_is_visible(!FLAG_lazy_async_stacks); + function.set_is_inlinable(false); + function.set_is_visible(false); break; default: // no special modifier
diff --git a/runtime/vm/service.cc b/runtime/vm/service.cc index c056360..85cf403 100644 --- a/runtime/vm/service.cc +++ b/runtime/vm/service.cc
@@ -2881,6 +2881,13 @@ output.Add(instance); return; } + if (type.IsTypeRef()) { + // A TypeRef is used to break cycles in the representation of types + // calling type class on it will cause an infinite recursion. + // We use null instead. + output.Add(instance); + return; + } const Class& cls = Class::Handle(type.type_class()); const Library& lib = Library::Handle(zone, cls.library());
diff --git a/runtime/vm/stack_trace.cc b/runtime/vm/stack_trace.cc index 671f58b..21ab60e 100644 --- a/runtime/vm/stack_trace.cc +++ b/runtime/vm/stack_trace.cc
@@ -627,7 +627,7 @@ } } -void StackTraceUtils::CollectFramesLazy( +void StackTraceUtils::CollectFrames( Thread* thread, const GrowableObjectArray& code_array, GrowableArray<uword>* pc_offset_array, @@ -696,85 +696,4 @@ return; } -intptr_t StackTraceUtils::CountFrames(Thread* thread, - int skip_frames, - const Function& async_function, - bool* sync_async_end) { - Zone* zone = thread->zone(); - intptr_t frame_count = 0; - DartFrameIterator frames(thread, StackFrameIterator::kNoCrossThreadIteration); - StackFrame* frame = frames.NextFrame(); - ASSERT(frame != nullptr); // We expect to find a dart invocation frame. - Function& function = Function::Handle(zone); - Code& code = Code::Handle(zone); - Closure& closure = Closure::Handle(zone); - const bool async_function_is_null = async_function.IsNull(); - - ASSERT(async_function_is_null || sync_async_end != nullptr); - - for (; frame != nullptr; frame = frames.NextFrame()) { - if (skip_frames > 0) { - skip_frames--; - continue; - } - code = frame->LookupDartCode(); - function = code.function(); - - frame_count++; - - const bool function_is_null = function.IsNull(); - - if (!async_function_is_null && !function_is_null && - function.parent_function() != Function::null()) { - if (async_function.ptr() == function.parent_function()) { - if (function.IsAsyncClosure() || function.IsAsyncGenClosure()) { - ObjectPtr* last_caller_obj = - reinterpret_cast<ObjectPtr*>(frame->GetCallerSp()); - closure = FindClosureInFrame(last_caller_obj, function); - if (!closure.IsNull() && - CallerClosureFinder::IsRunningAsync(closure)) { - *sync_async_end = false; - return frame_count; - } - } - break; - } - } - } - - if (!async_function_is_null) { - *sync_async_end = true; - } - - return frame_count; -} - -intptr_t StackTraceUtils::CollectFrames(Thread* thread, - const Array& code_array, - const TypedData& pc_offset_array, - intptr_t array_offset, - intptr_t count, - int skip_frames) { - Zone* zone = thread->zone(); - DartFrameIterator frames(thread, StackFrameIterator::kNoCrossThreadIteration); - StackFrame* frame = frames.NextFrame(); - ASSERT(frame != NULL); // We expect to find a dart invocation frame. - Code& code = Code::Handle(zone); - intptr_t collected_frames_count = 0; - for (; (frame != NULL) && (collected_frames_count < count); - frame = frames.NextFrame()) { - if (skip_frames > 0) { - skip_frames--; - continue; - } - code = frame->LookupDartCode(); - const intptr_t pc_offset = frame->pc() - code.PayloadStart(); - code_array.SetAt(array_offset, code); - pc_offset_array.SetUintPtr(array_offset * kWordSize, pc_offset); - array_offset++; - collected_frames_count++; - } - return collected_frames_count; -} - } // namespace dart
diff --git a/runtime/vm/stack_trace.h b/runtime/vm/stack_trace.h index 37df069..cfd558c 100644 --- a/runtime/vm/stack_trace.h +++ b/runtime/vm/stack_trace.h
@@ -144,46 +144,17 @@ /// hit which has yielded before (i.e. is not in sync-async case). /// /// From there on finds the closure of the async/async* frame and starts - /// traversing the listeners: - /// while (closure != null) { - /// yield_index = closure.context[Context::kAsyncJumpVarIndex] - /// pc = closure.function.code.pc_descriptors.LookupPcFromYieldIndex( - /// yield_index); - /// <emit pc in frame> - /// closure = closure.context[Context::kAsyncCompleterVarIndex]._future - /// ._resultOrListeners.callback; - /// } + /// traversing the listeners. /// /// If [on_sync_frames] is non-nullptr, it will be called for every /// synchronous frame which is collected. - static void CollectFramesLazy( + static void CollectFrames( Thread* thread, const GrowableObjectArray& code_array, GrowableArray<uword>* pc_offset_array, int skip_frames, std::function<void(StackFrame*)>* on_sync_frames = nullptr, bool* has_async = nullptr); - - /// Counts the number of stack frames. - /// Skips over the first |skip_frames|. - /// If |async_function| is not null, stops at the function that has - /// |async_function| as its parent, and records in 'sync_async_end' whether - /// |async_function| was called synchronously. - static intptr_t CountFrames(Thread* thread, - int skip_frames, - const Function& async_function, - bool* sync_async_end); - - /// Collects |count| frames into |code_array| and |pc_offset_array|. - /// Writing begins at |array_offset|. - /// Skips over the first |skip_frames|. - /// Returns the number of frames collected. - static intptr_t CollectFrames(Thread* thread, - const Array& code_array, - const TypedData& pc_offset_array, - intptr_t array_offset, - intptr_t count, - int skip_frames); }; } // namespace dart
diff --git a/sdk/lib/_internal/vm/lib/async_patch.dart b/sdk/lib/_internal/vm/lib/async_patch.dart index 238cbb6..8e1d110 100644 --- a/sdk/lib/_internal/vm/lib/async_patch.dart +++ b/sdk/lib/_internal/vm/lib/async_patch.dart
@@ -372,15 +372,69 @@ } } + @pragma("vm:invisible") + @pragma("vm:prefer-inline") + void _awaitCompletedFuture(_Future future) { + assert(future._isComplete); + final zone = Zone._current; + if (future._hasError) { + @pragma("vm:invisible") + void run() { + final AsyncError asyncError = + unsafeCast<AsyncError>(future._resultOrListeners); + zone.runBinary( + unsafeCast<dynamic Function(Object, StackTrace)>(_errorCallback), + asyncError.error, + asyncError.stackTrace); + } + + zone.scheduleMicrotask(run); + } else { + @pragma("vm:invisible") + void run() { + zone.runUnary(unsafeCast<dynamic Function(dynamic)>(_thenCallback), + future._resultOrListeners); + } + + zone.scheduleMicrotask(run); + } + } + + @pragma("vm:invisible") + @pragma("vm:prefer-inline") + void _awaitNotFuture(Object? object) { + final zone = Zone._current; + @pragma("vm:invisible") + void run() { + zone.runUnary( + unsafeCast<dynamic Function(dynamic)>(_thenCallback), object); + } + + zone.scheduleMicrotask(run); + } + @pragma("vm:entry-point", "call") @pragma("vm:invisible") Object? _await(Object? object) { - if (_trace) print('_awaitAsync (object=$object)'); + if (_trace) print('_await (object=$object)'); if (_thenCallback == null) { _createAsyncCallbacks(); } - _awaitHelper(object, unsafeCast<dynamic Function(dynamic)>(_thenCallback), - unsafeCast<dynamic Function(Object, StackTrace)>(_errorCallback)); + if (object is _Future) { + if (object._isComplete) { + _awaitCompletedFuture(object); + } else { + object._thenAwait<dynamic>( + unsafeCast<dynamic Function(dynamic)>(_thenCallback), + unsafeCast<dynamic Function(Object, StackTrace)>(_errorCallback)); + } + } else if (object is! Future) { + _awaitNotFuture(object); + } else { + object.then(unsafeCast<dynamic Function(dynamic)>(_thenCallback), + onError: + unsafeCast<dynamic Function(Object, StackTrace)>(_errorCallback)); + } return _functionData; } @@ -392,14 +446,16 @@ 'returnValue=$returnValue)'); } _Future future; - bool isSync = true; if (suspendState is _SuspendState) { future = unsafeCast<_Future>(suspendState._functionData); } else { future = unsafeCast<_Future>(suspendState); - isSync = false; } - _completeOnAsyncReturn(future, returnValue, isSync); + if (returnValue is Future) { + future._asyncCompleteUnchecked(returnValue); + } else { + future._completeWithValue(returnValue); + } return future; } @@ -412,14 +468,12 @@ 'returnValue=$returnValue)'); } _Future future; - bool isSync = true; if (suspendState is _SuspendState) { future = unsafeCast<_Future>(suspendState._functionData); } else { future = unsafeCast<_Future>(suspendState); - isSync = false; } - _completeWithNoFutureOnAsyncReturn(future, returnValue, isSync); + future._completeWithValue(returnValue); return future; }
diff --git a/tests/language/vm/lazy_async_exception_stack2_test.dart b/tests/language/vm/lazy_async_exception_stack2_test.dart index bd9b8d5..9368e75 100644 --- a/tests/language/vm/lazy_async_exception_stack2_test.dart +++ b/tests/language/vm/lazy_async_exception_stack2_test.dart
@@ -1,8 +1,6 @@ // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file // 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. -// -// VMOptions=--lazy-async-stacks import 'package:async_helper/async_minitest.dart';
diff --git a/tests/language/vm/lazy_async_exception_stack_test.dart b/tests/language/vm/lazy_async_exception_stack_test.dart index 9b9705e..8811343 100644 --- a/tests/language/vm/lazy_async_exception_stack_test.dart +++ b/tests/language/vm/lazy_async_exception_stack_test.dart
@@ -1,8 +1,6 @@ // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file // 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. -// -// VMOptions=--lazy-async-stacks import 'package:async_helper/async_minitest.dart'; @@ -36,8 +34,8 @@ } catch (e, st) { expect( h.stringContainsInOrder(st.toString(), [ - 'thrower', '.dart:12', // no auto-format. - 'generator', '.dart:21', // no auto-format. + 'thrower', '.dart:10', // no auto-format. + 'generator', '.dart:19', // no auto-format. '<asynchronous suspension>', // no auto-format. 'foo', '.dart', // no auto-format. 'main', @@ -74,8 +72,8 @@ } catch (e, st) { expect( h.stringContainsInOrder(st.toString(), [ - 'thrower', '.dart:12', // no auto-format. - 'main.<anonymous closure>', '.dart:73', // no auto-format. + 'thrower', '.dart:10', // no auto-format. + 'main.<anonymous closure>', '.dart:71', // no auto-format. ]), isTrue); }
diff --git a/tests/language_2/vm/lazy_async_exception_stack2_test.dart b/tests/language_2/vm/lazy_async_exception_stack2_test.dart index 81df6ce..9cff86a 100644 --- a/tests/language_2/vm/lazy_async_exception_stack2_test.dart +++ b/tests/language_2/vm/lazy_async_exception_stack2_test.dart
@@ -1,8 +1,6 @@ // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file // 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. -// -// VMOptions=--lazy-async-stacks // @dart = 2.9
diff --git a/tests/language_2/vm/lazy_async_exception_stack_test.dart b/tests/language_2/vm/lazy_async_exception_stack_test.dart index 46ee9ff..f037568 100644 --- a/tests/language_2/vm/lazy_async_exception_stack_test.dart +++ b/tests/language_2/vm/lazy_async_exception_stack_test.dart
@@ -1,8 +1,6 @@ // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file // 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. -// -// VMOptions=--lazy-async-stacks // @dart = 2.9 @@ -38,8 +36,8 @@ } catch (e, st) { expect( h.stringContainsInOrder(st.toString(), [ - 'thrower', '.dart:14', // no auto-format. - 'generator', '.dart:23', // no auto-format. + 'thrower', '.dart:12', // no auto-format. + 'generator', '.dart:21', // no auto-format. '<asynchronous suspension>', // no auto-format. 'foo', '.dart', // no auto-format. 'main', @@ -76,8 +74,8 @@ } catch (e, st) { expect( h.stringContainsInOrder(st.toString(), [ - 'thrower', '.dart:14', // no auto-format. - 'main.<anonymous closure>', '.dart:75', // no auto-format. + 'thrower', '.dart:12', // no auto-format. + 'main.<anonymous closure>', '.dart:73', // no auto-format. ]), isTrue); }
diff --git a/tests/standalone/lazy_async_stack_test.dart b/tests/standalone/lazy_async_stack_test.dart index 652edb3..810f1ac 100644 --- a/tests/standalone/lazy_async_stack_test.dart +++ b/tests/standalone/lazy_async_stack_test.dart
@@ -1,8 +1,6 @@ // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file // 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. -// -// VMOptions=--lazy-async-stacks import "package:expect/expect.dart";
diff --git a/tests/standalone_2/lazy_async_stack_test.dart b/tests/standalone_2/lazy_async_stack_test.dart index 5066215..707d5ee 100644 --- a/tests/standalone_2/lazy_async_stack_test.dart +++ b/tests/standalone_2/lazy_async_stack_test.dart
@@ -1,8 +1,6 @@ // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file // 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. -// -// VMOptions=--lazy-async-stacks // @dart = 2.9
diff --git a/tools/VERSION b/tools/VERSION index 7e37bbe..4ffdc59 100644 --- a/tools/VERSION +++ b/tools/VERSION
@@ -27,5 +27,5 @@ MAJOR 2 MINOR 18 PATCH 0 -PRERELEASE 176 +PRERELEASE 177 PRERELEASE_PATCH 0 \ No newline at end of file