Commit graph

74977 commits

Author SHA1 Message Date
Liam Appelbe 0f14261176 Reland "[vm/wasm] Boilerplate for package:wasm"
This is a reland of 2bafc322fd

Original change's description:
> [vm/wasm] Boilerplate for package:wasm
>
> So far this just builds the wasmer library, copies it into the sdk
> directory, loads the library, and allows you to compile WASM modules.
> You can't actually do anything with the modules yet.
>
> Bug: https://github.com/dart-lang/sdk/issues/37882
> Change-Id: I7d7cfe5721bbe38a6afe76f326518e714d236ed4
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158367
> Commit-Queue: Liam Appelbe <liama@google.com>
> Reviewed-by: Ryan Macnak <rmacnak@google.com>

Bug: https://github.com/dart-lang/sdk/issues/37882
Change-Id: I8056df1e301acde2772ba2273148faa53d03173e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159321
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2020-08-21 18:23:00 +00:00
Konstantin Shcheglov 085076337b Add LocalVariableElement/PropertyInducingElement.hasInitializer, ParameterElement.hasDefaultValue, deprecate VariableElement.initializer
Change-Id: I02ba37b4f6f1ce79ffddf40613646b99ecbedc9d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159582
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-08-21 18:20:30 +00:00
Christian Altamirano 42dec58c01 [dart2js] Added powerset bits API and implemented most powerset queries
Change-Id: I3d0940df76e66049f3bd545b1a53dbe6036b4df2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158580
Commit-Queue: Christian Altamirano <coam@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2020-08-21 18:10:00 +00:00
Devon Carew 3ce72bb994 use dartdev for analysis on the bots; fix two analysis issues
Change-Id: I83beb65396e31b58bb0ffd25984ec322f01e9b99
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159641
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2020-08-21 17:24:10 +00:00
Paul Berry e8577913eb Sort declarations in edge_origin.dart
Change-Id: I8a410be295191abbaa332b0d626abd5320d32fb7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159585
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-08-21 16:58:20 +00:00
Alexander Markov 09a9026cf6 [vm/compiler] More accurate inference of LoadIndexed type
So far inference of LoadIndexed type was based on the reaching type
of array. However, in certain cases array definition type may provide
somewhat less accurate but more useful information about generic type of
array. This change improves inference of LoadIndexed type to also take
definition type into account.

Benchmarks in JIT mode with null safety:

MegaFieldHasGetterOnce +8-13%
MegaFieldIndirect +14-31%
MegaFieldHasGetterOnceIndirect +11-32%
MegaOnlyOverriddenOnceIndirect +11-26%
MegaOnlyOverriddenOnce +13-29%
MegaNeverOverriddenIndirect +40-55%
MegaNeverOverridden +36-52%
MegaField +47-59%

MegaOverriddenEvery2nd -23-24%
(This regression is due to an additional method inlining.)


Change-Id: I8ec3342ab05543f810f8415d6fea7cf2e2cdb3c2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159521
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2020-08-21 16:48:50 +00:00
Jens Johansen f190a4ae27 [CFE] Change sorting in textual outline
This CL basically change two things about the sorting:
* Entities are not sorted according to metadata. Metadata just follows
  along. Before "@a class B {}" would come before "class A {}" because
  "@" comes before "c". Now "class A {}" comes first because "A" < "B".
* Sorting happens on a token level, i.e. "F<int>" will now come before
  "F2<int>" because "F" < "F2" whereas before it was the other way
  around because "F2" < "F<" (because "2" < "<").

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

Change-Id: Ib1d887ab0c14519316c8e9a3da38f0dd49b4104f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159041
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-08-21 09:55:00 +00:00
Lasse Reichstein Holst Nielsen 0d322488ae Fix bug in Stream.multi.
The sync operations on a MultiStreamController did not check whether
sending events at the current time was allowed.
That could lead to `null` dereferencing errors when doing operations
on the controller after a cancel, and could cause events to appear
out of order.

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

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

