Commit Graph

3687 Commits

Author SHA1 Message Date
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
Johnni Winther 82755aa303 Rename ClosedWorld to JClosedWorld and merge it with ClosedWorldRefiner
Change-Id: I858695194fe4b0dffb7c85a93e2d6bcc04dd6229
Reviewed-on: https://dart-review.googlesource.com/58022
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-06-04 09:22:41 +00:00
Johnni Winther b58cc36ddc Extract KClosedWorld from ClosedWorld.
Change-Id: I2db59cea5081fde2f0b35c6518d6b618df617ac1
Reviewed-on: https://dart-review.googlesource.com/57827
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-06-04 09:22:41 +00:00
Stephen Adams 41e1d2cc28 [dart2js] Fix --csp
TBR=efortuna@google.com

Change-Id: I5738b1432b82df9f3f391f015d845c9d664901e6
Reviewed-on: https://dart-review.googlesource.com/58140
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-06-02 03:05:05 +00:00
Johnni Winther f3502f9051 Fix bug in RTI optimization
Change-Id: Iec3026f0a79ac54dd125e15f00e4beb21e9a371c
Reviewed-on: https://dart-review.googlesource.com/58020
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-06-01 22:20:59 +00:00
Johnni Winther e1549df93f Fix regression introduced in 'Use AbstractValue in most of ssa'
Change-Id: Ie6159eb750ece1748ba1bb0b3c4f4d13a0dff9d6
Reviewed-on: https://dart-review.googlesource.com/58021
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-06-01 21:18:03 +00:00
Sigmund Cherem b930ae19b1 Fix regression in deferred loading (part2)
Change-Id: If38e0c40c8997af65da470285cdbd8e45a20af7d
Reviewed-on: https://dart-review.googlesource.com/57705
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2018-05-31 21:42:07 +00:00
Emily Fortuna c911a1bef6 Clean up additional dart2js strong mode runtime error and don't add method type variable in dart 1 version.
Change-Id: I8f8a62fe2b4fcc00c05fbab22ed9e7a55eb95ccf
Reviewed-on: https://dart-review.googlesource.com/57523
Commit-Queue: Emily Fortuna <efortuna@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2018-05-31 18:52:06 +00:00
Johnni Winther b75da964ef Move all type mask code to inferrer/typemasks and use it via an AbstractValueStrategy
Change-Id: Ib6f0089b0fee05488fea9295cbb5df944bb29d49
Reviewed-on: https://dart-review.googlesource.com/56980
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-31 16:15:32 +00:00
Johnni Winther 39b0efd613 Handle generic jsinterop classes as type arguments.
Change-Id: I89d8a77d632cf6d4f8adffa84f042a1c03a79f26
Reviewed-on: https://dart-review.googlesource.com/56665
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2018-05-31 07:50:52 +00:00
Johnni Winther c6129f768e Use AbstractValue in the rest of type inference
Change-Id: Ic782af55e7b9ab9942eab9809f180e3979d2b326
Reviewed-on: https://dart-review.googlesource.com/56920
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2018-05-31 07:26:52 +00:00
Johnni Winther 947760f9b2 Use AbstractValue in much of inference
Change-Id: I38cd4631c099ec6bd16c675804ccc453a6401889
Reviewed-on: https://dart-review.googlesource.com/56670
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-31 07:26:52 +00:00
Johnni Winther 3dd70ce67b Usa AbstractValue in the rest of ssa
Change-Id: Id29d7bdaaeaa0fb6dfd4f5fbba50468cd474cd8e
Reviewed-on: https://dart-review.googlesource.com/56664
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-31 07:26:52 +00:00
Johnni Winther bbef9aee7c Use AbstractValue in most of ssa
Change-Id: I157081f817e033181d7c314f7567517e5ce85058
Reviewed-on: https://dart-review.googlesource.com/56522
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-31 07:26:52 +00:00
Johnni Winther aecf8e8dc4 Use AbstractValue in KernelToTypeInferenceMap and KernelTypeGraphBuilder
Change-Id: I0af69d10223364256852248228cdbbcbca3f83fa
Reviewed-on: https://dart-review.googlesource.com/56484
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-31 07:26:52 +00:00
Sigmund Cherem fa9ff9a061 Fix regression in deferred loading.
Ensure closures are not moved out of the main output unit accidentally.

This was seen in a large app, I haven't yet come up with a small repro for our
unit tests.

