Chromium Code Reviews
DescriptionAbandon type inference on closures that (potentially) flow into Function.apply.
Type inference uses the closure tracer to decide whether it has sufficient global
information to compute an actual type on a closure. If tracing fails, it will
abandon type inference for that closure. However, we no longer fail tracing just
because a closure flows into Function.apply, as this still means that we have
seen all use sites. Unfortunately, type inference does not understand that
Function.apply is actually a call site (and we lack other information to make
this knowledge worthwhile). So it concludes that the closure is never called.
With this fix, it now correctly abandons inference again.
The second issue was that we only take default values into account when looking
at a call site (so that we only use them if they are actually used). This can be
decided statically unless we loose track or there is a call to Function.apply.
I have added an extra edge to the use-graph so that there now always is a use
edge from a default to the parameter. While this is conservative, it will only
affect tracing and thus only the types of traced entities that are used as
default should be impacted.
BUG= http://dartbug.com/24297
R=sigmund@google.com, sra@google.com
Committed: https://github.com/dart-lang/sdk/commit/75b48722bc041e41f9a703531e5ce6913a1667c0
Patch Set 1 #
Messages
Total messages: 5 (1 generated)
|
||||||||||||||||||||||||||||||||||||||||||||||