Commit Graph

309 Commits

Author SHA1 Message Date
Aske Simon Christensen 2183869465 Treat invocations on dynamic as unknown, except for return type of ==
Closes https://github.com/dart-lang/sdk/issues/32173

Change-Id: I77bd06f292a701f1b51d4077f31439598a7b4683
Reviewed-on: https://dart-review.googlesource.com/41762
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2018-02-20 16:42:25 +00:00
Alexander Markov 396ba9b2d2 [vm/kernel/aot] Correctly handle FutureOr in type flow analysis
This CL adds special case for FutureOr<T> type (which is a union
of Future<T> and T) into type flow analysis.
As type flow analysis doesn't retain information about generic type
arguments yet, FutureOr<T> is treated as AnyType for now.

Issue: https://github.com/dart-lang/sdk/issues/30480
Change-Id: Ieb4d862b5a993fe46c9662d9bcb0e1f06058a166
Reviewed-on: https://dart-review.googlesource.com/40463
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-02-13 19:24:44 +00:00
Alexander Markov 6ed2ebf6b0 [vm/kernel/aot] Infer parameter types in type flow analysis
Issue: https://github.com/dart-lang/sdk/issues/30480
Change-Id: Iea1480ce2f20b6cb08b4eb57eef5ca14a002e6e0
Reviewed-on: https://dart-review.googlesource.com/40400
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-02-13 01:11:18 +00:00
Alexander Markov 30a12f927b [vm/kernel/tfa] Fix invalidation of invocations during processing
This CL fixes the case when an invocation is invalidated in the
middle of processing. In such case, its result should not be retained
and it should be re-processed again.

Also:

* _WorkList.pending Set is replaced with LinkedList (reduces analysis time).

* ClassHierarchy is configured to ignore ambiguous supertypes.

* _AssertionError._throwNew entry point is added (as it is implicitly
  inserted by flow graph builder).

Change-Id: Ie2d5d29352a5463fbe602910f9ae7f6f77a917d7
Reviewed-on: https://dart-review.googlesource.com/37126
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2018-01-30 17:32:19 +00:00
Alexander Markov be767fc855 [vm/kernel] Support noSuchMethod in type flow analysis
Issue: https://github.com/dart-lang/sdk/issues/30480
Change-Id: I65bc3af0745107a401d473f267789de4b27bf191
Reviewed-on: https://dart-review.googlesource.com/36361
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2018-01-29 17:47:03 +00:00
Alexander Markov f9503cda50 [vm/kernel] Improvements and fixes in type flow analysis
* Invocation handlers and InvocationAnalyzer are revised to reduce
  complexity of the code, improve precision and efficiency of analysis.

* Invocation now has 2 subclasses: DirectInvocation and
  DispatchableInvocation; processing of invocations is moved to these
  subclasses and simplified.
  DirectInvocation is responsible for processing particular
  methods and fields, while DispatchableInvocation processes polymorphic
  calls by collecting targets and accurate receiver types for each target,
  and delegating to DirectInvocations for processing of each target.

* Dynamic tear-offs and dynamic calls via getter/field are
  supported.

* Invalidation of field initializers is implemented.

* Implicit 'return null' at the end of a function is correctly
  detected.

Issue: https://github.com/dart-lang/sdk/issues/30480
Change-Id: I3d2ea69fbc95e3eb9aee244ee909016dfcf79bee
Reviewed-on: https://dart-review.googlesource.com/34507
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-01-19 17:39:35 +00:00
Jens Johansen 6fe7b74e47 [kernel] Mark synthetic constructors as such
Fixes #31143

Change-Id: I2c844e48c955234de1b03de08c12729f72db4f3a
Reviewed-on: https://dart-review.googlesource.com/35921
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2018-01-19 12:29:56 +00:00
Jens Johansen c1160d8cfa [kernel] Change ast to text output to use synthetic instead of default
Change-Id: Ied8777df13aa0411daf89f3ad3ec6bdda7bb4898
Reviewed-on: https://dart-review.googlesource.com/35862
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2018-01-19 09:58:46 +00:00
Alexander Markov bcdb32bc1a [vm/kernel] Unit tests for type flow analysis
Issue: https://github.com/dart-lang/sdk/issues/30480
Change-Id: If6cf8c7dfb59703b00f5432ce803f81e1bf90232
Reviewed-on: https://dart-review.googlesource.com/34301
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-01-19 00:55:34 +00:00