Change-Id: Id19df710dff965250bfb7cf51d8756394cbe2067
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159080
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-08-21 09:38:37 +00:00
Alexander Aprelev 1c69c69650 [vm/resolve] Move class finalization out of lookup and resolve function methods.
This is to make sure that lookup can be done without getting a safepoint, which might be needed if class needs to be finalized.

Change-Id: I6ed52a56d53369327df0b85d7b04cf41a46ac690
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159188
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-08-21 02:57:07 +00:00
Konstantin Shcheglov 62bd19cac9 Extract VariableDeclarationResolver.
Change-Id: Ib88682ae56b3e1dd9717957d6f01571de5a685a3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159600
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-08-21 02:05:47 +00:00
pq 1e2772d106 invalid @doNotStore assignment analysis
TODO: follow-up with an `extensions_test`

Change-Id: Ie3d18229daf347885128d02e4b751436a8a0643f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159560
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-08-20 23:58:06 +00:00
Joshua Litt 1e1f407553 [dart2js] Correctly output class types when they are shadowed.
Change-Id: Ie0889a6312aa9f885059873dd8cb2debde64f2cf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158724
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-08-20 22:48:04 +00:00
Konstantin Shcheglov 514094b74b Resolver annotations for each node directly.
Specifically, don't rely on climbing up from VariableDeclaration(s).

R=brianwilkerson@google.com

Change-Id: I70225ce0b55f9ee2b3405e8a678cc2c854b2af6a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159561
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-08-20 21:23:39 +00:00
Robert Nystrom 7ec29a9b6d Add filtering to "--list-configurations".
I got tired of wading through the giant list and guessing at which one
matches the options I want to run the tests on, so I added filtering.
If you pass any of the common options like "-m", "-r", etc. when also
passing "--list-configurations", then it only prints configurations
that match those options.

Also, by default it only prints configurations that match the current
host OS.

Eventually, I would like *running* tests to work the same way, where
passing "-c" means "find me a config in the test matrix with this
compiler. But this seems like a good start.

Also, I removed the slow way that test.dart calls test.py to handle
--list-configurations now that those are all in the same package.

Change-Id: Ifabb415a9fad889afc12cfcd7dd81bd02c918612
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158980
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Karl Klose <karlklose@google.com>
2020-08-20 19:05:49 +00:00
Ben Konyi d11e89f516 [ Service ] Wait for DDS connection before outputting service connection
information

When dartdev and the VM service are enabled, the service should avoid
advertising its connection information until after DDS has connected in
order to prevent race conditions between DDS and external clients.

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

Change-Id: If6393f085e9147af628997a1f8936e84f9d8310c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/157462
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-08-20 19:00:59 +00:00
Stephen Adams ae462475f9 [dart2js] Try to preserve precision of bools in inferrer.
Use abstract type of constant for BoolConstantTypeInformation
as the AbstractValueDomain may have something more precise than 'bool'
for a true/false constant.

Evaluate short-circuit `&&` and `||` for constant inputs.
This can occur with named and -Dxxx= defined constants.

TODO: we should consider adding a node like a guarded-phi to
select an input, with possible boolean conversions on inputs.



Change-Id: I7f54503db87f6a6d2034ca59c16b4f1ff69ebbb6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159323
Reviewed-by: Christian Altamirano <coam@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2020-08-20 18:26:59 +00:00
Devon Carew 059a347580 update pubspec.yaml files to reflect actual package usage
Change-Id: I44dd6f5cb69e11a65a8c2b552a54b89ebc5fa4b5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159161
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-08-20 18:08:49 +00:00
Devon Carew f7006a91bb Add a tool to validate pubspec.yaml files in pkg/
Change-Id: If218f2aa48b58330cc506574d7dd68ad165a7b11
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159162
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Jaime Wren <jwren@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-08-20 18:05:49 +00:00
Devon Carew c40edde709 fix the pubspec.yaml change from https://dart-review.googlesource.com/c/sdk/+/159143
Change-Id: I7dbd1c30c1d404bf49d2a6e3e69296346948e72c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159540
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-08-20 17:28:43 +00:00
Konstantin Shcheglov 1c0a64ded5 Comments and renames in FlowAnalysisDataForTesting.
R=brianwilkerson@google.com

