Commit graph

72410 commits

Author SHA1 Message Date
Riley Porter 654b725ee4 [tests] Fix cast_test and migrate to nnbd.
Also splits up cast_test to test collections separately and
updates corelib_2 version with the same changes, including
fixes in relevant pending CL:
https://dart-review.googlesource.com/c/sdk/+/126320

Fixes #39517

Bug: http://dartbug.com/39517
Change-Id: I8df1fde1d48ed23561ce9d0d8b87d7fc2ba52eb1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144469
Commit-Queue: Riley Porter <rileyporter@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2020-04-30 02:33:53 +00:00
Stephen Adams ef1528aa78 [js_runtime] Never is a bottom in legacy mode
Opt-in code can have Never types even with legacy subtyping.

Bug: 41675

Change-Id: I6dbdc064dceeedf0774d10faaca336561b41b7d5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145561
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2020-04-30 01:41:02 +00:00
Mayank Patke 94c81a137b [dart2js] Remove redundant check for Object when printing bounds.
Change-Id: I7e8190ac9d0095cf1bb225f94184eceba00ba887
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145308
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2020-04-30 00:36:28 +00:00
Mike Fairhurst cde8098c97 [nnbd_migration] Improve error message quality
Change-Id: I3da17864861dc58df7cde9d1c6b034715f1c88bd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144684
Commit-Queue: Janice Collins <jcollins@google.com>
Auto-Submit: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Janice Collins <jcollins@google.com>
2020-04-30 00:25:48 +00:00
Alexander Markov d2ae466056 [vm/aot] Update references from types to mixin applications after deduplication
CFE may use anonymous mixin application classes in types after
applying LUB (Least Upper Bound) algorithm in conditional expressions,
and then those types can spread via type inference.

After anonymous mixin application classes are deduplicated, all
references to removed mixin applications from types should be
updated to point to the remaining mixin application.

Fixes https://github.com/flutter/flutter/issues/55345

Change-Id: I7860b2868cb153d125fec363c1653b7aa16521e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145501
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-04-29 23:54:08 +00:00
Jaime Wren 4aec1e76e2 Record and report the completion suggestions that take the longest to compute in completion_metrics.dart.
Change-Id: I5a4043a9754439c38be6b86c094a895366c2afc9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145562
Commit-Queue: Jaime Wren <jwren@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Jaime Wren <jwren@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-04-29 22:38:58 +00:00
Sam Rawlins 5506769402 Count variables checked with ArgumentError.checkNotNull as not null
Fixes https://github.com/dart-lang/sdk/issues/39644

Change-Id: I552e87e7c57dd2c5a012b76d9c73c24fefb19785
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145025
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2020-04-29 22:35:18 +00:00
Sam Rawlins 61755dea19 Migrator: Infer late for test variables
Fixes https://github.com/dart-lang/sdk/issues/38291

This change also involves moving the "package" where test sources are
written and analyzed; It used to be /home/test (or /project in some
places); and a pubspec.yaml was written (or a .packages file) which
specified the package's name was "test". However, this conflicts with
adding an entry for a mock copy of the actual _test_ package. A
.packages file cannot have two entries for a package named "test", so
the package where all test sources are written is changed to "tests"
(located at /home/tests).

Change-Id: I462b88a814931dc2d4f1e72d07e3daf64768a399
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144994
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2020-04-29 22:09:28 +00:00
Robert Nystrom 62d5f57477 Migrate language_2/extension_methods to NNBD.
Change-Id: Ic4426baeb9d02624af5f60106473a1eeced15310
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142780
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2020-04-29 21:36:28 +00:00
Jaime Wren 3dc7664a8a Additional tests in override_contributor_test.dart
Change-Id: I04311b5685bb853926ebef4c20aef5ac58b5881d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145520
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
2020-04-29 20:54:04 +00:00
Konstantin Shcheglov 7deb5a3874 Fix documentation for EXPORT_LEGACY_SYMBOL.
With https://dart-review.googlesource.com/c/sdk/+/145220 specifying
the current language version using `// @dart=` does not opt-out from
experiments.

Change-Id: Ibee76c35af8e829bef7d14347fe155ba876c1033
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145445
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-04-29 20:36:39 +00:00
Jaime Wren 1784caa31d Completion metrics bug fix, pass in DartdocDirectiveInfo() when creating a DartCompletionManager()
Change-Id: Ib9a1c15016d3ed2427510e58dd63458655a50b5c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145504
Commit-Queue: Jaime Wren <jwren@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Jaime Wren <jwren@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-04-29 20:05:44 +00:00
Ryan Macnak 3388e5765b Revert "[vm, gc] Address data race when recycling TLABs."
This reverts commit 8241779d83.

