Skip to content

Commit 9ff77fd

Browse files
mralephCommit Queue
authored andcommitted
[vm] Mark _FutureListener.handleValue invisible
Instead of hiding it by skipping it in AsyncAwareStackUnwinder. Skipping it manually meant that we don't expand and see functions which are inlined into handleValue in the stacktrace which might be undesirable and makes stacktraces unnecessarily sensitive to inlining. Filtering based on visibility happens after inlined frame expansion which makes stack trace more stable. Fixes #60684 TEST=vm/dart/awaiter_stacks/* CoreLibraryReviewExempt: pragma only change Cq-Include-Trybots: luci.dart.try:vm-aot-linux-release-x64-try,vm-aot-linux-product-x64-try Change-Id: Ie6e0ad65285dd1d6f77e27e7488e8d46d30c176c Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/429660 Reviewed-by: Alexander Markov <[email protected]> Commit-Queue: Slava Egorov <[email protected]>
1 parent 981924f commit 9ff77fd

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

runtime/vm/compiler/recognized_methods_list.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace dart {
1313
// debug mode to get the correct fingerprint from the mismatch error.
1414
#define OTHER_RECOGNIZED_LIST(V) \
1515
V(AsyncLibrary, _FutureListener, handleValue, FutureListenerHandleValue, \
16-
0xaa83f1d2) \
16+
0xaa83f593) \
1717
V(AsyncLibrary, _SuspendState, get:_functionData, \
1818
SuspendState_getFunctionData, 0x79c36e2e) \
1919
V(AsyncLibrary, _SuspendState, set:_functionData, \

runtime/vm/stack_trace.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ bool AsyncAwareStackUnwinder::HandleSynchronousFrame() {
420420
object_ = GetReceiver();
421421
InitializeAwaiterFrameFromFutureListener(object_);
422422
UnwindToAwaiter();
423-
return true; // Hide this frame from the stack trace.
423+
return false; // Do not hide this from the stack trace.
424424
}
425425

426426
return false;

sdk/lib/async/future_impl.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ class _FutureListener<S, T> {
217217

218218
@pragma("vm:recognized", "other")
219219
@pragma("vm:never-inline")
220+
@pragma("vm:invisible")
220221
FutureOr<T> handleValue(S sourceResult) {
221222
return _zone.runUnary<FutureOr<T>, S>(_onValue, sourceResult);
222223
}

0 commit comments

Comments
 (0)