Commit Graph

4070 Commits

Author SHA1 Message Date
Johnni Winther 7ef28f0b03 Handle constant field init registration correctly.
+ avoid side-effects of checking enqueuer invariants

Change-Id: Id327371bc70e4b1b5fd4d326b8c8cf8caf50ea0e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98142
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-03-29 16:44:15 +00:00
Johnni Winther da0de0a867 Handle native field impact correctly from ir constants
Change-Id: I0393fd57b78c7cb417888ec3e0ff139b888bf3a3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98322
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-03-29 16:41:55 +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 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 a8e51c5868 Bypass use of dart2js_platform.dill when experimental flags are non-default
Change-Id: I95e654c6c2a430f7aebb30ced92b33cd35aadca3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97634
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-03-26 13:18:24 +00:00
Johnni Winther 0a3cd80d41 Reland "Change default of 'keepFields' in constant transformation to true"
Reviewed in https://dart-review.googlesource.com/c/sdk/+/97632

Change-Id: I042a81ffcf60b3dfb0666f69dcb97a8835036afc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97921
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-03-26 11:48:41 +00:00
Vyacheslav Egorov c9ecdabe5d Revert "Combine override checks and override-based inference in one phase"
This reverts commit 9db4119b67.

Revert "Change default of 'keepFields' in constant transformation to true"

This reverts commit b1e14cbe5f.

Revert "[fasta] Don't create forwarding stub if there's already a member"

This reverts commit 51da94da76.

These commits are reverted to unblock rolls into Flutter.

b1e14cbe5f is reverted because it contained
changes that prevented clean revert of the other CLs.

Change-Id: I8d3c00f0c1b146f4debe7f1a1a7de75be154e265
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97802
Commit-Queue: Alexander Aprelev <aam@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2019-03-25 19:40:26 +00:00
Johnni Winther b1e14cbe5f Change default of 'keepFields' in constant transformation to true
This is necessary to support modular constant transformation as
needed for instance of for platform dill files.

This change also restricts the removal of additionExports to fields.

Change-Id: Ie7379f09672d8caeaf0689d42af9e1246b9678fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97632
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-03-25 10:05:18 +00:00
Sigmund Cherem ee79ca9a74 dart2js support for loading .dill files built modularly
Change-Id: Ie360b13b5be786df9101c96982400136c63dff00
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97462
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-03-22 21:16:21 +00:00
Johnni Winther 87c553bf3c Ascribe constants to the member world impacts
Change-Id: I978a6453196b47dd4ed5f51dde1d81feaa4f2008
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97502
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-03-22 12:58:40 +00:00
Johnni Winther 3de6276ad6 Handle deferred constants in the ssa builder
Change-Id: I8fc5e4f01d00a0f1b5ad1b2b51495476f0ec625e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97328
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-03-22 09:06:03 +00:00
Johnni Winther 7dd4259d87 Handle ir constants in inferrer
Change-Id: Ie7b6ff9e62b3b8c78f6c04359cb72f77b249440c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97240
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-03-21 11:25:40 +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 9c9ab11450 Reland "Handle ir constants in field analysis and impact tests"
Include initial handling of unevaluated constants from environment.

Change-Id: I288801b42a9e25e440baa3eac9ce88263acea0a7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97241
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Auto-Submit: Johnni Winther <johnniwinther@google.com>
2019-03-18 17:57:55 +00:00
Aske Simon Christensen e62391a162 Revert "Handle ir constants in field analysis and impact tests"
This reverts commit 0cd89e5bd1.

Reason for revert: Conflicts with move of constant evaluator.

Original change's description:
> Handle ir constants in field analysis and impact tests
> 
> Include initial handling of unevaluated constants from environment.
> 
> Change-Id: Ibd330a14dfabad1dee95b64ce7015939412374d3
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97112
> Commit-Queue: Johnni Winther <johnniwinther@google.com>
> Reviewed-by: Sigmund Cherem <sigmund@google.com>

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

Change-Id: Ie01c7dda6152abbf852cd40a00597f019db49e66
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97116
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2019-03-18 13:01:11 +00:00
Johnni Winther 0cd89e5bd1 Handle ir constants in field analysis and impact tests
Include initial handling of unevaluated constants from environment.

