dart-sdk/runtime
Tess Strickland d7e6e0e8c3 [vm/compiler] Fix dart fuzzer CalculateElementAddress crash on X64C.
In the backend, handle the following cases that were assumed not to
happen before:
* If the index and offset are both 0, then the operation is a no-op
  and so the output register should be the same as the first input.
  (Should only happen if the instruction is used in a non-optimizing
  context, as otherwise it is removed by canonicalization.)
* If the scaled index can be used as an instruction immediate and the
  offset is 0, then emit the appropriate instruction(s).
* If the scaled index and offset can both be used as immediates to
  instructions, but their sum (the total offset in bytes) cannot, then
  allocate a register for the index and fall back to the non-constant
  index case.

CalculateElementAddress::Canonicalize now only performs removal of
no-op instructions.

This CL also fixes a switch on the instruction tag in
FlowGraph::RenameRecursive to appropriately convert UnboxedConstant
instructions to initial definitions of the FlowGraph as it already does
for Constant instructions.

TEST=vm/dart/regress_55877

Issue: https://github.com/dart-lang/sdk/issues/55877
Cq-Include-Trybots: luci.dart.try:vm-aot-linux-debug-simarm_x64-try,vm-aot-linux-debug-simriscv64-try,vm-aot-linux-debug-x64-try,vm-aot-linux-debug-x64c-try,vm-linux-debug-ia32-try,vm-linux-debug-x64-try,vm-linux-debug-x64c-try,vm-linux-debug-simriscv64-try,vm-mac-debug-arm64-try,vm-aot-mac-release-arm64-try
Change-Id: I613d6c8770fe02facf6bbdb3d2b11f842b51540d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369642
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2024-06-06 09:14:18 +00:00
..
bin [vm, io] Remove dead Windows 7 code. 2024-06-05 23:08:15 +00:00
docs [vm, gc] Incremental compaction, take 3. 2024-05-30 21:01:39 +00:00
include [vm/sendports] Introduce an api that can be safely used to rebuild SendPort. 2024-05-01 17:19:16 +00:00
lib [vm] Unsound mode cleanup: remove legacy types from the VM 2024-04-30 17:49:37 +00:00
observatory observatory: replace unsupported [this] comment references with this. 2024-05-16 19:24:38 +00:00
platform [vm, gc] Incremental compaction, take 3. 2024-05-30 21:01:39 +00:00
tests [vm/compiler] Fix dart fuzzer CalculateElementAddress crash on X64C. 2024-06-06 09:14:18 +00:00
tools [dartfuzz] Set dart:io's exitCode, not the shadowing local. 2024-05-06 21:22:28 +00:00
vm [vm/compiler] Fix dart fuzzer CalculateElementAddress crash on X64C. 2024-06-06 09:14:18 +00:00
.clang-tidy
.gitignore
BUILD.gn [vm, compiler] Allow targeting TSAN or MSAN by passing a flag to gen_snapshot. 2024-05-08 17:03:59 +00:00
codereview.settings
configs.gni
CPPLINT.cfg
OWNERS
PRESUBMIT.py
runtime_args.gni Reland "[Fuchsia] Remove the legacy gn build rules for fuchsia" 2024-03-14 20:22:12 +00:00
vm-jit.shard.cml
vm.shard.cml [fuchsia][sysmem2] route fuchsia.sysmem2.Allocator 2024-05-10 17:00:29 +00:00