Descriptiondart2js cps: Do not propagate impure expressions across null receiver.
If the receiver is null, the arguments are not evaluated.
Example:
Dart:
var x = null;
var y = bar();
x.foo(y);
JS before:
null.foo$1(bar());
JS after:
var y = bar();
null.foo$1(y);
If the receiver is known not be null, we still propagate into the
arguments, and "pure" expressions can always propagate even if the
receiver might be null.
InvokeMethod now has a field isReceiverNotNull, which carries a bit of
static type information. Another field like this is InvokeStatic.isPure.
I intentionally chose to pass along the *least* amount of information
that is sufficient for what we need in the tree optimizations.
That CPS type propagation was not very good at proving when things are
not null, so a couple of things missing from it have been filled in.
BUG=
R=kmillikin@google.com
Committed: https://github.com/dart-lang/sdk/commit/c442bf56976854100a98d4ce59aac65c718bfb7c
Patch Set 1 #Patch Set 2 : Rebase #Patch Set 3 : Beefed up type propagation #Patch Set 4 : Extra fix in type propagation #
Total comments: 1
Messages
Total messages: 8 (2 generated)
|