Commit graph

20192 commits

Author SHA1 Message Date
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