Commit Graph

4835 Commits

Author SHA1 Message Date
Johnni Winther 4f1d6a33fc Remove --analyze-* flags
Change-Id: I72f7834ba754bd5affec1a72d1d7be203031aa42
Reviewed-on: https://dart-review.googlesource.com/64041
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-07-10 08:40:59 +00:00
Johnni Winther 1c673b1046 Include bounds in type literals
Change-Id: Ieb3e5b09e88c98f8943a6e7ca9031c8a6ab776e1
Reviewed-on: https://dart-review.googlesource.com/63820
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-07-09 12:24:04 +00:00
Johnni Winther 1717371c99 Move InferredData to GlobalTypeInferenceResults
- and make a pure GlobalTypeInferenceResults interface to prepare for (de)serialization.

Change-Id: I3c2f5f43d686c0d247c611185730134394d86844
Reviewed-on: https://dart-review.googlesource.com/63946
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2018-07-06 22:02:57 +00:00
Johnni Winther 5dbf6da529 Remove generics where only ir.Node is used
Change-Id: I500b237a871ee21aca1a800806cdc95828713b5c
Reviewed-on: https://dart-review.googlesource.com/63944
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-07-06 22:02:57 +00:00
Johnni Winther da9705b356 Split compileLoadedLibraries
- into computeClosedWorld, performGlobalTypeInference and generateJavaScriptCode
+ pass closed world and inference results directly
+ this prepares for (de)serialization after global inference

Change-Id: I1180de35eea78a107c9e95fc6e904084b63ba0f2
Reviewed-on: https://dart-review.googlesource.com/63943
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-07-06 22:02:57 +00:00
Johnni Winther 04168fa922 Move more methods to ClassHierarchy.
Change-Id: I6f7f0266a77db1e64a40307a4878bfd9b1ca5f07
Reviewed-on: https://dart-review.googlesource.com/61932
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-07-06 22:02:57 +00:00
Sigmund Cherem a4c47afcae Fix global-inference bug.
We incorrectly tracked is checks that are nested within subexpressions of
conditions that do not affect control-flow.

Fixes https://github.com/dart-lang/sdk/issues/33761

Change-Id: If8a9b64273998aed5c4ea8854ea8d717588d5658
Reviewed-on: https://dart-review.googlesource.com/63981
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2018-07-06 22:01:37 +00:00
Sigmund Cherem 72f3abc239 Fix force-strong flag.
This has a tiny effect in reporting warnings, other than that the flags were
interpreted correctly during compilation.

The force-flag was is used to recognize when the user
explicitly said `--strong` and when it was implicit, so if we see
`--no-preview-dart-2` and we don't see `--strong`, we know we are in legacy mode
and we don't show warnigns about `--checked` and `--trust-type-annotations`.

Change-Id: I532ce4520b49e3aac1ec13898186c74585855d3e
Reviewed-on: https://dart-review.googlesource.com/63980
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2018-07-06 18:42:56 +00:00
Johnni Winther bb69cc15cb Add ClassHierarchy to share code between J/KClosedWorld (second attempt)
+ improve the commonSubclasses implementation to support the
implementation of FlatTypeMask.intersection and RuntimeEquals.equals
computation. FlatTypeMask.intersection is now ~20% faster.

Change-Id: I0b452afd260ab3b0598ed4d67f07a55ea96d2756
Reviewed-on: https://dart-review.googlesource.com/63560
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-07-04 09:00:28 +00:00
Stephen Adams afaca9f7cf Use field for class hierarchy map
Change-Id: Iabcfd69f3ecbd3d87eb4c7dafd9c80a1be01a016
Reviewed-on: https://dart-review.googlesource.com/63540
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2018-07-03 19:17:35 +00:00
Johnni Winther 69db5c104a Check local constants
Closes #33707

Change-Id: I8046b45aac8eeef60dca405a47a573724af8bfe8
Reviewed-on: https://dart-review.googlesource.com/63280
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-06-29 22:30:39 +00:00
Stephen Adams 6e108d709c Include native classes needed for RTI
Closes #33627

