Commit graph

75930 commits

Author SHA1 Message Date
Erik Ernst a369992f4b Corrections in lub tests, cf. #43717, #43720.
The tests least_upper_bound_{futureor,function}_test.dart are corrected:
The expected least upper bound was changed in one case in each test,
because the case matches a rule earlier in the ruleset, so the new rules
are not used in these cases.

Change-Id: I1f5f303ccde10af6084771a90d92d81d636909d6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166635
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2020-10-09 11:22:46 +00:00
Johnni Winther 16ea8422d5 [cfe] Fix encoding for sync*/async/async* extension tear-offs
The internal closure was wrongly marked with the async marker of the
torn-off method.

Change-Id: Ie29eee6ed77fb07e9c0992bd0e49590cc10edd3e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166634
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-10-09 10:42:56 +00:00
Alexander Thomas 0c0e33c1b6 [co19] Roll co19 to 5182a15ce02779832377ec02c35bd174acd875ac
2020-10-09 irina.arkhipets@gmail.com Fixes 950: typo corrected.
2020-10-09 irina.arkhipets@gmail.com Fixes 950: test adjusted.
2020-10-08 irina.arkhipets@gmail.com Fixes 946: LanguageFeatures/Instantiate-to-bounds/typedef-static/typedef_typedef_* tests updated according to the recent SDK changes.
2020-10-08 irina.arkhipets@gmail.com Fixes 946: LanguageFeatures/Instantiate-to-bounds/typedef/static/typedef_l2_06_* tests updated according to the recent SDK changes.
2020-10-08 irina.arkhipets@gmail.com Issue 946: LanguageFeatures/Instantiate-to-bounds/typedef/static/typedef_l2_t05_* tests updated according to the recent SDK changes.
2020-10-08 irina.arkhipets@gmail.com Fixes 946: LanguageFeatures/Instantiate-to-bounds/typedef/static/typedef_l2_t04_* tests updated according to the recent SDK changes.
2020-10-08 sgrekhov@unipro.ru Fixes 912. Abstract variables tests added
2020-10-08 sgrekhov@unipro.ru Fixes 949. Explicitly cast initializer expression as nullable
2020-10-07 sgrekhov@unipro.ru Fixes 944. Add check for HttpStatus.permanentRedirect
2020-10-07 irina.arkhipets@gmail.com Issue 946: LanguageFeatures/Instantiate-to-bounds/typedef/static/typedef_l2_t03_* tests updated according to the recent SDK changes.
2020-10-07 sgrekhov@unipro.ru 948. Change type of additional required argument to dynamic
2020-10-07 sgrekhov@unipro.ru Fixes 948. Add two positional parameters to Language/Libraries_and_Scripts/Scripts/main_required_parameters_t03 to match the test description
2020-10-06 sgrekhov@unipro.ru 923. More tests for local variable read and definite (un)assignment
2020-10-06 irina.arkhipets@gmail.com Fixes 946: LanguageFeatures/Instantiate-to-bounds/typedef/static/typedef_l2_02_* tests updated according to the recent SDK changes.
2020-10-05 sgrekhov@unipro.ru Fixes 947. It's compile error to declare getter named 'main'
2020-10-05 irina.arkhipets@gmail.com Issue 946: LanguageFeatures/Instantiate-to-bounds/typrdef/static/typedef_l2_* tests updated according to the SDK changes.
2020-10-04 sgrekhov@unipro.ru Fix Process/exitCode_A01_t02 test on Windows. Allow 1 exit code
2020-10-02 sgrekhov@unipro.ru 923. Added tests for local variables assignment and read

Change-Id: Ibdc85b357abfe3c5f8dc0c44b30b354480250d91
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166632
Reviewed-by: Karl Klose <karlklose@google.com>
2020-10-09 10:41:24 +00:00
Tess Strickland 45a46ca2b8 [vm] Add (S)LEB128 encoding/decoding to BaseWriteStream.
Unlike cfc8e6de, this does _not_ replace the default variable length
encoding for {Read,Write}Streams, but insteads adds separate
{Read,Write}{S,}LEB128 methods to the appropriate classes. If we later
find the cause of the issues that led to the revert of cfc8e6de, it'll
be easy to switch over then.

Note that WriteLEB128 asserts that the value is non-negative if used
with a signed type (since negative values suggests that SLEB128 should
be used instead for minimal encoding).

Also removes the various other encoding and decoding methods for
(S)LEB128 across the codebase and changes those clients to use
{Read,Write}Streams instead.

Other cleanups:

* Various constant-related cleanups in datastream.h.

