Commit Graph

4770 Commits

Author SHA1 Message Date
Nicholas Shahan 8cc4a12938 [cfe] Move checks for all sound Components from .dill
Moving here allows the checks to cover more code paths including
the mode used in google3 where the no mixed .dills in sound mode
was not being enforced for ddc targets.

Change-Id: I1af1d63f96dd23f56d637bffd4eef397d4deb167
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162823
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-09-16 16:54:08 +00:00
jonahwilliams d0e095507c [frontend_server] connect widget cache to frontend_server
Connect the widget cache to the frontend server to be enabled when
--flutter-widget-cache is provided as a flag.

See also: go/fast-single-widget-reloads

Bug: https://github.com/flutter/flutter/issues/61407
Change-Id: I9d1f2c59dbb1dc56bb7e6ac7ebd05a01d1d47803
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162943
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Jonah Williams <jonahwilliams@google.com>
2020-09-16 15:09:18 +00:00
Johnni Winther b3bd2e95e7 [cfe] Fix git access in presubmit script on Windows
Change-Id: I6c871264dc1fff39b19421ce1f5513eb2e56901d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163061
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-09-16 14:17:18 +00:00
Dmitry Stefantsov e119ccad2a [cfe] Infer Object from constraints similar to T? = dynamic
Closes #43163.

Bug: https://github.com/dart-lang/sdk/issues/43163
Change-Id: I55f51eee097a320dcc38cf54a41c9f6684b5dd59
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162505
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2020-09-16 11:36:28 +00:00
Johnni Winther 52c3d94863 [cfe] Use origin location in override error
Override errors on member signatures would point to the synthesized
location (the enclosing class definition) and not the original
member declaration.

Change-Id: If271039f2238f7ae74706e5c4f5143ea6ee4fc1d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162750
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-09-16 11:25:38 +00:00
Johnni Winther c9576a1dac Reland "[cfe] Make fast path for adding simple member signatures"
Change-Id: If9aa575308a3932988259f36d217f6d402136388
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162749
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-09-16 10:37:28 +00:00
Johnni Winther 644df9b9fb Revert "Reland: [kernel] Rename Name.name to Name.text"
This reverts commit c430a0ac0b.

Reason for revert: Will break flutter_frontend_server when rolled into google3

Original change's description:
> Reland: [kernel] Rename Name.name to Name.text
> 
> Change-Id: I5240b0ff09faf35184998920202d7600dc97766d
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162746
> Reviewed-by: Johnni Winther <johnniwinther@google.com>
> Commit-Queue: Johnni Winther <johnniwinther@google.com>

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

Change-Id: Ib6961f49dd416171c5d5935c490d79d6f7be779e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162748
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-09-16 08:22:55 +00:00
Johnni Winther c430a0ac0b Reland: [kernel] Rename Name.name to Name.text
Change-Id: I5240b0ff09faf35184998920202d7600dc97766d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162746
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-09-16 07:42:42 +00:00
Jason Simmons fc01707e44 Revert "[cfe] Make fast path for adding simple member signatures"
This reverts commit f7ff99e937.

Reason for revert: This caused a regression in Flutter:
https://api.cirrus-ci.com/v1/task/5181542404194304/logs/test_framework.log

Change-Id: I892690cb2c7dc626939ddbec99b6dffda3f6fc80
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163000
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2020-09-15 23:53:45 +00:00
jonahwilliams 99c3eac6cb [frontend] add support for flutter widget cache
Add an initial draft of the widget cache for fast single widget reloads.

THe intention is to capture the common cases where only a single widget class is modified. This can
provide a signal to the flutter tool that a faster reassemble can be performed, rather than forcing
a complete cold frame.

For more details see the linked issue or go/fast-single-widget-reloads

Bug: https://github.com/flutter/flutter/issues/61407
Change-Id: I1c95fd8fb2d1b297f41874dd69c1c76b0456a4bb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161604
Commit-Queue: Jonah Williams <jonahwilliams@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-09-15 17:03:43 +00:00
Daco Harkes 7302e01a79 Revert "[kernel] Rename Name.name to Name.text"
This reverts commit 3ff8dd2f51.

Reason for revert: Fails all CI builders. Possibly something landed
in the mean time.

