Commit graph

74157 commits

Author SHA1 Message Date
Filip Filmar
e3a682480a Reland "[vm] Replaces fuchsia.deprecatedtimezone"
This is a reland of 16f09f20b3

The apparent break of internal tests was not caused by this change.

Original change's description:
> [vm] Replaces fuchsia.deprecatedtimezone
>
> (prior attempt was rolled back as it caused downstream tests to time
> out.  See prior attempt at: See:
> https://dart-review.googlesource.com/c/sdk/+/149206)
>
> The FIDL library fuchsia.deprecatedtimezone is going away.  There are
> different and better ways to obtain the same functionality.  This change
> removes the dependency on fuchsia.deprecatedtimezone from the Dart SDK.
>
> Adds inspect metrics that allow whitebox testing of the runners.  Here's
> a sample `fx iquery` excerpt from a running device, showing both a dart
> and a flutter runner exposing the same OS diagnostic metrics.
>
> ```
> /hub/c/dart_jit_runner.cmx/70981/out/diagnostics:
>   /hub/c/dart_jit_runner.cmx/70981/out/diagnostics#os:
>     dst_status = 0
>     get_profile_status = 0
>     timezone_content_status = 0
>     tz_data_close_status = 0
>     tz_data_status = 0
> /hub/c/flutter_jit_runner.cmx/29567/out/diagnostics:
>   /hub/c/flutter_jit_runner.cmx/29567/out/diagnostics#os:
>     dst_status = 0
>     get_profile_status = 0
>     timezone_content_status = 0
>     tz_data_close_status = 0
>     tz_data_status = 0
> ```
>
> Under nominal operation, all of the above values should be equal to 0.
> Nonzero values indicate an error.
>
> This functionality is guarded by Fuchsia integration tests at
> //src/tests/intl.
>
> Tested:
>   (compile locally for Fuchsia and deploy)
>   fx test //src/tests/intl
>
> See:
>   - https://github.com/dart-lang/sdk/issues/42245
>   - https://github.com/dart-lang/sdk/issues/39650
>
> Fixes #39650
>
> Change-Id: I97f6e17e57000f6eec71246aee670bca65b7e1d1
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150662
> Commit-Queue: Filip Filmar <fmil@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>

Change-Id: I5da6b0f481af0eb42c3b5e74c920588ac2ef5be9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151862
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Filip Filmar <fmil@google.com>
2020-07-09 01:41:53 +00:00
Alexander Markov
6f6b1f8818 [vm] Rename --null-safety option to --sound-null-safety
Deprecated option --null-safety still remains in order to allow
graceful migration.

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

Change-Id: Ie47b1bebc9dd6532658a60743ecb85dc7fdc108c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153660
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2020-07-09 01:37:23 +00:00
Konstantin Shcheglov
7a87766f23 Remove bogus features from analyzer.
R=brianwilkerson@google.com, devoncarew@google.com

Bug: https://github.com/dart-lang/sdk/issues/40860
Change-Id: I9ce962b43cc9d0d865a54d0b31a30245e5f7c001
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153707
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-07-09 01:23:23 +00:00
Michael Thomsen
897706edbd Remove unrecommended flag from output:
The current output indirectly advertizes premature out-of-order migration,
which would be bad if it happened widely.

We can keep the flag, but should not advertize it.

Change-Id: I8bde10489cef8e1104e2e5216e03aed61bc95ba0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153612
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Michael Thomsen <mit@google.com>
2020-07-09 01:19:53 +00:00
Konstantin Shcheglov
849cdb2ab4 Check for consistency of language version overrides between library and parts.
Change-Id: I209cbcda3d96c4e2f1f7a0352b563c886a22e687
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153702
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-07-09 00:42:42 +00:00
Konstantin Shcheglov
aff22600de Use CaughtExceptionWithFiles instead of LibraryCycleLinkException.
R=brianwilkerson@google.com, devoncarew@google.com

Change-Id: Iae70c6453930fca8ef8e2828cf7e3932cc742263
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153706
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-07-09 00:34:57 +00:00
Konstantin Shcheglov
9dea0a8d97 Add InterfaceType.asInstanceOf(ClassElement) to API.
R=brianwilkerson@google.com

Change-Id: I91c61aea37bb4ccfb300083e1b017b8e71ef6d6d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153703
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-07-09 00:34:38 +00:00
Ryan Macnak
d4ffb92ed8 [vm] Reify loading units.
Loading unit metadata is expanded to create an object representing each loading unit, and each library to reference the loading unit it is a part of.

To be used at compile-time to help assign objects to snapshots.

To be used at runtime to track which units have been loading and the base objects for cross-snapshot references.

Bug: https://github.com/dart-lang/sdk/issues/41974
Change-Id: Icd3fa95ffd5949bd8f7f84a6f750c4c515de0dba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151865
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-07-09 00:15:07 +00:00
Konstantin Shcheglov
c76fc431c7 Add WorkspacePackage to each FileState.
We need this so that we can look if the file is NullSafe by asking
the package that contains it.

Bug: https://github.com/dart-lang/sdk/issues/42594
Change-Id: I11c71faf7bddd53b458a66f0786454ecd7453b5e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153521
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-07-08 23:54:47 +00:00
Jonas Termansen
42102684d4 Roll benchmarks-internal fce42736f4d6..81f0ebd1fd65
81f0ebd1fd651eae860cb1958bd359440ec17057 https://dart-internal-review.googlesource.com/c/benchmarks-internal/+/2020

R=regis@google.com

Change-Id: Id2b50aff0fd78703a4505304f85595710aaa9629
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153618
Auto-Submit: Jonas Termansen <sortie@google.com>
Commit-Queue: Jonas Termansen <sortie@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2020-07-08 23:14:57 +00:00
pq
7498facd2a fix async fix processor name
Change-Id: Ie6e0a0e3e42ce07f4a5a8334a4f4240c8c0fa64d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153624
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2020-07-08 22:03:46 +00:00
Konstantin Shcheglov
f2cbec8010 Check for unnecessary_parenthesis in analyzer.
R=brianwilkerson@google.com

Change-Id: I2e8af156a190b51741d60fdb0217101c15306a79
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153622
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-07-08 21:46:16 +00:00
Konstantin Shcheglov
9280712d29 Change ConstructorElement.returnType to InterfaceType.
R=brianwilkerson@google.com

Change-Id: I3f2605b26cc953d707dc5c37b690ec0438a99b3c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153621
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-07-08 20:01:07 +00:00
Alexander Aprelev
8b9f920c52 [vm/isolates] Clean up redundant SafepointOperationScope when installing allocation stub.
The SafepointOperationScope is provided by RunWithStoppedMutators.

Change-Id: Ib0f3a86de58b074a0b5b84b05631ecc59d62de36
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153640
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2020-07-08 19:47:36 +00:00
Jonas Termansen
8e3b375123 Roll benchmarks-internal 42145e4ddea8..fce42736f4d6
6efdf1f8431224da0efd6d29b65670861ccbd5a7 https://dart-internal-review.googlesource.com/c/benchmarks-internal/+/1982
fce42736f4d6721b882b8d0119edac568dbc90d2 https://dart-internal-review.googlesource.com/c/benchmarks-internal/+/2000

R=regis@google.com

Change-Id: I2b1a6cf0a26bcaa207b84fe644b49ce840db4b93
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153617
Auto-Submit: Jonas Termansen <sortie@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2020-07-08 19:43:45 +00:00
Stephen Adams
a38e265f04 Fix #42531
Bad identifier for async closure generator body names in extension methods.

Fixed: 42531
Change-Id: Ice29bb5ac03c67b1024c0fd53ffdb9b9b1d2131f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153484
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2020-07-08 19:29:45 +00:00
linzj
db5cda81fb Fix disassembler fails to mention sign extend for loads on arm64.
R=vegorov@google.com

Change-Id: I817c16f220c94827b81510895c9dbf69e2327a27
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153580
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2020-07-08 19:29:38 +00:00
Alexander Markov
bfd15821a7 [vm] Specialize List.generate factory constructor invocations
List.generate could return both growable and fixed-size lists.
This change specializes invocations of List.generate when value of
'growable' argument is known (constant or omitted), so it becomes
possible to infer actual type returned by the factory.

This becomes more important with null safety as List.generate is used
more often to initialize lists of non-nullable elements.

Migrated NNBD benchmarks in AOT mode on x64:
Sudoku +11%
DartMicroBenchMM.{Min,Max}Lib +11-13%
DartMicroBenchMM.{Min,Max}Code +19-27%
ForInGeneratedLoop +19%
ForEachLoop +85%
ForInLoop +64%
ForLoop +680%

This change also includes test for inferred types of various List
constructors.

Change-Id: I801231b0a70e3aa8fb14ec9fe749f1dd420b1b9c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153388
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2020-07-08 18:29:25 +00:00
Alexander Markov
255c6fa2fd [vm/compiler] Do not count UnboxedConstant instructions in inliner
These instructions are often folded into indexing instructions.
Also, we do not want unboxing decisions to hinder inlining.

Fixes the regression of NNBD version of ParticleSystemUpdate
benchmark in AOT mode after https://dart-review.googlesource.com/c/sdk/+/150300

ParticleSystemUpdate +11-14%

Change-Id: I9707137195b8fe8550985fd972c02dcc59ce9239
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153540
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-07-08 18:09:15 +00:00
David Morgan
27a13c2817 Rename dev_compiler/LICENCE.md -> LICENSE, remove obsolete text.
Change-Id: I18bed36eb433a5a053c026bb327a6a474fd4161d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153614
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: David Morgan <davidmorgan@google.com>
2020-07-08 17:10:14 +00:00
Brian Wilkerson
018ded55ed Support setting unique names for lint codes
Change-Id: I815a519ea0278a6ea33c6f8d83ddac4f3cfd2a58
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153561
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-07-08 16:16:54 +00:00
Johnni Winther
fd432febe0 [cfe] Update messages for invalid returns
Closes #42527

Change-Id: Ic240dd7a8822c85c550941923bf9ce3b5cfe0dba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153348
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2020-07-08 14:47:14 +00:00
Johnni Winther
9ab7a5edef [cfe] Use variable name in error message for missing initializer
Closes #42610

Change-Id: I70a5ac9302bd6545cd5e73f2dab61a29bc6a3000
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153462
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-07-08 12:45:15 +00:00
Alexander Thomas
2b5eaffc15 Revert "[test] Add paths to chrome and firefox to the environment when present"
This reverts commit 40c79c8ed7.

Reason for revert: Breaks on windows.

Original change's description:
> [test] Add paths to chrome and firefox to the environment when present
> 
> This adds a CHROME_PATH or FIREFOX_PATH environment variable to the
> test's evnironment which contains a path to the browser's executable.
> This is only set if the --chrome or --firefox argument was passed to
> test.py.
> 
> https://github.com/dart-lang/sdk/issues/42417
> 
> Change-Id: I711de6ab91b8ffbbe72c7fb1530b68c4189a4b8a
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153209
> Commit-Queue: Alexander Thomas <athom@google.com>
> Reviewed-by: William Hesse <whesse@google.com>

TBR=whesse@google.com,athom@google.com

Change-Id: I7e1351f9b170ae3ddd218055efb770fe6e1f54e8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153606
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2020-07-08 11:00:36 +00:00
Clement Skau
fcbf5341f0 [SDK] Fixes crash in tools/run_abi_tests.py
logRecords is expected to be of type dict, but the fallback value
was previously set to [] (type list).

This CL changes the fallback values to an empty dict.
It also uses the builtin dict.get() to handle to fallback instead
of manually doing so.

Note: This CL will not make the bot go green.
It will change it from purple (infra failure due to crash) to red
since there are tests that are legitimately failing.

Bug: https://github.com/dart-lang/sdk/issues/42625
Cq-Include-Trybots: dart/try:vm-dartkb-linux-release-x64-abi-try
Change-Id: I12ad7688719039566cd16e128997f0f8efc60a69
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153600
Commit-Queue: Clement Skau <cskau@google.com>
Auto-Submit: Clement Skau <cskau@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2020-07-08 09:56:04 +00:00
Dmitry Stefantsov
2e5e03fe8d [cfe] Add support for Switch statements to text serialization
Also handle TryCatch and TryFinally.

Change-Id: I68e64161500c036bc0e1d39723baf2a88f7a3cc1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153603
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2020-07-08 09:46:54 +00:00
Jonas Termansen
ddb97247f7 Roll benchmarks-internal 4b33c3149cfe..42145e4ddea8
aad2b0dc3f23f462a550f80049ef2280a4bc874e https://dart-internal-review.googlesource.com/c/benchmarks-internal/+/1980
42145e4ddea82e8180e55b00dfd7064622ebc190 https://dart-internal-review.googlesource.com/c/benchmarks-internal/+/1981

R=regis@google.com

Change-Id: Ic5f071274e1e149387711e3b5db7fbc2e8685a66
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153466
Auto-Submit: Jonas Termansen <sortie@google.com>
Commit-Queue: Jonas Termansen <sortie@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2020-07-08 08:56:04 +00:00
Johnni Winther
233fe72de0 [cfe] Handle extension setters on nullable types
Change-Id: I5b36246038f0c7b94c9d317c2273e00ab8e8772e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152500
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-07-08 08:47:04 +00:00
Johnni Winther
45af99177b [cfe] Check overrides on operators
Change-Id: Ib250117553b2e22c6c71b78bf354be1162bc9981
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151235
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-07-08 08:45:34 +00:00
sgrekhov
fefcac472f [co19] Language/Statements tests enabled in .status files
Change-Id: Ia9832d81a4d472c8781a79bf221324a1232c144a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153211
Reviewed-by: Alexander Thomas <athom@google.com>
2020-07-08 07:47:44 +00:00
Jens Johansen
ad4d43cf5b [CFE] Constant transformation for expression compilation
Fixes https://github.com/dart-lang/sdk/issues/42240

Change-Id: Idc75e99aed6acbb67755c77faa1904183a630f91
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153355
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-07-08 07:17:40 +00:00
Clement Skau
219935a48f [VM] Adds Future.timeout stack unwinding support for --lazy-async-stacks.
Bug: https://github.com/dart-lang/sdk/issues/40815
Change-Id: I1603e1effe67b727d5dc47c0830b4758c764cf4a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152328
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-07-08 06:50:40 +00:00
Alexander Markov
05003ab60d [vm/gen_kernel] Support package_config.json when converting main script URI to package URI
Fixes https://github.com/dart-lang/sdk/issues/42614

Change-Id: I6253412677b6954be36f519a193bed34004a1ff3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153541
Reviewed-by: Jonah Williams <jonahwilliams@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2020-07-08 04:15:00 +00:00
Paul Berry
464641f51a Extend BaselPackageUriResolver to handle files outside of lib.
Generated files can exist outside of `lib`.  In a Bazel workspace
these are referred to using `file:` URIs that point to the generated
code directory.  We need to be able to resolve references both from
the generated code to non-generated code and vice versa.

This is blocking the use of the migration tool in Bazel workspaces,
since the migration tool doesn't have the same level of error recovery
as the rest of the analyzer, so it needs to be able to resolve all
files including generated ones.  But it should also improve the user
experience for using the analysis server in general in Bazel
workspaces, by reducing the number of nuisance "URI not resolved"
errors.

Change-Id: I38dababd29f4490746cc6e1eeede9f438526a815
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153520
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-07-08 01:49:40 +00:00
Paul Berry
36e89f845b Flow analysis: ensure that restrict method doesn't try to promote write-captured variables.
Fixes #42066

Change-Id: Ieab80c004b3d331abb81916c3e158416bcd3ce86
Bug: https://github.com/dart-lang/sdk/issues/42066
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153480
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-07-08 01:37:30 +00:00
Konstantin Shcheglov
653e44485f Prepare to publish analyzer_plugin 0.2.5
R=brianwilkerson@google.com

Change-Id: Ie48ebda4951c1ea6d90e049639d3bbf8e15013be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153383
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-07-08 01:17:50 +00:00
Konstantin Shcheglov
819f0a92a5 Remove unnecessary override in ReplacementVisitor.
R=brianwilkerson@google.com

Change-Id: Iba88984097212242e1373e80af61a340e22d4a1f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153500
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-07-08 00:25:00 +00:00
Konstantin Shcheglov
eada9fa426 Issue 42605. Do LEGACY_ERASURE when checking inferred mixin type arguments.
Bug: https://github.com/dart-lang/sdk/issues/42605
Change-Id: I58d27352e770ce63fabc0da2c07920dbadb8af11
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153482
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-07-08 00:09:24 +00:00
Konstantin Shcheglov
ec30a30ac2 Remove the type parameter from NullabilityEliminator.perform().
R=brianwilkerson@google.com

Change-Id: Iebf32f926aec6d904940d531a8c56318f33b8074
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153483
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-07-08 00:06:00 +00:00
Nicholas Shahan
b524f398c3 [ddc] Add option to run non-null asserts in weak mode
* Setting the nonNullAsserts flag in the bootstrapping logic will
  enable/disable failing when a null value is passed to a non-nullable
  method parameter when running with weak null safety.

* Move the --null-assertions from VM options to the shared options in
  the test and use it to set the flag in DDC the entry point.

* Configure other backends to ignore the flag.

Change-Id: Ia2670514bed7fa981564e99b85d74f6bae6dd9fc
Fixes: https://github.com/dart-lang/sdk/issues/42404
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151306
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-07-07 21:48:40 +00:00
Alexander Aprelev
a199791cc2 [vm/patch_class] Remove obsolete "patch" bit from Class object.
This bit was made redundant when parsing was moved out of vm into
frontend.

Change-Id: Ia0c40e2420e58caffa3ad7ed390b9189706b6acb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153385
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2020-07-07 21:17:00 +00:00
Zichang Guo
b8a6e77700 Update operatingSystemVersion on MacOS/iOS to return system version instead of kernel version
Platform.operatingSystemVersion on MacOS/iOS returns the version of the
kernel. It should instead returns system version.

This cl will try to use recently added "kern.osproductversion" to get
the system version. If it failed, try to read from "SystemVersion.plist".
Falls back to original kernal version if none of them succeed.

Bug: https://github.com/dart-lang/sdk/issues/41725
Change-Id: Ibbf78f10dc6d21b79d83d82fbcdacfd22ebc716d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151165
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
2020-07-07 21:07:55 +00:00
Mayank Patke
5c99205769 [dart2js] Support required named parameters in weak NNBD function types.
We cannot simply discard the `required` modifier in weak mode function
types since function types that differ in the placement of `required`
cannot compare equal. Instead, we do that during subtype checks.

We continue to ignore `required` in the actual calling convention in
weak mode.

Change-Id: I7dbb28550095c635f65592f78e495e8e4e8d7026
Fixes: https://github.com/dart-lang/sdk/issues/42608
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153386
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2020-07-07 21:00:40 +00:00
Konstantin Shcheglov
a1f510080d Use analyzer 0.39.12 in nnbd_migration.
So, we can use package:analyzer/src/dart/element/type_system.dart
instead of src/generated/... library.

R=brianwilkerson@google.com, paulberry@google.com

Change-Id: Ic804cd29429bf8a85d25e21f77292a6816a3ede7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153363
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-07-07 20:59:50 +00:00
Konstantin Shcheglov
7255b99432 Update dartdoc to 0.32.2.
So, that we unblock https://github.com/dart-lang/sdk/issues/40860

Bug: https://github.com/dart-lang/dartdoc/issues/2156
Change-Id: I0e4df8527b2868863de42d631c0833bd38fb448c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153420
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-07-07 20:40:30 +00:00
Konstantin Shcheglov
fea5f5866e Add DartTypeVisitor and DartType.accept(DartTypeVisitor) to API.
R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/40478
Change-Id: I8453011f4a39323bda86244a749509b4b347b4b6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153361
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-07-07 20:13:10 +00:00
Zichang Guo
42fcc18fcc Reland "File::Copy avoids direct copying on Windows"
This is a reland of 391d3bcdd8

The root cause of the failure is that the destination path uses forward
slashes as path separator.

This fix checks for forward slashes as a potential path separators.
If both forward and back slashes exist, the one closer to the end of the
path will be used to get the destination directory.

If any step fails, it will fall back to original copy.


Original change's description:
> File::Copy avoids direct copying on Windows
>
> There is a race condition for copying file on Windows, where CopyFile()
> returns success but data has not been populated into destination file.
> E.g process is killed or died in the middle.
>
> This cl will change File::Copy as
> 1. Copy file to a temp file in the same directory of destination file.
> 2. Rename the file to the target file.
>
> Bug: https://github.com/dart-lang/sdk/issues/42119
> Change-Id: I39b6d451f6ace970bc554501148259d33de232c7
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149667
> Commit-Queue: Zichang Guo <zichangguo@google.com>
> Reviewed-by: Zach Anderson <zra@google.com>

Bug: https://github.com/dart-lang/sdk/issues/42119
Change-Id: I58c3aa432d3f64bddb1deace4c9a1ceb2f0f5e16
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151035
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2020-07-07 20:11:00 +00:00
Nicholas Shahan
7ac8f426ff [ddc] Update flags in ddb script
* Start using --sound-null-safety in ddb script To be more consistent
with the finalized naming.
Legacy mode: No flags
Weak mode: --enable-experiment=non-nullable
Sound mode: --enable-experiment=non-nullable --sound-null-safety

* Remove --kernel flag. It's been ignored since analyzer based DDC
was removed.

Change-Id: I1349f7852927e65b1574637a96f68123f1f9741a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153387
Auto-Submit: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-07-07 19:44:40 +00:00
Jonas Termansen
62ff05b84d Roll benchmarks-internal ac71e64e299f..4b33c3149cfe
f8c4bd497b3ded004c3e357abdca17e73df7fded https://dart-internal-review.googlesource.com/c/benchmarks-internal/+/1884
4b33c3149cfec05bb9c888f37e4b5b094cca828a https://dart-internal-review.googlesource.com/c/benchmarks-internal/+/1961

R=athom@google.com

Change-Id: Ibd4d003358f76f59ee13dc5e84c7588f717e5c1f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153465
Auto-Submit: Jonas Termansen <sortie@google.com>
Commit-Queue: Jonas Termansen <sortie@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2020-07-07 17:44:22 +00:00
Jonas Termansen
0d1db38cf8 [ddc] Only print blank line in ddb if verbose.
The blank line clobbers the output if ddb is used in non-verbose mode
to execute a program where the stdout ordinarily belongs to the program
in question whose output might be machine parsed.

Change-Id: Ie929d19deabebb7b1f3d24f99035aec2d9844a64
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153208
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Jonas Termansen <sortie@google.com>
2020-07-07 17:36:12 +00:00