* Adds DART_FORCE_INLINE to ReadStream::ReadByte and uses it in the
  default variable length decoding methods for retrieving bytes
  from the stream instead of managing current_ by hand.

* Creates a canonical empty CompressedStackMaps instance and uses
  that instead of the null CompressedStackMaps instance in most cases.
  The only remaining (expected) use of the null CompressedStackMaps
  instance is for the global table in the object store when no global
  table exists (e.g., in JIT mode before any snapshotting).

* Moves CompressedStackMapsIterator from code_descriptors.h to an
  Iterator class within CompressedStackMaps in object.h (similar to
  PcDescriptors::Iterator), to limit friend declarations and because it
  conceptually makes more sense as part of CompressedStackMaps.

* Removed CompressedStackMaps::PayloadByte, since existing clients
  (CompressedStackMaps::Iterator, StackMapEntry in program_visitor.cc)
  are better served by just operating on the payload buffer directly
  (with appropriate NoSafepointScopes).

* WriteStreams no longer allocate their initial space on construction,
  but rather on the first write, so no allocation is performed by
  constructing a never-used WriteStream.

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-debug-simarm_x64-try,vm-kernel-precomp-mac-release-simarm64-try,vm-kernel-mac-debug-x64-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-kernel-precomp-win-release-x64-try,vm-kernel-ubsan-linux-release-x64-try,vm-kernel-tsan-linux-release-x64-try,vm-kernel-precomp-ubsan-linux-release-x64-try,vm-kernel-precomp-tsan-linux-release-x64-try,vm-kernel-precomp-msan-linux-release-x64-try,vm-kernel-precomp-asan-linux-release-x64-try,vm-kernel-msan-linux-release-x64-try,vm-kernel-asan-linux-release-x64-try
Change-Id: Ice63321abaa79157fbe9f230a864c8bba0e6dea9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166421
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2020-10-09 10:08:16 +00:00
Johnni Winther b2e33ee550 [cfe] Check getter/setter types on top level and extension members
Closes #43714

Change-Id: I07ee20cb3a65758dda2139e965aeb4fb36cf38c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166628
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-10-09 07:16:06 +00:00
Erik Ernst 2ffa46326b Add test dealing with UP on types involving FutureOr
Cf. spec change https://github.com/dart-lang/language/pull/1254,
commit ae340c7dcc62d375bd8df9fd4cb0d669d84478d2.

Change-Id: I28c950ee37c21e138fb7148950b0404004086eff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166626
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2020-10-09 07:05:16 +00:00
Johnni Winther 4d1e0378c9 [cfe] Update test expectation for number_operator_error_test
Change-Id: I43cda6ca3f57818f9afb0dd33ae9b040f08f384a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166630
Auto-Submit: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2020-10-09 06:27:16 +00:00
pq af5cde47b5 linter 0.1.121
Change-Id: I1aa19efecac1065f7b4d0ae1a78c10986154f051
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166784
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2020-10-09 02:39:45 +00:00
Konstantin Shcheglov 694c8d0d6b Update UP for FutureOr.
Bug: https://github.com/dart-lang/sdk/issues/43720
Change-Id: I9decd3a3b430f82e3e4bd0c4e6963cd3069f9adf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166786
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-10-09 00:00:55 +00:00
Konstantin Shcheglov 63e0cd6955 Issue 43717. Update UP(FunctionType, unrelated) to UP(Object, unrelated).
Bug: https://github.com/dart-lang/sdk/issues/43717
Change-Id: Ib2fa861df24d010c768e4a06ba2bff175bbf88f4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166783
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-10-08 23:42:45 +00:00
Nate Bosch 057ac51f12 Update to latest stack_trace
Fixes parsing of some stack traces with async gaps.

Change-Id: Ieb010e54289fd1375955e432548aa87552fa1d26
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166761
Auto-Submit: Nate Bosch <nbosch@google.com>
Reviewed-by: Clement Skau <cskau@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2020-10-08 22:09:45 +00:00
Paul Berry 7a1e92a670 Ensure that assert statements promote properly in unreachable code.
Fixes #40009.

