Commit graph

72489 commits

Author SHA1 Message Date
Konstantin Shcheglov f724ff477b Extract INCONSISTENT_INHERITANCE tests.
R=brianwilkerson@google.com

Change-Id: I069859da9e2d34f7c7b97f653a8f875794e502d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146540
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-05-05 15:23:44 +00:00
Lasse Reichstein Holst Nielsen 7bb38670d2 Don't run tests depending on member names when obfuscated.
Bug: http://dartbug.com/41771
Change-Id: I1f4a7d4900e225ca05bb445db0e22e85a71f8723
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146582
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2020-05-05 12:46:54 +00:00
Martin Kustermann c01f9fb8a9 [vm/concurrency] Make an isolate group use a custom ThreadPool with maximum size
Our TLAB sizes and maximum new space size constrain the number of
parallel mutator threads we can have. Having too many mutator threads
would cause constant races between threads to acquire TLABs.

In reality we should constrain the number of threads to be at most the
number of cores, since at most that many threads can run in parallel
(i.e. at the same time).

This CL extends the TreadPool implementation to be constrained by a
maximum size. Furthermore it makes each isolate group's have it's own
pool with constrained size and schedule all group member
mutator / message handler tasks on that pool.

Issue https://github.com/dart-lang/sdk/issues/36097

Change-Id: I095c749adad827ab892f33713a32be594d7606d1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145382
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-05-05 12:08:43 +00:00
Clement Skau 2359f4dc68 [VM] Reworked: Remove unnecessary Closure.clone() from sync*.
Removes the Closure.clone() in sync* by adding an additional closure
around the rewritten sync* function body.

This is a re-worked version of the now reverted:
- https://dart-review.googlesource.com/c/sdk/+/136190
- https://dart-review.googlesource.com/c/sdk/+/144948

This CL includes changes from both the above CLs, in addition to:
- A new 'ShadowRewriter' transformer to do deep rewriting of
  shadowed parameters.
  Previous versions only rewrote the immediate sync* function, missing
  references in nested rewritten functions.

Note: This CL is re-landing largely unchanged since the roll-blocking
issues suspected to be caused by this was later attributed to a
different set of changes.
I have independently re-run all failing external tests to verify
them passing for this CL.

Bug: https://github.com/dart-lang/sdk/issues/37753
Change-Id: Id1670a93961180e8558d7c7eca65fe7e9115f07b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145402
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2020-05-05 12:04:03 +00:00
Jens Johansen 15acf8a51f [parser] Replace isBuiltIn and isPseudo (and implicit isReserved) with explicit enum
Change-Id: I1e77e97989b931160bf98c99272e0a016920b8cf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145801
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-05-05 11:53:54 +00:00
Johnni Winther 59e54abb0e [cfe] Handle callable type variables.
Change-Id: Ibd963206bb81fef16f3cb410fc352e636b0596e0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146580
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-05-05 10:02:03 +00:00
Lasse Reichstein Holst Nielsen 765c9c3a8e Make tests not assume catch(e) gives e type dynamic.
See #41558

Bug: http://dartbug.com/41558
Change-Id: I8980ad6e0d240c917f36ec4f9fcf2091fb61a4b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143819
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2020-05-05 09:57:23 +00:00
Jens Johansen 2ac2433a31 [parser] Remove @deprecated methods
Change-Id: Ib8b5e6b95067acc2bed8586088ee55222cb9d80b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145800
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-05-05 09:42:23 +00:00
Johnni Winther 3788a59c6c [cfe] Remove ObjectAccessTargetKind.unresolved
Change-Id: I39fd278531038829ea28a870b6333918e4a6bf38
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146261
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-05-05 09:00:23 +00:00
Lasse Reichstein Holst Nielsen 2ca3555c44 Allow NoSuchMethodError.withInvocation to accept any Invocation.
Currently the VM only accepts an `_InvocationMirror` instance, not a user created `Invocation`.

Fixes #33124