Change-Id: I75710e11b88bbed59e57bc1928f9e06bbd279c5b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159520
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-08-20 17:14:29 +00:00
Zichang Guo 4192405cbc Update trusted root certs
Bug: https://github.com/dart-lang/sdk/issues/32131
Change-Id: I376ef97fb82a6b50294c951690cbdcfe9f7ecc72
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159420
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
2020-08-20 16:57:19 +00:00
Devon Carew d26469f715 update the pubspec.yaml files to reflect actual package usage
Change-Id: I7a46c42dff3506cd5d09d3d793c072258e09a6e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159143
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-08-20 16:08:59 +00:00
Konstantin Shcheglov eb51dbc403 Fix prefix start for locations before a token.
Bug: https://buganizer.corp.google.com/issues/161242256
Change-Id: I67a5ee774090f155d53e9c71e7a06d848e1d9c72
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159324
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-08-20 15:51:59 +00:00
Konstantin Shcheglov 25edea3d8d Issue 43100. Verify local variable reads for null safety.
Bug: https://github.com/dart-lang/sdk/issues/43100
Change-Id: Ia8ece4de32f65d7912e534ce61936a45f2c768c0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159382
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-08-20 15:50:50 +00:00
Brian Wilkerson d52a577f3b Fix the correction message for late_local_final_already_assigned
Change-Id: I983c6e9a20020f148e16ec068c7edd8d698534ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159460
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-08-20 15:30:59 +00:00
Brian Wilkerson 90b2e5f576 Enhance DartEditBuilder.writeParameter to support the covariant and required keywords
Change-Id: I625196ff5786d9a6029db92809487d79e0e8d710
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159385
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-08-20 14:03:18 +00:00
Jens Johansen f5b1063f86 [CFE] Implement typeVariables and type for DillTypeAliasBuilder
This CL lets DillTypeAliasBuilder implement typeVariables and type
and adds a few test that crashed before.

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

Change-Id: I735a5d56cf2073be2a1c5f1fa142d98420ef9d19
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159440
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-08-20 11:36:38 +00:00
Tess Strickland e5cf5d9502 [vm/compiler] Add nullable boxed native field slots.
Previously, all boxed native field slots were marked not nullable.
However, several boxed native fields are in fact nullable, which means
that even generated IL that appropriately checks these fields for null
can break in optimized code when the null checks are removed.

Also add some helper utilities for working with representations.

Change-Id: I22703d14cfbadbabeae74179476dea47ace12161
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159280
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Clement Skau <cskau@google.com>
2020-08-20 11:36:00 +00:00
Jens Johansen 65968a481b [kernel] ast-to-text shows combinators for imports/exports
Change-Id: If153dded362eb1fe5f4c52a92206ff8e86579c1f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159248
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-08-20 10:24:48 +00:00
William Hesse ea96424c02 Reland "[build] Use Goma from depot_tools instead of $HOME/goma"
This is a reland of 7fc61e77e2

Original change's description:
> [build] Use Goma from depot_tools instead of $HOME/goma
> 
> Goma will only be distributed with depot_tools in the future.
> 
> Change-Id: Ia7a7faf76f2562bde97d4f88cfe5db02ba76b561
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152652
> Reviewed-by: Alexander Thomas <athom@google.com>
> Commit-Queue: Alexander Thomas <athom@google.com>

