[vm] Make stack trace generation code more conservative
[vm] Make stack trace generation code more conservative

If the _FutureListener.handleValue function gets deoptimized at a point
when the `this` is no longer needed/live the deoptimization procedure
may override the `this` slot in the caller frame with "<optimized out>".

This has been triggered on the "iso-stress" builder due to using VM
testing flags that cause many deoptimizations in many places.

The stack walking code should take this possibility into consideration
and be therefore conservative.

Alternatives considered:

  * Use "copy parameters" into our own frame approach - like we do
    with methods that  have optional parameters
    => This will make all unoptimized code slower.

  * Add a reachability fence to the _FutureListener.handleValue function
    => The reachabilityFench is only available in dart:_internal for VM
    => If the function could be debugged after fence but before return
       one might be able to trigger the issue nonetheless.

Closes https://github.com/dart-lang/sdk/issues/46823

TEST=Should remove flaky crashes on "iso-stress" builder.

Change-Id: I9d953706b292e02d2ba75fd794c872865faf45d0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/227401
Reviewed-by: Alexander Markov <239e774fd29abc1267878f57afe1a8a03e0ca887@google.com>
Reviewed-by: Slava Egorov <72c81f38df725d8f1832acb9b5bb99563fc2f1b9@google.com>
Commit-Queue: Martin Kustermann <a35dd5b79fac84b2bb3b026a16b8becc55af5961@google.com>

dart-lang/sdk,dart-lang/sdk,dart-lang/sdk,dart-lang/sdk,dart-lang/sdk,dart-lang/sdk,dart-lang/sdk,dart-lang/sdk