Commit Graph

117 Commits

Author SHA1 Message Date
Johnni Winther 77668f4e58 [CFE] Preserve errors in unevaluated and unused arguments and locals
Change-Id: If8c23ac2f374ee863fd8df4c241195c0a115e69d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104980
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-06-21 13:53:17 +00:00
Johnni Winther f889bd7067 Delete JavaScriptBackend
* move names to Identifiers
* move resolution parts to front end strategy
* move codegen parts to backend strategy
* remove now unneeded methods from FrontendStrategy and BackendStrategy

Change-Id: I0675d56045dd212ad195177ecd23b27b0d849a80
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105742
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-06-13 10:09:46 +00:00
Johnni Winther 682ffb6e7a Handle unevaluated constants in annotations
Change-Id: Icbcdac10ea5aabedbeebd7953134d297ab6c1d32
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104561
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-06-05 13:05:00 +00:00
Sam Rawlins b22cd05c51 Reland fix for #28233: add hint for missing returns to function expressions
The bulk of this change is actually correcting missing returns in the Dart SDK.

Bug: https://github.com/dart-lang/sdk/issues/28233
Change-Id: I52bcbc6c6f4a129d3fc22003f4448a7c3d4487ad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100301
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-05-22 18:12:30 +00:00
Johnni Winther c69d0c6e30 Flatten DynamicUse and StaticUse class hierarchies
Change-Id: Ib325425dfab7d7001a1a6133df1d50dddfadcbab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102700
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-05-20 08:57:39 +00:00
Johnni Winther 28faf8c7ca Merge GraphBuilder into KernelSsaGraphBuilder
+ avoid use of `compiler` and `backend`
+ make members of KernelSsaGraphBuilder private when possible

Change-Id: Ia069a8c3b4167c1ae55554baadb857975aeff67f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101287
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-05-06 08:53:24 +00:00
Johnni Winther 1577b95c93 [CFE] Substitute types in unevaluated as-expressions and instantiations
As expressions and instantiations lose the connection to the current type environment when put into an unevaluated constant expression. This leaves type variables unsubstituted when the expressions are lazily evaluated leading to invalid compile-time errors. This is avoided by substituting the type variable when creating the unevaluated constant. If the type variables are not substituted by concrete types, this is flagged as a valid compile-time error during the lazy evaluation.

Change-Id: I46264da4332ea1d5b783531d89a5e6f85b8f90e4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100963
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-05-02 13:14:21 +00:00
Johnni Winther 5af34ea93d [CFE] Handle invalid constant string interpolation in unevaluated constant expressions
Non-primitive constants were incorrectly stringified in an unevaluated
context. These are now, as with unevaluated constants, checked when the
string concatenation is fully evaluated.

Closes #36609

Change-Id: Ia3266ebcb9d497b277690244569812f7cd3e30c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99461
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Auto-Submit: Johnni Winther <johnniwinther@google.com>
2019-04-16 16:05:05 +00:00
Sigmund Cherem 1ca57fc729 Update cfe_constant_evaluation_test and remove old constant-expression tests now that constant-update-2018 is on by default
Fixes https://github.com/dart-lang/sdk/issues/36597

Change-Id: Iaaadbacb71fdaddb5486bf0cf85188a30d088e50
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99280
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2019-04-12 19:46:50 +00:00
Johnni Winther 14fd3b7d6a Report errors on invalid constants in == and !=
Invocation of == and != is only constant on receivers of types bool, int, double, and String or null operands. This is now handled correctly in constant evaluation. The case for method invocation of `a != b` is removed since it is parsed as `!(a == b)`.

Change-Id: I65d8ddf2716f319f61fc0609803a5237f4aba644
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98349
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-04-02 13:54:28 +00:00
Johnni Winther 1a3e8dda3b Handle nested unevaluated constants in constant evaluator
The constant evaluator assumed that any ConstantExpression met during evaluation of a sub expression was not an unevaluated constant. This do occur, for instance when a field is initialized to an unevaluated constant. With the change, unevaluated constants met during evaluation are themselves evaluated.

This change also fixed handling of assert initializers in unevaluated constants.

Change-Id: Id9e676f40bc829c4d234f34a74ef0ca5c4c6ec48
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98348
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-04-01 14:29:32 +00:00
Johnni Winther 05dd851566 Test late CFE constant evaluation.
Tests that dart2js can handle evaluation of unevaluated constants from CFE, including handling of potential compile-time errors found during evaluation.