Original change's description:
> [kernel] Rename Name.name to Name.text
> 
> Change-Id: I93162fb387ba123b949e19a7829bd5614845b15d
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162722
> Reviewed-by: Jens Johansen <jensj@google.com>
> Commit-Queue: Johnni Winther <johnniwinther@google.com>

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

Change-Id: I2ffe526dabf37ae09d5e4ab1fbe514925f6e8768
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162744
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2020-09-15 15:21:35 +00:00
Johnni Winther 3ff8dd2f51 [kernel] Rename Name.name to Name.text
Change-Id: I93162fb387ba123b949e19a7829bd5614845b15d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162722
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-09-15 14:27:22 +00:00
Johnni Winther f7ff99e937 [cfe] Make fast path for adding simple member signatures
Change-Id: I9eae2bbd048738a9620ed39c2210c5890428e14b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162704
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-09-15 12:06:31 +00:00
Johnni Winther 7ff49902db [cfe] Only perform override checks on source class members
Change-Id: Id5eea0e83ea1042443990946c415664b2f071d47
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162540
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2020-09-14 12:12:19 +00:00
Johnni Winther 3f6af87cd4 [cfe] Use declared nullability in replacement visitors
Legacy erasure on FutureOr<T*> would not yield FutureOr<T*>* as intended.

Change-Id: Ie2ec44900ddd2ee0daa7fd8a5b655e568153b59f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162640
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-09-14 08:40:39 +00:00
Johnni Winther f4dd96c6a9 [cfe] Handle nullable enum in switch case
Closes #43348

Change-Id: Id2bb94f2019e85021c43eb7b2a5d12a651159369
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162184
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-09-10 09:42:15 +00:00
Johnni Winther a8f9f08253 [cfe] Don't find unnamed mixin application in least upper bound
InterfaceType's referring to unnamed mixin applications continuously
cause problems for backends since these might not correspond to
types supported at runtime. The LUB specification does not mention
how to handle these so it is valid skip these in the computation of
LUB.

Change-Id: I38f46bf43d5858dec473c26326b741cf36eb57d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145420
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-09-09 13:00:17 +00:00
Johnni Winther 22db21590d [cfe] Report error on nullable spread access
Closes #43256

Change-Id: I15b0f5a9353566af290b78151f7889fa06a44406
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162002
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-09-09 12:44:37 +00:00
Jens Johansen 0c90775fd6 [CFE] Better error messages for class initialization errors
Change-Id: Ic7c489b0bfffd05cdd71dc254db042956fd25c3a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161944
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-09-09 11:37:47 +00:00
jlcontreras 173a958d37 [cfe] Implement addEqualsOperator in value class transformation
Change-Id: I07afadfe9d23f792edb61681e794faa4de6aebb5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161506
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Javier López-Contreras <jlcontreras@google.com>
2020-09-08 18:30:55 +00:00
Johnni Winther 9d6ee9ec5a [cfe] Don't lower instance fields
Closes #42956

Change-Id: I3d27c8601d835ecafa50dadcebca1493f64588ad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161700
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-09-08 08:11:24 +00:00
Johnni Winther 9be92f4309 [cfe] Don't perform static field lowering on const top-level/static fields
Closes #42956

Change-Id: I2a06602246a48be4cd9c3ebecb8ff166b8dc0442
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161505
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-09-03 07:30:14 +00:00
Johnni Winther f67b35e455 [cfe] Allow experimental flag to opt in to release version
Experiments can now be enabled in the experiment release version
using --enable-experiments (and not just through allowed_experiments.json).

Change-Id: Ic83aac6b2a342bb9d6e43ecc5475234e04d1dd7c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161503
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-09-03 06:54:04 +00:00
Johnni Winther fb3143f684 [cfe] Handle this.length in constant context
Closes #43290

Change-Id: I099b0185c37bd824518628d95e1eda8b897b3e73
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161502
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-09-03 06:51:44 +00:00
Paul Berry a4b2047d9d Reland "Flow analysis changes to fix mixed-mode unsoundness loophole."
This is a reland of d833f2f65c