Change-Id: Ibd330a14dfabad1dee95b64ce7015939412374d3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97112
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-03-18 10:30:04 +00:00
Stephen Adams 7a90563ee3 [js_runtime] Try to avoid String.prototype.replace with replacement patterns
Change-Id: I4b063fe77592bbb0ad9f6ffb628c3bdd6323b20c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96220
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Jenny Messerly <jmesserly@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2019-03-15 21:51:15 +00:00
Johnni Winther eb6f1b6abd Handle effectively constant fields in class stub generator
Closes #36222

Change-Id: Ic8b7a3963e1364903b4b2d7871ff0b12cb134572
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97082
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-03-15 20:15:25 +00:00
Johnni Winther d0c4d6b329 Take variance into account when computing rti checks
Change-Id: Ie3f93a6ac1fbf796b1c66bf29d2e9de51f5dee13
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96942
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-03-15 09:40:14 +00:00
Johnni Winther 3e794ec16a Add tests for rti emission on function types
Change-Id: Iee612110afbb83947a7869df3c49138a9ba34832
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96906
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-03-15 09:40:14 +00:00
Nate Bosch 28d697a6c1 Enforce override annotations in dart2js
Update the excludes in the test directory analysis options to match the
files that were not updated to add override annotations.
Update the excludes in `testing.json` to match the analysis options.

With a consistent analysis options test config the diagnostics in
editors will match what is enforced by the test.

Also clean up the no longer required `enableSuperMixins` config.