The CL fixes a bug in the constant evaluator where it created map literals that were not marked as constant as needed.

Change-Id: I7df77a3c68e52392a143478b3567d19e09ebe6bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98347
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-04-01 13:05:52 +00:00
Johnni Winther 05f3b12960 Add test for native declarations
Change-Id: Iea9d8d27e6fdefa6f47471a459cdb4363aab65e1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98011
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-03-28 10:29:11 +00:00
Johnni Winther 7baae76480 Always use ir constants in annotations when constant-update-2018 is enabled
Change-Id: Ib5ba6a908904c36a8580f6f47424b6982800dddd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98002
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-03-28 09:34:21 +00:00
Johnni Winther 8915407f2c Support computation of NativeData directly from IrAnnotationData
Change-Id: Ie11791b61e1ffbc011959d6d7a9f0a502cb1c74f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97114
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-03-21 10:44:21 +00:00
Johnni Winther c4c0db440c Handle ir constants in noSuchMethod handling and deferred load
Change-Id: Ic57e44bd3f03d88119962c235fb6f136785d9ac1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97118
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-03-20 10:18:13 +00:00
Johnni Winther 1ac41d26b4 Support @Creates and @Returns from ir constants
Change-Id: I5afa43354f70e42dad93a568afabb14d2004cf52
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96784
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-03-14 08:44:46 +00:00
Nate Bosch f2579a8ede Add override annotations in dart2js tests
In preparation of enforcing these in the analysis options.

Change-Id: I316f2efea510ecc8ff1b975e96d166a5f8c0286c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96834
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-03-14 00:15:46 +00:00
Johnni Winther f307524421 Support native member annotations through ir constants
Change-Id: I247385c951d3a794afe7e4066b3b1d1ea14a76b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96641
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-03-13 09:08:27 +00:00
Johnni Winther 6a2aa920cd Support pragma annotations through ir constants
Change-Id: I40b2662a00596ca9ebbb5301f99b541806e71515
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96280
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-03-12 09:28:32 +00:00
Johnni Winther 95cfa6c583 Support native class and js-interop annotations through ir constants
Change-Id: I8e9deb1392dc98d958f13611a984e422b028265c
Reviewed-on: https://dart-review.googlesource.com/c/95032
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-03-04 08:40:15 +00:00
Johnni Winther 9201b906ee Convert ir.Constant to ConstantValue
Needed for passing the --enable-experiments=constant-update-2018 option to start working on ir.Constant nodes.

Change-Id: I4f3d8fa6a59ddbda1635fe2da64591bcffcb0f12
Reviewed-on: https://dart-review.googlesource.com/c/95030
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-03-01 18:46:00 +00:00
Mayank Patke 3d3f6f9d4b Remove immediateUnderSetLiteral.
Change-Id: I5abb8bb6dafa2a7ee88ce4bf559bae20ac0998fd
Reviewed-on: https://dart-review.googlesource.com/c/92401
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-02-26 18:38:00 +00:00
Mayank Patke 8fface97f0 Reland "Eliminate singleton/static access to the constant system and expose its functionality at the top level."
This is a reland of 027b76ecbf

Original change's description:
> Eliminate singleton/static access to the constant system and expose its
> functionality at the top level.
>
> Use sites have been updated to import the library with a prefix.
>
> Change-Id: I0f5e4e47bec089d2d0dc2fcd50caccfd98947cf5
> Reviewed-on: https://dart-review.googlesource.com/c/93842
> Reviewed-by: Sigmund Cherem <sigmund@google.com>
> Reviewed-by: Johnni Winther <johnniwinther@google.com>

Change-Id: Ib04a9d48c8dca51020258313256e0fb0df330d9b
Reviewed-on: https://dart-review.googlesource.com/c/94107
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-02-23 00:06:31 +00:00
Mayank Patke e40b0e04c9 Reland "Merge the JavaScript constant system into the base constant system and flatten the inheritance hierarchy."
This is a reland of cf51eb2fba

Original change's description:
> Merge the JavaScript constant system into the base constant system and
> flatten the inheritance hierarchy.
>
> dart2js only needs one constant system at most.
>
> Change-Id: I72e446652ea44298677e986b06e63152e381353b
> Reviewed-on: https://dart-review.googlesource.com/c/93880
> Reviewed-by: Sigmund Cherem <sigmund@google.com>
> Reviewed-by: Johnni Winther <johnniwinther@google.com>