Bug: http://dartbug.com/33124
Change-Id: Ifdc95861cbe632bc317ca8d9fb92cf0d3ae600f0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140100
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2020-05-05 08:10:13 +00:00
Jens Johansen 497bdc5226 [parser] Some recovery from using reserved words as method/field names
Change-Id: I9795ecc28f06d1f9410066ded73405019052947d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145586
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-05-05 07:56:33 +00:00
Jens Johansen e1cfc95c02 [CFE] Add missing '()' to nnbd/override_checks
Change-Id: I7a62dbb21a9c3bc59550f2daff59a1a62cc3588f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144580
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-05-05 07:45:13 +00:00
Zichang Guo 94498c503c [dart:io] Remove unused fields in socket_patch
Change-Id: Id509738f729324127e3ce8cb17848203d6a4e47a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146160
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
2020-05-05 07:03:43 +00:00
Sam Rawlins 9c94f08410 Migrator: Fix 'Report a Problem' link
Fixes https://github.com/dart-lang/sdk/issues/41485

Change-Id: I514cc299f7a821f8cd8d623a8d9702e694178379
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146461
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2020-05-05 04:04:03 +00:00
Devon Carew bbe133eac7 re-generate package:vm_service
Change-Id: I0891c39a76775afb667e9c35de1c629823c14281
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146520
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2020-05-05 02:25:38 +00:00
Paul Berry 11e5a05a70 Migration: when removing dead code, remove unnecessay ??=s
Fixes #38676.

Change-Id: Icc24c6f070d7f3e8a74fc9494aef3e4c2583fac4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146320
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2020-05-05 02:18:13 +00:00
Paul Berry 13b3d67278 Migration: test interactions between type promotion and new compound assignment diagnostics
Change-Id: I31d0389872640a54c962976754e65c3e2aeb2f1a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145981
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-05-05 02:18:13 +00:00
Ben Konyi 798b6e7c8d Revert "[ dartdev / DDS ] Spawn a Dart Development Service instance when running with --observe via dartdev"
This reverts commit ffbd84d383.

Reason for revert: Failing build on golem and failing test on simarm bot. Will investigate tomorrow.

Original change's description:
> [ dartdev / DDS ] Spawn a Dart Development Service instance when running with --observe via dartdev
> 
> Dartdev will now spawn a DDS instance when the --observe flag is
> provided. The stdio streams from the target process are filtered to
> replace any references to the true VM service URI with the DDS URI.
> 
> If arguments are provided to --observe to configure the server, the
> arguments will be used when spawning DDS instead of the VM service.
> 
> Change-Id: I48888c391135fc9f1e7f92d2a86855071e6b4aaf
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145680
> Reviewed-by: Ryan Macnak <rmacnak@google.com>
> Commit-Queue: Ben Konyi <bkonyi@google.com>

TBR=jwren@google.com,bkonyi@google.com,rmacnak@google.com,asiva@google.com

Change-Id: I750325b45692ff7a40066b37924b01fa98a692d3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146522
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-05-05 02:17:36 +00:00
Robert Nystrom 6cddb9eb1b Migrate language_2/function_type to NNBD.
Change-Id: I4599b9a2bc0a410b977cd95ee75b62557eca8aae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145567
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
2020-05-05 01:38:43 +00:00
Ben Konyi ffbd84d383 [ dartdev / DDS ] Spawn a Dart Development Service instance when running with --observe via dartdev
Dartdev will now spawn a DDS instance when the --observe flag is
provided. The stdio streams from the target process are filtered to
replace any references to the true VM service URI with the DDS URI.

If arguments are provided to --observe to configure the server, the
arguments will be used when spawning DDS instead of the VM service.

Change-Id: I48888c391135fc9f1e7f92d2a86855071e6b4aaf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145680
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-05-05 01:18:28 +00:00
Ben Konyi 9cfe19d38b [ VM / Service ] Remove _spawnUri RPC from VM service
This code doesn't appear to be used anywhere in the Dart SDK or Flutter.

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