Bug: https://github.com/dart-lang/sdk/issues/40009
Change-Id: I96561a72b6ba8dd8b8b95a4d9827d195941ea038
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166760
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-10-08 21:42:14 +00:00
Paul Berry 18644c338b Ensure that while statements promote properly in unreachable code.
Bug: https://github.com/dart-lang/sdk/issues/40009
Change-Id: I492b465b08a0f00549e8e69390cead35af211e0b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166700
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-10-08 21:42:14 +00:00
Paul Berry f51fb064cc Ensure that try/catch statements promote properly in unreachable code.
Bug: https://github.com/dart-lang/sdk/issues/40009
Change-Id: Ie4b8809c6f37ff67891bc874c0c0ec10c70eb9fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166660
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-10-08 21:42:14 +00:00
Paul Berry ef1646697c Ensure that switch statements promote properly in unreachable code.
Bug: https://github.com/dart-lang/sdk/issues/40009
Change-Id: I00a8fcf52bce131874ba6d96680b11e8bc1a549c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166640
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-10-08 21:42:14 +00:00
Paul Berry 2601fa6d78 Ensure that && and || expressions promote properly in unreachable code.
Bug: https://github.com/dart-lang/sdk/issues/40009
Change-Id: Ib06449624de9320f5229957511ebaaee92c75ec8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166606
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-10-08 21:42:14 +00:00
Paul Berry 17ebbfcbda Ensure that labeled statements promote properly in unreachable code.
Bug: https://github.com/dart-lang/sdk/issues/40009
Change-Id: Ice9b50ee6a7e9ffc32635312dc951362ff0da665
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166540
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-10-08 21:42:14 +00:00
Paul Berry ce7accb828 Ensure that ?? and ?. expressions promote properly in unreachable code.
Due to https://github.com/dart-lang/sdk/issues/43725 these have to be
updated in a single atomic CL.

Bug: https://github.com/dart-lang/sdk/issues/40009
Change-Id: Ifbd5fdee6379b7cbee5ab135f72a013134b70aa1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166601
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-10-08 21:42:14 +00:00
Ryan Macnak 4182cbe1a3 Remove use of set_sources_assignment_filter
The sources assignment filter is considered a misfeature of gn
and is planned for removal (see discussion at [1]).

Convert dart BUILD.gn rules to manually filter the files that
are build using explicit `if` expressions. Remove obsolete call
to set_sources_assignment_filter() to filter '*_test.*' files
as no such files are present in the variables used to build the
`sources` value.

[1]: https://groups.google.com/a/chromium.org/g/gn-dev/c/oQcYStl_WkI/m/roukYTxSDAAJ

Bug: gn:125
Change-Id: I591fbb746cf694f7d2a5a330f81652380acf5c11
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166629
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-10-08 20:08:59 +00:00
Konstantin Shcheglov 52370de8fa Enforce prefer_typing_uninitialized_variables in analysis_server
Change-Id: I09294ac48ab0f86a93cd1dcdcc53cca20546fb31
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166720
Reviewed-by: Devon Carew <devoncarew@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-10-08 20:00:05 +00:00
Konstantin Shcheglov 132e2307e7 Report MAIN_FIRST_POSITIONAL_PARAMETER_TYPE
Bug: https://github.com/dart-lang/sdk/issues/43555
Change-Id: Ieacc710f1da1d92ab99337c6511a6b994e9bc0da
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166780
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2020-10-08 19:59:19 +00:00
Alexander Markov d77fff7307 [vm/nnbd] Add separate Snapshot::Kind for core snapshots
Core snapshots should be agnostic to the sound null safety mode
(so they can be used both in weak and strong modes), and snapshot
writer verifies that.

Snapshot::kFull was previously used both for core snapshots and
app snapshots on ia32. However, app snapshots are not guaranteed to
be agnostic, which appeared as failures on a few test on ia32.
Also, VM should be able to detect null safety mode from app snapshots,
even if they do not contain code, but null safety mode was not
written into features string of kFull snapshots.

In order to disambiguate core snapshots, a new Snapshot::Kind is
added. Snapshot::kFullCore works exactly as Snapshot::kFull, except
for verification of agnostic null safety and snapshot features string
omitting null safety mode. All snapshots except kFullCore now have
null safety mode included into their features string.

Fixes https://github.com/dart-lang/sdk/issues/43626
Issue https://github.com/dart-lang/sdk/issues/43613

Change-Id: I8cd3b049ef4e428dd5e1ce666d4c7aa3b596d70c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166308
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2020-10-08 19:59:15 +00:00
pq c21b906182 disable pubspec linting
Disables the fix in https://dart-review.googlesource.com/c/sdk/+/164249 pending a fix to `sort_pub_dependencies` which is producing a false positive that is blocking the Flutter engine roll.

See: https://github.com/dart-lang/sdk/issues/43529
See: https://github.com/dart-lang/linter/issues/2271

Change-Id: Ica6262153b89259ba67b5a43eeeafe2bdd482b44
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166703
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Dan Field <dnfield@google.com>
2020-10-08 19:39:55 +00:00
Paul Berry 51c6ba0edb Introduce distinct subclasses for _SimpleContext.
Note that due to https://github.com/dart-lang/sdk/issues/43725 we
can't yet downcast to these subclasses in all cases; added a test case
that would fail if we did.

