dart-sdk/runtime
Alexander Markov 30abce99f3 [vm] Treat static final fields with trivial initializers as const
When loading a value of a static final field with trivial initializer
generate a Constant instruction instead of LoadStaticField.

Initializer of a static field is considered trivial if it is null, int,
double, String or bool literal.

TEST=vm/cc/StreamingFlowGraphBuilder_StaticGetFinalFieldWithTrivialInitializer
Fixes https://github.com/dart-lang/sdk/issues/47120

Change-Id: Id2bfc3da8c14376f7f1ef829265cca29a018bad1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212873
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2021-09-13 16:51:59 +00:00
..
bin [vm] Adds args_n to FFI resolver. 2021-09-13 07:57:00 +00:00
docs [vm] Migrate away from native 'name' syntax. 2021-09-08 13:39:34 +00:00
include [vm] Adds args_n to FFI resolver. 2021-09-13 07:57:00 +00:00
lib [vm] Adds args_n to FFI resolver. 2021-09-13 07:57:00 +00:00
observatory [VM] [CFE]: Expression compilation inside extension method 2021-09-10 12:02:57 +00:00
observatory_2 [VM] [CFE]: Expression compilation inside extension method 2021-09-10 12:02:57 +00:00
platform [vm] Remove support for dart-ext: imports 2021-09-02 14:14:35 +00:00
tests [gardening] Give vm/dart{,_2}/use_strip_flag_test more time in TSAN mode 2021-09-10 13:34:29 +00:00
third_party [tools] Update all iteritems -> items 2021-05-20 11:36:52 +00:00
tools [dartfuzz] Avoid more compile-time errors. 2021-08-31 23:11:26 +00:00
vm [vm] Treat static final fields with trivial initializers as const 2021-09-13 16:51:59 +00:00
.clang-tidy
.gitignore
BUILD.gn Allow deprecated copy on fuchsia 2021-08-11 01:14:22 +00:00
codereview.settings
configs.gni Reland "[vm] Build dart2native dependencies with the normal "create_sdk" target" 2020-06-17 16:12:26 +00:00
CPPLINT.cfg
PRESUBMIT.py [python3] Migrate PRESUBMIT.py files 2021-08-16 08:29:54 +00:00
runtime_args.gni [wasm] Remove deprecated dart_enable_wasm flag. 2021-04-01 22:45:07 +00:00