Change-Id: I9ed6bf9941df6445209a64c29af8986e382b7c51
Reviewed-on: https://dart-review.googlesource.com/62521
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2018-06-28 23:16:28 +00:00
Sigmund Cherem 64553b68e9 Workaround for bug in nsm-forwarders
This lets dart2js correctly handle nsmForwarders with private names (see
https://github.com/dart-lang/sdk/issues/33665 for details).

Change-Id: Ic34bc8c2dbfd570f35f2f6a4c5a84b3da6ddb1f5
Reviewed-on: https://dart-review.googlesource.com/62711
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2018-06-28 17:03:50 +00:00
Stephen Adams 50fe42a886 Reduce use of putIfAbsent
Change-Id: I2088d80126bd5af09c0091c768c381b13733aa1e
Reviewed-on: https://dart-review.googlesource.com/62021
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-06-27 02:58:38 +00:00
Sigmund Cherem 46710a77dd Make checked flag again only enable assertions in Dart 2.0
This regressed when we swap the default to Dart 2.0 because the strongMode flag
is no longer explicit.

Fixes #33639

Change-Id: If808987efda0d11e15a9b53b81c0979c239749df
Reviewed-on: https://dart-review.googlesource.com/62442
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2018-06-26 23:47:58 +00:00
Stephen Adams e0905b979a Revert "Add ClassHierarchy to share code between J/KClosedWorld"
This reverts commit a8e930caf3.

Compile time regression on some large apps.

TBR=johnniwinther@google.com

Change-Id: Ic1b736a5d50814ed8b8d24a9dc4a2d910e5f70df
Reviewed-on: https://dart-review.googlesource.com/62446
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-06-26 23:40:48 +00:00
Johnni Winther a8e930caf3 Add ClassHierarchy to share code between J/KClosedWorld
+ improve the commonSubclasses implementation to support the
implementation of FlatTypeMask.intersection and RuntimeEquals.equals
computation.

Change-Id: I51c4d229e9dc6d5de101aff33e56bb44bf93bc0d
Reviewed-on: https://dart-review.googlesource.com/61927
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2018-06-26 07:46:24 +00:00
Stephen Adams e661c9ef54 Simplify 'as T' for simple T
Example change:

      return H.subtypeOfRuntimeTypeCast(this.$index(0, "name"), P.String);
--->
      return H.stringTypeCast(this.$index(0, "name"));

Change-Id: I65752a3e9516c5d391cff4e7a0c4b74c877c81af
Reviewed-on: https://dart-review.googlesource.com/60827
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-06-25 23:22:23 +00:00
Stephen Adams 9146cea63a Print times in seconds
Change-Id: I4adcb9847d7a1ce4e91f93e7c484a3fd59310f52
Reviewed-on: https://dart-review.googlesource.com/62001
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-06-23 00:50:15 +00:00
Stephen Adams aeba82ef9a [dart2js] Fix for issue 33572
Change-Id: If33e59880c882885b4368a8be91663298deb207c
Reviewed-on: https://dart-review.googlesource.com/61965
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-06-22 20:50:45 +00:00
Johnni Winther 7c6211b1d8 Make unittests work with Dart 2
Change-Id: Ic2c105747dfba067464fc15e158f58417c8636a8
Reviewed-on: https://dart-review.googlesource.com/61922
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2018-06-22 20:25:05 +00:00
Johnni Winther a8d805055a Handle covariant parameters in function types
Closes #33575

Change-Id: I743a951f5864ca538b588441ecba2680eba2081f
Reviewed-on: https://dart-review.googlesource.com/61924
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-06-22 20:24:55 +00:00
Sigmund Cherem 4c697085be dart2js: Make bazel-input-provider dart2 compliant.
Change-Id: Ia832982852720c3c591621091ba15b81b922d553
Reviewed-on: https://dart-review.googlesource.com/61914
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2018-06-22 18:26:25 +00:00
Jens Johansen 6888bc2824 Compile time error for web int literals that cannot be represented exactly
Bug: #33351
Change-Id: I2b99858dfc276dc70c3a36c289030e801145af86
Reviewed-on: https://dart-review.googlesource.com/61180
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2018-06-22 10:47:54 +00:00
Johnni Winther 075c713a93 Register type arguments on inlining
Closes #33529

Change-Id: I992552a400199490959d10de8c838e56015159e5
Reviewed-on: https://dart-review.googlesource.com/61522
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2018-06-22 08:24:13 +00:00
Stephen Adams 5ccc497678 Inline constructor bodies that are called once
Change-Id: I74b2518fed543a78f1531b54510f4dcbe3a57192
Reviewed-on: https://dart-review.googlesource.com/60324
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-06-20 22:12:02 +00:00
Johnni Winther 1c4b362ba5 Support noSuchMethod forwarders in dart2js
Closes #32750

Change-Id: Ib2f358b14ae5a079e3df8413013ecfc006f0e69b
Reviewed-on: https://dart-review.googlesource.com/60250
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-06-20 10:15:41 +00:00
Stephen Adams 75f485d6d9 [dart2js] Fix for issue 33500
Fix check for whether to lower JSArray.add to Array.push.

Change-Id: I22149bf7d31442b8a4bba6b6431239f5f031e55b
Reviewed-on: https://dart-review.googlesource.com/61104
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-06-20 05:07:32 +00:00
Sigmund Cherem c96f23243b Enable Dart2 in dart2js by default
Change-Id: Id197fc734bcb45f0805e49e89c0d03419384bb0b
Reviewed-on: https://dart-review.googlesource.com/60448
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2018-06-19 19:20:36 +00:00
Johnni Winther 532b9aaa93 Flatten *WorldBuilder hierarchies.
Change-Id: I59bfa08f151f2e238816a4da6163a39e6df2dc9c
Reviewed-on: https://dart-review.googlesource.com/60544
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2018-06-19 08:16:03 +00:00
Johnni Winther b558a9c2f4 Handle missing compile-time errors
Closes #33468

Change-Id: I6da12012103ed465257335ce5bb81ba1fc54c81a
Reviewed-on: https://dart-review.googlesource.com/60500
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2018-06-18 07:34:46 +00:00
Sigmund Cherem bc8d77231d Improve flags documentation, reenable hints in dart2js.
Now that #32111 has been fixed, we can reenable hints in dart2js. Tested on a
large consumer app and there are no unncessary hints at this time.

Change-Id: Idfe39abb319a0a8d54b4439dc74b9315d2cc1b41
Reviewed-on: https://dart-review.googlesource.com/60445
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Emily Fortuna <efortuna@google.com>
2018-06-15 21:01:59 +00:00
Johnni Winther f59389b688 Optimize .runtimeType impact based on usage
Change-Id: If6c24d4115241dcb8ac2ed82eee58c4025e3d8e2
Reviewed-on: https://dart-review.googlesource.com/59090
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-06-15 19:51:14 +00:00
Sigmund Cherem a63cf8e0cb Add --no-preview-dart-2 flag.
Currently it is a noop, it will change once we update the default to 2.0

Change-Id: Id0f0b43d4742dddc25d2c9e4ddb77c55d397caaf
Reviewed-on: https://dart-review.googlesource.com/60440
Reviewed-by: Emily Fortuna <efortuna@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2018-06-15 18:25:10 +00:00
Johnni Winther 37425618d5 Narrow to static types in invoke/get in inference
Change-Id: Ifb085cf881c21a6161a22cb1f2b6058a9947f321
Reviewed-on: https://dart-review.googlesource.com/55920
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-06-13 13:11:10 +00:00
Peter von der Ahé 3d98cce456 Replace Severity.nit by Severity.ignored
Change-Id: Ib249c2e383c25173bd25b965bdb0d67c9a487cb4
Reviewed-on: https://dart-review.googlesource.com/59085
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2018-06-13 08:12:34 +00:00
Emily Fortuna 8e472acd37 No arguments to process with signature functions.
Change-Id: I741b6c1e698385b40cad15682658254edea9a58b
Reviewed-on: https://dart-review.googlesource.com/60022
Commit-Queue: Emily Fortuna <efortuna@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2018-06-12 22:06:23 +00:00
Stephen Adams 14dfd82d69 [dart2js] Chain null-field initializers
Change-Id: I1fff4143ee5698dd1c8c1c833fcb99828d1f8223
Reviewed-on: https://dart-review.googlesource.com/59860
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-06-12 17:51:40 +00:00
Lasse R.H. Nielsen 0b91676362 Remove the retype method.
See #33075.

Bug: http://dartbug.com/33075
Change-Id: I1ee2f587afbc672dd08ac61ac003bbdc85bb95e2
Reviewed-on: https://dart-review.googlesource.com/59091
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2018-06-12 14:36:09 +00:00
Johnni Winther e7ad806bf1 Provide default type variable bounds on inlining.
+ use the 'any' type to avoid failing on bounds with type variables, which we currently don't support.

Change-Id: I57d74d17fa9eee598bd86c8e76790778438cddfd
Reviewed-on: https://dart-review.googlesource.com/59540
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2018-06-12 09:05:09 +00:00
Johnni Winther 7321f938d5 Use default type for type variable bounds.
Change-Id: I5d21a16a76eb6cd898e8e11104d0be0f7e669426
Reviewed-on: https://dart-review.googlesource.com/59420
Reviewed-by: Stephen Adams <sra@google.com>
2018-06-12 09:05:09 +00:00
Johnni Winther 52d7a3043a Track RTI dependency through instantiations
Closes #33093

Change-Id: Ia7d9cd1235cd4fe60858f37533689f5eeb600540
Reviewed-on: https://dart-review.googlesource.com/59400
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2018-06-12 08:00:09 +00:00
Stephen Adams 1fb845c2f4 [dart2js] Apply stub should default type parameters
Change-Id: Ie01ade9b6e561a96a3ac06bf13617bb679122c63
Reviewed-on: https://dart-review.googlesource.com/59020
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2018-06-12 01:10:39 +00:00
Stephen Adams 4596881c9e [dart2js] Remove more entry checks
Remove checks on generator bodies, constructor bodies and constructor
factories, as these are all called from statically resolved contexts.

Add a TargetChecks type to convey which checks are required.

Change-Id: Ib354956d039078a5d1428de4706b7427401b08d9
Reviewed-on: https://dart-review.googlesource.com/58681
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-06-07 19:43:30 +00:00
Johnni Winther c39c2c8ac1 Handle type variables in optional function typed parameter in jsinterop methods
Closes ##33162

Change-Id: If31e7c793cc9312e584817cf4c373b8f10ff3bc1
Reviewed-on: https://dart-review.googlesource.com/58460
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2018-06-06 11:06:10 +00:00
Johnni Winther d17ec7c131 Move inference data from JClosedWorld to GlobalTypeInferenceResults.
Change-Id: I19fdd6771c78c022fd5ca9a3f63c01064bc34d07
Reviewed-on: https://dart-review.googlesource.com/58220
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2018-06-06 07:49:08 +00:00
Emily Fortuna 134e00fd73 Treat 64 bit ints as unsigned until conversion to JS.
Change-Id: Idb9c5d4a3562f59bc75a5bb7eef4b7af8f5df992
Reviewed-on: https://dart-review.googlesource.com/57714
Commit-Queue: Emily Fortuna <efortuna@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2018-06-06 00:28:28 +00:00
Emily Fortuna b667be4861 Fix source maps strong mode runtime failure in dart2js.
Fix for https://github.com/dart-lang/sdk/issues/33332

Change-Id: I16c464b5dec85ccef55ecbe2e75d67dbf3481927
Reviewed-on: https://dart-review.googlesource.com/58480
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Emily Fortuna <efortuna@google.com>
2018-06-05 18:04:37 +00:00
Emily Fortuna c499e0021a Remove unnecessary class type parameters now that we only have ir.Node.
Fixes https://github.com/dart-lang/sdk/issues/33328
a Dart 2 strong mode runtime error.

Change-Id: I10d52a6360f932cf4ab4592dfd1fb01c263fffb4
Reviewed-on: https://dart-review.googlesource.com/58423
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Emily Fortuna <efortuna@google.com>
2018-06-05 01:23:09 +00:00
Stephen Adams 38467cca03 Track always-initialized-to-null fields
Change-Id: Idb4d3a0395ce73eaaa4fc15a8df3bceaa4821b4f
Reviewed-on: https://dart-review.googlesource.com/57525
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2018-06-04 21:05:01 +00:00