dart-sdk/runtime
Martin Kustermann 07549ac9ab [vm] When marking an instruction as deopt to before an instruction, ensure prune-count=0
The [Environment] represents 2 different things:

  * before (env, deopt-id): The state of unoptimized frame right before
    the IL instruction is executed

  * after (env, deopt-id): The state of unoptimized frame right after
    the call machine instruction instruction (i.e. which may not be
    after the IL instruction - as it may still have to drop arguments)

The environment's prune-count specifies the number of entries from the
[Environment] to be removed to get from before-env to after-env.

This prune-count includes generally most of `<IR>::InputCount()` - as
most IR instructions consume their inputs (which location summary may
e.g. require in registers) before doing any call. Though it doesn't include
arguments as we currently have a stack-based calling convention and both
optimized and unoptimized code will explicitly drop them after the machine
call instruction.

Our optimizing compiler may emit speculative instructions. Those will
receive an environment that makes before (env, deopt-id) and after (env,
deopt-id) the same - as both eager and lazy deopt will target a
before (env, deopt-id).

=> We should ensure that the prune-count is set to 0, ensuring we won't
prune anything in case an IL instruction was marked with
`MarkAsLazyDeoptToBeforeDeoptId`.

=> This is a preparation for inlining force-optimized functions: If we
inline them and some callee IL instruction performs lazy deopt it should
re-try the call without any pruned inputs.

TEST=ci

Change-Id: I091c9fa962b376200dc5cfb6ea8c9a47ef43810f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/319440
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2023-08-09 11:31:47 +00:00
..
bin [vm] Separate for-snapshot vs embed-sources bools when compiling to kernel 2023-07-28 10:01:53 +00:00
docs [vm] Update lingering references to RawObject. 2023-07-26 21:53:49 +00:00
include [vm] Separate for-snapshot vs embed-sources bools when compiling to kernel 2023-07-28 10:01:53 +00:00
lib [vm] Disentagle PortMap/MessageHandler from port status tracking 2023-08-08 10:57:47 +00:00
observatory [vm] Fix expression evaluation in context of closures 2023-08-04 11:07:46 +00:00
observatory_2 [vm, service] Fix discrepancy between VM generating kind _TypeParameters and service.md claiming the existence of kind TypeParameters. 2023-08-01 20:34:21 +00:00
platform [vm] Allow non-TSAN gen_snapshot target TSAN AOT runtime 2023-07-10 11:53:58 +00:00
tests [gardening] Skip slow vm/dart/awaiter_stacks/sync_async_start_pkg_test_test on hot reload bots 2023-08-08 15:40:49 +00:00
third_party Spelling pkg analyzer lib 2023-01-25 14:08:27 +00:00
tools [vm] Enable clang-tidy for arm, arm64, riscv64, product, release, precompiler. 2023-07-11 15:13:58 +00:00
vm [vm] When marking an instruction as deopt to before an instruction, ensure prune-count=0 2023-08-09 11:31:47 +00:00
.clang-tidy
.gitignore
BUILD.gn Add a GN flag for the non-debug optimization level 2023-07-15 14:14:59 +00:00
codereview.settings
configs.gni [Runtime] Add extra_product_deps and extra_nonproduct_deps params to "library_for_all_configs_with_compiler" template 2023-04-14 19:51:40 +00:00
CPPLINT.cfg [cpplint] Disable runtime/references lint 2023-01-23 18:21:48 +00:00
OWNERS [infra] Add OWNERS to the Dart SDK 2022-02-14 14:06:34 +00:00
PRESUBMIT.py Reland "Reland "[VM] Begin supporting Perfetto file recorder"" 2023-04-18 19:39:05 +00:00
runtime_args.gni Add a GN flag for the non-debug optimization level 2023-07-15 14:14:59 +00:00