Commit graph

55628 commits

Author SHA1 Message Date
Peter von der Ahé
bc86dc1dd6 Remove unused reify transformation
Change-Id: I4d29e3372b9aaf6bc7f1849e9fc0fb27f63e5c5f
Reviewed-on: https://dart-review.googlesource.com/54223
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Karl Klose <karlklose@google.com>
2018-05-14 14:48:57 +00:00
Samir Jindel
184e2a8b4c [vm] Support partial instantiation of noSuchMethod forwarders in VM.
This is complicated by the fact that the normal factory method for creating
Invocation objects references the arguments descriptor to determine how many
type arguments are passed. This doesn't work for partially instantiated
closures, because the arguments descriptor will say "0" type arguments even when
there may be delayed type arguments attached to the closure from partial
instantiation. The arguments descriptor can't be modified, so we have a new
factory method which takes the number of delayed type arguments directly.

Change-Id: Ic9a35a482b3b7ef80564e674cc6207873e255111
Reviewed-on: https://dart-review.googlesource.com/54245
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2018-05-14 14:34:58 +00:00
Peter von der Ahé
abb861d812 Remove pkg/kernel/lib/frontend directory
Removing this directory as it is mostly unused.
Closure conversion still relies on VariableAccessor, so I moved it
there.

We should consider removing closure conversion. I don't believe we
actually use it.

Change-Id: I885620b310c4d1bf3a9b9b805188921bc242a993
Reviewed-on: https://dart-review.googlesource.com/54221
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-05-14 14:25:38 +00:00
Johnni Winther
e7bae4c8fd Use int.tryParse in sourcemap_testing
Change-Id: I7e2f51628604cc7522752b7b67d3c5b6775901c2
Reviewed-on: https://dart-review.googlesource.com/54905
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2018-05-14 13:56:18 +00:00
Brian Wilkerson
37d028e17c Fix some issues in the test framework
Change-Id: I26b2ff2427db2db135b8969bf8c1a892ef22d891
Reviewed-on: https://dart-review.googlesource.com/54800
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-05-14 13:32:38 +00:00
Peter von der Ahé
f97695e7dd First step towards renaming Accessor to ExpressionGenerator
I want to merge the class hierarchy, for example, merge Accessor and
FastaAccessor into a class called named ExpressionGenerator.

I also plan to get rid of all the _FooAccessor classes by merging them
with their non-private subclass.

I also plan to rename all the Accessor classes to use the word
Generator instead of Accessor.

Change-Id: I271f56077d02f98cc5981760e370ff91c0864400
Reviewed-on: https://dart-review.googlesource.com/54201
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-05-14 13:25:37 +00:00
Brian Wilkerson
74db253d34 Allow metadata on enum constants
Change-Id: I2aed6df1fd5f20da865339fdc86cad3bc66f0770
Reviewed-on: https://dart-review.googlesource.com/54621
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-05-14 13:20:10 +00:00
Peter von der Ahé
a26951cef9 Skip tests we don't care about in legacy mode
We're running dartk legacy tests to preserve test coverage of
language and co19 test suites on Fasta. We don't care about
service and standalone suites, as these are tested in strong mode.

Change-Id: I0784d2f434926f0e50373c506e559e16a3c26486
Reviewed-on: https://dart-review.googlesource.com/54902
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2018-05-14 13:13:17 +00:00
Jens Johansen
7b3ba3f41f ClassHierarchy refactorings
This CL:
* Removes unused functions in the ClassHierarchy
* Turns the data structures used in the ClassHierarchy upside down
  (nodes have a lists of supers instead of lists of subs)
* Factors some things that needs the original list-of-subs into another
  class that the user can ask the ClassHierarchy to compute if needed.
  It appears that it isn't generally.

This is step #1 in turning the ClassHierarchy into an incremental
ClassHierarchy.

Change-Id: I48c5731c01c1b0e8bf1fcd4ddba7f2bf7ce3b9c9
Reviewed-on: https://dart-review.googlesource.com/53662
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2018-05-14 11:33:20 +00:00
Jens Johansen
94a6a48edd Don't encode strings up front; don't toString uris
Second try. First try was reverted because a previously empty URL (the
default 'always there' one) is now a null url instead, which wasn't
handled properly in the frontend_server.

See 47e9039512 for original details.

This reverts commit 4c9b712052.