Change-Id: I83960035a7b0989397f9646f2f834ec468aa4908
Reviewed-on: https://dart-review.googlesource.com/c/94106
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-02-23 00:06:31 +00:00
Mayank Patke 6bdd38ae84 Reland "Move the JavaScript constant system into constants/constant_system.dart in preparation to merge it with the base constant system and flatten the constant system hierarchy."
This is a reland of 1702b986c8

Original change's description:
> Move the JavaScript constant system into constants/constant_system.dart
> in preparation to merge it with the base constant system and flatten the
> constant system hierarchy.
>
> Change-Id: I6ef27b210515140d4516336fea015f74c8a0cd6a
> Reviewed-on: https://dart-review.googlesource.com/c/93840
> Reviewed-by: Sigmund Cherem <sigmund@google.com>
> Reviewed-by: Johnni Winther <johnniwinther@google.com>

Change-Id: I20ef9755886a6b54135aa7169c9d7de08e8cbe93
Reviewed-on: https://dart-review.googlesource.com/c/94105
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-02-23 00:06:31 +00:00
Mayank Patke 960b08a969 Reland "Remove the Dart constant system and move all required classes into the JavaScript constant system."
This is a reland of 5af8de8954

Original change's description:
> Remove the Dart constant system and move all required classes into the
> JavaScript constant system.
>
> Change-Id: I2a31ea743270459284c42b615b0dffd1c7aa2584
> Reviewed-on: https://dart-review.googlesource.com/c/93746
> Reviewed-by: Sigmund Cherem <sigmund@google.com>
> Reviewed-by: Johnni Winther <johnniwinther@google.com>

Change-Id: I8c8399e94dd80c1f543a54454efc9cf59ef6ac7b
Reviewed-on: https://dart-review.googlesource.com/c/94104
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-02-23 00:06:31 +00:00
Mayank Patke e1992e0178 Revert "Remove the Dart constant system and move all required classes into the"
This reverts commit 5af8de8954.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Remove the Dart constant system and move all required classes into the
> JavaScript constant system.
> 
> Change-Id: I2a31ea743270459284c42b615b0dffd1c7aa2584
> Reviewed-on: https://dart-review.googlesource.com/c/93746
> Reviewed-by: Sigmund Cherem <sigmund@google.com>
> Reviewed-by: Johnni Winther <johnniwinther@google.com>

TBR=johnniwinther@google.com,sigmund@google.com,fishythefish@google.com

Change-Id: Ic28807774502d11a53572095616510a642cf75b3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/94081
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2019-02-22 21:54:57 +00:00
Mayank Patke 05d9c60a22 Revert "Move the JavaScript constant system into constants/constant_system.dart"
This reverts commit 1702b986c8.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Move the JavaScript constant system into constants/constant_system.dart
> in preparation to merge it with the base constant system and flatten the
> constant system hierarchy.
> 
> Change-Id: I6ef27b210515140d4516336fea015f74c8a0cd6a
> Reviewed-on: https://dart-review.googlesource.com/c/93840
> Reviewed-by: Sigmund Cherem <sigmund@google.com>
> Reviewed-by: Johnni Winther <johnniwinther@google.com>

TBR=johnniwinther@google.com,sigmund@google.com,fishythefish@google.com

Change-Id: If1b6291508c9792a6135a2ad5333b4bb3b800f69
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/94103
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2019-02-22 21:50:57 +00:00
Mayank Patke 388f8e7731 Revert "Merge the JavaScript constant system into the base constant system and"
This reverts commit cf51eb2fba.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Merge the JavaScript constant system into the base constant system and
> flatten the inheritance hierarchy.
> 
> dart2js only needs one constant system at most.
> 
> Change-Id: I72e446652ea44298677e986b06e63152e381353b
> Reviewed-on: https://dart-review.googlesource.com/c/93880
> Reviewed-by: Sigmund Cherem <sigmund@google.com>
> Reviewed-by: Johnni Winther <johnniwinther@google.com>

TBR=johnniwinther@google.com,sigmund@google.com,fishythefish@google.com

Change-Id: I2d403834ac3ac41371e041d21eec3d83d152343a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/94102
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2019-02-22 21:46:52 +00:00
Mayank Patke 2c3dfa9e71 Revert "Eliminate singleton/static access to the constant system and expose its"
This reverts commit 027b76ecbf.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Eliminate singleton/static access to the constant system and expose its
> functionality at the top level.
> 
> Use sites have been updated to import the library with a prefix.
> 
> Change-Id: I0f5e4e47bec089d2d0dc2fcd50caccfd98947cf5
> Reviewed-on: https://dart-review.googlesource.com/c/93842
> Reviewed-by: Sigmund Cherem <sigmund@google.com>
> Reviewed-by: Johnni Winther <johnniwinther@google.com>