Change-Id: Ie1d4b3b5396eeeb41528e355c7f0d4abdfca7154
Reviewed-on: https://dart-review.googlesource.com/57521
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2018-05-31 00:12:41 +00:00
Emily Fortuna 2911f1f107 More dart2js strong mode cleanup.
Change-Id: Id54951ebac50e465a31914c78d1ce859e8599229
Reviewed-on: https://dart-review.googlesource.com/57484
Commit-Queue: Emily Fortuna <efortuna@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-30 22:26:01 +00:00
Emily Fortuna 0e3ca9a668 Fix strong mode runtime error in dart2js.
Change-Id: Ib736576a094388f88183c981f9d04733142c8860
Reviewed-on: https://dart-review.googlesource.com/57480
Commit-Queue: Emily Fortuna <efortuna@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2018-05-30 20:13:10 +00:00
Johnni Winther 9d9eff44c9 Support sharing function signatures in deferred parts for fast startup
Change-Id: I2ee08817241512269fe04d7fb0e3367df847d37a
Reviewed-on: https://dart-review.googlesource.com/56940
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2018-05-30 13:25:48 +00:00
Emily Fortuna 7b33203f8e Fixes to make hackernews run strong mode clean
Change-Id: I3ca5fcd0a4d8daf3aaca3cc39ba034a608f5f760
Reviewed-on: https://dart-review.googlesource.com/56707
Commit-Queue: Emily Fortuna <efortuna@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2018-05-29 18:58:36 +00:00
Alexander Markov 1ca17b6d03 [vm/kernel] Recognize desugared mixin applications in dart:mirrors
Kernel mixin transformation desugars mixin applications into normal
classes. Mixed-in type is pulled into interfaces list.
However, dart:mirrors needs to know the original mixed-in type of
a mixin application.

This change solves this problem by propagating a 'isTransformedMixinApplication'
attribute of a class through kernel AST, kernel binary and VM objects
into dart:mirrors implementation.

Fixes: https://github.com/dart-lang/sdk/issues/33240
Change-Id: I98ca69294e1ad445402a5ca91d90c30447aabcb2
Reviewed-on: https://dart-review.googlesource.com/56721
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2018-05-29 18:12:26 +00:00
Peter von der Ahé 2514a67614 Import link.dart directly
I'd like to deprecate and remove the Link class,
as best as I can tell, it doesn't offer the same
performance benefits as I've seen on other platforms.

Fasta mostly uses "null" to represent empty lists, and
after the old dart2js front was deleted, there are few
uses remaining.

This CL makes it easier to find the remaining uses.

Change-Id: I73ac9b6b8b1bf5fed9669ae939cb3252cedbef0f
Reviewed-on: https://dart-review.googlesource.com/56781
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2018-05-29 07:40:27 +00:00
Peter von der Ahé 990c85276b Avoid allocation and bottom-type on Link
Change-Id: Ib23e596edf55285cc63e3a391da3712b2bcb1224
Reviewed-on: https://dart-review.googlesource.com/56761
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2018-05-29 07:40:27 +00:00
Johnni Winther 6b7f3d5f54 Share non-generic signatures through init.types
Change-Id: Ie132bbe805780022c91e5578c8dc4636c3c4cc8b
Reviewed-on: https://dart-review.googlesource.com/56671
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2018-05-28 07:40:24 +00:00
Emily Fortuna 785f36853f Last changes to make dart2js strong mode clean when compiling itself!
Change-Id: I43b6869cc5dccb2b2d0f41133402225e0f55e433
Reviewed-on: https://dart-review.googlesource.com/56626
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2018-05-24 22:00:35 +00:00
Emily Fortuna 00a5197542 More changes to make dart2js dart 2 strong mode clean.
Change-Id: I796ac4b71ca9b91ec43ac72a02127ed87872f954
Reviewed-on: https://dart-review.googlesource.com/56460
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2018-05-24 20:50:51 +00:00
Johnni Winther 89514bd8cf Cleanup library_loader.
Change-Id: I0255580cd9292bcd3a5997c7d97d83b25d888372
Reviewed-on: https://dart-review.googlesource.com/55960
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-24 09:52:50 +00:00
Johnni Winther 21b65a9732 Remove unused typedef code
We only use the name of typedef type literals. These are passed through
TypeConstantExpression to TypeConstantValue and used directly as the
nominal identity (!) of the emitted typedef type literal constant value.

Note that the emitted typedef type literal has no relation to its alias.

Change-Id: I1cdc5a88a9b3d75faa0786ecd07226b5075df1c4
Reviewed-on: https://dart-review.googlesource.com/55898
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-24 09:52:50 +00:00
Johnni Winther 18407141b7 Split deferred load entity computation by class, member and local function
Change-Id: Ifb612de6ac945d2ececa96871f0eb3fc5ceb4052
Reviewed-on: https://dart-review.googlesource.com/55896
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-24 09:52:50 +00:00
Johnni Winther 0ec82e24ce Avoid late creation of entities.
This changes has been reviewed as part of https://dart-review.googlesource.com/c/sdk/+/55898

Change-Id: I28d41110919a592499ee7b5b7605728638bd5ea2
Reviewed-on: https://dart-review.googlesource.com/56481
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2018-05-24 08:01:00 +00:00
Johnni Winther 4d7bbb53ab Use AbstractValue in ClosedWorld
Change-Id: Ib091ec1f251f9d75f9dea5cc4879ab16c9af0215
Reviewed-on: https://dart-review.googlesource.com/55961
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2018-05-24 07:43:39 +00:00
Emily Fortuna 552680b7f0 First round of changes to dart2js to make it strong mode clean.
Change-Id: Idc3612072c3cf28a4f58bbb890908f67473d8292
Reviewed-on: https://dart-review.googlesource.com/56284
Commit-Queue: Emily Fortuna <efortuna@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-23 21:26:04 +00:00
Stephen Adams 2c8c05f877 [dart2js] merge generator body into empty entry function
Change-Id: I99a5f16f9a22d3c3cbb4989151a8d3c7bfda16ef
Reviewed-on: https://dart-review.googlesource.com/56037
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-22 21:17:44 +00:00
Stephen Adams e1cabfd1d4 [dart2js] 'Fix' error in registrations
Restore 'overregisration' removed by
https://dart.googlesource.com/sdk/+/929b79e86533b6c409437fbc4a08cf5dfde8be75