Change-Id: Iad8537f3187caa7b2304ee2ec2aaaa8b6ba2b35c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146480
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-05-05 00:47:37 +00:00
Paul Berry eb3a42b789 Migration: test interactions between null-shorting and new compound assignment diagnostics
Change-Id: Ia46aaf380fad1c65b59fff214217658cfcaee973
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146000
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2020-05-04 23:02:17 +00:00
Paul Berry b71d09542c Migration: extend compound assignment diagnostics to ++ and --.
Bug: https://github.com/dart-lang/sdk/issues/38676
Change-Id: Iab5097359d8de7aa9411f51ee0ec6212c3adb678
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145920
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2020-05-04 23:02:17 +00:00
Ryan Macnak 47e33200fb [vm] Remove ObjectLayout::ptr(), which is now a no-op.
Change-Id: I5a066b0c510f580d8e720aba6e532218de165fb5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146061
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-05-04 22:54:17 +00:00
Ryan Macnak 60493d58fb [vm] Remove undefined shifts from ReadStream.
Change-Id: I3570739b77d431e412af94c87fa544805f6dbbcb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146028
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-05-04 22:53:47 +00:00
Joshua Litt fb5ebf6a09 [dart2js] Fix and rebase impact test for nnbd.
Change-Id: I545f5df00c4e8c1ae6a60ec6a6c4458c5d53db78
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146360
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2020-05-04 22:05:37 +00:00
Mark Zhou 3391be2d16 [tests] Adding and extending tests for required named parameters.
Some of these are currently disabled in the CFE. See: https://github.com/dart-lang/sdk/blob/master/pkg/front_end/lib/src/fasta/source/source_library_builder.dart#L403

Change-Id: If5aeff4e3743ea589e8c2572ada869aeced5c826
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144671
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2020-05-04 21:17:47 +00:00
Ryan Macnak 14dfa1b9ee [vm] Fix gcc build.
Change-Id: I6634dc10fdc8d7523562c0fcc20e3561eb580acf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146023
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-05-04 21:15:27 +00:00
pq 767e78cb4d add lint reporting for offsets
Change-Id: I56898228f19039aeb6f241080cd3324027763b6c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146420
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2020-05-04 20:32:17 +00:00
Zach Anderson bbebad9eca [dart:io] Don't treat a file descriptor as a signal o_o;
Prior to this CL, the signal handler finalizer passes a file descriptor
where a signal number is expected.

This went uncaught for awhile since it is innocuous in most cases.
Clearing a signal handler just involves setting it back to the
default. It is not innocuous where the VM chose to override the
default, for example in the case of SIGPIPE. When setting signal
handlers with the dart:io API, if the finalizer for a _NativeSocket
for a signal handler runs, some time later the VM may be killed by
SIGPIPE instead of getting EPIPE from an IO call.

This CL replaces the call in the finalizer with a new call that
expects a file descriptor, and uses the file descriptor to look
up the signal handler that needs to be cleaned up.

Change-Id: I54caa14a556e434872d12fd9acf8c2fcf767b91e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146080
Commit-Queue: Zach Anderson <zra@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2020-05-04 20:19:18 +00:00
Keerti Parthasarathy 01820c20a5 Fix checking path for windows
Change-Id: I7ad6bb40be07dc2cf9d609c7c379dc7ec6725da1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146400
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2020-05-04 19:56:54 +00:00
Alexander Markov 99d4f68a3a [vm/aot/tfa] Eliminate null checks and comparisons with null in TFA
Flutter gallery in release mode:
snapshot size armv7 -0.47%, armv8 -0.45%
app.so gzip armv7 -0.53%, armv8 -0.51%
app.so brotli armv7 -0.47%, armv8 -0.40%

with size optimizations:
snapshot size armv7 -0.57%, armv8 -0.46%
app.so gzip armv7 -0.52%, armv8 -0.52%
app.so brotli armv7 -0.53%, armv8 -0.49%

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

Change-Id: I1b841b634595723d7c2e7c0d366805e1c224c9bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146026
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-05-04 19:42:44 +00:00
Devon Carew a99ae4d2f3 re-generate the vm_service library and add misc improvements to RPCError
Change-Id: Ibb3de14e9b438a5ec34b865122445a6bcb83dcd1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146100
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2020-05-04 19:25:24 +00:00
Brian Wilkerson ed3d0e7483 Convert StaticMemberContributor to use SuggestionBuilder
This also removes the use of an ElementVisitor.