TBR=johnniwinther@google.com,sigmund@google.com,fishythefish@google.com

Change-Id: I65310b2579c6746620ed6129e670206ed9bf5e91
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/94101
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2019-02-22 21:42:52 +00:00
Mayank Patke 027b76ecbf Eliminate singleton/static access to the constant system and expose its
functionality at the top level.

Use sites have been updated to import the library with a prefix.

Change-Id: I0f5e4e47bec089d2d0dc2fcd50caccfd98947cf5
Reviewed-on: https://dart-review.googlesource.com/c/93842
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-02-22 21:34:47 +00:00
Mayank Patke cf51eb2fba Merge the JavaScript constant system into the base constant system and
flatten the inheritance hierarchy.

dart2js only needs one constant system at most.

Change-Id: I72e446652ea44298677e986b06e63152e381353b
Reviewed-on: https://dart-review.googlesource.com/c/93880
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-02-22 21:34:47 +00:00
Mayank Patke 1702b986c8 Move the JavaScript constant system into constants/constant_system.dart
in preparation to merge it with the base constant system and flatten the
constant system hierarchy.

Change-Id: I6ef27b210515140d4516336fea015f74c8a0cd6a
Reviewed-on: https://dart-review.googlesource.com/c/93840
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-02-22 21:34:47 +00:00
Mayank Patke 5af8de8954 Remove the Dart constant system and move all required classes into the
JavaScript constant system.

Change-Id: I2a31ea743270459284c42b615b0dffd1c7aa2584
Reviewed-on: https://dart-review.googlesource.com/c/93746
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-02-22 21:34:47 +00:00
Johnni Winther 60e4f194b0 Recognize and inline effectively constant fields
Change-Id: I243ee80ebc45d9cdab2f7c944cf5eceb26185b2c
Reviewed-on: https://dart-review.googlesource.com/c/93436
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2019-02-22 14:06:05 +00:00
Peter von der Ahé 857d834e64 Remove obsolete expectMoreSpecific parameter
Change-Id: I6d5ff79ba0eec022812da14201fb30ae2625d355
Reviewed-on: https://dart-review.googlesource.com/c/92126
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-02-13 10:51:55 +00:00
Johnni Winther c591454dd3 Inline unprovided optional parameters
Change-Id: I61c82216965062feee8e01ba2533d0ea7c0052ef
Reviewed-on: https://dart-review.googlesource.com/c/90700
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-02-07 08:44:49 +00:00
Sigmund Cherem bb4a880777 Report duplicate set entries with a different error
It will take some time until the CFE will take on reporting this error (and
duplicate keys in maps).

For now: detect whether a map is used as the implementation of a set literal,
and if so report the error differently.

Change-Id: I9f657189c79a4532023f615aa91bf63602f27664
Reviewed-on: https://dart-review.googlesource.com/c/91102
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2019-01-25 17:12:43 +00:00
Johnni Winther b61a085c60 Use custom thisType to signal static type precision.
This also removes the dependency on the state (!) in ir.TypeEnvironment.

Change-Id: I0180d111ecf45b685c4abce12c6a9bd52c1f308e
Reviewed-on: https://dart-review.googlesource.com/c/88968
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-01-11 12:17:14 +00:00
Sigmund Cherem 2a39f63c2a Record deferred accesses in kernel world impacts and use it for splitting only
under a flag.

This reapplies commit 70e1517d98, but adds a flag
to gradually migrate users before enabling it by default.

Patchset 1 matches the old CL

Change-Id: Iaf7ee3dec8d4aa658f0b4334549b507e5a610a68
Reviewed-on: https://dart-review.googlesource.com/c/86444
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2018-12-06 23:20:38 +00:00
Sigmund Cherem adf595dc62 Revert "Record deferred accesses in kernel world impacts and use it for splitting."
This reverts commit 70e1517d98.

Reason for revert: saw unexpected regression on acx-gallery as well. I'd like to look in more detail and reland if it is justified.

