This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Commit 30abce9
[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 dart-lang/sdk#47120
Change-Id: Id2bfc3da8c14376f7f1ef829265cca29a018bad1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212873
Reviewed-by: Slava Egorov <[email protected]>
Commit-Queue: Alexander Markov <[email protected]>1 parent 1d6f4c7 commit 30abce9
File tree
5 files changed
+53
-3
lines changed- runtime/vm
- compiler
- backend
- frontend
5 files changed
+53
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
552 | 552 | | |
553 | 553 | | |
554 | 554 | | |
555 | | - | |
| 555 | + | |
556 | 556 | | |
557 | 557 | | |
558 | 558 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2776 | 2776 | | |
2777 | 2777 | | |
2778 | 2778 | | |
| 2779 | + | |
| 2780 | + | |
| 2781 | + | |
| 2782 | + | |
2779 | 2783 | | |
2780 | 2784 | | |
2781 | 2785 | | |
| |||
Lines changed: 40 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
340 | 340 | | |
341 | 341 | | |
342 | 342 | | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
343 | 383 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
881 | 881 | | |
882 | 882 | | |
883 | 883 | | |
884 | | - | |
| 884 | + | |
| 885 | + | |
885 | 886 | | |
886 | 887 | | |
887 | 888 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11172 | 11172 | | |
11173 | 11173 | | |
11174 | 11174 | | |
11175 | | - | |
| 11175 | + | |
| 11176 | + | |
11176 | 11177 | | |
11177 | 11178 | | |
11178 | 11179 | | |
| |||
11183 | 11184 | | |
11184 | 11185 | | |
11185 | 11186 | | |
| 11187 | + | |
| 11188 | + | |
| 11189 | + | |
11186 | 11190 | | |
| 11191 | + | |
11187 | 11192 | | |
11188 | 11193 | | |
11189 | 11194 | | |
| |||
0 commit comments