Change-Id: I9589a4f8fb66ce365ed911a86d3a6f832c189dbe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146380
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-05-04 19:17:54 +00:00
Mike Fairhurst 2b80aa0f7f [analysis_server] Report angular plugin exceptions to new staging crash product
Change-Id: I72826fc66ff87acc5003e913483a63081fa2931b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145960
Reviewed-by: Jaime Wren <jwren@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2020-05-04 18:11:54 +00:00
Mike Fairhurst f1c1dfacb7 [analysis_server] Report to both prod & staging crash reporting
This CL enables us to have different crash reporters that report to
different backends, this will be useful if we report plugin errors to
staging and server errors to prod.

Currently doing this with server errors so that we can make the switch
over to prod incrementally. For the time being, the staging backend will
have our whole crash history, and continue to get new crashes. Reports
and dashboards can switch over to the prod backend as we get enough
history for those reports to be useful, and when we have switched
everything over we can stop reporting to staging entirely.

Change-Id: Ie29b4e05c89fd57faf1487a2c2eba3701fc319d0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145922
Reviewed-by: Devon Carew <devoncarew@google.com>
2020-05-04 18:11:54 +00:00
Daco Harkes e6c552e322 [vm/ffi] Update package:ffi version
Update package:ffi to a version which does not depend on unpaired
surrogates.

Breaking change in Dart: https://github.com/dart-lang/sdk/issues/41100.

Change-Id: I2a5ba0abee7c6cccb166c234f8f620dbe0063d47
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146340
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2020-05-04 17:47:44 +00:00
Filip Filmar b161b52331 Use new call to get ComponentContext
Fuchsia OS is making a change in the serving sequence for component
startup, to avoid a race condition in which clients attempt to connect
to services that are not yet exposed but will be.

This change is needed for a smooth transition to that new API.  The
Fuchsia SDK change has already rolled to Dart.

See: https://bugs.fuchsia.dev/p/fuchsia/issues/detail?id=50758
Change-Id: Ib1249dcf771e99f542343328918ae55497ddaf71
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145700
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Filip Filmar <fmil@google.com>
2020-05-04 17:35:24 +00:00
Ryan Macnak 75c65a4b39 [vm] Switch Zones from arithmetic to geometric growth when they become large.
Avoids failing on Linux from exhausting Page Table Entries before exhausting physical memory or address space.

Change-Id: Idffbd0a2eb8b030f2afabb4c31135fb75deca59f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144669
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2020-05-04 17:01:44 +00:00
Mark Zhou bc4c0428be [dart2js] Fixing some nullability errors in linked_hash_map.dart.
This is responsible for some overzealous tree-shaking in the failures seen in: https://dart-review.googlesource.com/c/sdk/+/144671

Change-Id: I039a7dd2162601adf2d3c7e883ad6d98ba95cd9a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146025
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2020-05-04 16:32:57 +00:00
Brian Wilkerson c562a628bd Remove containingMemberName parameters from SuggestionBuilder
Change-Id: I5dc85773deffe98fd5d8308b0d4c8fe350a385f3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146063
Reviewed-by: Jaime Wren <jwren@google.com>
2020-05-04 16:23:30 +00:00
Daco Harkes 018fa4ef46 [vm] Make BSS relocation reusable
Change-Id: I6669a59fc1f36ad1b4d626f115c0ad9bccf69e6f
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145590
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-05-04 16:17:14 +00:00
Keerti Parthasarathy cc7c0ffa15 Fix test failure on windows bot
Change-Id: I30b4208420d5160ed00b06d5cfdfe15562703dfa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146280
Reviewed-by: Paul Berry <paulberry@google.com>
2020-05-04 15:57:08 +00:00
Martin Kustermann a94b8ae45d Reland "[vm] Make VM support .dart_tool/package_config.json"
This relands the following CLs

    [vm] Make VM support .dart_tool/package_config.json
    https://dart-review.googlesource.com/c/sdk/+/145462

    [vm] Make Isolate.resolveUri() work for both `.packages` and `dart_tool/package_config.json`
    https://dart-review.googlesource.com/c/sdk/+/145803

    [vm] Skip (newly enabled) isolate tests on simarm* and hot-reload configs
    https://dart-review.googlesource.com/c/sdk/+/145861

    [vm] Remove ../0 postfix from status file entries (test framework does not recognize those multitests)
    https://dart-review.googlesource.com/c/sdk/+/145940

    [vm] - Fix hang when no package config or .packages exist
    https://dart-review.googlesource.com/c/sdk/+/145661

