Commit Graph

20 Commits

Author SHA1 Message Date
Johnni Winther 10abacba10 Use hasOnlyNonDeferredImportPathsToConstant to add deferred constants
Change-Id: Ifd8b733c526fe4e7ae837a7d17c682e91717feb5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98013
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-03-28 09:17:31 +00:00
Johnni Winther 8a92d2a8d9 Collect types deeply for deferred loading
Change-Id: I7bbd9499975c78fcdcfa88ceba31cb2e8e5a7cc6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97639
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-03-27 11:08:37 +00:00
Johnni Winther 477de6b84b Cleanup unittests
- remove use of '_strong', '_trust', and '_checked' suffices
- test omit-implicit-checks by default

Change-Id: I2a83f6fb23a22c894cc7867c51ab460abb4cc524
Reviewed-on: https://dart-review.googlesource.com/c/88454
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-01-07 15:01:10 +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
Johnni Winther a22c72bc49 Add tests for non-constant deferred instantiation
Change-Id: I86e799377ae52a5b9ab8bbb56a54bab97d41f2df
Reviewed-on: https://dart-review.googlesource.com/65901
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2018-07-23 07:59:09 +00:00
Johnni Winther eeb8cba38f Add tests for generic instantiations in deferred parts
Change-Id: I7d0e383ff1cc442a50bea637890f6916e3589ecb
Reviewed-on: https://dart-review.googlesource.com/65680
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-07-20 12:28:28 +00:00
Johnni Winther ada23cde0b Add deferred test for local functions
Change-Id: I9f4b67de9435e74378af72d2a0c0fc711c0b0252
Reviewed-on: https://dart-review.googlesource.com/55891
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-18 19:33:48 +00:00
Johnni Winther add1e67295 Include generic type arguments in deferred load computation.
Closes #33046

Change-Id: I1273b631e3f5b5aca8d4042b0afd972709a00068
Reviewed-on: https://dart-review.googlesource.com/53805
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-07 09:21:48 +00:00
Sigmund Cherem 521188f838 Fix deferred loading in the presence of type parameters too
(and get rid of a TODO(redemption) that I should have fixed eons ago...)

Change-Id: I218a7bddcc8256ff84b4ec03b54a858e8f5d8687
Reviewed-on: https://dart-review.googlesource.com/40180
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Emily Fortuna <efortuna@google.com>
2018-02-09 00:25:26 +00:00
Sigmund Cherem 3b6d39cc2c Correctly defer typedef references
Change-Id: I61fb5ebb399dcfca5193b7ae870badc10add23e5
Reviewed-on: https://dart-review.googlesource.com/37880
Reviewed-by: Emily Fortuna <efortuna@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2018-01-31 21:10:29 +00:00
Sigmund Cherem 497d592ac7 Fixes for deferred constants in the kernel pipeline.
The constant collector was inconsistent with the old frontend: we were
skipping primitives and we were not going into the body of closures.

Change-Id: I3321426da7e684d203f0ac7a2a2c7028f3138a7b
Reviewed-on: https://dart-review.googlesource.com/32663
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Emily Fortuna <efortuna@google.com>
2018-01-05 23:37:58 +00:00
Sigmund Cherem 747772b02d Add regression test for #31306
I ended up fixing this bug during my refactoring to support
deferred-constant-values in kernel (1ddb7db237).
The issue was that ssa/builder.dart was using the output unit of the deferred
import instead of the output unit of the deferred constant field.

(fixes #31306)
Bug: https://github.com/dart-lang/sdk/issues/31306
Change-Id: I557983c5ec85f2aa6adb486961dd2f79852e8d5a
Reviewed-on: https://dart-review.googlesource.com/32201
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2018-01-04 00:16:25 +00:00
Sigmund Cherem 1ddb7db237 Add support for deferred globals in kernel.
Change-Id: I24adb7e4c67b7c1d077efd6705b9bce92406deac
Reviewed-on: https://dart-review.googlesource.com/31680
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Emily Fortuna <efortuna@google.com>
2017-12-29 07:17:53 +00:00
Sigmund Cherem eae0dda31e Ensure that missing-ids is empty
Change-Id: I3a1526645a385e2ab75240841cd8def58712e792
Reviewed-on: https://dart-review.googlesource.com/31741
Reviewed-by: Emily Fortuna <efortuna@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2017-12-28 23:46:43 +00:00
Sigmund Cherem 9250db194c Add test for deferred-constants, skip for kernel for now
Change-Id: I8164857666787241294cc6ca389932d96d7d6a82
Reviewed-on: https://dart-review.googlesource.com/31740
Reviewed-by: Emily Fortuna <efortuna@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2017-12-28 23:33:53 +00:00
Emily Fortuna fa9e576a40 Adjust importsTo so that you can get the import chain for entities other than memberEntities.
Also added some more tests to the deferred equivalence test.


Bug:
Change-Id: Ia5ca50728a96020ff76b7b519558cdb5847d598e
Reviewed-on: https://dart-review.googlesource.com/31600
Commit-Queue: Emily Fortuna <efortuna@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-28 19:31:13 +00:00
Sigmund Cherem c03a8a8944 Show output unit of top-level constants in deferred tests.
We might want to later do this for all constants in the code, but this is a start.

Change-Id: I797c0d7b95dc81ca6f5a84b300a221cc5ff6c44a
Reviewed-on: https://dart-review.googlesource.com/31640
Reviewed-by: Emily Fortuna <efortuna@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2017-12-28 19:03:23 +00:00
Emily Fortuna 21891a965f Do id equivalence testing for deferred imports.
Also allows us to more generally compare annotations in multi-file tests.

Bug:
Change-Id: I2f4ac34b918cc80400ebc417dfcc2caf56457ac2
Reviewed-on: https://dart-review.googlesource.com/30923
Commit-Queue: Emily Fortuna <efortuna@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-12-22 20:04:44 +00:00