Change-Id: I717eb927cbe29b6388e72f7e270428d234d44e4d
Reviewed-on: https://dart-review.googlesource.com/53580
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-05-14 11:31:58 +00:00
Aske Simon Christensen
4bcb23c2af Status file update
Change-Id: I7a24a113b26470468bb3a4ed3af216f7019964d4
Reviewed-on: https://dart-review.googlesource.com/54884
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2018-05-14 11:31:16 +00:00
Aske Simon Christensen
f5130108ea Some triage of missing compile-time errors in Fasta
Change-Id: Ia7601f7296e2da66ca234a94c57105c366d94a06
Reviewed-on: https://dart-review.googlesource.com/52800
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Karl Klose <karlklose@google.com>
2018-05-14 10:18:17 +00:00
Jens Johansen
22c80a4e14 Test for constructor having type parameter
Change-Id: I766ac78f087b3396c5bf09d92fce55b381cda1ef
Reviewed-on: https://dart-review.googlesource.com/54391
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2018-05-14 09:16:17 +00:00
Kevin Millikin
0c55fdcc2e Remove a stale TODO
Change-Id: I7981829a86daf7b2eb5aec6ee357777cefbd3248
Reviewed-on: https://dart-review.googlesource.com/54384
Reviewed-by: Karl Klose <karlklose@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
2018-05-14 08:57:27 +00:00
Peter von der Ahé
664a3b7769 Use Forest API in Accessors.
Change-Id: I7ee61ed51d8141bd4c7bef335eaf9cb1e1e6277c
Reviewed-on: https://dart-review.googlesource.com/54040
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-05-14 08:51:47 +00:00
Kevin Millikin
896cf38eca Stop using some deprecated APIs
Change-Id: Id75c317c6728fb2bd5f374e00c8a8f2e8556ded2
Reviewed-on: https://dart-review.googlesource.com/54840
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
2018-05-14 08:42:07 +00:00
Johnni Winther
d0d265b5a7 Remove GraphBuilder.commonMasks
Change-Id: I477054bf4d05772e1c2e3d14a0862b8528661fcb
Reviewed-on: https://dart-review.googlesource.com/54390
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-14 08:29:57 +00:00
Johnni Winther
c71e680152 Delete ResolverVisitor and friends
Change-Id: I012a86ca2d0f1986b226f1e4fea20ee295ccb6ed
Reviewed-on: https://dart-review.googlesource.com/54409
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-14 08:14:07 +00:00
Johnni Winther
f75db77597 Delete ScannerTask, DietParserTask and TypeCheckerTask
Change-Id: I5dede24df4583a7bd6d6d493e8f55c257bc8f0bc
Reviewed-on: https://dart-review.googlesource.com/54408
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-14 08:14:07 +00:00
Johnni Winther
14537e3a2f Delete LibraryLoader and patch parser
Change-Id: I0ea824541ec3b5b204577d4cd1da32ffba30c071
Reviewed-on: https://dart-review.googlesource.com/54405
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-14 08:14:07 +00:00
Johnni Winther
506c8819ae Delete CompilerResolution, ResolutionFrontEndStrategy at al.
Change-Id: I13698f02d5c9af878750290ad1aef8d32777684f
Reviewed-on: https://dart-review.googlesource.com/54403
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-14 08:14:07 +00:00
Johnni Winther
d4c7a444fe Support isTry optimization in phi-nodes for kernel
Change-Id: Ia9c4b239b135eab7a7d02773b89b614407119156
Reviewed-on: https://dart-review.googlesource.com/54389
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2018-05-14 08:12:09 +00:00
Alexander Thomas
b651b0ebcd [release] Prepare changelog for 2.0.0-dev.55.0
TBR=whesse@google.com

Change-Id: I91d7691c6e3d983c804c6a09b7fb136a78d247dd
Reviewed-on: https://dart-review.googlesource.com/54820
Reviewed-by: Alexander Thomas <athom@google.com>
2018-05-14 06:55:54 +00:00
Brian Wilkerson
4b239de27c Add the remaining parser tests
Change-Id: If08036b0911651d12a1f51c24406a2b87937757a
Reviewed-on: https://dart-review.googlesource.com/54700
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
2018-05-12 20:20:55 +00:00
Danny Tuppeny
a1a2711120 Remove references to deprecated class
Change-Id: Ie61ae31e2366f3e26601839d1b9e7a100797f894
Reviewed-on: https://dart-review.googlesource.com/54760
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2018-05-12 15:42:57 +00:00
Jenny Messerly
7359d4ee10 fix #33019, noSuchMethod should receive default values for optional args
Change-Id: If692a68d20c88139a88de8c9701314ae53becd03
Reviewed-on: https://dart-review.googlesource.com/54340
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-05-12 04:18:40 +00:00
asiva
c2860dec50 Ensure app-jit snapshots generated with --preview-dart-2 work.
Change-Id: I437573479c0044cf8e4af481650de92eec052c36
Reviewed-on: https://dart-review.googlesource.com/54630
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2018-05-12 00:17:22 +00:00
Stephen Adams
c75cbdff05 [dart2js] unreachable-throw experiment
Make functions that are unreachable throw if entered.
Use like this:

DART_VM_OPTIONS='-Dunreachable-throw=true' dart2js ...

TBR=sigmund@google.com

Change-Id: Ia4ebab797143886f87f36bc696accfb65b36f478
Reviewed-on: https://dart-review.googlesource.com/54740
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-11 23:27:42 +00:00
Jenny Messerly
147bd68ad3 disable dart:mirrors in DDC unless emit-metadata is set
fixes #32294

Change-Id: I5fde124a9da61e512ea0aa41cc84574e27a50d48
Reviewed-on: https://dart-review.googlesource.com/53163
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2018-05-11 23:13:30 +00:00
Brian Wilkerson
c0f2721e85 Use the type system to compare types (issue 30897)
Change-Id: I6ae706255bcf09276627a9e27fe2f12ea15bb203
Reviewed-on: https://dart-review.googlesource.com/54715
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-05-11 23:04:33 +00:00
Régis Crelier
6d7d6fdf01 [VM interpreter] Recover EntryOptional bytecode, improve interpreter tracing.
Change-Id: I51a4bd6ac5b55ff0250965386199057c723d7fdb
Reviewed-on: https://dart-review.googlesource.com/54742
Reviewed-by: Zach Anderson <zra@google.com>
2018-05-11 22:39:49 +00:00
Konstantin Shcheglov
e3966fcfb9 Protocol for runtime completion.
This protocol will be used to support "Evaluate Expression" and "Watch"
window features in IDEs.

Change-Id: Ibde1e88507a66d8c487836a227dfeb13ffd77d9d
Reviewed-on: https://dart-review.googlesource.com/54629
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Jacob Richman <jacobr@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-05-11 22:23:42 +00:00
Konstantin Shcheglov
4a323f8aef Stop spamming to the console from analyzer tests.
R=brianwilkerson@google.com

Change-Id: I43545d4205a012c03e73b04d5a73737f8034714c
Reviewed-on: https://dart-review.googlesource.com/54713
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-05-11 20:45:53 +00:00
Sigmund Cherem
3c22fc9216 Allow null nonce
This should fix the bots for FF and safari.  (Chrome returns '', but FF and
Safari return a null value.)

TBR=sra@google.com

Change-Id: I9a402d3c9f4fed09b9181a8ec29f68ff6770e509
Reviewed-on: https://dart-review.googlesource.com/54714
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2018-05-11 20:41:59 +00:00
Alexander Markov
400c1f1797 Update status for passing test after constant evaluation was reverted
This is a follow-up to reverting constant evaluation in
46ab040e58.
The issue https://github.com/dart-lang/sdk/issues/33086 appears only
if constant evaluation is enabled.

Change-Id: I719f1fde3cf8a87150a815ce7a6cdab68e26eef9
Reviewed-on: https://dart-review.googlesource.com/54709
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2018-05-11 20:10:49 +00:00
Konstantin Shcheglov
bdecb92032 Fix MinimalPlugin to allow its loading in Dart2 VM.
R=brianwilkerson@google.com

Change-Id: I9e52979cee844f32e4d423a7c928c0359f9dd5b2
Reviewed-on: https://dart-review.googlesource.com/54708
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-05-11 19:47:09 +00:00
Ryan Macnak
1ecad6e743 [vm] Remove ObjectMirror.getField/setField optimization from mirrors.
This optimization depends on an always-present Dart compiler, which is broken by the architecture of the CFE.

Change-Id: I2e3dfd514d6a4c19a09638719f09371bfb158106
Reviewed-on: https://dart-review.googlesource.com/54706
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-05-11 19:43:50 +00:00
Ryan Macnak
1e28b8987d [vm] Reify even more generics in the mirrors implementation to appease Dart 2.
Bug: https://github.com/dart-lang/sdk/issues/33091
Bug: https://github.com/dart-lang/sdk/issues/33098
Change-Id: Ibecce1274b9bda47e387d109a29a5af4d53adb7f
Reviewed-on: https://dart-review.googlesource.com/54704
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2018-05-11 19:18:49 +00:00
Brian Wilkerson
e057c4bdbf Fix the resolution tests when run locally
Change-Id: I6faee8b8e0f9df6b2aa3405b53cfdfcccccc7bb0
Reviewed-on: https://dart-review.googlesource.com/54707
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-05-11 19:07:29 +00:00
Konstantin Shcheglov
242bc3413c Copy @failingTest annotations to mixin applications.
This works around https://github.com/dart-lang/sdk/issues/33099

R=brianwilkerson@google.com

Change-Id: Idfada538b30fe6d8cce2d23112787522e5d19521
Reviewed-on: https://dart-review.googlesource.com/54705
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-05-11 18:31:00 +00:00
Zach Anderson
46ab040e58 Revert "[vm/kernel] Enable kernel2kernel "constants" transformation in AOT mode (after running TFA)"
This reverts commit 039e8a1755.