Change-Id: I607d2bfbbaa4ea9d320b37aebba06acd1da1af19
Reviewed-on: https://dart-review.googlesource.com/56038
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-05-22 01:56:11 +00:00
Emily Fortuna 49d5ca3bb4 Switch to BigInt for ConstantValue.
Change-Id: I17eec094d794b1c4791d491ea523d284f9eae4ed
Reviewed-on: https://dart-review.googlesource.com/55500
Commit-Queue: Emily Fortuna <efortuna@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2018-05-22 01:04:41 +00:00
Stephen Adams 929b79e865 [dart2js] Don't insert redundant checks
This is in preparation for detecting if a generator header has checks.

By not registering the redundant checks (which should really done in codegen) we remove a few $isXXX flags.

Change-Id: I30deb2bc498858540cd326243798248c51ce9375
Reviewed-on: https://dart-review.googlesource.com/56006
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-21 22:23:18 +00:00
Stephen Adams ff76905aeb [dart2js] Don't try to generate stubs for generator bodies
Change-Id: I8e176d1ccb97d0c12d87427529f41e7db39d8723
Reviewed-on: https://dart-review.googlesource.com/55989
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-05-19 06:52:30 +00:00
Johnni Winther b911f78ee2 Use AbstractValue/AbstractValueDomain in function_set.dart
Change-Id: I8c2e80d7d6722254eec2c8753c2f37a495a9026a
Reviewed-on: https://dart-review.googlesource.com/55899
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2018-05-18 22:12:48 +00:00
Johnni Winther f1f660fe1e Small cleanup
Change-Id: I368fbaa3bac5a5a47c374f26998cce8ad8b265a6
Reviewed-on: https://dart-review.googlesource.com/55890
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-18 19:33:48 +00:00
Johnni Winther 8d0bda43f3 Fix codesize regression from Cleanup after removing MirrorsData
Change-Id: If67905010f46797e0d007cf80973905a8f6e5537
Reviewed-on: https://dart-review.googlesource.com/55889
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2018-05-18 17:05:47 +00:00
Johnni Winther d5719cae62 Small cleanup in compiler.dart
Change-Id: I2b3d3ce5925d6c7078250ab3fdadfc3daef90d73
Reviewed-on: https://dart-review.googlesource.com/55462
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2018-05-17 08:40:03 +00:00
Johnni Winther 54173bf293 Move TypeMask cache to CommonMasks
Change-Id: I908046245f822079dab41421b868a8cc786c9745
Reviewed-on: https://dart-review.googlesource.com/55463
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2018-05-17 08:05:42 +00:00
Johnni Winther 78f348b3d5 Don't export types/masks.dart from types/types.dart
To make uses of TypeMask explicit in the imports.

Change-Id: I7c0c2377b65720394dcda217e5e68a4e3f9a4e9c
Reviewed-on: https://dart-review.googlesource.com/55421
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-17 08:05:42 +00:00
Johnni Winther d2d763411d Use AbstractValue in inference results.
Change-Id: I2a932abd2d8d3236b560721c9d5ec010271d2b85
Reviewed-on: https://dart-review.googlesource.com/55362
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-17 08:05:42 +00:00
Johnni Winther 1c0b52ccc0 Reapply "Cleanup after removing MirrorsData" with fix
Change-Id: I4083b06ed2ea8d9e8bdc9e884803f238adb564fb
Reviewed-on: https://dart-review.googlesource.com/55420
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2018-05-17 08:01:22 +00:00
Stephen Adams 6d55ba3037 [dart2js] Remove checks from inlined static call sites
Change-Id: Ib309684efa6c518dd57bff76491484fe7288e628
Reviewed-on: https://dart-review.googlesource.com/55522
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-17 00:03:24 +00:00
Stephen Adams 6c3a861f8f [dart2js] Check arguments declared with generic method type parameter
Change-Id: Ic479695a2859e30867639d38930bed07b459f50a
Reviewed-on: https://dart-review.googlesource.com/55480
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-16 20:50:24 +00:00
Johnni Winther 9bfdaf9182 Revert "Cleanup after removing MirrorsData"
Apparently a bit to eager :(

Change-Id: Id1e87447f3641c4d9689a4a7aa8cdd8cbd839d89
Reviewed-on: https://dart-review.googlesource.com/55380
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2018-05-16 11:35:13 +00:00
Johnni Winther 54331b1c4b Delete elements.dart and resolution_types.dart
Change-Id: Ib50dabdbeec72ebf443e85b51b818d9ed0602b4f
Reviewed-on: https://dart-review.googlesource.com/55221
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-16 09:54:18 +00:00