The only change (extra patchset) is to let VM prefer the old/legacy
".packages" format and only use the newer
".dart_tool/package_config.json" if we failed to find a ".packages".

Closes https://github.com/dart-lang/sdk/issues/41739
Closes https://github.com/dart-lang/sdk/issues/41649

Change-Id: I220f808540e6e521d985ae763968f64dbf57fe67
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145942
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2020-05-04 14:51:14 +00:00
Martin Kustermann 1ada0442d8 [vm] Move disabling of OS thread creation after last Thread::EnterIsolate (which can create a thread)
With our current C++ unit test framework (run_vm_tests) we cannot write
a regression test for this.

See b/155605399

Change-Id: I86453db2b74dbf6d57a205abff6e9cdcac18b9df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146260
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2020-05-04 13:56:28 +00:00
Johnni Winther e7bebea059 [analyzer,cfe,dart2js] Make id-testing wildcard customizable and unsupported by default
Change-Id: Id11dc3c04d1d42853566e492b7d5aead4a35a724
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145781
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-05-04 12:58:24 +00:00
Alexander Thomas 469fed5a30 [infra] Add gen_snapshot target to cross arm AOT builder
The builder requires out/ReleaseXARM64/gen_snapshot to produce valid
test results.

Change-Id: I107b58b3e0031d2fa911ae0fbb89f11e0ca31b7f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146222
Commit-Queue: Alexander Thomas <athom@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Auto-Submit: Alexander Thomas <athom@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-05-04 11:08:13 +00:00
Aske Simon Christensen 3efa014657 Changelog entry for UTF-8 breaking change
Closes https://github.com/dart-lang/sdk/issues/41100

Change-Id: I91b39af42cfc6c738056e20c1a96cad6fd3cfde6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145785
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2020-05-04 10:48:32 +00:00
Aske Simon Christensen 07d508b45f Adjust JSON encoding and decoding to the WHATWG standard.
This brings JSON encoding and decoding in line with the UTF-8 changes
described at https://github.com/dart-lang/sdk/issues/41100

The fused UTF-8 / JSON decoder for the VM now uses the new UTF-8 decoder
instead of its own, separate UTF-8 decoder.

The JSON encoder now escapes lone surrogates, so it can encode JSON
string values containing lone surrogates while keeping its output valid
UTF-8.

Change-Id: Ie4d4601cf84012068849e64d4670f2dcd49ea088
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144286
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2020-05-04 10:48:32 +00:00
Aske Simon Christensen fa2fd41166 UTF-8 decoder using a state machine.
Two-pass decoder: the first pass scans through the input to compute
the length of the resulting string and which decoder to use, and the
second pass does the actual decoding.

The same decoder is used for both one-shot and chunked decoding, and
both with and without allowMalformed. If there is an error in the input
and allowMalformed is true, it starts over with a general decoder that
supports malformed input and allocates space as it goes along.

JS targets go directly to the general decoder, as the two-pass approach
is not beneficial here.

Three pieces of the decoder are designed to be pluggable by patches to
optimize the performance further:
- scan, running the first pass of the conversion.
- decode8, decoding Latin1 data into a OneByteString.
- decode16, decoding arbitrary data into a TwoByteString.

Improves decoding speed, especially for complex input (many multi-byte
characters). Observed speed increases are approximately:
 - dart2js: up to 40%
 - VM JIT:  up to 260%
 - VM AOT:  up to 130%

The constant overhead of calling the UTF-8 decoder is also significantly
reduced for dart2js.

Code size for dart2js is slightly reduced compared to the old decoder.

ASCII inputs currently see a slight speed decrease for VM targets, which
will be fixed in https://dart-review.googlesource.com/c/sdk/+/145460

This is part of the implementation of the breaking change described at
https://github.com/dart-lang/sdk/issues/41100

Closes https://github.com/dart-lang/sdk/issues/28832
Closes https://github.com/dart-lang/sdk/issues/31954

Ideas for further improvements to the decoder are collected in
https://github.com/dart-lang/sdk/issues/41734

Change-Id: I3c5bb84e8d6783231680a9d34d6c38e8a28ab112
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142025
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-05-04 10:48:32 +00:00