Commit graph

20390 commits

Author SHA1 Message Date
Brian Wilkerson 0a9697596e Add Forest support for for statements
Change-Id: Ic65a09c01012e8a5d0ab2a4f755950c18b00fa9f
Reviewed-on: https://dart-review.googlesource.com/56000
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
2018-05-23 17:32:55 +00:00
Aske Simon Christensen 8427d53a4d Extra precedence level in parser to distinguish postfix operators and selectors
Fixes https://github.com/dart-lang/sdk/issues/31185

Change-Id: I77d617f6abd367d857741d04cf47571ea7492c6a
Reviewed-on: https://dart-review.googlesource.com/56111
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2018-05-23 16:13:55 +00:00
Dan Rubel 1ce9b2541b Replace call to parseTypeVariablesOpt with computeTypeParam
Change-Id: Icc4443e9ba4206a3d16cdac5fdd3ffa70459012f
Reviewed-on: https://dart-review.googlesource.com/56043
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-05-23 16:09:50 +00:00
Peter von der Ahé f7e09684b6 Split IndexedAccessGenerator and ThisIndexedAccessGenerator
This prepares the generators to be implemented by the analyzer.

Change-Id: I28ada82b602893b427c8d34df68b2c9a7f8439cf
Reviewed-on: https://dart-review.googlesource.com/56341
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2018-05-23 16:02:55 +00:00
Peter von der Ahé 9f3cd54d3b Remove UnhandledListener
Change-Id: I693f3352a3e5582456b4f41c9b7dc06d23cf98d3
Reviewed-on: https://dart-review.googlesource.com/56327
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2018-05-23 16:02:55 +00:00
Peter von der Ahé 98fcc338ca Fix diet_listener.dart imports
Change-Id: Iff0b5f9eae0080f961c3b0395a65f854f4714e41
Reviewed-on: https://dart-review.googlesource.com/56326
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-05-23 16:02:55 +00:00
Peter von der Ahé 3a5454a691 Split SuperPropertyAccessGenerator
This prepares the generator to be implemented by the analyzer.

Change-Id: I7c6ebf43e8dee46ea734d7a245c20fc03fe74b65
Reviewed-on: https://dart-review.googlesource.com/56325
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-05-23 16:02:55 +00:00
Dan Rubel fa6fd26892 Remove unused IdentifierContext instance
Change-Id: Ib7f82b2d9a3d367f20bb5e9be7456ef8693bd69f
Reviewed-on: https://dart-review.googlesource.com/56042
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-05-23 15:50:25 +00:00
Peter von der Ahé a80dfa12d7 Revert "Add colons"
This reverts commit 29253c57ed.

Reason for revert: Analyzer doesn't use colons on TODOs.

Original change's description:
> Add colons
> 
> Change-Id: Idb51f8d5d3fa65f92ce0d64bbe79d63a9337cf1c
> Reviewed-on: https://dart-review.googlesource.com/56320
> Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>

TBR=ahe@google.com,brianwilkerson@google.com,dmitryas@google.com

Change-Id: I19e7f574537a011dd9ad36b795b9b48249d192b9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/56360
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-05-23 14:26:56 +00:00
Peter von der Ahé 443c23c091 Remove subpackage_relationships_test.dart
This also enables us to remove unsupported front-end API.

Change-Id: I1f655039e9fa4718ef5c941d1932c136eefab3c5
Reviewed-on: https://dart-review.googlesource.com/56342
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2018-05-23 14:12:36 +00:00
Dan Rubel 0271003c33 Extract parseFunctionLiteral from parseType
This is another step towards removing parseType and improving recovery.

Change-Id: Ie2cb1999406bc603355015e8a3b9aaa854f785db
Reviewed-on: https://dart-review.googlesource.com/56120
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-05-23 13:40:06 +00:00
Dan Rubel b8cb785aed Improve formal parameter identifier recovery
Change-Id: I7bc6012295836a4455388c287da3cf15eed9ee5f
Reviewed-on: https://dart-review.googlesource.com/56300
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-05-23 13:34:26 +00:00
Dmitry Stefantsov 9f1097948a [fasta] Add and use a type-inference-specific interface of BodyBuilder
Change-Id: I04c954c4233cc6c43b1f065be95f587a09ed5003
Reviewed-on: https://dart-review.googlesource.com/56328
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-05-23 13:15:05 +00:00
Brian Wilkerson 3960cacc89 Make peek return null when the stack is empty
Change-Id: I73cea25140ad1123ff1a8cb1bca1c69742d3d6f7
Reviewed-on: https://dart-review.googlesource.com/56201
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-05-23 13:11:56 +00:00
Martin Kustermann 3582e30d8e [VM] Remove unused _Random._A field in Dart sources and make constant in C++ code instead
Issue https://github.com/dart-lang/sdk/issues/33185

Change-Id: I256a66ebf81d4433bded15f19b4147327df9b588
Reviewed-on: https://dart-review.googlesource.com/56329
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-05-23 13:06:25 +00:00
Peter von der Ahé 39bccc125d Split NullAwarePropertyAccessGenerator
This prepares the generator to be implemented by the analyzer.

Change-Id: I6468e0eb24a812e6de498b358d33d668683da3ed
Reviewed-on: https://dart-review.googlesource.com/56321
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2018-05-23 11:07:07 +00:00
Peter von der Ahé 29253c57ed Add colons
Change-Id: Idb51f8d5d3fa65f92ce0d64bbe79d63a9337cf1c
Reviewed-on: https://dart-review.googlesource.com/56320
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-05-23 11:07:07 +00:00
Peter von der Ahé fc95fd920b Move generators out of body_builder
Change-Id: Ifc1edcc04659931fc8e1cfc76922921ad1665328
Reviewed-on: https://dart-review.googlesource.com/56119
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-05-23 11:07:07 +00:00
Peter von der Ahé 39516de753 Split ThisPropertyAccessGenerator
This prepares the generator to be implemented by the analyzer.

Change-Id: I429f41beec55057b427ef686d99c7ff26c1e6b25
Reviewed-on: https://dart-review.googlesource.com/56118
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2018-05-23 09:26:35 +00:00
Peter von der Ahé 2d79c356e0 Start creating common superclass for generators
Change-Id: I9d8c95665eed15be45c2a5b734e541af73a7db91
Reviewed-on: https://dart-review.googlesource.com/56117
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2018-05-23 09:24:46 +00:00
Ben Konyi 6d8f473d4f [ VM / Hot Reload ] Updated kernel_service and hot reload behavior to run as long as the compiler returns valid kernel.
Change-Id: Id2b20d95488ccd374f4ca337355dde9f5057292a
Reviewed-on: https://dart-review.googlesource.com/46820
Reviewed-by: Siva Annamalai <asiva@google.com>
2018-05-22 23:50:28 +00:00
Dan Rubel f4f79acb61 Improve annotation identifier recovery
Change-Id: Iaac50ebf39f6f76939f738f97929c8212fa2c098
Reviewed-on: https://dart-review.googlesource.com/56240
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-05-22 22:24:04 +00:00
Dan Rubel 3bdd173175 Call computeType rather than parseType
Change-Id: I4d67e8742997181775320b596443ea9dd78be60d
Reviewed-on: https://dart-review.googlesource.com/56241
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-05-22 21:47:14 +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
Brian Wilkerson 3ac2a3fe19 Address comment from 55981
Change-Id: I8e0e95239f613d15d130c465a0d39dd04a044194
Reviewed-on: https://dart-review.googlesource.com/56200
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-05-22 20:53:16 +00:00
Sigmund Cherem 8c0f5747a0 Add build_integration package and move multi_root_file_system there.
This is following the design discussion we had a few months ago.

Change-Id: I48b2e82af33d10b9cd1e599e1b3a4e8e419417c8
Reviewed-on: https://dart-review.googlesource.com/56035
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-05-22 20:09:24 +00:00
Brian Wilkerson a756248065 Add Forest support for assert statements and initializers
Change-Id: I7a1f51144e69890d9858e60948cf59800ed81e53
Reviewed-on: https://dart-review.googlesource.com/56005
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
2018-05-22 17:59:24 +00:00
Dan Rubel 298129c3a4 Improve part of identifier recovery
Change-Id: I16b5799e883ed0a04445809e329d9e7fba5afff4
Reviewed-on: https://dart-review.googlesource.com/56041
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-05-22 17:07:46 +00:00
Konstantin Shcheglov 371c8e4b87 Append version and CRC32 to data in FileByteStore.
We need this to prevent reading accidentally damaged data.