Change-Id: Idd498840484a6a4c60a0cf2f8e01092ba75e7d2e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166722
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-10-08 17:15:55 +00:00
Johnni Winther aa376d1520 [cfe] Check types and initialization on extensions, extension members and factories
Closes #43211

Change-Id: I45bb0ee59bbdc4fdd63861e6e434d95bdcb5791a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166481
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-10-08 16:19:05 +00:00
Johnni Winther 5a2a435b6e [cfe] Use combined member signature for override inference.
Closes #43381

Change-Id: Id3ba97d717556f807eac1115e1c3570662cab87c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166240
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-10-08 15:29:05 +00:00
Konstantin Shcheglov 0c342ae491 Fix crash when invalid default field formal parameter has annotation.
Change-Id: Iabb329f850195be981d80b0589d9f7851596c680
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166740
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-10-08 15:17:05 +00:00
Johnni Winther 383b470d39 [test] Update never_runtime_check_nnbd to match new expectations
The test was written when a more disruptive solution for the unsoundness
fix was planned. A more lenient solution was found and the test is updated
accordingly.

Closes #43707

Change-Id: I31936fdc3aa0ae23fddd72c850eca5da50b22352
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166620
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-10-08 15:08:05 +00:00
Johnni Winther 1c0c0a1e86 [cfe] Resolve "Never" as "Null" in opt-out libraries
Closes #43499

Change-Id: I5d0ba97a626248019d7aab4e7a5a68d0a566a87a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166440
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-10-08 15:08:05 +00:00
Erik Ernst 2d92a26cca Test error for -e and ~e when e is potentially nullable
This verifies that the operators `unary-` and `~` do not participate
in null-shorting. Cf. https://github.com/dart-lang/language/issues/1081.

Change-Id: Iba446724f00c1c4aaedb4be4425e69fb52cdb5c9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166627
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2020-10-08 15:01:55 +00:00
Jens Johansen 34e4a6d814 [CFE] Remove inconsistency where visitIsExpression called .accept directly
Change-Id: I81d0e99e6908f24d082cfa57454db8fdc3b333be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166625
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-10-08 13:23:45 +00:00
Erik Ernst 87dd7c03e1 Add tests for least upper bound spec change #1195
https://github.com/dart-lang/language/pull/1195 changes the UP function
such that it uses the greatest closure with bounded and promoted type
variables, and adjusts the catch-all rules about function types (used
with `Function(int)` and `String` and other "otherwise" cases).

This PR adds tests for the updated rules.

Change-Id: I793b85ceec76105d013c03e8d9bccdd187bb476f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166101
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2020-10-08 10:49:33 +00:00
Alexander Thomas ae7ff6c13a [build] Set mac_use_goma_rbe to true for goma builds on mac
Without this, local builds on macOS fail to use the Goma on RBE backend.

See also: https://dart-review.googlesource.com/c/sdk/+/139782

Change-Id: Ic1caba904bcb486c638aef9462bca3fda65d8a6a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152147
Reviewed-by: Karl Klose <karlklose@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2020-10-08 09:44:23 +00:00
Alexander Thomas bebfd106da [infra] Add analyzer NNBD macOS and Windows builders to the test matrix
https://github.com/dart-lang/sdk/issues/43463

Change-Id: Ibba0f6738714d2b2917613bcfc70f31c95527f1a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166423
Reviewed-by: Karl Klose <karlklose@google.com>
2020-10-08 08:31:23 +00:00
pq f84bba2897 get libraries to fix from the context collection
Fixes: https://github.com/dart-lang/sdk/issues/43694

Also implements recursive fix semantics consistent with `dart analyze`.



Change-Id: I349650a0c1704c2e2be84287b46de17ecc132d56
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166602
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-10-08 01:34:08 +00:00
Konstantin Shcheglov 103465c90c Report MAIN_HAS_MORE_THAN_TWO_REQUIRED_POSITIONAL_PARAMETERS and MAIN_HAS_REQUIRED_NAMED_PARAMETER.
Bug: https://github.com/dart-lang/sdk/issues/43559
Change-Id: If74634187d411c0b008133b59c1c3e23e87319c3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166309
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-10-08 00:05:16 +00:00
Devon Carew 4d7714174e [dartdev] push the analysisFinished logic down into the AnalysisServer wrapper
Change-Id: Idf2c7422046365bae056c8c767ed915ad91d7cf2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166560
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2020-10-07 22:58:06 +00:00
Konstantin Shcheglov 4f760fa268 Store declared elements into linked nodes, get from them.
The previous approach was reverted.