Change-Id: I6793b6003a40816a8b336273118f6ad983295800
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/157380
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2020-08-20 08:24:48 +00:00
Sam Rawlins d1a235d7d1 Bump dartdoc in to ~0.32.4
Change-Id: I526c928b54bfacb7abd863507820747581870f46
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159401
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-08-20 03:48:18 +00:00
Zichang Guo d5a1b84997 Add certs from Windows root stores to SSL trust store
Bug: https://github.com/dart-lang/sdk/issues/32131
Change-Id: I5f5890e8c6d0c4ff8c51ef7017f204d73ff9c4bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159202
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-08-20 02:14:08 +00:00
Konstantin Shcheglov 39e4dfe571 Update experimental_features.yaml, set experimentalReleaseVersion for non-nullable.
Bug: https://github.com/dart-lang/sdk/issues/43032
Change-Id: I28b27b3416826abd807a185b2d4214782571fb98
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159383
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
2020-08-20 01:38:48 +00:00
Joshua Litt 23372198a7 [dart2js] Remove unnecessary line.
Change-Id: I7b1f16d156d9cc10fde378aa4b8d69ab66ca701a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158160
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2020-08-19 23:02:08 +00:00
Srujan Gaddam f20b0ddcc2 [package:js] Remove stale TODOs from static error tests
Closes https://github.com/dart-lang/sdk/issues/43022

Real static errors were added in a previous CL. This simply removes
TODOs to address that and removes a TODO to handle contexts. Static
error testing doesn't support testing for contexts.

Change-Id: Id27fadeb77484a3556fdfdf4c50c8cd67ce2d9a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159381
Auto-Submit: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2020-08-19 22:04:58 +00:00
Konstantin Shcheglov 32ae7d9efc Switch tests for the new testing and remove ResolverTestCase.
R=brianwilkerson@google.com

Change-Id: I2bbf8a5194878389bca43d534bbf3bc116c5acbf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159302
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-08-19 21:54:47 +00:00
Brian Wilkerson 3c5a081c08 Update modify_parameters to handle post-deprected APIs
I also removed the support for updating overrides. I realized, after I'd
started to implement it, that we can't capture enough information in the
text file to be able to update overrides. I have an idea for an
alternative, but would love to hear any thoughts you might have.

Change-Id: I2c55e944384869f853e32238995c659aab49f520
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159380
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-08-19 21:08:27 +00:00
Alexander Markov 00ad7e3326 [vm] Throw NoSuchMethodError from external functions without body
According to Dart language specification:

  Attempting to invoke an external function that has not been connected
  to its body will throw a NoSuchMethodError or some subclass thereof.

Previously, VM was silently returning null, which is not correct.
This change fixes VM behavior so it throws NoSuchMethodError when
external function without body is called.

Fixes https://github.com/dart-lang/sdk/issues/43109
Fixes https://github.com/dart-lang/sdk/issues/42987
Fixes https://github.com/dart-lang/sdk/issues/42750
Fixes https://github.com/dart-lang/sdk/issues/42182

Change-Id: I6a145c5d8fa1eb61e8863ed55684b04b71fc6393
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159340
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2020-08-19 20:51:47 +00:00
Nicholas Shahan c1d18d72f2 [ddc] Fix issues with sdk compile from dill
- Wait for the file writes to complete before exiting.
- Only accept the arguments that are actually used.
- Consistently read the arguments that are passed.

Change-Id: I913b8bd35135495cb5e94e4f88555997aea42e54
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159181
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
2020-08-19 20:26:47 +00:00
Devon Carew c04ef0ba96 [dartdev] update the link to the 'dart migrate' migration docs
Change-Id: Ide264b97d4dd192a015b6b53b63521452dd64322
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159303
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2020-08-19 20:18:07 +00:00
Paul Berry 66501778e7 Run MethodInvocationResolutionTest cases in null safety mode.
Previously, MethodInvocationResolutionTest contained a bunch of useful
tests that should pass in both legacy and null-safety modes (with some
minor changes to expectations), but they were only run in legacy mode
(and a very small set of tests were run in null-safety mode).  This CL
moves those tests to a mixin so that they get run in both modes.

