[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 https://github.com/dart-lang/sdk/issues/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 <alexmarkov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
This commit is contained in:
Vyacheslav Egorov
2025-05-20 11:12:02 -07:00
committed by Commit Queue
parent 981924f436
commit 9ff77fd414
3 changed files with 3 additions and 2 deletions
@@ -13,7 +13,7 @@ namespace dart {
// debug mode to get the correct fingerprint from the mismatch error.
#define OTHER_RECOGNIZED_LIST(V) \
V(AsyncLibrary, _FutureListener, handleValue, FutureListenerHandleValue, \
0xaa83f1d2) \
0xaa83f593) \
V(AsyncLibrary, _SuspendState, get:_functionData, \
SuspendState_getFunctionData, 0x79c36e2e) \
V(AsyncLibrary, _SuspendState, set:_functionData, \
+1 -1
View File
@@ -420,7 +420,7 @@ bool AsyncAwareStackUnwinder::HandleSynchronousFrame() {
object_ = GetReceiver();
InitializeAwaiterFrameFromFutureListener(object_);
UnwindToAwaiter();
return true; // Hide this frame from the stack trace.
return false; // Do not hide this from the stack trace.
}
return false;
+1
View File
@@ -217,6 +217,7 @@ class _FutureListener<S, T> {
@pragma("vm:recognized", "other")
@pragma("vm:never-inline")
@pragma("vm:invisible")
FutureOr<T> handleValue(S sourceResult) {
return _zone.runUnary<FutureOr<T>, S>(_onValue, sourceResult);
}