Change-Id: Ib4b9d09d740511cd2ef76d663412a3358c7f666d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166400
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-10-07 22:51:43 +00:00
Alexander Markov 5c19b4abcd [vm] Handle errors from RegExp engine
Bug: b/72146178
Change-Id: I2d05a004690b4d3e0b3e79786a967e27fddaacb5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166582
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2020-10-07 22:34:24 +00:00
Ryan Macnak 6c31582031 Copy Dart 2 version of Observatory and service tests.
Change-Id: If47aa98918b0166dba781a0008c23b991d46fe1c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165420
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-10-07 22:20:25 +00:00
Brian Wilkerson bd6c31ad9a Do not match on parameter names
One of the bugs I recently found caused the transform for a getter to be
applied against a parameter. This CL fixes that particular issue by
correctly computing the element name to be the name of the enclosing
invocation rather than the parameter.

It also introduces an `ElementMatcher` to hold the data currently being
used to match elements with the intent that more information will be
added in the future to prevent similar sorts of mismatches.

Change-Id: I14abbece334b3dc660d3854b817362c441efa11d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166600
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2020-10-07 21:37:20 +00:00
Sam Rawlins b4f265290c Bump meta package to 1.3.0-nullsafety.4
Change-Id: I693e4aee8c14177e3a72ef421b96637e4b1d2037
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166340
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-10-07 21:09:14 +00:00
Paul Berry c13f4ab08b Adjust flow analysis of for each statements for consistency with for.
The recent changes to `for` statements were necessary to ensure that
if a `for` statement causes type promotion due to an unreachable
branch without type promotion joining a reachable one with type
promotion, the type promotion would still happen properly even if the
top of the `for` statement was itself unreachable.  There is no need
for a similar change to `for each` statements, because they are simple
enough that this situation cannot arise.  But it's still worth making
the corresponding change for consistency.

Bug: https://github.com/dart-lang/sdk/issues/40009
Change-Id: Idabf7745f04a99152e688bf050a8d80e07b004e2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166520
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-10-07 20:01:34 +00:00
Paul Berry 7aa9444059 Ensure that for statements promote properly in unreachable code.
Bug: https://github.com/dart-lang/sdk/issues/40009
Change-Id: I87ea8c8cd943c0c44d795aec084e012b3e2b4496
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166500
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-10-07 20:01:34 +00:00
Paul Berry c39b1642b6 Ensure that do statements promote properly in unreachable code.
Bug: https://github.com/dart-lang/sdk/issues/40009
Change-Id: I2c53e1171bb986784b1f0e18e35556f7d6afcb15
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166320
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-10-07 18:16:52 +00:00
Paul Berry 57932cfb4f Ensure that conditional expressions promote properly in unreachable code
Change-Id: I8680b81b44be789a047238b1e2d008ff240e59c2
Bug: https://github.com/dart-lang/sdk/issues/40009
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165405
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-10-07 18:16:52 +00:00
Paul Berry 8b65c31fec Fix CFE flow analysis of conditional expressions.
It turns out we didn't have enough id test coverage to tell that we
were passing the wrong value for `conditional_end`'s
`conditionalExpression` argument.

This change fixes the call site and adds an id test that would have
caught the bug.

Change-Id: Ie99b1b7045e757ee78d72fcb435222fd27d680d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166307
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-10-07 18:16:52 +00:00
Ryan Macnak 6bcdcb5c68 [vm] Don't allocate on the Dart heap when printing stack traces.
Bug: https://github.com/dart-lang/sdk/issues/43642
Bug: b/169880355
Change-Id: Ib067eb8c8183367442cffa5b0975d5264ccc3017
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166244
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-10-07 17:09:37 +00:00
Alexander Markov 0e9b2b8a36 [vm/compiler] Fix assertion when assigning type to a Phi in ComputeSSA
Fixes https://github.com/dart-lang/sdk/issues/43682

Change-Id: I6b123ac5ba153b1f4177148341619419c3058684
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166304
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2020-10-07 16:30:17 +00:00
Jacob MacDonald 1e450cadde Remove reference to nullable StackTrace from Stream.listen docs.
The StackTrace argument will never be null, but may be a default.

Also rewrite the type descriptions to use function type syntax instead
of the legacy argument syntax, and remove a redundant parameter name.

Bug: #43655
Change-Id: Ie91024b2a70d66c24ce29e413c811a61beae3bfc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166460
Auto-Submit: Jake Macdonald <jakemac@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2020-10-07 15:58:15 +00:00