R=brianwilkerson@google.com, paulberry@google.com

Bug:
Change-Id: I1c3b2c61f3cdb087c8f7effafba7fa13deef87ce
Reviewed-on: https://dart-review.googlesource.com/3700
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-05-22 17:06:32 +00:00
Aske Simon Christensen 6cc0d9770f Skip expressions by parsing them with a no-op listener.
This change slows down Fasta by around 0.5%, as it now does a full
parse of expressions outside bodies in the outline and diet parsing
phases, but it is, for now, a more robust solution than the heuristic
skipExpression, fixing several crashes.

Fixes https://github.com/dart-lang/sdk/issues/31155
Fixes https://github.com/dart-lang/sdk/issues/31171
Fixes https://github.com/dart-lang/sdk/issues/31188

Change-Id: Id5639dbd8b4c3f1f7e42eed66e3bee60f37bc3dc
Reviewed-on: https://dart-review.googlesource.com/55660
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
2018-05-22 16:51:29 +00:00
Mike Fairhurst d34fe65afa Revert "New package:build workspace before we support it at the language level."
This reverts commit ac8971a98a.

Reason for revert: Tests fail on windows

Original change's description:
> New package:build workspace before we support it at the language level.
> 
> Does not work with dartanalyzer, only dart analysis server.
> 
> Change-Id: I1d7c3fbbbda512d799ac44a6fa5a188d1a3bb8c3
> Reviewed-on: https://dart-review.googlesource.com/55586
> Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Reviewed-by: Mike Fairhurst <mfairhurst@google.com>

TBR=brianwilkerson@google.com,mfairhurst@google.com

Change-Id: Ie3a0f7549cdbd65c9a3f7100f303105b121830a6
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/56162
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2018-05-22 16:43:25 +00:00
Konstantin Shcheglov 89df6b785d Issue 33181. Use RefactoringWorkspace in rename refactoring to determine when element being renamed is outside the workspace.
R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/33181
Change-Id: I01c9b275579cd961a581491d8cd25893b3bcc094
Reviewed-on: https://dart-review.googlesource.com/56039
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-05-22 15:28:23 +00:00
Dmitry Stefantsov 08d466bfad [kernel] Treat TypeParameter.defaultType as a child in visit methods
Change-Id: Id2bc2ec8f4d08ca3ef0c428efa2dbf369039b59c
Reviewed-on: https://dart-review.googlesource.com/55883
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2018-05-22 13:14:16 +00:00
Peter von der Ahé 330dcb19da Rename remaining generators
Change-Id: I8baf2347aaab8a32eb41518ea8079dc491753af5
Reviewed-on: https://dart-review.googlesource.com/56106
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-05-22 13:10:42 +00:00
Dmitry Stefantsov 2c9d8924e3 [fasta] Make explicit Object in bound a constraint during type inference
Change-Id: I1da9c822e83663dd285880a074e5a36ff295003c
Reviewed-on: https://dart-review.googlesource.com/55897
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2018-05-22 13:06:11 +00:00
Peter von der Ahé 5924c35640 Prepare to remove expression_generator_impl.dart
Change-Id: I459ee57e95b47bf59935df32902ce19051c3e7ab
Reviewed-on: https://dart-review.googlesource.com/56105
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-05-22 12:23:21 +00:00
Vijay Menon c771e4d132 DDC: disallow ignore option on Stream cast failures
See #27223

Change-Id: Ia23edc3700a8e0bb3d982be9b0bb36ad4522091d
Reviewed-on: https://dart-review.googlesource.com/56033
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2018-05-22 12:15:32 +00:00
Aske Simon Christensen e191d4feb5 Simplify errors on invalid arguments
Change-Id: I1bd94725b4e4e44e706c6d22543bbea22649ec69
Reviewed-on: https://dart-review.googlesource.com/55680
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-05-22 11:14:22 +00:00
Peter von der Ahé 7ab9ea0e4e Change return type of Fangorn.parenthesizedCondition
Change-Id: Ie023607a0a85adcb710ec91174188a2013146254
Reviewed-on: https://dart-review.googlesource.com/56100
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2018-05-22 09:40:21 +00:00
Peter von der Ahé 09582b46ea Remove FastaAccessor and Accessor
Change-Id: I439670b0fafa09536901647572615afa4e82977a
Reviewed-on: https://dart-review.googlesource.com/55965
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-05-22 09:32:41 +00:00
Peter von der Ahé a738567968 Convert ContextAccessor to ContextAwareGenerator
Change-Id: Id9afaa968616d48c0dbe088d19a7dcb0f94ef369
Reviewed-on: https://dart-review.googlesource.com/55964
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-05-22 09:23:21 +00:00
Peter von der Ahé bbdf560ee7 Convert UnresolvedAccessor to UnresolvedNameGenerator
Change-Id: Ie28b5d963ab575383b36551657c0f0109b5de53d
Reviewed-on: https://dart-review.googlesource.com/55963
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-05-22 09:23:21 +00:00
Peter von der Ahé b5c6143d74 Convert IncompleteSend to IncompleteSendGenerator
Change-Id: Ief33fe9277ec9a297f0dc9274820e1f1ab13ca75
Reviewed-on: https://dart-review.googlesource.com/55962
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-05-22 09:23:21 +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
Konstantin Shcheglov 9696c9dcd0 Change analysis_server tests to use /project/test.dart as the test file.
Correspondingly all files that were referenced using relative URI(s)
also put into /project, which is the contextRoot for the test
AnalysisDriver.

This will let us (in a following CL) start checking that the element
being renamed is defined inside the current workspace (the set of
analysis roots). Currently the context root is hardcoded as /project.

R=brianwilkerson@google.com