Revert "[vm, gc] Divide new-space into pages like old-space."

This reverts commit 3495158ec9.

Revert "[vm, gc] Set the scavenger's forwarding bit to equal to the pointer tag bit."

This reverts commit 6e37605661.

Bug: b/155227688
Change-Id: I7e26bd86e188fb3658b82ba311a261468db96b78
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145444
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-04-29 19:47:24 +00:00
William Hesse 70f8e1810c [infra] Add linux-debug-canary configurations used by canary builder
With this change, each configuration is run on only one builder (per
branch). We need this to start processing and storing results by
configuration instead of by builder.

Change-Id: Ib11c1f3b459c2992440ce8a3540c455deb64b9f4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144701
Reviewed-by: Jonas Termansen <sortie@google.com>
2020-04-29 19:45:18 +00:00
Paul Berry 4d1ca6316f Migration: fix mock SDK path for testing CLI on windows.
Bug: https://github.com/dart-lang/sdk/issues/41678
Change-Id: I191699a5b9f39445be1bccad5e1e44d6b568d486
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145441
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Janice Collins <jcollins@google.com>
2020-04-29 19:11:54 +00:00
Paul Berry c6f94c3224 Migrtaion: add a hook to allow the preview server to be shut down in unit tests.
Without this, it's possible for a unit test failure to result in a
preview server remaining open, which can prevent test execution from
terminating.

Change-Id: I8a11056da5bea003dfa46e3871a241e8f5ce8cc1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145440
Reviewed-by: Janice Collins <jcollins@google.com>
2020-04-29 19:11:54 +00:00
Martin Kustermann fa6cc57a32 Reland "[vm] Make VM support .dart_tool/package_config.json"
This CL makes the VM add support for .dart_tool/package_config.json via
  * the --packages=<file> command line parameter
  * the `packageConfig: <file>` parameter to `Isolate.spawnUri`

It also allows now `package:*` uris being used in `Isolate.spawnUri`

The CL also removes the unused `packageRoot` parameter from the Dart to
C++ interface as well as in various places in C++.

The CL also aligns the implementations between sdk and sdk_nnbd more.

Issue https://github.com/dart-lang/sdk/issues/41649
Issue https://github.com/dart-lang/sdk/issues/41245
Issue https://github.com/dart-lang/sdk/issues/41246

Change-Id: I0a7aa3040332abafa19bf80bdbd8a8f8594cc6fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145462
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2020-04-29 19:05:26 +00:00
Joshua Litt e580dd8e84 [dart2js] Remove hardcoded paths in dart2js unit tests.
Change-Id: Ic223c44d917ca55f07f9f62752a91ef4db325444
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145180
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-04-29 18:24:24 +00:00
Jaime Wren cb77214f19 Revert 2 of the override_contributor.dart changes from last week.
This reverts commit f7d14e49 and 45588642

Change-Id: Iab211d2879f2bd6a420ea6fb5b0de058c02ac4ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145481
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
2020-04-29 18:22:49 +00:00
Jaime Wren 53601ecc18 Implement available suggestions in completion_metrics.dart, a flag is added to enable the new feature.
Change-Id: Ib7477b1a517d4aa1dc09d85df3df553ca61baa2e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145241
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
2020-04-29 17:59:24 +00:00
Sam Rawlins 82e4a4465b Migrator: change sdk constraints to >=2.9.0 <2.10.0
Bug: #38347
Change-Id: Iedb9acfe313a14d4c35f3637f3ef0104e836dd4e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145260
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-04-29 17:47:44 +00:00
Mike Fairhurst 2693b80dfd [nnbd_migration] Do basic categorization of edit types to suppress noise.
We really should switch this, if possible, to use the edit kind APIs
that the preview tool uses, so that we can categorize this without
guesswork.

However this will keep it as a rough list, and I don't know if we need
anything fancier that currently -- and it will no longer produce noise
if new changes are added.