Change-Id: If0e23642c25e0b5c1aced6a5a8c8c05a6da538f8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96836
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2019-03-14 18:47:05 +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
Mayank Patke 4339fe9b51 Add constant evaluation tests for IfNull.
Change-Id: I68229e831cea9e1c9aac548d9da8434bcacdaaff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96710
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2019-03-13 21:36:51 +00:00
Mayank Patke 8adcab9fec Add constant evaluation tests for Identity.
Change-Id: I9ce93147f7cdb96ce659551499a64958a77d1711
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96709
Reviewed-by: Stephen Adams <sra@google.com>
2019-03-13 21:36:51 +00:00
Mayank Patke 3552dbb429 Add constant evaluation tests for Equals.
Change-Id: I20be37af485f8841ec549f33c16e5680e0170444
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96708
Reviewed-by: Stephen Adams <sra@google.com>
2019-03-13 21:36:51 +00:00
Mayank Patke 27328840f9 Add constant evaluation tests for GreaterEqual.
Change-Id: I2e2a3b656710cd130882dd2f7480f9d532a1ba61
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96707
Reviewed-by: Stephen Adams <sra@google.com>
2019-03-13 21:36:51 +00:00
Mayank Patke 9f680cd0bd Add constant evaluation tests for Greater.
Change-Id: I356b805ff69307a697e073ea4499217e11541cc5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96706
Reviewed-by: Stephen Adams <sra@google.com>
2019-03-13 21:36:51 +00:00
Mayank Patke 0950d473ad Add constant evaluation tests for LessEqual.
Change-Id: If98b28bfbb32b14e1d53546642fae613aa937519
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96705
Reviewed-by: Stephen Adams <sra@google.com>
2019-03-13 21:36:51 +00:00
Mayank Patke 7ff70237d4 Add constant evaluation tests for Less.
Change-Id: I024905e6e90f40301d092de2e4e0e45e379b143b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96704
Reviewed-by: Stephen Adams <sra@google.com>
2019-03-13 21:36:51 +00:00
Mayank Patke ce9a1bb24e Add constant evaluation tests for Add.
Change-Id: I21b5fd03bfaee3c32573c56d8f529c933f315d14
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96703
Reviewed-by: Stephen Adams <sra@google.com>
2019-03-13 21:36:51 +00:00
Mayank Patke 2fa96dd653 Add constant evaluation tests for Divide.
Change-Id: Ic361816bd0cfa5a6822cb96322bb29fcf7749778
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96405
Reviewed-by: Stephen Adams <sra@google.com>
2019-03-13 21:36:51 +00:00
Mayank Patke 952421a68d Add constant evaluation tests for TruncatingDivide.
Change-Id: I144967283f76570ec6312750995ca219d3a4ad09
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96404
Reviewed-by: Stephen Adams <sra@google.com>
2019-03-13 21:36:51 +00:00
Mayank Patke 9fd0ec2560 Add constant evaluation tests for Modulo.
Change-Id: Ia8d7fd2faee166ea71aaca5e1fc797d5d658d8c3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96403
Reviewed-by: Stephen Adams <sra@google.com>
2019-03-13 21:36:51 +00:00
Mayank Patke 9262d111fd Add constant evaluation tests for Multiply.
Change-Id: I05e7c3e6b6cb4a137a03f4917b8ab7125a1e19b1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96402
Reviewed-by: Stephen Adams <sra@google.com>
2019-03-13 21:36:51 +00:00
Mayank Patke aba9392f0e Add constant evaluation tests for Subtract.
Change-Id: Id818fc9c2f246b8858fb747d8955604b44348a4d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96401
Reviewed-by: Stephen Adams <sra@google.com>
2019-03-13 21:36:51 +00:00
Mayank Patke 3a38f0bb89 Add constant evaluation tests for BooleanOr.
Change-Id: Ib9f7b409845ff13ecaa49fd1d949ea1bf474281d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/94465
Reviewed-by: Stephen Adams <sra@google.com>
2019-03-13 21:36:51 +00:00
Mayank Patke 052d6d235c Add constant evaluation tests for BooleanAnd.
Change-Id: Icead29835e72027f6f9cd82f799781983843fc89
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/94464
Reviewed-by: Stephen Adams <sra@google.com>
2019-03-13 21:36:51 +00:00
Mayank Patke be5332c0a5 Add constant evaluation tests for ShiftRight.
Change-Id: I327d98fa496543db885549e3654844da5f9f6a16
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/94463
Reviewed-by: Stephen Adams <sra@google.com>
2019-03-13 21:36:51 +00:00
Mayank Patke 4f34218ce1 Add constant evaluation tests for ShiftLeft.
Change-Id: Ie669c127be1f76a64dbb7a96b81b3ce7d1621733
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/94462
Reviewed-by: Stephen Adams <sra@google.com>
2019-03-13 21:36:51 +00:00
Mayank Patke 3df5334137 Add constant evaluation tests for BitXor.
Change-Id: If5b72f5743ebde2304058ba57e50c7dee5173561
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/94344
Reviewed-by: Stephen Adams <sra@google.com>
2019-03-13 21:36:51 +00:00
Mayank Patke 84d8d6b513 Add constant evaluation tests for BitOr.
Change-Id: I93d172601c8c3e83e3a17d4eeb90d06f2fe2fd45
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/94343
Reviewed-by: Stephen Adams <sra@google.com>
2019-03-13 21:36:51 +00:00
Mayank Patke f7972480bd Add constant evaluation tests for BitAnd.
Change-Id: I162aed0534530efb04e7e743d1f29ef041f888fc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/94342
Reviewed-by: Stephen Adams <sra@google.com>
2019-03-13 21:36:51 +00:00
Mayank Patke 432c6c8c39 Add constant evaluation tests for Not.
Change-Id: I1afa07efb7f3def69f13719ee3f57cd4d8c00f2a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/94341
Reviewed-by: Stephen Adams <sra@google.com>
2019-03-13 21:36:51 +00:00
Mayank Patke 2e1c78db7b Add constant evaluation tests for Negate.
Change-Id: I9e23fc47538324fcd64c8e2e90e75cf12e8b0491
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/94340
Reviewed-by: Stephen Adams <sra@google.com>
2019-03-13 21:36:51 +00:00
Mayank Patke 5853f129b2 Add constant evaluation tests for BitNot.
Change-Id: I1bc82d76073006a18109eedfc62bd53a70f1685f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/94320
Reviewed-by: Stephen Adams <sra@google.com>
2019-03-13 21:36:51 +00:00
Mayank Patke aa4a2df5a2 Add structure of constant folding tests.
This test suite is not comprehensive by any means. The goal is to
establish the right structure for the tests (so that we get the right
inlining and constant folding behavior). Broader semantic tests will be
added later.

Change-Id: Ib028ec05f063b98046f5946272cfbfe986244d3f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/94040
Reviewed-by: Stephen Adams <sra@google.com>
2019-03-13 21:36:51 +00:00