Original change's description:
> Flow analysis changes to fix mixed-mode unsoundness loophole.
> 
> This is the flow analysis portion of the fix to
> https://github.com/dart-lang/language/issues/1143.  Follow-up changes
> will be needed in the CFE and/or backends to ensure that exceptions
> are thrown under appropriate circumstances.
> 
> This CL also makes some improvements to flow analysis's reachability
> analysis so that it accounts for nullability of the target when
> analyzing the reachability of `??=` and `?.`.  Hopefully these
> improvements should make the fix to
> https://github.com/dart-lang/language/issues/1143 clearer and more
> consistent.
> 
> Change-Id: I5fa5c070f13fd57ac4c2fb87f2d67588861594b0
> Bug: https://github.com/dart-lang/language/issues/1143
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160440
> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
> Reviewed-by: Johnni Winther <johnniwinther@google.com>
> Commit-Queue: Paul Berry <paulberry@google.com>

Bug: https://github.com/dart-lang/language/issues/1143
Change-Id: If9c45649c1e9f4b19f7c282e7a1c4c956a7bc17f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161622
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-09-03 01:01:43 +00:00
Paul Berry ab16d79af9 Revert "Flow analysis changes to fix mixed-mode unsoundness loophole."
This reverts commit d833f2f65c.

Reason for revert: Broke build, e.g. https://ci.chromium.org/p/dart/builders/ci/dart-sdk-mac/12688

Original change's description:
> Flow analysis changes to fix mixed-mode unsoundness loophole.
> 
> This is the flow analysis portion of the fix to
> https://github.com/dart-lang/language/issues/1143.  Follow-up changes
> will be needed in the CFE and/or backends to ensure that exceptions
> are thrown under appropriate circumstances.
> 
> This CL also makes some improvements to flow analysis's reachability
> analysis so that it accounts for nullability of the target when
> analyzing the reachability of `??=` and `?.`.  Hopefully these
> improvements should make the fix to
> https://github.com/dart-lang/language/issues/1143 clearer and more
> consistent.
> 
> Change-Id: I5fa5c070f13fd57ac4c2fb87f2d67588861594b0
> Bug: https://github.com/dart-lang/language/issues/1143
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160440
> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
> Reviewed-by: Johnni Winther <johnniwinther@google.com>
> Commit-Queue: Paul Berry <paulberry@google.com>

TBR=paulberry@google.com,scheglov@google.com,johnniwinther@google.com

Change-Id: If1215b19975e0958d612dd69767088095d853879
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/language/issues/1143
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161580
Reviewed-by: Paul Berry <paulberry@google.com>
2020-09-02 15:02:46 +00:00
Paul Berry d833f2f65c Flow analysis changes to fix mixed-mode unsoundness loophole.
This is the flow analysis portion of the fix to
https://github.com/dart-lang/language/issues/1143.  Follow-up changes
will be needed in the CFE and/or backends to ensure that exceptions
are thrown under appropriate circumstances.

This CL also makes some improvements to flow analysis's reachability
analysis so that it accounts for nullability of the target when
analyzing the reachability of `??=` and `?.`.  Hopefully these
improvements should make the fix to
https://github.com/dart-lang/language/issues/1143 clearer and more
consistent.

Change-Id: I5fa5c070f13fd57ac4c2fb87f2d67588861594b0
Bug: https://github.com/dart-lang/language/issues/1143
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160440
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-09-02 14:27:52 +00:00
Johnni Winther 7130dd4d3d [cfe] Report error on non-void setter return type
This CL also adds fileUri/charOffset to all TypeBuilder's and renames
Void/FutureOr/Never/Dynamic/BuiltInTypeBuilder to *TypeDeclarationBuilder
so match their relation to TypeBuilder/TypeDeclarationBuilder.

Closes #42962

Change-Id: Iee5102134574d24f748103282a37bb9a85a0ac2d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161165
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2020-09-02 12:43:12 +00:00
Jens Johansen 8030a3f68e [CFE] Enable textual outline modelling in incremental compiler
This CL enables textual outline modelling in the incremental compiler,
meaning that the textual outlines created (and compared) to figure out
if we can do a "minimal invalidation" (with the experiment enabled)
is "modelled", i.e. have members, classes etc sorted so that re-ordering
things in a file generally doesn't cause a "transitive invalidation".