Change-Id: I9dca3509af1be13c9016bf03d4a4b95d71bc9374
Reviewed-on: https://dart-review.googlesource.com/56031
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-05-22 00:31:22 +00:00
Alexander Aprelev e71bd048e5 [vm, kernel] Fix async stack code traversal in dart2.
With this change debugger requests yield(await) positions from kernel builder so it can confirm which frame handles what exceptions.
This also renames ':completer' to ':async_completer' in constructed kernel, so it is compliant with what VM expects to see(and updates test expectations accordingly).
Further it fixes async stack navigation for sync-async that became default in dart vm since first version went for the review((uses `future` getter, rather than property).
It also makes `future` getter non-debuggable to allow stepping-out of async methods.

Make Handle zone-scoped. Clean up frame counter var name.

Bug: https://github.com/dart-lang/sdk/issues/29056

Change-Id: Ia71f3c851a6b313655b57dad28c296f5dd081eda
Reviewed-on: https://dart-review.googlesource.com/54640
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2018-05-22 00:27:01 +00:00
Alexander Markov 714697efbb [vm/kernel/bytecode] Write constant pool before bytecode and exceptions table
This simplifies reading, as exceptions table refers to constant pool.

Change-Id: Id20d2a315ad87aa4e5247fcd98d7e5996c188eec
Reviewed-on: https://dart-review.googlesource.com/56032
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2018-05-21 23:51:41 +00:00
Alexander Aprelev 80b48195b1 [frontend-server] Serialize compiled expression procedure into the file.
Improve comments and test, report errors.

Follow-up to https://dart-review.googlesource.com/c/sdk/+/49040.

Change-Id: Ie02dae1c0edfcb54e3cd7333641e2c5eface1412
Reviewed-on: https://dart-review.googlesource.com/56030
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2018-05-21 23:50:22 +00:00
Alexander Markov 68b19b4ff4 [vm/kernel/bytecode] Add invocation kind to StaticICData constant
VM will use the invocation kind to distinguish between getters,
setters and calls via field/getter.

Change-Id: I97cf36bc8778533e53f8251c25b373fddec3c2e8
Reviewed-on: https://dart-review.googlesource.com/55581
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2018-05-21 23:03:01 +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
Konstantin Shcheglov 4cf51e6c1a Give (the old) ContextRoot path.Context to work with paths.
R=brianwilkerson@google.com

Change-Id: I7699bb50ea4b6239c61c69de5e8e2ceeed64ea64
Reviewed-on: https://dart-review.googlesource.com/56024
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-05-21 22:04:24 +00:00
Vijay Menon bea580c3a4 Disallow ignore on any explicit cast failures
See #27223

Change-Id: I9689ce9a72597b3e5c945f9787f2de6c5e8c2074
Reviewed-on: https://dart-review.googlesource.com/54701
Commit-Queue: Vijay Menon <vsm@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Jenny Messerly <jmesserly@google.com>
2018-05-21 22:01:39 +00:00
danrubel 1cf871a4d2 Improve import/export combinator identifier recovery
Change-Id: I9f0a418d3b1fae001199c27850b1a85daf2d07a6
Reviewed-on: https://dart-review.googlesource.com/56040
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-05-21 21:12:19 +00:00
Konstantin Shcheglov 79a0ef60e0 Fix for 'Convert to final field' quick assist when no return type.
R=brianwilkerson@google.com

Change-Id: I9927c8f44fcab8ad812939680a1a082f85cc9b66
Reviewed-on: https://dart-review.googlesource.com/56020
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-05-21 20:51:10 +00:00
Alexander Aprelev d5b99860e4 [frontend-server] Introduce compile-expression command.
Change-Id: I5b200ab00076710b08527ec4b35322a6a5fcc4b9
Reviewed-on: https://dart-review.googlesource.com/49040
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
2018-05-21 18:11:09 +00:00
Mike Fairhurst ac8971a98a New package:build workspace before we support it at the language level.
Does not work with dartanalyzer, only dart analysis server.

Change-Id: I1d7c3fbbbda512d799ac44a6fa5a188d1a3bb8c3
Reviewed-on: https://dart-review.googlesource.com/55586
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2018-05-21 17:45:28 +00:00
Brian Wilkerson 99eb2195c8 Add Forest support for break and continue statements
Change-Id: Id7b109ca9acaa6d68cdc0682109bb65bd7cda62f
Reviewed-on: https://dart-review.googlesource.com/55991
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
2018-05-21 16:45:40 +00:00
Samir Jindel c31b9a461d [vm/kernel] Reference constants in Dill by offset into constants table.
Summary:

The constants table contains a concatenation of the variable-length encodings of
each constant used in the serialized component. Previously, we referenced the
constants in the code by index into the constants table, which requires reading
potentially the entire constants table to dereference. Now, we refer to the
constant by the binary offset into the constants table, which allows us to peek
into it in constant time.

Test Plan:

The constants table is used by all the precompiler modes, so the new encoding
will inherit the coverage of the existing encoding.

Results from debug and release precompiler bots are available under the
"cl-linux-try" button.

Change-Id: I4782bc0035d0b0cbd5bd6b9d086561ea601286c8
Reviewed-on: https://dart-review.googlesource.com/55470
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2018-05-21 15:54:08 +00:00
Brian Wilkerson 0ff6c20c66 Add Forest support for return statements
Change-Id: I84df2c0e392de16130e6933544a7aa41bb7d9a7f
Reviewed-on: https://dart-review.googlesource.com/55993
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-05-21 13:08:28 +00:00
Brian Wilkerson 85fbc71f22 More test framework cleanup
Change-Id: I9090c4f07154fb86621e8870158876053bad5336
Reviewed-on: https://dart-review.googlesource.com/55992
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-05-21 02:44:28 +00:00
Alexander Markov 6202749429 [vm/kernel/bytecode] Support try-catch-finally in bytecode generator
Change-Id: I2882546741b1dd8f6e03a21d85b5487fb754b742
Reviewed-on: https://dart-review.googlesource.com/55324
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2018-05-20 19:52:07 +00:00
Dan Rubel 78cc8a13a2 Improve type parameter recovery
This CL replaces several calls to parseTypeVariablesOpt with calls
to computeTypeParam with improved recovery for missing '>'.

In addition, this CL
* moves isOneOfOrEof to util.dart
* moves insertSyntheticIdentifierAfter into TokenStreamRewriter

Change-Id: I48080809d156dd98ccfed7aa2f67be254f4da201
Reviewed-on: https://dart-review.googlesource.com/55940
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-05-20 12:02:56 +00:00
Dan Rubel 3e7eef12d4 Remove reference to token.previous
Change-Id: Ia1ae04e03b868dfb482d4853fac1c288331a6085
Reviewed-on: https://dart-review.googlesource.com/55942
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-05-20 02:33:00 +00:00
Konstantin Shcheglov 5b4d67b22e Compute runtime completions in the context file itsef.
So, we support all elements - class fields, top-level functions and
variables, etc. And it is just simpler too.

R=brianwilkerson@google.com

Change-Id: Ifed8f9b8d8ef857750b28c48f851d8611a56ef22
Reviewed-on: https://dart-review.googlesource.com/55990
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-05-19 17:03:21 +00:00
Brian Wilkerson 720b6c963c Improve some tests and fix a Dart 2 error
Change-Id: Ia9581c5b27e7fc0540054b7acde9dd1a96dfe927
Reviewed-on: https://dart-review.googlesource.com/55981
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-05-19 15:06:51 +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
Peter von der Ahé 4610daa1c1 Convert ThisAccessor to ThisAccessGenerator
Change-Id: I097c330712c789a65a1ce9c6a57ef0c81a3a32ed
Reviewed-on: https://dart-review.googlesource.com/55893
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-05-19 06:29:19 +00:00
Peter von der Ahé cb9bf910f9 Test that fasta_codes_generated.dart is up to date
Change-Id: If9fbbdaf495b32da7a5a288e2fe63bee6f29ee1e
Reviewed-on: https://dart-review.googlesource.com/55888
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2018-05-19 06:09:49 +00:00
Peter von der Ahé eec11ebe4a Convert ErrorAccessor to ErroneousExpressionGenerator
Change-Id: Ie62314781b264a56a77e466f334f6c9d8cec2cba
Reviewed-on: https://dart-review.googlesource.com/55887
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-05-19 06:09:49 +00:00
Jenny Messerly 21fbf7d767 fix #33103, switch dartdevk to use Kernel nSM stubs
Change-Id: I383b36809b1e8b43f9f7a36ca84d8db5da7cef67
Reviewed-on: https://dart-review.googlesource.com/55266
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2018-05-18 23:43:58 +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
Konstantin Shcheglov c9ea44bd8f Use the static type from the identifier element is local completions.
We always have fully reoslved unit, so usually actual types are available.

For the case when the type annotation cannot be resolved, keep the
old code that returns unresolved type string in this case. Probably
can be simplified more, e.g. remember declared types on the side instead
of passing them around just in case. Later.

R=brianwilkerson@google.com

Change-Id: Ida0b6caa90fc1408e5e7d12b762b19651cb201f6
Reviewed-on: https://dart-review.googlesource.com/55980
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-05-18 22:06:08 +00:00
Dan Rubel 715ba58048 Remove reference to token.previous
Change-Id: Ia25035e592637376e5c8a895516b9e6dc53f5d62
Reviewed-on: https://dart-review.googlesource.com/55941
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-05-18 21:47:28 +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
Vijay Menon 9f6e8a3a96 Move DDC to Dart 2 snapshot
This is not yet working.

Change-Id: I86990eb7a8758d9bccee45997f30286d72a8925f
Reviewed-on: https://dart-review.googlesource.com/54532
Commit-Queue: Vijay Menon <vsm@google.com>
Reviewed-by: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2018-05-18 19:13:08 +00:00
Konstantin Shcheglov be5b189c19 Exclude synthetic import prefixes from runtime completion.
R=brianwilkerson@google.com

Change-Id: I6ebcef8eab433782cc120810f50b872faa097314
Reviewed-on: https://dart-review.googlesource.com/55913
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-05-18 18:57:59 +00:00
Brian Wilkerson 7ac05a120a Add Forest support for do statements
Change-Id: Iefa5f5bda3f7b47cc230f4ae8da93fbe3897961f
Reviewed-on: https://dart-review.googlesource.com/55912
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-05-18 18:49:58 +00:00
Brian Wilkerson 029e1394f7 Make type promotion conditional depending on which builder is being used
Change-Id: I5a689de071ae9d34816d354ffc10e95e719cae4a
Reviewed-on: https://dart-review.googlesource.com/55910
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-05-18 18:21:27 +00:00
Konstantin Shcheglov 817965f49d Runtime completion support for constructors, for loops, and function expressions.
R=brianwilkerson@google.com

Change-Id: I3d33841b9386b6c9fb0e0f74946ca6fe9449581a
Reviewed-on: https://dart-review.googlesource.com/55911
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-05-18 18:14:32 +00:00
Konstantin Shcheglov 97b6c2e09d Don't give Source and ResourceProvider to CompletionRequestImpl.
It knows them already.

R=brianwilkerson@google.com

Change-Id: I48de58d7de140b210b17a11d7cc085c43461803c
Reviewed-on: https://dart-review.googlesource.com/55905
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-05-18 17:52:28 +00:00
Brian Wilkerson 04816270fa Add Forest support for creating parenthesized conditions
Change-Id: I69aa15244dff20d18d7a34c6b052bd9eeed388ed
Reviewed-on: https://dart-review.googlesource.com/55761
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-05-18 17:51:08 +00:00
Konstantin Shcheglov 7a90ed9b88 Tests for completion with nested blocks, functions, and methods.
R=brianwilkerson@google.com

Change-Id: I050aaa2f80a3374fd92587a0b8461bc170078bd8
Reviewed-on: https://dart-review.googlesource.com/55903
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-05-18 17:43:38 +00:00
Brian Wilkerson 353ddbaea1 Add Forest support for while statements
Change-Id: Iffec7799642a44fc6ab2b5f8b7493135d2d05ac5
Reviewed-on: https://dart-review.googlesource.com/55906
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-05-18 17:34:28 +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
Brian Wilkerson 802c25aff9 Add tests to test InstanceCreationExpressionImpl.canBeConst
Change-Id: Id678d054d7b54e5eb33e5f406efa7b51a7aa4361
Reviewed-on: https://dart-review.googlesource.com/55902
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-05-18 16:51:27 +00:00
Konstantin Shcheglov def6f6c86c Don't create linked groups when nothing was written.
In particular, if the type was invalid, so that we cannot write it.

R=brianwilkerson@google.com

Change-Id: I5499e17e2aa3527d21cab050b7fecfd3cd09efc7
Reviewed-on: https://dart-review.googlesource.com/55860
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-05-18 15:54:29 +00:00
Peter von der Ahé 0c2b349827 Blocks and variable declarations in Forest
This is a starting point for supporting blocks and variable
declarations in the forest API. I'm not sure exactly how the
analyzer handles variable declarations, so we'll probably have
to iterate on that part.

Change-Id: I93aec818baec24f8b038f02c66699117070d6b0c
Reviewed-on: https://dart-review.googlesource.com/55683
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2018-05-18 13:55:47 +00:00
Dmitry Stefantsov 5ecf69d90a [fasta] Use Object as defaultType if Object is the explicit bound
Change-Id: I0b3dacbbe5bc45b9e0142e7bb3f6793c83ac4cd2
Reviewed-on: https://dart-review.googlesource.com/55885
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-05-18 11:08:57 +00:00
Lasse R.H. Nielsen a4494a7fb2 Make mixin and interface built-in identifiers.
Fixes #33113

Bug: http://dartbug.com/33113
Change-Id: I4b0b7c9d82ae9df6a7e9f71168ca981c62c7a2f1
Reviewed-on: https://dart-review.googlesource.com/55222
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-05-18 09:57:17 +00:00
Lasse R.H. Nielsen dc76aa34c7 Stop using a port to keep the isolate alive in async_helper.
Addresses issue #33067.

Bug: http://dartbug.com/33067
Change-Id: Id9e60e930a8f289a51063f609e13fb998f6907c3
Reviewed-on: https://dart-review.googlesource.com/55662
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2018-05-18 09:33:27 +00:00
Konstantin Shcheglov d49af06ce0 Fix for searching references to named parameters in hierarchy.
R=brianwilkerson@google.com

Change-Id: I932eae1a1c6e440fab2034bffc7ec850f1216b9c
Reviewed-on: https://dart-review.googlesource.com/55841
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-05-18 00:08:38 +00:00
Dan Rubel 6fee620564 Convert more IdentiferContext consts
* Update local function identifier context
* Update IdentifierContext.operatorName
* Simplify top level declaration identifier context

Change-Id: Ie977769dde3374f109283b9af49be18dd71144bf
Reviewed-on: https://dart-review.googlesource.com/55803
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-05-17 21:42:17 +00:00
Brian Wilkerson a6ad152315 Fix constant-related deprecation warnings in analyzer packages
Change-Id: I6e4186d2a877275db2f04881a6aa6d154d4f8693
Reviewed-on: https://dart-review.googlesource.com/55820
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-05-17 21:24:38 +00:00
Dan Rubel 3e8ca8e0a6 Improve class declaration header recovery
This improves recovery when parsing type names in a class declaration header
by replacing calls to parseType with calls to computeType.

Change-Id: Icbb86fd977d4d92b00abf2282baea34a1ff21e1d
Reviewed-on: https://dart-review.googlesource.com/55802
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-05-17 20:57:11 +00:00
Dan Rubel ffd5a1914d Update top level function name identifier context
Change-Id: I25e20aad434b670752a2cac2d572812a0f88228a
Reviewed-on: https://dart-review.googlesource.com/55801
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-05-17 20:57:11 +00:00
Dan Rubel 1a2f317735 Update parse mixin to use computeType and add recovery tests
... and address comments in
https://dart-review.googlesource.com/c/sdk/+/55560

Change-Id: Ifc97b0b43d91e6c04a344a862d2de0e11ae001cf
Reviewed-on: https://dart-review.googlesource.com/55800
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-05-17 20:49:06 +00:00
Konstantin Shcheglov 76a30dd594 Initial implementation of 'execution.getSuggestions'.
Only local variables, no tests for multiple blocks, or parameters.
No support for classes yet.

No support for expressions or runtime variable types.

R=brianwilkerson@google.com

Change-Id: I9ec5c40e407cda48be408e4e4882d97349413b9c
Reviewed-on: https://dart-review.googlesource.com/55762
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-05-17 20:25:04 +00:00
Konstantin Shcheglov abb1ee98f7 Move library related operations to DartFileEditBuilderImpl. Initialize enclosing elements into fields lazily.
R=brianwilkerson@google.com

Change-Id: Ic933c9399f2288805e1f450f9d564e174516addc
Reviewed-on: https://dart-review.googlesource.com/55760
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-05-17 18:41:49 +00:00
Dan Rubel 7d5ebb937b A few more Analyzer/CFE type argument tests
Change-Id: I32e3dd65f470893f1ff244412eae7fccc0a6c150
Reviewed-on: https://dart-review.googlesource.com/55740
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-05-17 17:17:16 +00:00
Konstantin Shcheglov 62ffedefdd Rewrite writing types to using existing writeXYZ() methods.
Also extract code that ensures imports and writes prefixes into a
separate method.

R=brianwilkerson@google.com

Change-Id: Icd35af19435153bfaebd46f7611823e6a9830d20
Reviewed-on: https://dart-review.googlesource.com/55640
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-05-17 15:51:27 +00:00
Dmitry Stefantsov d59745029a [fasta] Update expectation files after CL 50945
Change-Id: I639fe81e848bec4a3d8735f55750d59eb422763d
Reviewed-on: https://dart-review.googlesource.com/54246
Reviewed-by: Samir Jindel <sjindel@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2018-05-17 14:27:46 +00:00
Dmitry Stefantsov 6fc4854e98 [fasta] Run instantiate-to-bound on functions
Change-Id: Icff76f2e8f309b6d96059839f05b3ec4cc61510d
Reviewed-on: https://dart-review.googlesource.com/50945
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-05-17 14:27:46 +00:00
Dan Rubel b827b70e89 Extract IdentifierContext.typeVariableContext into new subclass
Change-Id: Iae637b02ee517e06d4d04f1e0f0289d760750195
Reviewed-on: https://dart-review.googlesource.com/55600
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-05-17 13:39:36 +00:00
Dan Rubel b7659e6d03 Improve typedef declaration recovery
This CL improves typedef recovery and removes another call to parseType.

Change-Id: I55aca86fe08bb06b040f5ec3c54266fcf795dbb3
Reviewed-on: https://dart-review.googlesource.com/55540
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-05-17 13:39:36 +00:00
Brian Wilkerson 7c1ae73a21 Fix a Dart 2 runtime bug in BodyBuilder
Change-Id: Iea2acd59b7b6283a6144dd06e1cabc0c10521d35
Reviewed-on: https://dart-review.googlesource.com/55583
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-05-17 13:18:16 +00:00
Peter von der Ahé 812189d3e7 Convert LargeIntAccessor to LargeIntAccessGenerator
Change-Id: I904562f31a5f03fb7dfdd8dac3db55b5085ed68a
Reviewed-on: https://dart-review.googlesource.com/55469
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2018-05-17 08:45:05 +00:00
Peter von der Ahé 5e98c49606 Convert ReadOnlyAccessor to ReadOnlyAccessGenerator
Change-Id: If4ba17b46dbe366ff148f50f55df99d79f492fe0
Reviewed-on: https://dart-review.googlesource.com/55467
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-05-17 08:45:05 +00:00
Peter von der Ahé 17e284fbc2 Convert DeferredAccessor to DeferredAccessGenerator
Change-Id: I591895d94b051534c0151e30689d1798d803796d
Reviewed-on: https://dart-review.googlesource.com/55466
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-05-17 08:45:05 +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
Jens Johansen e491bc5d86 Allow to specify what dill file to initialize from
This CL updates the frontend_server to allow specifying what dill
file to initialize from.

Normally, it tries to initialize from the same dill file as is the
output. This is fine in many cases (e.g. flutter run always says it
should output to build/app.dill): The first time it compiles
everything, subsequent times (across restarts) it only recompiles
what's needed.

When running tests, however, the output is in a temporary directory,
so it doesn't work across restarts. The startup time for tests is
always rather high, because it always has to recompile everything.

This CL updates the frontend_server to allow specifying what dill
file to initialize from. Flutter can thus save the compiled test
file in a centralized location (e.g. build/test.dill) and load from
that across restarts.

Plumbing this into flutter yields the following result, when running
a single test (the one automatically created when creating a new
flutter project):

Before: ~5.5 seconds
Now, first run: ~5.5 second (unchanged)
Now, subsequent runs: ~3.4 seconds

Approximate breakdown:

Startup cost (e.g. if there's no test directory):        ~ 800 ms
Starting up the actual frontend server: ~150 ms
Reading source from old dill, loading all relevant files
and invalidating source:                                 ~ 300 ms
Compiling everything (or, rather, nothing as it's all
from the dill at this point):                            ~ 650 ms
Serializing:                                             ~ 250 ms
Copying files:                                           ~  50 ms
Running the actual test:                                 ~1100 ms

Total:                                                   ~3300 ms

`time flutter test --local-engine=host_debug --preview-dart-2`
says ~3.4 seconds...

To compare, --no-preview-dart-2 takes ~2.2 seconds,
so dart2 still has a (significantly) higher startup cost.

Moves the needle on https://github.com/flutter/flutter/issues/15767.

Change-Id: I36a2d05bc76e0193d369df42eb3b9f08416dd78f
Reviewed-on: https://dart-review.googlesource.com/51820
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2018-05-17 06:49:41 +00:00
Jens Johansen 8101ee0479 [kernel] Remove unused GlobalIndexer from ast_to_binary.dart
Change-Id: Ide2b8997d831f811fa278164a25139ea1fde0c5f
Reviewed-on: https://dart-review.googlesource.com/55460
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2018-05-17 06:03:02 +00:00
Konstantin Shcheglov 0ad2b1243d Use carbon copy buffer field instead of passing it around.
R=brianwilkerson@google.com

Change-Id: I96d60d3012687c152168032717569c32cf0dc314
Reviewed-on: https://dart-review.googlesource.com/55585
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-05-17 01:40:52 +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
Dan Rubel 6363cf6d3d Add new handleParenthesizedCondition event
* Extract parseParenthesizedCondition from parseParenthesizedExpression
* Update parsing of control structures to use parseParenthesizedCondition
* Add a new handleParenthesizedCondition event

Change-Id: I9972bfa3fa4060fc6de2e6315902c4c524c76544
Reviewed-on: https://dart-review.googlesource.com/55560
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-05-16 22:12:34 +00:00
Jenny Messerly 393a47441f fix #33138, local class name should not conflict with inline-JS in SDK
Also this removes the workaround for dart:html that used a RegExp to
attempt to match inline-JS code that might trigger the problem.

Change-Id: I74b447928aaeaca43b3a9241d42526c284dbeffa
Reviewed-on: https://dart-review.googlesource.com/55504
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Jenny Messerly <jmesserly@google.com>
2018-05-16 22:04:05 +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
Konstantin Shcheglov d91af4625c Fix fix import URIs from file:// URIs on Windows.
This fix the issue we see on bots.

R=brianwilkerson@google.com

Change-Id: I65dfde81a6194a8bbdbf860129d4c19b646ef730
Reviewed-on: https://dart-review.googlesource.com/55521
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-05-16 20:23:23 +00:00
Konstantin Shcheglov 53a51d17db Support for optional ImportPrefixGenerator to generate prefixes for new imports.
Only one import is generated for each library.
If there is already an import for a library, new prefix is not asked.
If a prefix was generated once, it is not possible to force another
import with a different prefix.

R=brianwilkerson@google.com

Change-Id: I1676a1953002060b5e7155ce90abf87b3bfe270e
Reviewed-on: https://dart-review.googlesource.com/55326
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-05-16 20:15:03 +00:00
Brian Wilkerson 338a423416 Add Forest support for creating try statements
Change-Id: Ib0241b929fa4c9eda533beec1e3f902973340821
Reviewed-on: https://dart-review.googlesource.com/55520
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-05-16 20:15:02 +00:00
Konstantin Shcheglov 757ef3979c Revert "Revert "Revert "Don't do implicit new/const code generation with --preview-dart-2 enabled."""
This reverts commit 4089111540.

R=brianwilkerson@google.com

Change-Id: I66297466f8baafe6e070acbcb1776b41f3d9fedc
Reviewed-on: https://dart-review.googlesource.com/55506
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-05-16 19:43:22 +00:00
Konstantin Shcheglov d9d7cb12a6 Replace DartFileEditBuilder.importLibraries() with importLibrary().
It now returns the text of the URI that will be actually used, so
we can show it in the quick fix message without computing it separately.

R=brianwilkerson@google.com

Change-Id: I16a455d8f6a3c3e3a9c5779c94d654de32992006
Reviewed-on: https://dart-review.googlesource.com/55501
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-05-16 18:46:22 +00:00
Konstantin Shcheglov f32509b849 Export 'resourceProvider' from AnalysisSession.
R=brianwilkerson@google.com

Change-Id: I0544be022a078f96be23c4e75923c32f70385589
Reviewed-on: https://dart-review.googlesource.com/55443
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-05-16 17:28:16 +00:00
Paul Berry 3466823189 Enable analyzer testing of pkg in strong mode.
Fixes #33116.
Fixes #28649.

Change-Id: I881eef1d23909b09c856515edbf8b5cee1821824
Reviewed-on: https://dart-review.googlesource.com/55302
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-05-16 16:31:42 +00:00
Martin Kustermann 775eeece8a [VM] Enable kernel2kernel constants evaluation in AOT for the VM.
Change-Id: Iff40aaf464f870235c9a15c4ee33385256e58023
Reviewed-on: https://dart-review.googlesource.com/55461
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2018-05-16 16:11:22 +00:00
Zach Anderson 42bcdcd332 [dart:io] Revert recent non-utf8 path handling
Reason for revert: Breaking API change blocks Flutter rolls. Reverting
to reconsider, work around, etc..

Revert "[ VM ] Fixed issue where backing array was deleted from an ExternalTypedData before the ExternalTypedData was used."

This reverts commit 916b9da48d.

Revert "[ VM ] Fixed tests for non-UTF8 paths on Windows / Macos."

This reverts commit 6327fe91c2.

Revert "[ VM ] Fix failing tests on Windows bots after non-UTF-8 paths change."

This reverts commit b51f4b7956.

Revert "[ VM ] Updated non-UTF-8 tests to expect exceptions on OSX/iOS."

This reverts commit bcb36247d2.

Revert "Revert "[ VM ] Updated non-UTF-8 tests to expect exceptions on OSX/iOS.""

This reverts commit 24450c79a5.

Change-Id: I756f74f4acdde168d0984fe130f05f9252366334
Reviewed-on: https://dart-review.googlesource.com/55441
Reviewed-by: Todd Volkert <tvolkert@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2018-05-16 15:47:10 +00:00
Danny Tuppeny 39fa25cbe2 Implement FILE_HEADER folding
Bug: https://github.com/dart-lang/sdk/issues/33033
Change-Id: I66833cc73b4adecf1743c623cfc2c7fbd9af45bc
Reviewed-on: https://dart-review.googlesource.com/55284
Commit-Queue: Danny Tuppeny <dantup@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-05-16 15:37:20 +00:00
Kevin Millikin 05deb5b2f5 Just apply covariant fixes
The implementation built up a list of closures and then immediately
looped over them to apply them.  It seems simpler to do the operations
directly in the first place and it's probably faster too.

Change-Id: I4f3ce4cd1cb1bc3169f1b7190d54118ec22b8bda
Reviewed-on: https://dart-review.googlesource.com/55223
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-05-16 14:49:38 +00:00
Martin Kustermann aafc2a6d43 Reland "[vm/kernel] Enable kernel2kernel "constants" transformation in AOT mode (after running TFA)"
The CL was originally committed in 039e8a175 (and reverted in
46ab040e5). The fix for the issue has landed in 9d9ce8d69 .

This time the CL will land in "disabled" form and will be enabled in a separate CL.

Change-Id: I3d5eb952230aee99875e3c58a6595691c5145e25
Reviewed-on: https://dart-review.googlesource.com/55361
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-05-16 12:48:38 +00:00
Dan Rubel 137942aca5 Implement TypeParamOrArgInfo.parseVariables
This CL is the next step in replacing parseType and improving recovery.
It introduces a new parseVariables method for parsing type parameters
(aka type variables) method in addition to improving recovery in the
parseArguments method.

Change-Id: I4049528152a7c731771d7a8145e5f79729165d79
Reviewed-on: https://dart-review.googlesource.com/55301
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-05-16 11:44:08 +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
Peter von der Ahé 4e9f455220 Ensure toString is always implemented on generators
Change-Id: Iedff0cd12652ec57400718cb3ad9e865623d9165
Reviewed-on: https://dart-review.googlesource.com/55280
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-05-16 10:45:08 +00:00
Peter von der Ahé 7a2afce0aa Convert LoadLibraryAccessor to LoadLibraryGenerator
Change-Id: I60d7c905df8fa133693ce981d15476c1792be36e
Reviewed-on: https://dart-review.googlesource.com/55129
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-05-16 10:45:08 +00:00
Peter von der Ahé 6a10efba11 Convert StaticAccessor to StaticAccessGenerator
Change-Id: Ie3265ce20ce6e6b5114f8866010579e485bdcd38
Reviewed-on: https://dart-review.googlesource.com/55125
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-05-16 10:45:08 +00:00
Peter von der Ahé 331d31f56c Convert SuperIndexAccessor to SuperIndexedAccessGenerator
Change-Id: I0b4b53373b248e88058f0353a293d57a6eae766e
Reviewed-on: https://dart-review.googlesource.com/55124
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-05-16 10:45:08 +00:00
Peter von der Ahé 21ae1a0ab7 Convert ThisIndexAccessor to ThisIndexedAccessGenerator
Change-Id: I2ea175bbaa391bf719ba7fa000c164eff701e8c4
Reviewed-on: https://dart-review.googlesource.com/55123
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-05-16 10:45:08 +00:00
Peter von der Ahé 7e7c795919 Convert IndexAccessor to IndexedAccessGenerator
Change-Id: Ib5c1ef8b78543a0d9e0a98e10d6c1315409d9246
Reviewed-on: https://dart-review.googlesource.com/55122
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-05-16 10:45:08 +00:00
Kevin Millikin fbb9f525be Make reportCrash generic
This avoids a runtime typecheck failure because Future is Future<dynamic>
which isn't a subtype of Future<T> for any T that is not a top type.

Change-Id: I067987e27177f3ed81ec14101c965488f1c35e2e
Reviewed-on: https://dart-review.googlesource.com/55281
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-05-16 09:59:23 +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
Johnni Winther baf09db165 Remove Resolution and Target
Change-Id: I30fb47acd820077b0dd9efebc3460a9a8a1e6e1f
Reviewed-on: https://dart-review.googlesource.com/55200
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-16 09:54:18 +00:00
Johnni Winther 944ce140e2 Remove most imports of elements/elements.dart
Change-Id: I4ecd45286fab1171eab1e2d3d443a0441bbdc883
Reviewed-on: https://dart-review.googlesource.com/55180
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-16 09:54:18 +00:00
Johnni Winther c18311933b Cleanup after removing MirrorsData
Closes #23873

Change-Id: Iaa7e0b1d4f0426280bdc496d47d7799ce30543fa
Reviewed-on: https://dart-review.googlesource.com/55167
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-16 09:54:18 +00:00
Johnni Winther fc7f18a420 Delete MirrorsData
Change-Id: Ic5330226349dafc33c27291aa576bfe4d0ea09e8
Reviewed-on: https://dart-review.googlesource.com/55160
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-16 09:54:18 +00:00
Johnni Winther 1f20129650 Remove mirrors analyses
Change-Id: I1a4a0d2bd1d87a5877864d46636ff68d0426a09c
Reviewed-on: https://dart-review.googlesource.com/55127
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-16 09:54:18 +00:00
Johnni Winther 47a67b2b8f Delete AST nodes
Change-Id: Iab9396b3a21cd9502c455fb73633216faed777ef
Reviewed-on: https://dart-review.googlesource.com/55126
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-16 09:54:18 +00:00
Johnni Winther f4fb1fe932 Remove most references to tree/tree.dart
Change-Id: I2ebcfdc616ee204e8e39277537e7e3c622caee42
Reviewed-on: https://dart-review.googlesource.com/55121
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-16 09:54:18 +00:00
Lasse R.H. Nielsen bf77f064c1 Mark NoSuchMethodError constructor as deprecated.
Move implementation details into patch files, it does not belong in the interface.
Actually implement NoSuchMethod.withInvocation in dart2js.

Change-Id: I37049c258067b962d18eff42196e37aa127f0dea
Reviewed-on: https://dart-review.googlesource.com/55166
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2018-05-16 09:09:08 +00:00
Danny Tuppeny 9b8776763c Add some (marked) failing tests for FILE_HEADER
Bug: https://github.com/dart-lang/sdk/issues/33033
Change-Id: I89d358dd1dc41d8bece7f16ed49fb98b9b8c0aa5
Reviewed-on: https://dart-review.googlesource.com/55104
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2018-05-16 07:35:48 +00:00
Jens Johansen 021b4a0bc8 Always reuse dart: libraries in computeReusedLibraries
We don't support invalidating `dart:` libraries, so there's no reason
to include such libraries in the computeReusedLibraries calculations:
They should aways be reused.

This CL does exactly that.

On 430 flutter tests, it changes the time it takes to execute
`computeReusedLibraries` by -15.7188% +/- 8.83679%
(-193.125 ms +/- 108.571 ms for all 430 tests) (at 95% confidence).

Said another way it reduces the average runtime for
computeReusedLibraries from ~2.8 ms to ~2.4 ms.

Change-Id: I23a68d4910c81be94b8d9d29495e63546bdad23f
Reviewed-on: https://dart-review.googlesource.com/52441
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2018-05-16 06:05:57 +00:00
Jens Johansen df931e97a6 Only test if package URIs are updated if that's possible
Before this CL we always translated a package import URI to file URI
to check whether the file URI had been updated.
This CL changes that so it only does that once* per invalidation of the
.packages file.

Running 430 flutter tests in "batch incremental compilation mode" and
timing computeReusedLibraries, this change, at 95% confidence, changes
the time by -61.7793% +/- 7.63375% (-1941.6 ms +/- 239.914 ms) for all
430 files, or on average reduces the time it takes to run
computeReusedLibraries from ~7.3 ms to ~2.8 ms.

The total compilation time varies too much for it make a difference
at 95% confidence on that figure though.

* Once is a loose term here, it's once per successful compilation, i.e.
if we get a compilation error that goes into erroneousComponent it
doesn't count and we have to do it again and again until we get into
a good state.

Change-Id: Id1b4534f515d8c0487362f743112b44ce1372ed0
Reviewed-on: https://dart-review.googlesource.com/52440
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2018-05-16 06:04:49 +00:00
Stephen Adams 38f0d8faef [dart2js] Check type bounds before value parameters
Change-Id: Ibd75aa67b478b201f1115e9f3dc682bcc5f108c6
Reviewed-on: https://dart-review.googlesource.com/55275
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-05-15 23:18:57 +00:00
Brian Wilkerson 874f7f6c5c Add Forest support for creating if statements
Change-Id: Ia7f1f672adee0e8da2e5c1c54f9690e7f2597263
Reviewed-on: https://dart-review.googlesource.com/55273
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-05-15 22:31:42 +00:00
Mike Fairhurst ddd1c3548f Add ability for the angular plugin to set ErrorVerifier.enclosingClass.
There is a similar setter on Resolver, and without it, users are seeing
an issue:
https://github.com/dart-lang/angular_analyzer_plugin/issues/567.

Alternative options to modifying pkg:analyzer APIs are few. One option
is to block UNQUALIFIED_STATIC_REFERNCE errors, however, that will be
too general. We would need to implement a lookup to double-check when
those errors are reported, if they should be.

Alternatively the plugin could block all of them, and then do a second
pass to provide them where the plugins deems they should exist.

This seems the easiest approach and mirrors the api that [Resolver.set
enclosingClass] provides, but the chain of assertions makes we want a
second look on it.

Change-Id: I12df71719c7a0e968a0b3a43cc27c69160ec5210
Reviewed-on: https://dart-review.googlesource.com/54703
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2018-05-15 22:28:47 +00:00
Brian Wilkerson 4b647fcfe1 Add Forest support for creating yield statements
Change-Id: I244d6e17dee72704c6cb5cc2c26b9379fac03440
Reviewed-on: https://dart-review.googlesource.com/55274
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-05-15 22:23:37 +00:00
Ben Konyi 916b9da48d [ VM ] Fixed issue where backing array was deleted from an ExternalTypedData before the ExternalTypedData was used.
Reland "Fix issues with FileSystemEntities which have non-UTF8 paths causing exceptions to be thrown when converting to/from a Dart VM String."

This reverts commit 4f549e2900.

Change-Id: Ia27c8c300beb178fa7b08ffe0bfcb2d61f65bbb5
Reviewed-on: https://dart-review.googlesource.com/55271
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2018-05-15 21:54:46 +00:00
Konstantin Shcheglov 8907348ae9 Issue 2246. Fix for 'Wrap with new widget' assist when activated on a constructor name.
R=brianwilkerson@google.com

Bug: https://github.com/flutter/flutter-intellij/issues/2246
Change-Id: I66ca8b121b2600fa86c787fc26fe6dc01c79c24d
Reviewed-on: https://dart-review.googlesource.com/55272
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-05-15 21:22:26 +00:00
Konstantin Shcheglov ee414b4d9d Issue 2249. Fix swap with parent/child when code is not formatted.
We cannot just rely on line ends.
AST is our best guide.

R=brianwilkerson@google.com

Bug: https://github.com/flutter/flutter-intellij/issues/2249
Change-Id: Id901878f621abc745fb6a380e5cf9afe21884642
Reviewed-on: https://dart-review.googlesource.com/55268
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-05-15 20:35:06 +00:00
Stephen Adams 8cf81446a3 Add method stubs to support instantiation stubs
Change-Id: Id9cce10b6319d268eb4ec2745465df5f06d3b906
Reviewed-on: https://dart-review.googlesource.com/55081
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-05-15 20:32:46 +00:00
Alexander Markov a2b1ce8418 [vm/kernel/bytecode] Add an option to drop AST if bytecode was generated
This CL adds experimental option --drop-ast to the gen_kernel tool in
order to remove AST bodies of members with bytecode.

Change-Id: Ib5f02eb189ec1ccd9fa77159c175fc3774998ce5
Reviewed-on: https://dart-review.googlesource.com/55262
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2018-05-15 20:04:36 +00:00
Brian Wilkerson e5853e6098 Remove some unused imports in kernel_ast_api
Change-Id: Ia92bb1c8e30f3f79a7aaa5d3b93e9461cce23c17
Reviewed-on: https://dart-review.googlesource.com/55261
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-05-15 18:05:58 +00:00
Brian Wilkerson fc5b12ac7b Delay invoking toKernelStatement until necessary; address other comments
Change-Id: I583aa89ba93f945e04e38be4565ace874e1c718a
Reviewed-on: https://dart-review.googlesource.com/55260
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-05-15 16:56:36 +00:00
Alexander Markov 6b65dcbcf6 [vm/kernel/bytecode] Support closures in bytecode generator
Change-Id: I038ba92c7bc210568d817ebaa109ca0ad02550e1
Reviewed-on: https://dart-review.googlesource.com/52988
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2018-05-15 16:51:06 +00:00
Martin Kustermann 9d9ce8d69a [VM] Ensure constant table is written in depth-first post-order
The addition of recently added [PartialInstantiationConstant] caused an
issue during constant table writing, becaused we the table writing code
wasn't updated.

This change uses visitChildren to guard against such changes in the
future.

Closes https://github.com/dart-lang/sdk/issues/33095

Change-Id: I3c6b19e1383c6825f11120b2d6255b8b747d0063
Reviewed-on: https://dart-review.googlesource.com/55161
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2018-05-15 15:17:36 +00:00
Brian Wilkerson fb2f43b175 Introduce toKernelStatement and toStatement to BodyBuilder
Change-Id: I4d3746c85370125c617cd1b331db095689ce4b5b
Reviewed-on: https://dart-review.googlesource.com/54963
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-05-15 14:33:21 +00:00
Jens Johansen fd26343f98 Fix invalidation not sticking on compile error
Before this CL, the invalidated URLs would be cleared sooner than we
threw away the old "userCode".
On a compile time error (issuing an erroneousComponent) we restore
the old userCode, thus in practical terms forgetting about whatever
had been invalidated prior to that.

This CL introduces a test and fixes the problem.

Change-Id: I8f5329c2f499ec3842d0b7d67e2eda1de1e7d938
Reviewed-on: https://dart-review.googlesource.com/52321
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2018-05-15 14:25:16 +00:00
Johnni Winther 3fc7925894 Add impact_test
Change-Id: Ic607d69375d1ad41f6aac349822e47c7dbf77b5a
Reviewed-on: https://dart-review.googlesource.com/54906
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-15 13:53:56 +00:00
Brian Wilkerson 55eba71759 Add Forest method to support the rethrow statement
Change-Id: Iffba18a8c81462373122c9204d758008448fbfed
Reviewed-on: https://dart-review.googlesource.com/55021
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-05-15 13:40:32 +00:00
Danny Tuppeny 5a3aff60b6 Update annotations to be a single region for all
Bug: https://github.com/dart-lang/sdk/issues/33033
Change-Id: I41586b53814d335046cc18c24936a3d32277deda
Reviewed-on: https://dart-review.googlesource.com/55100
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2018-05-15 13:39:54 +00:00
Brian Wilkerson 35b14de7b8 Use Forest to build throw expressions
Change-Id: I568edd93204056298b640a09a67fe128f2e2c206
Reviewed-on: https://dart-review.googlesource.com/55022
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-05-15 13:21:53 +00:00
Martin Kustermann f2b37ab643 [VM] Add support for conditions in switch-case expressions to "constants" transformation
This seems to be the last remaining case which causes constant
evaluation in the VM in AOT mode.

Change-Id: I37dba2c634afa3bebd918ebe6dd93ff52a7708e7
Reviewed-on: https://dart-review.googlesource.com/55163
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2018-05-15 12:52:22 +00:00
Samir Jindel 39c93a2b19 Revert "Revert "[vm/kernel] Expression execution through Kernel."
This reverts commit b5154dd01e.

Original revision is in patchset 1.

Change-Id: Ic0776011c6fdbd64c025086535351474a9a88b6e
Reviewed-on: https://dart-review.googlesource.com/54407
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2018-05-15 12:03:22 +00:00
Samir Jindel 1a23ff68a5 Fix incorrect handling of NSM forwarders and pull all logic into CFE. (Take 2)
The behavioral difference is that named and optional arguments are filled in
with their default values in the `Invocation` object passed to `noSuchMethod`.

On the implementation side we make NSM forwarders concrete and fill in their
bodies in the CFE. The custom (and somewhat hacky) VM support is no longer
needed, and Dart2JS can benefit from this implementation as well.

According to discussion on #33031 we will be able to re-land this soon without
breaking Mockito.

Prior failures on precompiler bots are fixed in Patchset 2.

Change-Id: If1b7fe4cf6da5ef38f330e1ad226121bcfc958a1
Reviewed-on: https://dart-review.googlesource.com/54401
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-05-15 11:23:32 +00:00
Jens Johansen 9d05ada522 Renamings and updated comments in class hierarchy #2
Follow-up to https://dart-review.googlesource.com/c/sdk/+/53804.

Change-Id: I8359985f60207ef92c365c9a6e3833be181b49be
Reviewed-on: https://dart-review.googlesource.com/55162
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2018-05-15 10:12:32 +00:00
Jens Johansen 68f2db2f66 Renamings and updated comments in class hierarchy
Follow-up to https://dart-review.googlesource.com/c/sdk/+/53662.

Change-Id: I47923ee7e83800ac9d1f77c5f0e39d4b64bcfc7a
Reviewed-on: https://dart-review.googlesource.com/55120
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2018-05-15 09:15:53 +00:00
Johnni Winther 6fe26e7e55 Delete ElementVisitor, equivalence_helper and move live Elements functions
Change-Id: I0af209210d4a471ba12f939bd8e3a429dab100df
Reviewed-on: https://dart-review.googlesource.com/54913
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-15 08:37:29 +00:00
Johnni Winther 0cd377fe33 Delete ConstantCompilerBase
Change-Id: Ib2d748d380713b742110c772fac2fe7d428b7ded
Reviewed-on: https://dart-review.googlesource.com/54911
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-15 08:37:29 +00:00
Johnni Winther af37d7def3 Remove ConstantCompiler
Change-Id: I5c8681de4d5b9865da6a6fbb42900d2a7d2b21c3
Reviewed-on: https://dart-review.googlesource.com/54910
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-15 08:37:29 +00:00
Johnni Winther f493274ce8 Delete more parts of resolution
Change-Id: I1c9ab31efa7c4a97f283275d5122c7b9a8762fb8
Reviewed-on: https://dart-review.googlesource.com/54908
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-15 08:37:29 +00:00
Johnni Winther 330271ed2b Delete modelx
Change-Id: I8f69655ee251cef097b46d80ddfbb7d2434b1051
Reviewed-on: https://dart-review.googlesource.com/54903
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-15 08:37:29 +00:00
Johnni Winther 351b90cb59 Delete NativeDataResolver
Change-Id: I91d2e1cb8d03bb1d0da7e175c810fa3cf3216962
Reviewed-on: https://dart-review.googlesource.com/54901
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-15 08:37:29 +00:00
Johnni Winther a86621318d Delete CompileTimeConstantEvaluator
Change-Id: I025566965d992829e93e84912d68317f145d96b2
Reviewed-on: https://dart-review.googlesource.com/54885
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-15 08:37:29 +00:00
Johnni Winther 76ab610097 Remove parser listeners and partial elements
Change-Id: Ifb5fffdca3a0e4f2bca7c35ae3c1a99490978ebf
Reviewed-on: https://dart-review.googlesource.com/54882
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-15 08:37:29 +00:00
Johnni Winther aeaa3b05c4 Remove more parts of resolution
Change-Id: Ic32851c32f4119b9682bb8538cfd7aa745ca7f09
Reviewed-on: https://dart-review.googlesource.com/54880
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-15 08:37:29 +00:00
Johnni Winther 4d76600b22 Delete SemanticSendVisitor
Change-Id: I0ccf8527e973dc5cfeac19caaaac026f91795e17
Reviewed-on: https://dart-review.googlesource.com/54860
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2018-05-15 08:37:29 +00:00
Johnni Winther 049d41ee36 Delete AST-based SSA builder
Change-Id: I16aa702eae335a01163a3b79d36bf4e60561756e
Reviewed-on: https://dart-review.googlesource.com/54841
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-15 08:37:29 +00:00
Johnni Winther 4fbd22c9e2 Remove AST-based inference
Change-Id: I368630e15d08ecbc0fdee288985746f90477159b
Reviewed-on: https://dart-review.googlesource.com/54822
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-15 08:37:29 +00:00
Peter von der Ahé 013bc60b22 Make most fields in Generators final
Change-Id: I3cd1d3c88c0572874b3fbfb4c1862898ce8037a4
Reviewed-on: https://dart-review.googlesource.com/55103
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-05-15 08:07:08 +00:00
Peter von der Ahé 6b9754d9b5 Convert SuperPropertyAccessor to SuperPropertyAccessGenerator
Change-Id: I9252da81d07b948b16ce0da4a0e989b63df996e5
Reviewed-on: https://dart-review.googlesource.com/55102
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-05-15 07:57:28 +00:00
Peter von der Ahé 60c825e1be Convert NullAwarePropertyAccessor to NullAwarePropertyAccessGenerator
Change-Id: I55a656f153cd6226f55fad47e952b065928754fb
Reviewed-on: https://dart-review.googlesource.com/54915
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-05-15 07:42:09 +00:00
Peter von der Ahé 5e4776eab9 Convert ThisPropertyAccessor to ThisPropertyAccessGenerator
Change-Id: Ib3a729db7b87192d47fb909d36aa1eff88fff29b
Reviewed-on: https://dart-review.googlesource.com/54914
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-05-15 07:39:57 +00:00
Peter von der Ahé 43ab0e51db Add Generator as shared base class for converted generators
Change-Id: I739f883e90c0e902b461e40f83aa478f67d593fd
Reviewed-on: https://dart-review.googlesource.com/54909
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-05-15 07:39:57 +00:00
Jens Johansen f08f61e84d Incremental ClassHierarchy
This CL turns the ClassHierarchy incremental and use that in two places:

* When compiling incrementally
* When performing the second ClassHierarchy computation after adding
  forwarding stubs.

Change-Id: I7046d6be9d7673dc0783a98789b5a25183b44799
Reviewed-on: https://dart-review.googlesource.com/53804
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2018-05-15 07:37:09 +00:00
Jenny Messerly 29afbf8f12 Implement constant evaluation for dartdevk
This builds on the VM's support for constants, and brings dartdevk to
parity with dartdevc. Also, constants are computed with arithmetic
operations that match runtime behavior (JS numbers).

Constants are limited in some cases right now: when building outline
kernel files (via pkg/dev_compiler/tool/build_pkgs.dart), constant field
initializers are not preserved, and this fact is not recorded, making
these fields appear to be implicitly null. dartdevk will recognize this
and avoid inlining the constant in these cases.

Change-Id: I5e6d95ccc32799da3bec1667ed16078a1a87d0bd
Reviewed-on: https://dart-review.googlesource.com/53121
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2018-05-15 06:04:18 +00:00
Alexander Markov 344c68e54c [kernel, vm] Revise how metadata is written in kernel binaries
Metadata is no longer written ahead of all nodes. Instead, metadata for
each node is written in the same context as the node itself (into a separate
buffer). This allows metadata to contain (serialize) arbitrary nodes
(for example, arbitrary DartTypes) and use serialization context of parent
nodes (such as declared type parameters).

However, with this change metadata looses the ability to reference
arbitrary AST nodes. This ability was overly restricted and had no
practical uses. (It was not possible to reference nodes which are not
reachable from root Component. As a consequence, it was not possible to
write references to arbitrary DartTypes.)

This change aligns the serialization capabilities of metadata with
how kernel AST nodes are serialized.

Change-Id: I027299a33b599b62572eccd4aa7083ad1dd2b3b3
Reviewed-on: https://dart-review.googlesource.com/54481
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2018-05-15 00:41:08 +00:00
Stephen Adams 65c4eebcf6 [dart2js] $async$self does not require a temp
Change-Id: Ief44aa36b67928cf33176410ebf1dfd5c794b024
Reviewed-on: https://dart-review.googlesource.com/55040
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-05-15 00:29:48 +00:00
Sigmund Cherem a06f7c9241 Remove dart:_isolate_helper.
The rest of the code was used in a single place, so I've moved the code to the
appropriate library.

Change-Id: Idd0416bf7365e3de05f20ab1184428ae7ae614b2
Reviewed-on: https://dart-review.googlesource.com/54745
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2018-05-15 00:21:28 +00:00