This is necessary because in follow-up CLs I will be changing the type
analysis rules for method invocations in null safety mode (in
accordance with
https://github.com/dart-lang/language/blob/master/accepted/future-releases/nnbd/number-operation-typing.md),
and I want to make sure not to lose test coverage.

Bug: https://github.com/dart-lang/sdk/issues/42629
Change-Id: I263d8422bc2d110dcc7954c7521bd084b7ea839e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159360
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-08-19 19:56:37 +00:00
Devon Carew 8a0b75ced1 update the pubspec files to reflect actual package usage
Change-Id: I1fa259d0a9e827c7491312ce2e5ffe8261147038
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159142
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2020-08-19 19:40:47 +00:00
Paul Berry 4280e0a819 Fix crash when a null shorting expression is null checked.
Postfix increments and decrements are null-shorting expressions
(e.g. `x?.y++.isEven` only calls `isEven` if `x` was non-null), but it
is still being decided whether postfix `!` should be null shorting
(i.e. whether `x?.y!` should fail if `x` is null).  See
https://github.com/dart-lang/language/issues/1163.

Previously, the analyzer was inconsistent about whether it considered
`!` to participate in null shorting; as a result, when analyzing an
expression like `x?.y!`, the analyzer would fail to call
`FlowAnalysis.nullAwareAccess_end`, resulting in corrupted flow
analysis state, which could lead to a crash.

This change makes the analyzer treat `!` as *not* participating in
null shorting, which is consistent with what is currently written in
the spec and implemented in the CFE.

Fixes #43093.

Change-Id: Ie69c5c29f226fe1a0282d0e7a1e079778dc700c3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159147
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-08-19 19:35:57 +00:00
Jacob MacDonald 1522a867ca add --strong-null-safety flag to the kernel worker
Bug:https://github.com/dart-lang/sdk/issues/43091
Change-Id: I716d2ea6cf1c95be3911c32b1b2958788fe917ef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159183
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
2020-08-19 18:57:47 +00:00
Alexander Markov 5e551dd926 [vm/aot/tfa] Avoid stack overflow in TFA due to deeply nested calls
Issue: https://github.com/flutter/flutter/issues/63560
Change-Id: I995adf4c7ee17123f9a4979e07e651911c9577db
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158720
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2020-08-19 18:39:27 +00:00
Konstantin Shcheglov 2b7fc8f134 Update FeatureSet to the new rules.
Bug: https://github.com/dart-lang/sdk/issues/43032
Change-Id: I6c7d7dc56fd0d4edcc3c6f6cc6fb0422316b8f4c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159187
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-08-19 18:27:37 +00:00
Alexander Markov 816fd08b92 [vm/compiler] Infer more accurate generic type of list factory constructors
For recognized list factories, which take constant type arguments,
compiler can infer full generic type in addition to cid.
This helps remove AssertAssignable when creating List<List<...>> with
List.generate constructor.

Havlak +3.7-10% in JIT mode with null safety.

Change-Id: I0a050c9a0d3604ffcfd1a0afa0f123a07e9ac03a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159185
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2020-08-19 17:16:26 +00:00
Alexander Markov fdd01da670 [vm/compiler] Streamline code generated for empty list literals
Previously, empty list literals were generated as

  List<E>._fromLiteral(const [])

List._fromLiteral checks if the argument is an empty list and
calls _GrowableList<E>(0) in such case.
If List._fromLiteral is not inlined, this adds an unnecessary overhead.

Now empty list literals are generated more directly as

  _GrowableList<E>(0)

Havlak +15.58% in AOT mode with null safety.

Change-Id: I6723e1e912cd0bbcbbb622f928d912c554217e5e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159201
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2020-08-19 17:15:26 +00:00