(currently produces "and 0 other changes" when running on flutter, so
it's probably mostly comprehensive currently).

Change-Id: I9cb2662995af340346a61d38eba3469927a0f4ef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145160
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2020-04-29 17:22:44 +00:00
Konstantin Shcheglov e20731c0c3 Exit sooner from VariableModel.write() when writeCaptured.
No semantic changes, I think.
Just a step closer to what the spec says.

R=paulberry@google.com

Change-Id: I3b27c3daa3b93d425ede56bc1b2b1056210135d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145243
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2020-04-29 16:32:54 +00:00
Ryan Macnak 8241779d83 [vm, gc] Address data race when recycling TLABs.
Fixes TSAN failures in vm/cc/ExerciseTLABs.

Change-Id: I7b319d7dcff3fa7d77f08177efb08a9db7bc533d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145310
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-04-29 16:26:04 +00:00
Paul Berry 6c1f8a0fb6 Split migration_cli_test.dart into Windows and Posix tests.
Since the tests use a MemoryResourceProvider we can run both kinds of
tests on both platforms.  That should make it easier to track down and
fix issues occurring under Windows (see
https://github.com/dart-lang/sdk/issues/40381).

Change-Id: Ie058f8c08923a3ef4ea12c5f28219e48aa17c28d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145026
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-04-29 16:20:44 +00:00
Paul Berry 30fcb067e0 Rework how migration_cli_test tests the preview server.
This mechanism is simpler, and it has the advantage that if the
preview server fails to start for some reason, we get a useful failure
message rather than a timeout.

Change-Id: I6ead899b3af02431c2a022fa104c6596ff952917
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145142
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2020-04-29 16:20:44 +00:00
Brian Wilkerson 51a66bcfa2 Use SuggestionBuilder to build suggestions for field formal parameters
Change-Id: I157cc755f4bad5086c8e44d7e89504e31283e6bb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145442
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-04-29 15:30:14 +00:00
Konstantin Shcheglov 2ccfc88f25 Change Feature.restrictToVersion() to keep features of the current language version.
See https://github.com/dart-lang/sdk/issues/41691

Change-Id: I3ee40592158d4054d187120048f1eb805108ee69
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145220
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-04-29 15:24:54 +00:00
Konstantin Shcheglov d131ea4e13 Add Variable type parameter to VariableModel.
So, we can use exact type for TypeOperations, and it will be convenient
for implementing promotion via initialization.

R=paulberry@google.com

Change-Id: I5b1243d5a4ac95f92ee1d08e6ed64be09e8c8f53
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145306
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-04-29 15:08:23 +00:00
Joshua Litt 0b1451c5fd [dart2js] Trivial nnbd fix for no_such_method_forwarders_test.
Change-Id: Ib55e3c632c99e0700d239fe0c62e35aeadb0bf0e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145301
Reviewed-by: Mayank Patke <fishythefish@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2020-04-29 14:21:03 +00:00
Zichang Guo 64c9984ecf [dart:io] Fix HTTP parser not decoding header values as Latin-1.
This change reverts an accidental breaking change in 6a5b87f where the
HTTP parser rejects characters in HTTP header values that it wouldn't
send itself.

This change restores the previous behavior of decoding these characters
as Latin-1.

Fixes https://github.com/dart-lang/sdk/issues/41688
Change-Id: I02bae07b5721eb4cbec789ad912c7fe6e2b2b015
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145244
Reviewed-by: Jonas Termansen <sortie@google.com>
Commit-Queue: Jonas Termansen <sortie@google.com>
2020-04-29 12:58:53 +00:00
Dmitry Stefantsov b67a1313ae [cfe] Add an option to inspect internal state of text serialization
The option is added to the unit testing framework and is supposed to
be used locally.

Change-Id: Ia043ca35d27c15e597fe1b66429f923ccb24f3dc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144825
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2020-04-29 10:36:40 +00:00
Clement Skau 12a5c93d4a Revert "Reland "[VM] Remove unnecessary Closure.clone() from sync*.""
This reverts commit 1bf25798fa.

Reason for revert: Rolling back as it breaks more external targets and is currently blocking rolls.

Original change's description:
> Reland "[VM] Remove unnecessary Closure.clone() from sync*."
> 
> This reverts commit 430c75b5fa.
> 
> Reason for revert: We probably don't care about the dartkb breakages.
> 
> Original change's description:
> > Revert "[VM] Remove unnecessary Closure.clone() from sync*."
> > 
> > This reverts commit ca94ad7112.
> > 
> > Reason for revert: Appears to break dartkb.
> > 
> > Original change's description:
> > > [VM] Remove unnecessary Closure.clone() from sync*.
> > > 
> > > Instead, this CL wraps sync*'s sync_op in an additional function
> > > that captures local copies of the necessary closure state.
> > > Notably this state includes the parameters of the original sync* function
> > > as these also need to be cloned for each instance.
> > > 
> > > 
> > > Note: a large number of .expect files have a small number of changes
> > > due to the additional wrapper function, as well as some extra plumbing.
> > > 
> > > Bug: https://github.com/dart-lang/sdk/issues/37753
> > > Change-Id: If099dbfe9e5d62979626b852386fd0173fc76de5
> > > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136190
> > > Commit-Queue: Clement Skau <cskau@google.com>
> > > Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
> > 
> > TBR=vegorov@google.com,cskau@google.com
> > 
> > Change-Id: I89e517196f03622337f909f0fcecbdc77c9dda93
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Bug: https://github.com/dart-lang/sdk/issues/37753
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144920
> > Reviewed-by: Clement Skau <cskau@google.com>
> > Commit-Queue: Clement Skau <cskau@google.com>
> 
> TBR=vegorov@google.com,cskau@google.com
> 
> Change-Id: I78589c83cbb17151ca4ab8f811b4f18f252fb9c1
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: https://github.com/dart-lang/sdk/issues/37753
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144921
> Reviewed-by: Clement Skau <cskau@google.com>
> Commit-Queue: Clement Skau <cskau@google.com>

TBR=vegorov@google.com,cskau@google.com

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

Bug: https://github.com/dart-lang/sdk/issues/37753
Change-Id: I879df17bd282d01468fa010b94a8c89afdb8cd0d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145361
Reviewed-by: Clement Skau <cskau@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Clement Skau <cskau@google.com>
2020-04-29 09:52:30 +00:00
Clement Skau 871983d8ae Revert "[VM] Fixes missing bits for new sync* transform."
This reverts commit 05b7f49c72.

Reason for revert: This appears to break other external targets. Rolling this and original CL back to unblock rolls until deeper investigation can be done.

Original change's description:
> [VM] Fixes missing bits for new sync* transform.
> 
> The missing part of the transform fixes an issue that manifested
> as a crash when running tests for [0].
> Which was caused by un-transformed yields in nested functions in sync*s.
> 
> The second half of this CL updates the type_checker tool for the new
> transform of sync*s.
> 
> [0] https://github.com/KhronosGroup/glTF-Validator
> 
> TBR: To unblock roll blocked by crash.
> 
> Bug: https://github.com/dart-lang/sdk/issues/37753
> Change-Id: Ie20f351b16f2f87e92f0731fc96b0a5ea29e0300
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144948
> Commit-Queue: Clement Skau <cskau@google.com>
> Reviewed-by: Clement Skau <cskau@google.com>

TBR=kustermann@google.com,cskau@google.com

Change-Id: Ided526100e7393375445545d0fe16806333b0d20
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/37753
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145360
Reviewed-by: Clement Skau <cskau@google.com>
Commit-Queue: Clement Skau <cskau@google.com>
2020-04-29 08:35:52 +00:00
Clement Skau 05b7f49c72 [VM] Fixes missing bits for new sync* transform.
The missing part of the transform fixes an issue that manifested
as a crash when running tests for [0].
Which was caused by un-transformed yields in nested functions in sync*s.

The second half of this CL updates the type_checker tool for the new
transform of sync*s.

[0] https://github.com/KhronosGroup/glTF-Validator

TBR: To unblock roll blocked by crash.

Bug: https://github.com/dart-lang/sdk/issues/37753
Change-Id: Ie20f351b16f2f87e92f0731fc96b0a5ea29e0300
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144948
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Clement Skau <cskau@google.com>
2020-04-29 06:56:14 +00:00
Konstantin Shcheglov 1eb7ed02eb Fix leak of changed FileState(s).
R=brianwilkerson@google.com, keertip@google.com

Change-Id: I8b68eee0b0a3cdf613912615198990edec7768dd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145309
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-04-29 05:10:14 +00:00
Ryan Macnak 77a496427d [vm] Speed up reload in debug mode by avoiding costly checks in ~HandleScope.
Change-Id: Ic8fd16444b510829490935e64cc9393eed519150
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145305
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-04-29 01:23:03 +00:00
Nicholas Shahan 207953f367 [tests] Add regression tests for internal issue
We already landed a workaround for b/154963234 as
https://dart-review.googlesource.com/c/sdk/+/144815. Adding
these tests to ensure the followup fix doesn't break it again.

Change-Id: Ic021c2b3f0e5b3cd12ae0286ac5146c71f380aa2
Bug: b/154963234
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144988
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2020-04-28 23:49:43 +00:00
Brian Wilkerson 2270add4ae Use the element kind feature for instance members
Change-Id: I8fb449e485c77f7c13b9dd8b01f056d970ba551b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145302
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-04-28 23:40:43 +00:00
Paul Berry 885de405d2 Add test to validate resolution of #39641.
This test validates my understanding of
https://github.com/dart-lang/sdk/issues/39641#issuecomment-573669413,
namely that when assigning to a promoted variable, the context used to
do inference of the RHS of the assignment should come from the
promoted type, but it should still be ok if the RHS doesn't evaluate
to a subtype of the context type (in which case the assignment
de-promotes).

Change-Id: Iafb2e741f8b9631a9b017804a5ad59972bfc638e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144883
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-04-28 23:28:13 +00:00
Alexander Aprelev 334284a69b Revert "Reland "[vm] Make VM support .dart_tool/package_config.json""
This reverts commit 30085612f4 as it
broke vm-kernel-precomp-nnbd-linux-release-x64 bot.

Seems to be the same failure as the last time it was reverted: https://ci.chromium.org/p/dart/builders/ci.sandbox/vm-kernel-precomp-nnbd-linux-release-x64/537

Change-Id: I35a1897367bcb65f518b58659001280c5d5ed930
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145262
Reviewed-by: Alexander Aprelev <aam@google.com>
2020-04-28 23:23:44 +00:00
Nicholas Shahan 525e02fa5e [ddc] Use Null Safety flag in typeAcceptsNull
- Expose the internal runtime flag for the Null Safety mode.
- Add a guard to protect against accidental configurations
  that set the mode multiple times.

Change-Id: I8d16a3c7bd8590ea6f2fee9b6f8c09009898a64b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144991
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-04-28 21:56:48 +00:00
Alexander Markov 994f454996 [vm/nnbd] Call field initializer from stubs for late instance fields
This change introduces 2 new stubs, InitLateInstanceField and
InitLateFinalInstanceField. Those stubs call field initializer
directly without going to runtime.

Fixes the regressions on Uri.pathSegments.easy and Uri.pathSegments.hard.normalized
benchmarks with NNBD SDK after https://dart-review.googlesource.com/c/sdk/+/143189.

Change-Id: I6bde7a98010ac1321a95eda8b0f125105f3993c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144807
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-04-28 21:35:23 +00:00
Nicholas Shahan 3da1591253 [ddc] Fix function type casts in weak mode
Allow null to be cast as function types in weak mode.

Change-Id: I42084250c428b7e6a18ce343305d43603b4e1ec4
Fixes: https://github.com/dart-lang/sdk/issues/41680
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144995
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
2020-04-28 21:19:54 +00:00
Ryan Macnak 3495158ec9 [vm, gc] Divide new-space into pages like old-space.
Will allow
 - merging heaps without first evacuating the donor's new-space
 - visiting new-space in parallel during marking

Change-Id: I6189281801cdafa4f9944ab5e7bb2153f964b18b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143080
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-04-28 20:25:32 +00:00
Brian Wilkerson 5528d8daac Add a fix to add the required keyword
Change-Id: I2602ab5b4d3b47d3d8e302aa60847b791768481a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145200
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-04-28 20:04:22 +00:00
Vyacheslav Egorov 022f38a783 [vm/compiler] Fix operand encoding overflow in Drop on ARM64
It should use AddImmediate rather than raw add(...)

ARM already had correct implementation.

Fixes https://github.com/flutter/flutter/issues/55856

Change-Id: I7d06e5eab7eb5769cb0e1f198d45128d4f8f2f2d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145120
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2020-04-28 19:40:37 +00:00
Konstantin Shcheglov 39c503970b Reset the library context in FileResolver by timeout.
R=brianwilkerson@google.com, keertip@google.com

Change-Id: I4dafff7229ad8a6f6713d6929121222ad818eccf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144996
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
2020-04-28 19:38:02 +00:00
Ryan Macnak 6e37605661 [vm, gc] Set the scavenger's forwarding bit to equal to the pointer tag bit.
Makes some conversions no-ops.

Change-Id: I577475b1ec3ee9d4e79f3deb931b9d225053d447
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144805
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-04-28 19:32:32 +00:00
Joshua Litt ed6da1c899 [dart2js] NNBD changes for future_or_test.
Change-Id: I8911179c33f99fb604f0bee309140c85711ff536
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143880
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2020-04-28 19:01:22 +00:00