Commit graph

77327 commits

Author SHA1 Message Date
Alexander Aprelev a173599f4c [io/lookup] On iOS run both ipv6- and ipv4-lookup concurrently.
On iOS name resolution can take unexpectedly long because it waits for both ipv4 and ipv6 results and in some cases ipv6 lookup can take long. This CL runs explicit ipv4 and ipv6 concurrently and picks up first successfully resolved name it can connect to.

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

TEST=standalone/io/http_force_concurrent_ipv6_lookup_test

Change-Id: Ie9b7ca0493d945e2eeb8de1dec7bbacdeb902785
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177560
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2021-01-11 17:07:26 +00:00
Johnni Winther 63373b9e9c [cfe,analyzer] Pass message arguments directly to AnalysisError
This allows for supporting customized message for scanner/parser
errors.

Change-Id: Ib9470c3d8231de69611bc672570ae8902e9c0e6e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177940
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-01-11 16:45:26 +00:00
Lasse R.H. Nielsen eaf5be7b80 Uri.https and Uri.http constructors queryParams type
Currently `Uri.http` and `Uri.https` factory constructors do not allow for `queryParameters` to be `Map<String, dynamic>`, but only `Map<String, String>`, when in fact the main `Uri` constructor does work with `queryParameters` as `Map<String, dynamic>`.

Closes https://github.com/dart-lang/sdk/pull/42564
https://github.com/dart-lang/sdk/pull/42564

GitOrigin-RevId: 6fa130cc4325ae99d96260e8dc0a222398e7522f
Change-Id: Ia1ee0911ec4d80df75792a365af9ca143a729fa2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163620
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2021-01-11 15:22:06 +00:00
eggfly 318babd5ac [tools] Fix typo in build.py
Closes https://github.com/dart-lang/sdk/pull/44580
https://github.com/dart-lang/sdk/pull/44580

GitOrigin-RevId: 43ebbcec6ee358d04f19bdd2850b2aa8f9718ad5
Change-Id: Ia10816097d43f9ee1062d846326a680767033165
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177520
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2021-01-11 09:58:36 +00:00
Jens Johansen f7052cfbbc [parser] Better handling of eof when parsing 'Stream<List<>>'
This CL avoids the infinite loop created by allowing the parser
to parse it as a complex type (despite no actual name after it) and
adds a few asserts in an attempt to catch rewriting on eof (setting a
token after eof).

Fixes #42229
Fixes #44477

Change-Id: Ie2da0957894067a3d4748cb6384bc9d6cf32c215
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150521
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-01-11 09:55:06 +00:00
Brian Wilkerson 2efc8bf9e3 Unify two error codes for documentation purposes
Change-Id: I30c7bafdb0cde73a984c0d75a82cb324cded18b2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178500
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-01-10 22:52:25 +00:00
Parker Lougheed f9c3c09a9e Create a quick fix and bulk fix for unnecessary_string_interpolations
Change-Id: I8cdf98ef8e23ac6a0e5fd10d4c0605a1b0d38a85
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178340
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-01-10 16:24:25 +00:00
pq b29d36c559 bulk fix for use_function_type_syntax_for_parameters
Change-Id: I3a28cea584cc98dd0dcc9b750887485a7950b7ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178264
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-01-09 20:45:24 +00:00
Ben Konyi cf41a580eb [ package:vm_service ] Fix analysis error from https://dart.googlesource.com/sdk/+/fb5ffc827580ae49cd4611d3ddf0ad3c7c592c54
TEST=N/A

Change-Id: Iaa70b98d4918c9cfd38c32e197411318bb2cf7ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178301
Reviewed-by: Ben Konyi <bkonyi@google.com>
2021-01-09 01:16:22 +00:00
Alexander Markov 8c2ab1d04f [vm/compiler/arm] Fix register constraint for Float32x4ToFloat64x2
S-register operand used in VCVTDS instructions cannot be allocated to
an arbitrary Q-register and needs to be constrained (otherwise an
invalid instruction is generated).

TEST=runtime/tests/vm/dart/regress_42067_test

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

