dart-sdk/runtime
Alexander Markov 0bff5652ba Reland "[vm/compiler] Remove unnecessary type check from optimized switches"
This is a reland of commit 43ce5487c1

In addition to removing type check, switch range checks are adjusted
in order to avoid call to 'int.operator<=', which can be removed by
tree shaker in AOT/product mode, causing NoSuchMethodError at runtime.

Original change's description:
> [vm/compiler] Remove unnecessary type check from optimized switches
>
> Switch optimization now relies on static type of the tested value,
> so it is safe to omit the type check (with sound null safety) or
> reduce it to a null check (without sound null safety).
>
> TEST=co19/LanguageFeatures/Patterns/Exhaustiveness/exhaustiveness_enum_A01_t01
> Fixes https://github.com/dart-lang/sdk/issues/52422
>
> Change-Id: Ic93f4f212bee9ed3bfe5035f3c8d7535274c2f63
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/304102
> Commit-Queue: Alexander Markov <alexmarkov@google.com>
> Reviewed-by: Alexander Aprelev <aam@google.com>

TEST=co19/LanguageFeatures/Patterns/Exhaustiveness/exhaustiveness_enum_A01_t01
TEST=language/async/switch_test

Change-Id: I70bf480bf376f946d66caa504120c8f85093ea8d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/304322
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2023-05-18 18:33:37 +00:00
..
bin [vm/ffi] asTypedList MSAN and UBSAN fixes 2023-05-11 14:17:24 +00:00
docs [vm] Remove TypeRef 2023-04-28 19:29:36 +00:00
include [ VM ] Move class name from heap profiler report callback to allocation callback 2023-04-25 13:02:49 +00:00
lib [vm/ffi] Move ffi-callback related state from Thread to ObjectStore, move jit trampolines from Isolate to IsolateGroup 2023-05-17 11:23:28 +00:00
observatory [vm, service] Account for weakness in getRetainingPath and getRetainedSize. 2023-05-10 16:12:28 +00:00
observatory_2 [vm/service] Remove Stack.awaiterFrames 2023-05-09 13:46:56 +00:00
platform [vm/ffi] Move ffi-callback related state from Thread to ObjectStore, move jit trampolines from Isolate to IsolateGroup 2023-05-17 11:23:28 +00:00
tests [vm/compiler] Decide to optimize switch statements using static type of the tested value 2023-05-16 22:36:22 +00:00
third_party
tools [vm/ffi] Pointer.asTypedList finalizer 2023-05-10 11:38:57 +00:00
vm Reland "[vm/compiler] Remove unnecessary type check from optimized switches" 2023-05-18 18:33:37 +00:00
.clang-tidy
.gitignore
BUILD.gn [VM/Timeline] Lock accesses to the async track metadata map where needed 2023-05-01 14:52:30 +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
OWNERS
PRESUBMIT.py Reland "Reland "[VM] Begin supporting Perfetto file recorder"" 2023-04-18 19:39:05 +00:00
runtime_args.gni [VM/Timeline] Lock accesses to the async track metadata map where needed 2023-05-01 14:52:30 +00:00