Commit graph

32103 commits

Author SHA1 Message Date
Liam Appelbe 2bafc322fd [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>
2020-08-18 23:55:31 +00:00
Mayank Patke 1cec77f0a6 [dart2js] Fix impliedClasses logic during RTI resolution.
This code was inadvertently falling through to the `throw` if `VoidType`
was encountered (although this case currently never happens). In
addition, we were missing cases for some of the newer `DartType`s.

This CL fixes those cases and removes Object from the classes implied by
`DynamicType`.

Change-Id: Ibfecd92c0113d11eb8870d511d60cbc34ac1bfa0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159020
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2020-08-18 23:20:00 +00:00
Konstantin Shcheglov 1c5a17b212 Don't refresh files when they are not notified as changed.
The refresh was causing "Cycle loading state error", so it is possible
that this CL will fix this long standing issue.

Bug: https://github.com/dart-lang/sdk/issues/43073
Change-Id: Id1eeacd01cf10e918b002d227c8942e38bed543c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159140
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-08-18 21:15:00 +00:00
Devon Carew da2bff9c96 update the dartdev pubspec file; various lint fixes
Change-Id: Ib4bc6af7f77001895cbc534ef64c6d999008695f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159160
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2020-08-18 17:12:45 +00:00
Devon Carew 932712b602 update pubspec to reflect actual packages used
Change-Id: I02b10f92d858d0303f1a71e649395fb013f437aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159141
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2020-08-18 17:11:30 +00:00
Jaime Wren 90756064f9 If the machine is a bot such as a CI machine, prevent the 'The Dart tool uses Google Analytics to anonymously report feature usage...' message from being printed from dartdev.
Bug: https://github.com/dart-lang/sdk/issues/43046
Change-Id: I63c1d73bfd31af14e0a93669a43994222e2f3a50
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158920
Reviewed-by: Jonas Jensen <jonasfj@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
2020-08-18 17:04:40 +00:00
Stephen Adams e09249f97d [dart2js] Clean up old code in types_propagation
This code worked around bugs in how TypeMasks were generated 4+ years
ago. Now subtype cones are generated from the least upper bound of
instantiated subtypes, resulting in TypeMasks that are no longer
disjoint for 'double' and 'int'.

Change-Id: I7189c4447f2c41db7abb7a0ea1240eca6e28aa7f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159000
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2020-08-18 16:56:10 +00:00
Ryan Macnak 56a4d7c5f8 [vm] Support --use_table_dispatch when splitting snapshots.
When reading a secondary snapshot, re-run the dispatch table initialization found in the root snapshot. Since each loading unit's contribution to the dispatch table is scattered, it would take more snapshot size to try to serialize their contributions separately. We'll revisit this when we can defer Class, Function and Code, which will prevent the root snapshot from referencing all Codes.

Bug: https://github.com/dart-lang/sdk/issues/41974
Change-Id: Iefd2b98647b96ae59a7efe92897538f5cf8c2426
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158923
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-08-18 16:46:50 +00:00
Mayank Patke 41953c8835 [dart2js] Rewrite lib/html/js_typed_interop_type_test to use external
fields.

This brings it more in line with the lib_2 version.

Change-Id: I99e4f6a467fa5b58d6e7c5206e1f6d9956fc60bc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158961
Auto-Submit: Mayank Patke <fishythefish@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-08-18 15:46:20 +00:00
Konstantin Shcheglov a51f1747e0 Prepare to publish analyzer 0.40.0 and _fe_analyzer_shared 8.0.0.
Change-Id: I126207dcc47885565a3a6d7002ff15ad3cc493c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122483
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-08-18 15:12:10 +00:00
Konstantin Shcheglov 2bf61f4936 Don't call getFileSync() in tests.
I see no reason why this would be useful.

But it might be harmful.
When we create file1 that imports file2, and call getFileSync(file1),
the analyzer will read both file1 and file2 while building the
file graph. So, when we then create file2, it will not be read unless
we call changeFile(file2). And we don't.

Actually, if we want to simulate how migration works, we should first
create all files, and then migrate them.

R=paulberry@google.com

Change-Id: I22ff994d346c4ad985e5d06a34e9fd854d451757
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158960
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-08-18 14:58:30 +00:00
Brian Wilkerson 4af6831020 Add support for modifying parameters in a data-driven fix
Change-Id: I756df3e665c24cbf5131a0aae1c1526c08a5d172
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158940
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-08-18 14:56:40 +00:00
Mayank Patke bd672a90af [dart2js] Improve simplification of type tests.
Change-Id: I29fd8e32145df61816bf98dd9fdc2dac33cafc75
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/157662
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2020-08-18 09:14:10 +00:00
Mayank Patke e0c956065a [dart2js] Fix nullability handling in createFromStaticType.
Previously, we were creating nullable typemasks and then stripping off
the nullability if non-nullability was specified. We should be assuming
non-nullability as the default and adding nullability in if required.

The former approach has the issue that typemasks for `Null` keep getting
converted to empty typemasks when we try and remove the nullability.

Change-Id: I58907c1c45c756f023d67043ce88eb82c4b1589c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158371
Reviewed-by: Stephen Adams <sra@google.com>
2020-08-18 09:14:10 +00:00
Stephen Adams d2057a0b57 [dart2js] Check non-nullable native call values
When `--null-assertions` is enabled, values returned from @Native
methods and getters with non-nullable return types are checked.

Change-Id: I4b38e651a9a6b370ebed5420a3cfac0a53cfeb60
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158527
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2020-08-18 01:52:55 +00:00
Stephen Adams 6d2390ad8c [dart2js] Add some codegen metrics
- count decided conditions
- count various kinds of interceptor use

Change-Id: Iea8fde8555cfa7247ef78651fb11262e9295c876
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158503
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2020-08-18 01:52:05 +00:00
Paul Berry 5642366611 Null safe numbers: plumb element through to refineBinaryExpressionType.
The new rules for null-safe number promotion apply to both operators
and ordinary method calls, so I'll be implementing them in terms of
MethodElement.name rather than an operator TokenType.  To make this
possible, we need to pass the method element to
TypeSystem.refineBinaryExpressionType.

I'm doing this as a separate CL from the main implementation so that I
can verify that it doesn't introduce backward compatibility issues.

Bug: https://github.com/dart-lang/sdk/issues/42629
Change-Id: I6be9086553ee0ea9994994c903880fe9bb4477fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158480
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-08-17 23:17:55 +00:00
Brian Wilkerson 819af72908 Use "receiver" rather than "target" in messages and docs
Change-Id: I08fdc928c72035a04dc2bb731ce8a2e95a81f9df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158803
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-08-17 23:11:35 +00:00
Robert Nystrom 5be77279cd Migrate package:dart_internal to null safety.
This also highlighted a couple of mistakes in the patch files for

dart:_internal and the test.
Change-Id: I60b4e7d5673d64f85a95108c9e03f9328249b9d0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153021
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
2020-08-17 23:06:35 +00:00
Jaime Wren 538e2e4778 Include a simple README.txt in $HOME/.dart
Fixes https://github.com/dart-lang/sdk/issues/42500

Change-Id: Iec9c6dd3d7c279ddd5eb9ba7fdb934ecd712ad69
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158521
Reviewed-by: Michael Thomsen <mit@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
2020-08-17 22:01:35 +00:00
Jacob MacDonald 35e9e8f5b8 Support windows uris for multi roots, using nativeToUri instead of Uri.base.resolve
Specifically this allows passing the result of `someUri.toFilePath()` on windows as a multi-root.
These paths have drive letters which are not understood by `Uri.base.resolve`.

Change-Id: I66d452be1e1c6923e61c1843bdfbce83a7c12f94
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158900
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
2020-08-17 21:41:59 +00:00
Joshua Litt eab26cd2bd [dart2js] Flip flag to defer class types.
Change-Id: Ia1f913a01f2be006158967b145db3ee34b297cfe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155660
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-08-17 20:25:09 +00:00
pq 6e62a0435d bulk fix for unnecessary_brace_in_string_interps
Change-Id: I47e846994d727d84564ba8f7daf7a8e6334417c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158143
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-08-17 18:32:59 +00:00
Jaime Wren 7fa6490ed4 Copy the dart:test ArgParser from https://github.com/dart-lang/test/ to dartdev to have the dart test --help / dart help test command return faster and in a more robust manner.
Bug: https://github.com/dart-lang/sdk/issues/42014
Change-Id: Icb088f9d4756c7673751ebf271575abf05660983
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158701
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
2020-08-17 18:28:59 +00:00
Paul Berry 314dc8de98 Run AssignmentDriverResolutionTest cases in null safety mode.
Previously, these tests ran only in legacy mode.  This CL moves the
tests to a mixin so that they can be run in both modes.

This is necessary because in follow-up CLs I will be changing the type
analysis rules for binary expressions 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: I44a443205e9b36c698b7c736b75f8701aed7f947
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158600
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-08-17 16:08:39 +00:00
Johnni Winther de224ac5f4 [cfe] Update ast-to-text to include member signature origins
Change-Id: I46e7fe831bc5e87981e78537b37565c62646210f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/157961
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2020-08-17 13:41:49 +00:00
Jens Johansen ddb88ca455 [CFE] Fix textual outline bot failure caused by landing race
Change-Id: I50e5c317bd01cd07291b016c57343a8baa177e09
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158843
Reviewed-by: Jens Johansen <jensj@google.com>
2020-08-17 09:18:45 +00:00
Tess Strickland 787446213c [vm/compiler] Move argument shape (not type) checks out of closures.
This CL performs the following checks in the invoke field dispatcher for
dynamic closure calls when lazy dispatchers are enabled:

* The provided function type arguments vector (if any) has the correct
  length.

* No function type arguments should be provided if the closure has
  delayed type arguments.

* All required arguments (positional in all modes, named in appropriate
  null safety modes) have been provided by the caller.

* If there are optional positional arguments, an appropriate number
  has been provided.

* If there are optional named arguments, their names are valid.

Since the runtime already handles checking the argument shapes when lazy
dispatchers are disabled, these checks are now completely removed from
closure bodies in all cases. Thus, the only remaining checks in closure
bodies are the type checks performed by AssertSubtype and
AssertAssignable when lazy dispatchers are enabled.

Changes in the Flutter Gallery:

* ARM7, release: -3.61% instructions, -2.19% total
* ARM7, sizeopt: -3.62% instructions, -2.55% total
* ARM8, release: -3.66% instructions, -1.98% total
* ARM8, sizeopt: -3.65% instructions, -2.37% total

Most of these changes are already exercised by existing tests such as
(but not limited to):

* corelib{,_2}/dynamic_nosuchmethod_test
* language{,_2}/call/call_test
* language{,_2}/closure/tearoff_dynamic_test
* language{,_2}/generic/function_bounds_test
* language{,_2}/parameter/named_with_conversions_test
* language{,_2}/vm/no_such_args_error_message_vm_test

I've added one test to specifically check the interaction between
dynamic calls and required named parameters. There is some coverage in
other NNBD tests, but those are not directly focused on testing this
specifically.

Other changes:

* Adds initial cached ranges for certain BinarySmiOp and ShiftIntegerOp
  instructions when the RHS is a constant, to avoid false negatives for
  deoptimization and throw checks prior to range analysis.

* Adds new slots for various Function fields.

* Adds the ability to define unboxed native slots, which are always
  unboxed after retrieval even in unoptimized code. In the first
  iteration, the backend only handles loads from Uint32 unboxed native
  slots. Part of https://github.com/dart-lang/sdk/issues/42793.

* Removed the special handling for loading from non-nullable int fields
  in AOT compilation. Instead, their treatment is unified with the
  treatment of the new unboxed native fields, since the source field is
  always unboxed and the result of the load is also always unboxed, as
  code involving them is always optimized.

Bug: https://github.com/dart-lang/sdk/issues/40813
Change-Id: Ia02aa3e872c1fefd906fd67b55021ea1797556e4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155604
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-08-17 08:58:08 +00:00
Johnni Winther 07a440901e [cfe] Remove useConsolidated flag
Change-Id: Ife1cfdee865e889d985a9395c83a60549b0beb24
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158398
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-08-17 08:31:49 +00:00
Jens Johansen a12b14ed83 [CFE] Add option to mark unknown textual outline chunks
Change-Id: Idcb1596b62e9b6450f08212429b2cc1d5f06d19d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158552
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-08-17 08:16:18 +00:00
Jens Johansen 04bc03e4ad [CFE] Textual outline knows about (and can thus sort) imports and exports
Before this CL the textual outline didn't know about imports and exports
and thus couldn't sort them.

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

This CL does not sort the hide and show entries.

Change-Id: Ic640cdaa98ac3562f8b36b21180a26584cb6d205
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158551
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-08-17 08:16:18 +00:00
Jens Johansen 66f11394f3 [CFE] Textual outline knows about (and can thus sort) named mixin applications
Before this CL the textual outline didn't know about named mixin
applications which caused it to insert "fences", i.e. splaces it
wouldn't sort across.

So for instance
class E {}
class D {}
class C<T> = Object with A<Function(T)>;
class B {}
class A {}

would not be sorted fully because class C is a named mixin application,
something it didn't know about, and it would only allow stuff on either
side to be sorted. So the sorted output would have been

class D {}
class E {}
class C<T> = Object with A<Function(T)>;
class A {}
class B {}

With this change it knows about it and the output would now thus be
class A {}
class B {}
class C<T> = Object with A<Function(T)>;
class D {}
class E {}

Change-Id: I97b28706732582d0c37f1b2c052b9f6eaf862a5a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158550
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-08-17 08:16:18 +00:00
Jens Johansen 42214d2eb0 [CFE] Textual outline doesn't add line-break for empty classes
E.g. before this change an empty class output would have been
class Foo {
}

now instead it becomes
class Foo {}

this matches what the formatter does.

Change-Id: Id08edc5259bae00deff9a66b4ae745f21c192358
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158549
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-08-17 08:16:18 +00:00
Jens Johansen 330c7500d4 [CFE] Textual outline doesn't add space for empty methods
E.g. before this change a procedure output would have been
foo() { }

now instead it becomes
foo() {}

this matches what the formatter does.

Change-Id: Ieb538d61e527cbec26d1d65ed6de349311dd0163
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158548
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-08-17 08:16:18 +00:00
Jens Johansen 8bca93872a [parser] Better error message for annotations on type arguments
This CL changes the message given in the situation identified in
https://github.com/dart-lang/sdk/issues/22314

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

Change-Id: Ibd47dd419d52673ae0d9e32039e0a635c1e09543
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158388
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-08-17 07:43:52 +00:00
Konstantin Shcheglov d9ce879bc2 Track if location has access to this.
We will need this also to implement '16.35 Lexical Lookup' from the spec.

Change-Id: I3b77c4a016fd54771b07957d522074aeb8dd1938
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158802
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-08-17 01:08:52 +00:00
Devon Carew 528238465f Remove the PerformanceTag class and related code.
Change-Id: I55b39e8fa6de7a3a946333bc84cc4ba0a09ecba8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158524
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2020-08-16 23:59:42 +00:00
Konstantin Shcheglov 332aa7d0c5 Add more data to debug already loaded library cycles.
R=brianwilkerson@google.com, devoncarew@google.com

Change-Id: I60122021faabf776f14034ef42ef08142ba6a5a8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158760
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-08-16 01:25:21 +00:00
Konstantin Shcheglov 87027c97a1 Start rewriting AssignmentExpression resolution, local variables.
Also updates for tests when the left side is a SimpleIdentifier.

Change-Id: I8da1392e2aa8e11a323e09aa380fb49e8cbf38da
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158522
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-08-15 01:09:00 +00:00
Joshua Litt c060abfa45 [dart2js] Add regression test for 43055.
Change-Id: Ia83ada924f63ae7d8dfbe034415e5fd8f241cd2e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158680
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-08-15 00:01:00 +00:00
Jaime Wren dec0a1857c Dartdev change to detect stdout.hasTerminal as a new requirement- until the disclosure is shown, with hasTerminal, analytics won't be enabled
Change-Id: I525da104105b01dd0e2669d41c05b6101bb28321
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158202
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
2020-08-14 19:27:19 +00:00
Konstantin Shcheglov 30b1c95a78 Add readElement, writeElement, referenceElement to SimpleIdentifier.
Just getters for now, not field, and not migrating existing getters
to them.

Change-Id: Id93c5988c606c45d0833aa7b3fbfefa507cbdb2d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158525
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-08-14 19:00:24 +00:00
Paul Berry 8d12c07cce Work around redundant hint with unnecessary null comparison.
This should fix analyzer bot failures triggered by
https://dart-review.googlesource.com/c/sdk/+/155926.

Bug: https://github.com/dart-lang/sdk/issues/43051
Change-Id: Ie4650a72611c63798054b4f4aad9dfa7d76ad0af
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158486
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-08-14 17:53:38 +00:00
Paul Berry 27b6e1eaf6 Run BinaryExpressionResolutionTest cases in null safety mode.
Previously, BinaryExpressionResolutionTest contained a bunch of useful
tests that should pass in both legacy and null-safety modes, 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 binary expressions 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: I3eac5fd563d7505abe2930835b14867bebec3512
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158482
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-08-14 17:47:16 +00:00
Ben Konyi df18aaa460 [ dartdev ] Set run command help message width to match terminal size
Change-Id: Icd23bcd0993da30266574ad5f4d17c06ba95b364
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158400
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-08-14 16:21:08 +00:00
Johnni Winther d267906184 [cfe] Ensure that noSuchMethod forwarders are not marked as member signatures
Change-Id: Id8a093db8d757b08cee97d9c7de1baa452531bb9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158547
Reviewed-by: Jens Johansen <jensj@google.com>
2020-08-14 15:30:24 +00:00
Brian Wilkerson a904d72a02 Minor cleanup found while working on the next change
Change-Id: Ibdc2552bf373b080507ef139480343561bc74891
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158520
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-08-14 13:13:34 +00:00
Clement Skau 0004589928 [VM] Removes extra frames from debug lazy async stacks.
This adds a debugger mechanism to replace part of
--causal-async-stack's _asyncStackTraceHelper runtime entry.
It recognises async and async* functions and adds a synthetic
breakpoint on entry into the wrapped async_op, making sure we
don't get "synthetic" frames as we're stepping in and out of
the async code.

Change-Id: I1df6e6874de2fa9185f27a1a8873ad0071ad9fb6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/157480
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2020-08-14 12:45:37 +00:00
Paul Berry e403e6ae77 Flow analysis: rework handling of equality tests.
The new logic classifies the LHS and RHS of the equality check as
either null, non-nullable, or potentially nullable, and then either
promotes, treats the expression as equivalent to a boolean, or does
nothing, as appropriate.

This means, for example, that a comparison between a non-nullable
value and `null` is now known to evaluate to `true` for reachability
analysis.

Note: as part of this change, it was tempting to trigger promotion
whenever a varialbe is equality compared to an expression of type
`Null`, but this would be unsound (consider `(int? x) => x == (x =
null) ? true : x.isEven`).  So we still only promote when the variable
is compared to a literal `null`.

Fixes #41985.

There's a corresponding spec change out for review:
https://github.com/dart-lang/language/pull/1134

Change-Id: Id7f1d4eaa3b0fa57124445bb8352eef32c304feb
Bug: https://github.com/dart-lang/sdk/issues/41985
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155926
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-08-14 12:16:36 +00:00
Johnni Winther 4b2f375402 [cfe] Ensure that forwarding stub are distinct from member signatures
Change-Id: Ie5c37b55e0d636a1ab70cb77d816b977b5351451
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158385
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2020-08-14 11:12:40 +00:00