Change-Id: I9daddf2bd34e4c2e17b42a5e356033816d05b359
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161172
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-09-01 14:14:59 +00:00
Johnni Winther 6dc5a58252 [cfe] Report errors on non-nullable optional parameters without default value in factory constructors
Closes #43276

Change-Id: I50f68e910a5e79fd978f10cad3651bfe0aec535f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161169
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-09-01 14:05:19 +00:00
Jens Johansen 3a1f732c0f [parser] Make begin/end events always come in pairs
This CL:
* Changes the events so beginX and endX events always comes in pairs
  (though technically not right as some specific events can be beginX
  endY --- but in those cases it is at least documented and used in code
  that actually tests it).
  -> This entails adding some events and converting something from
    "beginX" to "handleX" instead.
* Adds a utility that can generate an AST of sorts directly from the
  parser via a listener using the begin/end matching (and knowing of the
  specific ones that doesn't match directly).
* Adds a test that checks that - at least for all tested (50,000+) files
  - the AST actually generate "correctly", i.e. matches up begin/ends
  and ends up with a single top entry "CompilationUnit".
* Adds a different visualization to the parser listener events by
  displaying the "AST directly from the parser" in a UI that can be
  navigated. The visualization may not be the best, but it's certainly
  a stepping stone.

Change-Id: I9b27f7bbf3be442adc92f357c7b3c46da6f84cf7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159664
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-09-01 09:30:43 +00:00
Johnni Winther 423c1503b1 [cfe] Add SourceTypeAliasBuilder
Change-Id: Ia3aeb7972f16f8cb6badf45c03dba4c48a30a5dd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160581
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-09-01 08:05:18 +00:00
Johnni Winther 082295a61e [cfe] Support lowering of static fields with initializers
This adds support lowering the encoding of top-level/static fields
with initializers as if they were marked as late fields. This ensures
that LateInitialization is thrown if final fields are written to during
initialization.

Closes #42956

Change-Id: I488fdddd87ebd935a0cdaf82a724e9b87d5f91ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160724
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-09-01 07:20:58 +00:00
jlcontreras 70fd140a9d [cfe] Implements addConstructor of value class transformation
Change-Id: I991c82693a6a3a44061efa7703fa89bd94f858b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158280
Commit-Queue: Javier López-Contreras <jlcontreras@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-08-31 13:24:38 +00:00
Johnni Winther 9be824c3ef [cfe] Provide missing forEffect argument
Closes #43218

Change-Id: Id1f4d872cc77d2b7b8ae76b0cafd7bf5f5297949
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160722
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-08-28 09:57:28 +00:00
Jens Johansen 97e981eb85 [CFE] Textual outline refactorings + ability to sort show/hide on import/export
Change-Id: I9d5f0e39f64036d474ec904993c44b1a242b2f4a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159660
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-08-28 09:43:58 +00:00
Johnni Winther 6079377dc1 [cfe] Ensure default type on all declarations
Closes #43202

Change-Id: I3b8f6e24436aac7cdcdd2e1cce1448a1bcc122de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160521
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-08-27 18:21:57 +00:00
Johnni Winther 3485a2333c [cfe] Catch and report non file system errors when trying to read a file.
When a crash occurs in Uri it doesn't include the content of the failing
Uri, making it very hard to determine why the error situation occurred.
With the change the offending Uri will be printed as part of the message.

Change-Id: I41bb9762e5fc8deb97e051adaf336ecf3599a901
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160281
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-08-26 10:32:24 +00:00
Johnni Winther f61cab8a27 [cfe] Reland: Support superscope search in late initializer
From https://github.com/dart-lang/sdk/pull/43156

The reland allows this access in assert initializers.

Closes #43137

Change-Id: Ie557108a57612f0d2e838ff9420f1bb6ce0a37f6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160069
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-08-25 13:23:09 +00:00
Johnni Winther 4996d11854 [cfe] Handle experiment release version in CFE.
Closes #43033

Change-Id: I6752d19e56586e4072de1c0f4a7cc31ca3500691
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160062
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-08-25 12:32:50 +00:00
Johnni Winther a3e001d0f1 Revert "[cfe] Support superscope search in late initializer"
This reverts commit 991f877e53.

Reason for revert: Breaks code using implicit this in assert initializer (which probably is illegal, though).

Original change's description:
> [cfe] Support superscope search in late initializer
> 
> From https://github.com/dart-lang/sdk/pull/43156
> 
> Closes #43137
> 
> Change-Id: I1ab972b93ee1d7b957c48d4097ff71fc1f1c5453
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159842
> Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
> Commit-Queue: Johnni Winther <johnniwinther@google.com>

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

Change-Id: I32ac4b4311aae3bebe31060af5e481c60d052aeb
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160067
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-08-25 09:56:41 +00:00
Johnni Winther 991f877e53 [cfe] Support superscope search in late initializer
From https://github.com/dart-lang/sdk/pull/43156

Closes #43137

Change-Id: I1ab972b93ee1d7b957c48d4097ff71fc1f1c5453
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159842
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-08-25 07:46:29 +00:00
Jens Johansen f190a4ae27 [CFE] Change sorting in textual outline
This CL basically change two things about the sorting:
* Entities are not sorted according to metadata. Metadata just follows
  along. Before "@a class B {}" would come before "class A {}" because
  "@" comes before "c". Now "class A {}" comes first because "A" < "B".
* Sorting happens on a token level, i.e. "F<int>" will now come before
  "F2<int>" because "F" < "F2" whereas before it was the other way
  around because "F2" < "F<" (because "2" < "<").

None of it really matters as long as sorting is done the same way when
comparing the outlines.
Doing it this way makes it faster and actually brings the runtime
(in benchmarks) less than the old (now deleted) textual outline.

Change-Id: Ib1d887ab0c14519316c8e9a3da38f0dd49b4104f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159041
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-08-21 09:55:00 +00:00
Jens Johansen 70914a7164 [CFE] Make textual outline v2 the default and remove the old one
Change-Id: I48d27c92edd445627e6938e2f264fadc11b9262f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159081
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-08-21 09:42:18 +00:00
Jens Johansen 28db218ed0 [CFE] Create version of textual outline that makes the model more explicit
This version generally produce the same output (with slight variations
for spacing between some elements as well as for unassociated metadata)
but is slightly slower in modelled (i.e. sorting) mode.

The slow-down is remedied (so the whole thing actually becomes slighly
faster) if sorting slightly differently than the old version. That is
for another CL though.

Change-Id: Id19df710dff965250bfb7cf51d8756394cbe2067
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159080
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-08-21 09:38:37 +00:00
Jens Johansen f5b1063f86 [CFE] Implement typeVariables and type for DillTypeAliasBuilder
This CL lets DillTypeAliasBuilder implement typeVariables and type
and adds a few test that crashed before.

The tests crashed similar to
https://github.com/dart-lang/sdk/issues/43084
so it's assumed that the issue is fixed too.

Change-Id: I735a5d56cf2073be2a1c5f1fa142d98420ef9d19
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159440
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-08-20 11:36:38 +00:00
Jacob MacDonald 1522a867ca add --strong-null-safety flag to the kernel worker
Bug:https://github.com/dart-lang/sdk/issues/43091
Change-Id: I716d2ea6cf1c95be3911c32b1b2958788fe917ef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159183
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
2020-08-19 18:57:47 +00:00
Johnni Winther 07a440901e [cfe] Remove useConsolidated flag
Change-Id: Ife1cfdee865e889d985a9395c83a60549b0beb24
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158398
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-08-17 08:31:49 +00:00
Jens Johansen a12b14ed83 [CFE] Add option to mark unknown textual outline chunks
Change-Id: Idcb1596b62e9b6450f08212429b2cc1d5f06d19d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158552
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-08-17 08:16:18 +00:00
Jens Johansen 04bc03e4ad [CFE] Textual outline knows about (and can thus sort) imports and exports
Before this CL the textual outline didn't know about imports and exports
and thus couldn't sort them.

This CL makes it know about them and allows imports and exports to be
sorted internally, but not mix with other stuff (e.g. imports should be
placed after "foo() {}" just because "f" comes before "i", but putting
"import 'a.dart'" before "import 'b.dart'" is OK.

This CL does not sort the hide and show entries.

Change-Id: Ic640cdaa98ac3562f8b36b21180a26584cb6d205
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158551
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-08-17 08:16:18 +00:00