Reason for revert:
Blocks the roll into Flutter.
See https://github.com/dart-lang/sdk/issues/33095

Original change's description:
> [vm/kernel] Enable kernel2kernel "constants" transformation in AOT mode (after running TFA)
> 
> This CL also uses the newer `onProblem` error reporting mechanism, which supports contexts.
> 
> The errors by the constant evaluator are formatted e.g. like this:
> 
>     .../language_2/compile_time_constant_o_test_01.dart:14:8: Error: Duplicate keys are not allowed in constant maps (found duplicate key "StringConstant(foo)").
>       "foo": 499
>        ^
>     .../language_2/compile_time_constant_o_test_01.dart:32:24: Context: While analyzing:
>       Expect.identical(m1, m3);
> 
> Change-Id: I463416e14686e218b0f08903bd6aa0bca7392260
> Reviewed-on: https://dart-review.googlesource.com/53021
> Commit-Queue: Martin Kustermann <kustermann@google.com>
> Reviewed-by: Aske Simon Christensen <askesc@google.com>
> Reviewed-by: Alexander Markov <alexmarkov@google.com>

TBR=vegorov@google.com,kustermann@google.com,alexmarkov@google.com,askesc@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I1af0200dcb0aef03c7bd9ba3b5aead1565f05708
Reviewed-on: https://dart-review.googlesource.com/54720
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Todd Volkert <tvolkert@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2018-05-11 17:50:46 +00:00
Sigmund Cherem
c7683ad41b Support strict CSP in dart2js.
dart2js will now set the CSP nonce on scripts that are inserted for deferred
loads. Note that this change only applies to the default hunk loader. Custom
hooks need to set the nonce value manually.

Fixes https://github.com/dart-lang/sdk/issues/33061

Change-Id: I04abc7904dff22dad586690d175b87c77c3f1fe2
Reviewed-on: https://dart-review.googlesource.com/54702
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2018-05-11 17:41:07 +00:00
Alexander Markov
3ca5d165af [frontend server] Add an option to generate delta kernel file
This change adds experimental option '--import-dill' to front-end server
to specify existing kernel file to import when compiling a new one.
Newly generated kernel file will depend on the imported one and will
omit libraries available in the imported dill file, as well as platform
libraries.

Caveat: the new option is not compatible with '--incremental'.
Change-Id: Id637908afdb12f1829e5f634251fa9ad82676baf
Reviewed-on: https://dart-review.googlesource.com/54309
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2018-05-11 17:18:26 +00:00
Alexander Markov
0f9cbf5885 [vm/kernel/bytecode] Fix bytecode generation for StaticSet
Change-Id: I42fd72ba0b7226fb5e33958af8b242e26f26e811
Reviewed-on: https://dart-review.googlesource.com/54661
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2018-05-11 17:16:06 +00:00
Brian Wilkerson
7a76db73d1 Add more parser tests for Fasta
Change-Id: I126f028ced01ac0624f080269a6a40d7de4a248d
Reviewed-on: https://dart-review.googlesource.com/54637
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
2018-05-11 13:51:16 +00:00
Danny Tuppeny
68229b862f NPE fix for annotations with no arguments
Change-Id: I93254aeef708157566a3adf942ebc84902e3c02c
Reviewed-on: https://dart-review.googlesource.com/54680
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2018-05-11 13:38:27 +00:00
Dan Rubel
3acf46386d Remove unused code
Change-Id: I100f37dbc9aa45856030b1c5c3c6f5d146dd1dfd
Reviewed-on: https://dart-review.googlesource.com/54604
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-05-11 13:30:06 +00:00
Dan Rubel
491c65a902 Replace calls to parseTypeArgumentsOpt and others
* Replace several calls to parseTypeArgumentsOpt with computeTypeParamOrArg
* Replace isValidMethodTypeArguments with computeMethodTypeArguments
* Fix TokenStreamRewriter.splitGtGt to preserve preceeding comment
* Switch to using computeTypeParamOrArg and remove redundant code

Change-Id: Ic4cab3ca91de8c0c9738f43ca208cdbf2ead6057
Reviewed-on: https://dart-review.googlesource.com/54603
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-05-11 13:28:06 +00:00
Stephen Adams
ef6e19a83a [dart2js] Implementation of extractTypeVariables
Change-Id: I80272dade861e30440f64fe36c1bf4bb5cd2eb8a
Reviewed-on: https://dart-review.googlesource.com/54625
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-11 01:37:45 +00:00
Nate Bosch
57dee60d4d Update to latest pub
Change-Id: I34de418baa3e3a202edb129e3d88f751473e0d3d
Reviewed-on: https://dart-review.googlesource.com/54636
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2018-05-11 00:03:35 +00:00