Original change's description:
> Record deferred accesses in kernel world impacts and use it for splitting.
> 
> On large apps this cuts down the time spent in the deferred loading algorithm by
> two thirds. To address issue #35311, this CL keeps things sound and may load in
> the main unit more code.
> 
> On some large apps, it appears the effect of this change is not that measurable,
> and we even see an improvement. I'm still validating the data, but I believe
> this is in part because there was a different bug
> in the previous algorithm: constructors were never deferred
> because we were looking for the constructor-name, usually '', instead of the
> enclosing class name.
> 
> My current data is that, the main unit of some large app shows:
>   old algorithm:        13,213,191
>   sound algorithm:      13,150,145
>   unsound algorithm*:   13,147,282
>   fixed old algorithm:  13,146,509
> 
> * ignoring return type of closures
> 
> 
> Change-Id: I7d3e525393ef38979b26051b4d354fc1001560af
> Reviewed-on: https://dart-review.googlesource.com/c/85725
> Commit-Queue: Sigmund Cherem <sigmund@google.com>
> Reviewed-by: Johnni Winther <johnniwinther@google.com>

TBR=johnniwinther@google.com,sigmund@google.com

Change-Id: I6992279bebcc99578f94087a17d6c327b32a0876
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/86246
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2018-12-05 19:16:32 +00:00
Sigmund Cherem 70e1517d98 Record deferred accesses in kernel world impacts and use it for splitting.
On large apps this cuts down the time spent in the deferred loading algorithm by
two thirds. To address issue #35311, this CL keeps things sound and may load in
the main unit more code.

On some large apps, it appears the effect of this change is not that measurable,
and we even see an improvement. I'm still validating the data, but I believe
this is in part because there was a different bug
in the previous algorithm: constructors were never deferred
because we were looking for the constructor-name, usually '', instead of the
enclosing class name.

My current data is that, the main unit of some large app shows:
  old algorithm:        13,213,191
  sound algorithm:      13,150,145
  unsound algorithm*:   13,147,282
  fixed old algorithm:  13,146,509

* ignoring return type of closures


Change-Id: I7d3e525393ef38979b26051b4d354fc1001560af
Reviewed-on: https://dart-review.googlesource.com/c/85725
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2018-12-05 17:40:27 +00:00
Kevin Moore be5d0cca5c Remove sha1 impl from dart2js
pkg:crypto has a fine implementation
Change-Id: Ibefd6c294259c58cd4eb3ac8f5718a078894a39b
Reviewed-on: https://dart-review.googlesource.com/c/85415
Auto-Submit: Kevin Moore <kevmoo@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2018-11-29 04:28:02 +00:00
Johnni Winther 82f9884289 Support exact class and this expression relations in StrongModeConstraint
Change-Id: I32e6e5b6f55d4ef4240b6ba87eb26dfc2a699130
Reviewed-on: https://dart-review.googlesource.com/c/85166
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2018-11-27 13:50:04 +00:00
Johnni Winther 9a1a7763f1 Skip checking of casts in metadata
This avoids assertion failure on js-interop class computation.

Change-Id: I040c6d63dbc427d239eb97c22dc8c3c67a6fb9fd
Reviewed-on: https://dart-review.googlesource.com/c/82722
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-11-05 10:40:58 +00:00
Johnni Winther 41c50d9ac9 Support serialization of deferred imports
+ add tests for various fixes
+ add canonicalization support in serialization

Change-Id: Ib6a8bfd6073dbd93c1ba4fd9d2feff77ac43b178
Reviewed-on: https://dart-review.googlesource.com/c/81402
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Auto-Submit: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-10-26 09:36:18 +00:00
Johnni Winther 741f81afba Use List instead of Link in class_set
+ fix the order of the iterator to match the class hierarchy tree

Change-Id: I06011b673f7413160863eb8bb4f00c3cdd8a5ad2
Reviewed-on: https://dart-review.googlesource.com/c/81400
Auto-Submit: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-10-25 17:37:44 +00:00
Johnni Winther 8b6f8969a6 Support post-inference serialization/deserialization
Currently handling Swarm in-memory serialization/deserialization.

Change-Id: I4b01f70d1e42d7462ed079ece227d6c2ed4de597
Reviewed-on: https://dart-review.googlesource.com/c/80445
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Auto-Submit: Johnni Winther <johnniwinther@google.com>
2018-10-22 14:37:04 +00:00
Dmitry Stefantsov 8648d782ae Reland "[fasta] Report errors for bounds violations"
The original commit:
https://github.com/dart-lang/sdk/commit/aa6fb2d3a4298e60b5635f26507d5b39f4e531cb

Change-Id: I34287ec856fde16d56e9369ef2620311ba9bb722
Reviewed-on: https://dart-review.googlesource.com/c/79200
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2018-10-11 10:20:01 +00:00