Change-Id: I46b5ff3c75a50361eccebb1c74878bfb3c35d301
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178162
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2021-01-08 23:00:23 +00:00
Ryan Macnak 0bf8d38b3d [vm] Defer object pools.
This is a step toward deferring literals, to effectively split binary size for libraries that are more data than code, such as localizations. Bare instructions mode still has all constants in the root snapshot because it has one global ObjectPool.

dart2js+analyzer product X64 non-bare:
app.so           10072728 ->  8479824 (-15.8%)
app.so-2.part.so 14074512 -> 15016976 (6.69%)
app.so-3.part.so  9225936 ->  9888984 (7.18%)

TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/41974
Change-Id: If61f6156e3fc2dd539331335b3bf0458102b7c75
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168991
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2021-01-08 22:11:03 +00:00
Ben Konyi fb5ffc8275 [ package:vm_service] Output null-safe code from package:vm_service code generator
TEST=Existing VM service tests

Change-Id: Ia3877927f8c761c8f37a37f1efe87221cc1ac2aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156980
Reviewed-by: Gary Roumanis <grouma@google.com>
2021-01-08 21:19:38 +00:00
Sam Rawlins 897235204e Split use_of_nullable_value into separate codes with more friendly
messages.

* UNCHECKED_INVOCATION_OF_NULLABLE_VALUE
* UNCHECKED_METHOD_INVOCATION_OF_NULLABLE_VALUE
* UNCHECKED_OPERATOR_INVOCATION_OF_NULLABLE_VALUE
* UNCHECKED_PROPERTY_ACCESS_OF_NULLABLE_VALUE
* UNCHECKED_USE_OF_NULLABLE_VALUE_AS_CONDITION
* UNCHECKED_USE_OF_NULLABLE_VALUE_AS_ITERATOR
* UNCHECKED_USE_OF_NULLABLE_VALUE_IN_SPREAD
* UNCHECKED_USE_OF_NULLABLE_VALUE_IN_YIELD_EACH

Additionally, improve the ADD_NULL_CHECK quick fix by supporting
expressions which need to be null-checked in a for-each, a yield-each,
and a spread.

Bug: https://github.com/dart-lang/sdk/issues/44603
Change-Id: Ie493a2dc1c05b64a16fd17c77d3468e8d562c497
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178080
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-01-08 21:07:02 +00:00
Ryan Macnak f59ae1e4ca [vm, arm64] Fix assertion when linking native calls.
TEST=run anything on debug simarm64
Change-Id: Idad4c1c7c008c504904b5aa26a4f81418f3a26c2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178263
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2021-01-08 20:40:52 +00:00
Sigmund Cherem d78ac75a6d [dart2js] delete bound_closure_super_test
This test has been failing for a long time because it had invalid expectations.

The test was written to test that, when overriding a member and making a
super call on a native class, we properly call the super Dart stub and
the super JavaScript method.

