DescriptionVM: Constant fold more loads from constants in the optimizer.
We have limited support for folding away length loads from constant
arrays and strings. However we were not folding away loads in code
like:
enum E { V }
isV(flags) => (flags & (1 << E.V.index)) != 0;
Here we would emit load index and shift for mask computation
instead of simply emitting 1.
This change fixes the oversight by enabling folding away loads
of final fields from constants.
This relands the original commit 746ab58f4623372e1efcfd04644927f16dd0fab7
with a fix for precompiler crashes: ArgumentError.value constructor is
added to the precompiler roots.
TBR=erikcorry@google.com
Committed: https://github.com/dart-lang/sdk/commit/20a0e75ef8f91a282ea453f9ad471e509d5f4ad4
Patch Set 1 #
Messages
Total messages: 4 (1 generated)
|