The former was handled properly (in the test the default parameter value
was injected according to the super type), but the latter was never
implemented (the generated code invoked `receiver.foo` instead of
`BB.prototype.foo.call(receiver, ...)`

We don't have plans to add support for the latter at this time. In the
future we do want to consider adding a static error checker to ensure
that we don't attempt to use this missing feautre.

Change-Id: I5f5179ebdf31d24d4a0b1edb8f947b94f85934ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178060
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2021-01-08 19:52:22 +00:00
Paul Berry 88cd4739b8 Flow analysis: switch on inference based on local boolean variables.
The implementation was completed in previous CLs, but hidden behind a
flag.  This CL switches on the feature and adds integration tests.

Bug: https://github.com/dart-lang/language/issues/1274
Change-Id: I0e2d7ac96d3a6d68d33d49f1eab5c341c9167f6f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175500
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-01-08 18:57:02 +00:00
Paul Berry 5b964887ee Language tests for type promotion based on local boolean variables.
The feature is not turned on yet; these tests will verify that it's
working properly once it is enabled.

Bug: https://github.com/dart-lang/language/issues/1274
Change-Id: Ia48996d4525b84b523627a7b254cba18bdef48c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177641
Reviewed-by: Leaf Petersen <leafp@google.com>
2021-01-08 18:57:02 +00:00
Srujan Gaddam 825f56c6aa Revert "[pkg:js] Add errors for JS interop using @Native classes"
This reverts commit bc43d06479.

Reason for revert: Breakage in https://github.com/flutter/flutter/issues/73176

Original change's description:
> [pkg:js] Add errors for JS interop using @Native classes
>
> Closes https://github.com/dart-lang/sdk/issues/44211
>
> - Preprocesses and hashes Native classes defined in the sdk.
> - Adds an error if you use a JS class with the same underlying name
> as a Native class.
> - Adds tests with different namespaces to test for the error.
>
> Change-Id: I649e8b2346de8cc6d11205941a37152ce42104b9
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175423
> Reviewed-by: Sigmund Cherem <sigmund@google.com>

TBR=sigmund@google.com,srujzs@google.com,rileyporter@google.com

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

Change-Id: I4b492015468d41335fc5c9d4952560d303841695
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178260
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2021-01-08 18:55:02 +00:00
pq daac91856b bulk fix for always_require_non_null_named_parameters
Change-Id: Ib91171f2f892b3a7db5e674b9b7dc884cba28d5d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178120
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2021-01-08 15:22:42 +00:00
Clement Skau a6dde1b121 [doc] Nit: Fixes MD formatting, pragmas.md
TEST=CQ

Change-Id: I33c1c148f37142d26de791c5b56cfef80f5de364
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178203
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Clement Skau <cskau@google.com>
2021-01-08 14:35:42 +00:00
Daco Harkes 78ca1452dc [cfe/test/ffi] Move ffi_sample.dart to nnbd folder
Bumps `package:ffi` to a version using `?`.

Moves `ffi_sample.dart` from `general` to `nnbd` to prevent errors on
the usage of `?` in `package:ffi`.

Change-Id: I8bce1850ce4d144174a2e3705b0ae00523b45c73
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178201
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2021-01-08 14:15:12 +00:00
Dmitry Stefantsov cf8887bd7e [cfe] Update the conversion algorithm for checking super-bounded types
The update is specified in the following:
https://github.com/dart-lang/language/pull/1133

Change-Id: I2850b1acf7c94b8174c21cf899c9b926a03d9cc8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175726
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2021-01-08 11:58:32 +00:00
Johnni Winther 35e23fbb88 [cfe] Add tests in preparation for refactoring of class hierarchy builder
Change-Id: Ic8df1dabe3ed53c41e0660315f87c313759585e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177707
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2021-01-08 11:25:51 +00:00
Anna Gringauze b1b0a6ce14 Do not add variables to scope that appear after the breakpoint
During expression evaluation, we are collecting  all variables in
all scopes that contain the current breakpoint line, and adding them
as available in current scope, which makes variables declared below
the current breakpoint line declared but undefined in JavaScript.

There is one exception to this seen so far - a variable
declared on the current breakpoint line might appear as not declared
in JavaScript and cause expression evaluation not to work due to
JS compilation errors.

This change fixes the issue by not collecting variables that are
declared on or after the current breakpoint line, making them undeclared
in dart (which also is correct according to dart scoping rules).

Closes: https://github.com/flutter/flutter/issues/72094
Change-Id: I113b69531171e0348d44edb8db6dd08a599c9db3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177760
Commit-Queue: Anna Gringauze <annagrin@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2021-01-07 23:55:59 +00:00
Regis Crelier b3bca1821c [VM/runtime] Decouple representation of function signatures from Function objects.
This fixes issue https://github.com/dart-lang/sdk/issues/43088

This CL improves on https://dart-review.googlesource.com/c/sdk/+/166920 by keeping the names of type parameters.

See go/dart-vm-signatures for motivation for this change.

TEST=existing suites

Change-Id: Ia82f1d322f72d07b2fb253cf914f9b868025c71e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176981
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2021-01-07 23:45:37 +00:00
Brian Wilkerson 5c174c8d8c Remove unused data from AssistKind
Change-Id: I71c21e4d8138fa7f92d1a3e5a919b9fff3b2098f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177980
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-01-07 23:16:48 +00:00
Alexander Markov 28edda4e41 [vm] Propagate all errors when calling Dart code from hot reload stress testing
When hot reload stress testing calls Dart code from stack overflow
check, Dart code may throw various runtime exceptions such as
StackOverflowError, not just UnwindError.

This is a possible fix for the flaky crash

../../runtime/vm/runtime_entry.cc: 2517: error: Bad script uri hook: UnhandledException
version=2.12.0-edge.26805bc63631b60de9ec31049ce93f6df3e17fde (be) (Thu Jan 7 01:55:41 2021 +0000) on "linux_x64"
pid=3227, thread=3254, isolate_group=main(0x5588bcb15c00), isolate=main(0x5588bcaee800)
isolate_instructions=5588baecc6e0, vm_instructions=5588baecc6e0
  pc 0x00005588bb2905fc fp 0x00007ff59389eff0 dart::Profiler::DumpStackTrace(void*)+0x7c
  pc 0x00005588baecc892 fp 0x00007ff59389f0d0 dart::Assert::Fail(char const*, ...)+0x82
  pc 0x00005588bb305af8 fp 0x00007ff59389f2a0 dart::DRT_StackOverflow(dart::NativeArguments)+0xf18
  pc 0x00007ff59aa023e2 fp 0x00007ff59389f2e0 Unknown symbol

on the test language_2/unsorted/stack_overflow_stacktrace_test.
This test is supposed to trigger stack overflow eventually, which may
also appear in hot reload stress testing.

TEST=language_2/unsorted/stack_overflow_stacktrace_test

Change-Id: Iad1feeecd7ee2aea451d1c698d17680cbc29d02d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178081
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2021-01-07 22:03:38 +00:00
Mark Zhou 5ee1ee3c04 [dartdevc] Adding support for deferred library checks in DDC.
Fixes #42491

Change-Id: I6afc084bb7b1ccf6c667cb241ab2ac20aa881af1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177620
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2021-01-07 21:43:08 +00:00
pq 63795a73e6 bulk fix for unnecessary_null_in_if_null_operators
Change-Id: I13b9ad4ad9ecaefd41eb211ac0a0aa0ee70557a3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178040
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-01-07 20:24:38 +00:00
Nate Bosch da6d850f5e Update to latest package:watcher
Fixes a bug in the null safety migration which did not allow a null
return from custom watcher factories.

Change-Id: Ia44978bc2b612451257386ab7839f18ffcb8623c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178061
Auto-Submit: Nate Bosch <nbosch@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
2021-01-07 20:13:48 +00:00
Ben Konyi 800ec511f5 [ DDS ] Add extension methods and getters for streams including event history
Also fixes issue where `StreamHistory` events were not being parsed
correctly.

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

Change-Id: I36c3bccf229a02ea78168041a112a30046773d59
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177720
Reviewed-by: Kenzie Schmoll <kenzieschmoll@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-01-07 17:04:38 +00:00
Ivan Inozemtsev 47aebd910d Bump matcher dependency to latest version
Changes:
  63f1110 Make argument to featureValueOf dynamic (#164)
  71eeaee Make the item argument to Match dynamic again (#163)
  2071cfd Add types to more parameters (#162)
  5d52720 Allow null-safe code to do `same(null)`. (#161)
  05db35c Delete .test_config (#160)
  e8b4964 remove redundant experiment (#159)
  48fe280 Bump SDK constraints for pub (#158)
  225cc13 allow the 2.12 prerelease sdks (#157)
  b9ce574 Prepare for the 2.11 dev SDKs (#156)
  fe4e68a Update .travis.yml
Change-Id: I90c8d9d2f21d6454f1ace977deb9efec0d29d93d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177881
Reviewed-by: David Morgan <davidmorgan@google.com>
Commit-Queue: Ivan Inozemtsev <iinozemtsev@google.com>
2021-01-07 15:17:38 +00:00
Clement Skau 3ee490327e [VM] Adds @pragma('vm:notify-debugger-on-exception')
Note: This is a reland:
- Relocates the tests.
- Adds status file skip for dartkp.

TEST=runtime/observatory{,_2}/tests/service{,_2}/notify_debugger_on_exception_test.dart

Bug: https://github.com/flutter/flutter/issues/17007
Change-Id: I5c79c140c5e7dee9dfeaa6d4bf750cf4d72f6e85
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177580
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2021-01-07 14:33:48 +00:00
Martin Kustermann eb2cac730e [vm] Remove incorrectly added ASSERT
This is a follow-up to

    https://dart-review.googlesource.com/c/sdk/+/177709

TEST=Removing incorrect ASSERT.

Change-Id: I146523d97f85271d5bce242d3284dc92ee5a21e7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177880
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2021-01-07 14:17:48 +00:00
Johnni Winther dd5b455a0c [dart2js] Handle super access in mixin declarations
This crashed because the canonical name for the replace procedure
was unbound before all references to it had been loaded, causing
subsequent reads of the canonical name to create reference without
a target.

This broke the flutter web smoke tests.

Change-Id: I6249cfda85ff76b5e2dd31bb0cf8d6312ad50c1d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177861
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-01-07 13:45:18 +00:00
Jens Johansen 5fac8d3d71 [CFE] Reproduction and fix of duplicate string-named 'abstract member-signature'
Before this CL, the map we use to "reuse" references when doing
experimental invalidation mapped from String to Reference.
In bug #44523 two abstract member-signatures have the same textual
(String) name meaning that via the lookup one would get the correct
one, one would get the wrong one, they would get the same one
which eventually causes a crash when trying to serialize.

This CL fixes the issue by mapping via the Name instead, which
basically - for private names - wraps the name and the library
which disambiguates it.

This CL also includes the reproduction of #44523.

Fixes #44523.

TEST=Mostly relying on existing test coverage.

Change-Id: Ib62ebca0b7f5092f0b8410d3c458663c3032eca1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177704
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-01-07 13:11:18 +00:00
Martin Kustermann 51674dea10 [vm/concurrency] Make static-const fields that are purely used by runtime operate on initial field table
For normal Dart code a usage of a constant (e.g. from a static const
field) is "inlined": It is represented as a `ConstantExpression` AST
node with a reference to the "evaluated" `Constant` node.
=> Static const fields are never accessed by generated code.

We would therefore not need to represent static const fields in
Kernel/VM anymore. Though there are a few exceptions where the VM's
runtime code needs access to them, which is why they are kept.

The VM runtime code doesn't need an isolate-specific slot for such
static const fields (it's a waste).

=> This CL changes the runtime code that accesses such fields to operate
   on the `IsolateGroup`s initial field table instead.

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

TEST=Pure refactoring - relying on existing test coverage.

Change-Id: I5994811a1c1016b2f523b318b698c9e052a98c29
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177709
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2021-01-07 11:44:58 +00:00
Sigurd Meldgaard 8e293ceae7 Bump pub
included commits:

 392a3cb4 Inline all usage of package:package_config (#2821)
 fdf7b052 Handle empty version constraint (#2796)
 d786b479 Inline package:http_throttle (#2812)
 789be3d4 Don't re-precompile if current global installed was same version (#2810)
 9851bf64 Simplify reproduction command (#2797)
 8eba9cfb Remove unused function (#2808)
 a377b5a6 Pass a Uri to package:http APIs (#2794)
 12d49078 Fix git not installed test on windows (#2803)
 d74520ac Deprecate flutter constraint upper bound (#2780)

Change-Id: Iecff8cc12fe55f12018b4e1f2257886317d2b5cb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177603
Reviewed-by: Jonas Jensen <jonasfj@google.com>
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
2021-01-07 10:55:48 +00:00
Martin Kustermann 5cd0770c9c [vm/concurrency] Move closure function related state from Isolate to ClosureFunctionsCache
As part of making the compiler and other subsystems independent
of `Isolate` we have to move various state from `Isolate` to
`IsolateGroup` (or to another place).

The access of `ObjectStore::closure_functions()` was spread out over our
codebase, including from `Isolate`. This CL moves it to a centralized
place - ClosureFunctionsCache.

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

TEST=Pure refactoring - relying on existing test coverage.

Change-Id: I3b282623f07614cdc2c2a863bd5b9d6c7748d36f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177130
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2021-01-07 09:41:27 +00:00
Sigmund Cherem 26805bc636 [dart2js] delete unnecessary test.
All tests in dart2js/native rely on this functionality, so testing that
private imports work seems redundant.

Change-Id: I25e9619206703c6f842beea903533aaf0301f1fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177820
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2021-01-07 01:55:41 +00:00
Devon Carew cabe1e995e [pkg/analyzer] widen the dep on package:crypto
Bug: https://github.com/dart-lang/sdk/issues/44577
Change-Id: Idcabaf66ad93b8d749e081fed57a1f4b5d9dc9c3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177800
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2021-01-07 01:33:41 +00:00
Stephen Adams b4ca18015c [dart2js] Canonicalize empty list to const in FunctionType
This one was somehow missed with the others.

Change-Id: I5d06cedc4d00c3fa5f2390d211389382f64e2fc2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177761
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2021-01-06 23:21:51 +00:00
Daco Harkes 28a228b64b [analyzer/ffi] Add tests for #44584
Add tests for analyzer and CFE covering `Pointer<void>` and
`Pointer<NativeFunction>` when used in `lookupFunction`.
Both were missing in test suites.

Added TODOs for the things that need to be addressed.

Issue: https://github.com/dart-lang/sdk/issues/44584
Issue: https://github.com/dart-lang/sdk/issues/44593
Issue: https://github.com/dart-lang/sdk/issues/44594

Change-Id: I24ce7caa1a20af51e14e75a7fa83578e00a2b440
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177700
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2021-01-06 19:26:30 +00:00
Brian Wilkerson 9453c76e22 Remove a hint code that is not being generated
Change-Id: Ifdc94c2d8dbcdeaf24ee938532c9f3a93c497e3e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177540
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-01-06 18:20:56 +00:00
Devon Carew ad3c3644a4 Add an initial version of a 'dart language-server' command.
Change-Id: Iffb8dedf7419a421e5282e09b4584e768c47e53f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176485
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-01-06 18:14:51 +00:00
Alexander Markov 3bef6cf639 [vm/aot] Attach unboxing info to unreachable members
Unreachable members could be used as interface targets of dispatch
table calls, so they should have correct unboxing metadata.
This change fixes attaching unboxing info to such members.

TEST=runtime/tests/vm/dart/regress_44563_test.dart

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

Change-Id: I5da6a8d07048904eb94b05bfba11bdf72d655e12
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177621
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2021-01-06 18:12:51 +00:00
Danny Tuppeny e5ed69d04d [Analyzer] Add support for LSP semanticTokens/range
Change-Id: Iebd0a5bfca29b51fe6bb309f71c1ee476d4ed9f4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177702
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-01-06 17:50:11 +00:00
Danny Tuppeny ee2899ed17 [Analyzer] Update DartUnitHighlightsComputer to allow generating LSP semantic tokens directly
This allows additional types/modifiers that cannot be mapped from highlights region (for example where the existing `keyword` region type needs to be mapped into both `keyword` and `keyword.control` to support different colours as the original textmate grammar did.

Change-Id: Ie71b165fa6e4d902c068854cbbba4039ddefe185
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177605
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-01-06 17:50:11 +00:00
Danny Tuppeny 28523a5e31 [Analyzer] Fix race condition in LSP semantic tokens + re-enable
Change-Id: I52c4eb18dd09e3334f21bbf5fac9ce4e716ea234
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176660
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-01-06 17:50:11 +00:00
Ryan Macnak 0a63d23c11 [vm] Don't allocate a backing store for maps until the first insert.
Empty maps are fairly common; delaying allocation of the backing store saves time and memory for empty maps. Non-empty maps probe an extra time for the first insert.

Most maps also have few associations, so reducing the initial backing store size also saves memory on balance. The best value for dart2js would be 2 associations, but this CL changes it to 4 as a compromise with other benchmarks on Golem.

Runtime as Score geomean              2.620%
MemoryUse geomean                    -5.233%
dart2js CompileSwarmLatest            0%
dart2js CompileSwarmLastedMemoryUse -10.51%

TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/26081
Change-Id: I80a925f698f3df44fae5e97e1804c8dff2ce0c60
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176583
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2021-01-06 17:49:31 +00:00