Commit graph

81948 commits

Author SHA1 Message Date
Konstantin Shcheglov 9ecb2d0616 Remove unused members from FileState and AnalysisDriver.
Change-Id: Ie28538f171233d800fa95e66bc7acd24fb6131dc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213523
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-15 21:21:04 +00:00
Konstantin Shcheglov a3f338e456 Fix MakeReturnTypeNullable for possible null type.
Saw in crash log:

StateError: Bad state: No type: void
at ExpressionExtension.typeOrThrow	(extensions.dart:89)
at MakeReturnTypeNullable.compute	(make_return_type_nullable.dart:55)
Change-Id: Id985d7a2bb26fe9e494f3a36dc0b15196c6de463
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213412
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-15 20:59:58 +00:00
Stephen Adams ff617b9505 [dart2js] Fix bug in load elimination with try-catch-finally
1. Make unwrapException pure. This allows it to be removed if the
exception is unused, and ensures that the catch does not unnecessarily
invalidate locations. This is helpful since, by itself, this change
causes some test failures due to the load elimination bug (#47166).

2. Invalidate locations on entry to catch and finally blocks. This is
a conservative fix for #47166.

Bug: 47166
Change-Id: If3b4113b538978095d59814c16bd8375bbd70696
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213414
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2021-09-15 19:34:23 +00:00
Konstantin Shcheglov 5a83de3313 Remove unused declarations in LibraryCycle.
Change-Id: I80ea79353a2caff6ad15b2c1d4936ec063c5b584
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213521
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-15 18:51:02 +00:00
Mayank Patke 9cf14f417d [dart2js] Move pkg/compiler/test/kernel/goldens_test testcases to
pkg/front_end/testcases/dart2js.

Change-Id: Iede8f9b03119dab4ee2a3ed6498d6a7e4e19a6a7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212260
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2021-09-15 18:34:14 +00:00
Nate Bosch 4dccb1ff35 Revert "Update to the latest package:collection"
This reverts commit c612650b8c.

Reason for revert: Introduces a conflict in google3. Rolling separately before landing in the SDK.

Original change's description:
> Update to the latest package:collection
>
> Change-Id: I142d50798fc7b5a0d1aef93f5cad8f3bc041b9da
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213520
> 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>

TBR=jakemac@google.com,nbosch@google.com

Change-Id: I8fd308f0885e8e5944865e85e79f04ce2dc09c70
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213522
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2021-09-15 18:09:03 +00:00
rnewquist 2917c1cb8f [io/http] Add a HTTP Client parameter on WebSocket.connect to allow a custom HTTP Client for web socket connections.
The WebSocket abstract class was changed to allow an optional parameter called customClient that takes in a HTTPClient and passes it to the WebSocket Implementation.
The WebSocket implementation takes the customClient, checks if its null, if its not null, it uses the customClient in place of the static HTTPClient that the WebSocket Implementation offers.
This custom client does not override the static HTTPClient, so all previous functionality remains the same when the customClient is not present.

TEST=testStaticClientUserAgentStaysTheSame() in web_socket_test.dart in standalone_2/standalone
TEST=new SecurityConfiguration(secure: true).runTests(); in web_socket_error_test.dart and web_socket_test.dart in standalone_2/standalone

Bug: https://github.com/dart-lang/sdk/issues/34284

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

GitOrigin-RevId: 58fed38baa606a8a492d3729190afa5009cc2409
Change-Id: I042b1e3fa7a4effed076c0deeec1f86af0dfe26d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/200262
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2021-09-15 18:06:42 +00:00
Nate Bosch c612650b8c Update to the latest package:collection
Change-Id: I142d50798fc7b5a0d1aef93f5cad8f3bc041b9da
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213520
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-09-15 17:54:02 +00:00
Sam Rawlins 2bd0759ec9 Move several local resolvers to be lazy fields on ResolverVisitor
This code is simpler and conceivably reduces memory usage.

Change-Id: Ic20a3ec05b60c557d829fc52a79589d6445e062d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213413
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-09-15 17:24:10 +00:00
Ahmed Ashour a9a95466e0 Remove WithNullSafetyMixin
Fixes #47189

Change-Id: I73fee77bb6d20ea03b11ae2da444d45583ec8c09
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213048
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-15 16:55:50 +00:00
Alexander Markov 2765b7c911 [vm/compiler] Cleanup passing of try_index
FlowGraphCompiler::CurrentTryIndex() always returns correct try_index,
even when generating slow path code. So we can cleanup passing of
try_index for slow paths.

Also, removed unnecessary arguments from EmitMegamorphicInstanceCall as
it is no longer called on slow paths.

TEST=ci

Change-Id: I2fc29914c0c45068c1732eac27f3da3fd4da6823
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213411
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2021-09-15 16:51:17 +00:00
Danny Tuppeny 35d5f857ab [dds] Add a DAP debug adapter that runs "dart test" and passes package:test JSON back
Change-Id: I2619df1d514529457a2035f40eecc5b33f52abd2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212576
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-09-15 15:11:25 +00:00
Chloe Stefantsova 9554357b33 [cfe] Display experiment-related message on extensions used as types
Change-Id: I58453788c6810bb4a81b116890dad45626bdd9bc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213347
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <dmitryas@google.com>
2021-09-15 14:15:05 +00:00
Clement Skau cd7c9922eb [vm/ffi] Adds FFI transform for Handle -> Pointer.
This will automatically desugar FfiNative calls passing
NativeFieldWrapperClass1 handles to use Pointer when
the underlying native function expects a pointer.
E.g.:

```
class ClassWithNativeField extends NativeFieldWrapperClass1 {}

@FfiNative<IntPtr Function(Pointer<Void>)>('PassAsPointer')
external int passAsPointer(ClassWithNativeField obj);

passAsPointer(ClassWithNativeField());
// Becomes roughly:
// #t0 = PointerClassWithNativeField();
// passAsPointer(Pointer.fromAddress(getNativeField(#t0)));
// reachabilityFence(#t0);
```

TEST=Adds new tests in tests/ffi/ffi_native_test.dart.
Change-Id: I4460f9249803054f12be5d5ff34dbdf7c96567fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213260
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2021-09-15 12:47:35 +00:00
Paul Berry f8e15bda9e Add a test to make sure analyzer message generation is up to date.
This required some refactoring of the message generator so that the
same targets object can be shared between the generator and the
checker.

Change-Id: I52bdfa08b75b15667b56d0fb65c93be6ff53b845
Bug: https://github.com/dart-lang/sdk/issues/44888
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213402
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-09-15 12:41:27 +00:00
Alexander Thomas a6f97d13fc [release] Add release notes for 2.14.2
Change-Id: If57db9e64e2e351acd5232830af3d2cc355e640e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213460
Reviewed-by: Michael Thomsen <mit@google.com>
2021-09-15 09:57:04 +00:00
Michal Terepeta f4919c0a6c Revert "Bump package:usage."
This reverts commit b4c19b93c9.

Reason for revert: http://b/199988795

Original change's description:
> Bump package:usage.
>
> Most of these are from a single PR that did not get squashed.
>
> Running `git log --format=%C(auto) %h %s e0780cd8b2f8af69a28dc52678ffe8492da27d06..016dd302b494e4ff70a7850957ec895eced9d220` in third_party/pkg/usage ✓
>  016dd30 Prepare release (#160)
>  076c653 Merge pull request #152 from sigurdm/batching
>  1d6b343 Remove debug print
>  c073fb7 Use correct limit for bytes
>  1d89875 Send batch early if full
>  2896a85 Update README.md
>  da20fab Delete travis.sh
>  7c351a3 Merge
>  0424091 Update build.yaml (#159)
>  4f2a050 Use a Duration for batching delay
>  aa3f3ce address review
>  318ebe5 Fix
>  71ddec1 Send remaining hits on waitForLastPing
>  1c895a7 Parametrize client-id in test
>  0ae7733 Fix pubspec
>  2255b3d Merge remote-tracking branch 'origin/master' into batching
>  14d3702 Merge remote-tracking branch 'origin/master' into batching
>  1c3393d Handle batching implicit waiting for a 'batchDelay' future
>  219b764 TODO about size of payloads
>  aaee6d9 Fix AnalyticsMock
>  a8ec5b4 Remove mockito as dep - didn't use it
>  e26fcce Allow batching of hits
>
> Change-Id: I801c0d9114fb90e1dc94c3e2552c1cd90a8f0c18
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213349
> Reviewed-by: Jonas Jensen <jonasfj@google.com>
> Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>

TBR=sigurdm@google.com,jonasfj@google.com

Change-Id: I3b044a1744bbe5aade9c75fecb9d057d6564ddda
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213440
Reviewed-by: Michal Terepeta <michalt@google.com>
Reviewed-by: Jonas Jensen <jonasfj@google.com>
Commit-Queue: Michal Terepeta <michalt@google.com>
2021-09-15 08:13:00 +00:00
Ahmed Ashour d6975c1905 master branch to main
Fixes #47190

TEST=None, only markdown files where edited.

Change-Id: Ife204f9c792b6bce30d0cd7bf2260ced11c8f2b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213049
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2021-09-15 06:22:23 +00:00
Jens Johansen 17503caa05 [CFE] Fix dangling reference to part imported as library
Before this CL:
If a library (say lib.dart) imports a file (say part.dart) that's
actually a part (of some other library (say main.dart)) an error is
given, but the "fake library" shortly representing the part is still
"linked" into the libraries dependency list.
This means that the component returned from a compilation is different
from the combination of libraries one can get to if walking all
LibraryDependency's. This also means that if we serialize the component
we can't load it back in (https://github.com/dart-lang/sdk/issues/46706).
It furthermore means that we have two different entities with the same
fileUri and importUri.

This CL rewrites a such import of a part to instead be an import of the
"parent", i.e. if a library lib.dart imports part.dart that's a part of
main.dart an error is issued, and the import is rewritten to be an import
of main.dart instead. The same thing happens to exports.

This alleviates the problems (i.e. no crashing if trying to load the dill,
no referenec to a otherwise non-existing library etc), and has the added
benefit of probably being what the user wants: Anything defined in
part.dart (that isn't private) is still in scope from lib.dart.

Change-Id: I17aca9db4edbf25b23d3ef301cf65589eeeb1635
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213344
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2021-09-15 06:20:03 +00:00
Sam Rawlins fd2d014112 Remove unnecessary imports from front_end
Bug: https://github.com/dart-lang/sdk/issues/44569
Change-Id: I646f5994b40f2007f8d8d4b5ef35e2c9ffbd2376
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213423
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-09-15 05:51:03 +00:00
Sam Rawlins e08ee7abec analyzer: resolve function type alias type instantiation
This code is a little weird because of how this type instantiation
works:

```
typedef Fn<T> = void Function(T);

var x = Fn<int>.foo;
var y = (Fn<int>).foo;

extension on Type {
  int get foo => 1;
}
```

`x` is illegal under any circumstance, because calling a getter on a
type instantiation can _only_ resolve to a constructor, but function
types do not have constructors. But it's nice to resolve what we can,
and what the user may have meant, and we have to represent
`Fn<int>.foo` _somehow_. So it's a property access on a TypeLiteral.

Add two new codes because it is not correct to say that `foo` is not a
getter on 'Type' because that is beside the point. The issue is that
there is no possible getter on a type-instantiated type literal of
a function type alias (nor method, nor setter).

Add lots of tests, for calling a method, a getter, and a setter on a
function type alias literal. Add tests with prefixes, bounds, too
many and too few args.

Bug: https://github.com/dart-lang/sdk/issues/46020
Change-Id: Icdf17506a64b3382226c5e50786784130d9e3bf9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213287
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-09-15 00:43:22 +00:00
Mayank Patke 74fa14a4c5 [dart2js] Replace references to NNBD with null safety.
Change-Id: Id23dce928425c99770ced629f866cee01fa2ef0c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212240
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2021-09-14 23:39:15 +00:00
Konstantin Shcheglov 1795c2c804 Fix for '?.' and '?..' in binary AST.
Change-Id: I35ecb6ed10e52e47ca5690deacda0688bcb5a6f2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213407
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2021-09-14 21:40:23 +00:00
Paul Berry 3295dda60c Add missing copyright notice to generate.dart
Change-Id: I943d0602744ff6e1841f07b79ea2bd421c646374
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213401
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-09-14 21:25:39 +00:00
Ryan Macnak 5c79501a64 [vm] Remove Dart_GetImportsOfScheme.
Dead since bda70c8489.

TEST=build
Change-Id: I0aed3d9d30a2b01f57f5d6a6bd02105fa89e3095
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213405
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2021-09-14 21:18:37 +00:00
Konstantin Shcheglov e39818f306 Fix null checks in ToSourceVisitor.
Change-Id: Iebac674c6a6b631fb59932c16caab1a55df0f7bd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213408
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-14 21:17:37 +00:00
Konstantin Shcheglov aa4cf21424 Fix UNNECESSARY_TYPE_CHECK_TRUE in analysis_server.
To fix before https://dart-review.googlesource.com/c/sdk/+/190360

Change-Id: I4e25a6efae59f54a1a717ca2345217f7dc764e59
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213420
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-14 21:01:48 +00:00
Konstantin Shcheglov d88f8ed57b Clear more maps in FileSystemState._clearFiles()
Change-Id: Ide25cbeb425f94ae84519c0940188801c2f346a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213404
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-14 21:01:29 +00:00
Sam Rawlins 903e906a35 analyzer: Include the error code type in the unique name
Failing analyzer test cases which should reference an error
code with a shared code might print:

  Expected but did not find:
    CompileTimeErrorCode.UNDEFINED_SETTER [58, 3]

  Found but did not expect:
    UNDEFINED_SETTER_ON_FUNCTION_TYPE [58, 3, The setter 'foo' isn't defined for the aliased function type.]

  To accept the current state, expect:
    error(UNDEFINED_SETTER_ON_FUNCTION_TYPE, 58, 3),

which is erroneous; `CompileTimeErrorCode.` is needed as well.

Change-Id: Ic44c38dfcd6e6158cf51d2ce9162567a0f8c0006
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213400
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-09-14 20:40:58 +00:00
Joshua Litt 76ac2ee172 [dart2js] Flip 'holder per part' flag.
Change-Id: I1ecf0d2628685738b0631040d6fe61d635164fb6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212340
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2021-09-14 20:31:20 +00:00
Paul Berry 283ce865c8 Migrate pkg/analyzer/tool/messages/generate.dart to null safety
Change-Id: Ib0c80b380f895dc4d72aebbfb23f57c5e5978534
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213282
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-09-14 19:24:38 +00:00
Alexander Markov d90b297166 [vm/compiler] Refactor Precompiler::AddCalleesOfHelper to use switch
This is a follow-up to review comment
https://dart-review.googlesource.com/c/sdk/+/213288/1/runtime/vm/compiler/aot/precompiler.cc#998

TEST=ci

Change-Id: I59b7b03eb1a9b90bd107fc07906c333d3d63283d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213292
Auto-Submit: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2021-09-14 18:52:47 +00:00
Erik Ernst 60d878137d Add tests dealing with instantiated function constants
Change-Id: Ie8cb03a7f7bb14eebc7c2e14bb1c38c04e2e7995
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213047
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2021-09-14 18:36:11 +00:00
Michal Terepeta 5da6490b1b Fix a bug when finding a package for a generated file
The recent change in `findFile` that uses the `bazel-bin`
symlinks was not supported by `findPackageFor` since the `blazeBins`
list would not necessarily contain the symlink path (we only added it
if there were no other paths). The user visible symptom of this was
that we would suggest importing packages with `package:blaze-bin.`
prefix.

I believe that we can simply always add the symlink as the last element
of `binPaths`, so that we recover the property one of its elements
corresponds to the generated file that we have found.

Bug: http://b/193636339
Change-Id: I818379b4770a477cbcb6b147a505f1f3c012bb6c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213046
Commit-Queue: Michal Terepeta <michalt@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-09-14 17:53:01 +00:00
Alexander Thomas 3860f4bf06 [co19] Roll co19 to 21e89324642656dcd903e97352d9d16da6a361ee
2021-09-14 sgrekhov@unipro.ru Fixes 1196. Roll failures fixed and issue numbers added
2021-09-14 sgrekhov@unipro.ru Fixes 1195. Typo in error expectations fixed
2021-09-14 sgrekhov@unipro.ru Use '/' as a path separator when working with Uri
2021-09-13 sgrekhov@unipro.ru Fixes 1193. Add constant expression tests for explicit generics instantiation
2021-09-10 sgrekhov@unipro.ru Fixes 1191. Call method tests updated according to the changed spec
2021-09-10 sgrekhov@unipro.ru Update expectations according to the SDK issue 47060
2021-09-10 sgrekhov@unipro.ru Fixes 1194. Use more precised function type in Expect statement
2021-09-08 sgrekhov@unipro.ru Fixes 1192. call_method_* tests updated. Assertion actualized, new tests added
2021-09-07 sgrekhov@unipro.ru Fixes 1192. Fix call_method_A03_t01.dart test and make it to do some generic function instantiation
2021-09-07 sgrekhov@unipro.ru Fixes 1190. Isolate entry point is allowed to be a local function or instance method now

Cq-Include-Trybots: dart/try:analyzer-nnbd-linux-release-try,dart2js-nnbd-linux-x64-chrome-try,ddc-nnbd-linux-release-chrome-try,front-end-nnbd-linux-release-x64-try,vm-kernel-nnbd-linux-release-x64-try,vm-kernel-precomp-nnbd-linux-release-x64-try
Change-Id: I011bfc05b652ca7e941d3aed3b448a7dbc098fae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213350
Reviewed-by: William Hesse <whesse@google.com>
2021-09-14 17:40:25 +00:00
Ben Konyi b1491fc43e [ Service ] Test constructor tearoffs through VM service
Fixes #46240

TEST=runtime/observatory/tests/service/constructor_tear_off_test.dart

Change-Id: I335b16106db89dfede10d2ba3b73676465b306bc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212627
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-09-14 17:14:31 +00:00
Sam Rawlins b113bd154b analyzer: use type arguments in constructor tearoff as const expression
https://github.com/dart-lang/sdk/issues/46020

Change-Id: Ib985b70773bb1a4c90742af0742a89e78f84ac98
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213293
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-09-14 17:05:48 +00:00
Konstantin Shcheglov 89fd6fce30 Remove unused 'astBytes' in LinkResult and PackageBundleBuilder.
Change-Id: Ife01597ca011a0642d92a35e45d3adaa07f9dff1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213296
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-14 16:57:48 +00:00
Konstantin Shcheglov 7262decaea Remove WithNonFunctionTypeAliasesMixin and WithNullSafetyMixin from analyzer_plugin tests.
So, consistently with analyzer/, by default enable everything, and
disable with WithoutNullSafetyMixin as necessary.

Change-Id: I89079d3c1122a14ad338aa8f0d8008086a1fcb89
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213295
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-14 16:57:45 +00:00
Konstantin Shcheglov 33c6606085 Merge NonNullableSubtypingCompoundTest into SubtypingCompoundTest.
Change-Id: I00b833b409b0c888a91a43654bad1dac4d644824
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213294
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-14 16:49:45 +00:00
Konstantin Shcheglov a4b3ae735a Don't use ElementsTypesMixin in resolution tests.
Change-Id: Ia4a8ebf9f31e22958ff63d7ce02f1ef76bb560aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213320
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-14 16:49:42 +00:00
Konstantin Shcheglov 9dd6854112 Rename id tests configs, all features are enabled by default.
Change-Id: Iea3739c2be173847a49d8838f399ebfd751b9713
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213300
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-14 16:41:41 +00:00
Konstantin Shcheglov c68d2c3919 Replace more ElementsTypesMixin with AbstractTypeSystemTest.
Change-Id: Ifa0601ba5181189ef17a35e4a9ba2118d213eb53
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213291
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-14 16:41:40 +00:00
Sigurd Meldgaard b4c19b93c9 Bump package:usage.
Most of these are from a single PR that did not get squashed.

Running `git log --format=%C(auto) %h %s e0780cd8b2f8af69a28dc52678ffe8492da27d06..016dd302b494e4ff70a7850957ec895eced9d220` in third_party/pkg/usage ✓
 016dd30 Prepare release (#160)
 076c653 Merge pull request #152 from sigurdm/batching
 1d6b343 Remove debug print
 c073fb7 Use correct limit for bytes
 1d89875 Send batch early if full
 2896a85 Update README.md
 da20fab Delete travis.sh
 7c351a3 Merge
 0424091 Update build.yaml (#159)
 4f2a050 Use a Duration for batching delay
 aa3f3ce address review
 318ebe5 Fix
 71ddec1 Send remaining hits on waitForLastPing
 1c895a7 Parametrize client-id in test
 0ae7733 Fix pubspec
 2255b3d Merge remote-tracking branch 'origin/master' into batching
 14d3702 Merge remote-tracking branch 'origin/master' into batching
 1c3393d Handle batching implicit waiting for a 'batchDelay' future
 219b764 TODO about size of payloads
 aaee6d9 Fix AnalyticsMock
 a8ec5b4 Remove mockito as dep - didn't use it
 e26fcce Allow batching of hits

Change-Id: I801c0d9114fb90e1dc94c3e2552c1cd90a8f0c18
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213349
Reviewed-by: Jonas Jensen <jonasfj@google.com>
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
2021-09-14 16:22:16 +00:00
Ryan Macnak b32bde155d [vm] Label virtual memory allocations on Android.
TEST=examine /proc/pid/smaps and Observatory's "process memory" page
Change-Id: I03922c9c604ceef8901a8946481d0ccc31110b72
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213289
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2021-09-14 16:10:10 +00:00
Sigurd Meldgaard d787e78d21 Bump pub
New commits in this revision:

git log --format=%C(auto) %h %s cafadd17ba285dad9ebe6d34c617bc0d70d096b3..98a01e1cdbf441f030f1be76417860b6b372663d ✓
 cafadd17 Don't use null safety (yet) (#3112)
 98a01e1c Store credentials in a config directory (#3092)
 4ee280b7 Fixed messages (#3110)
 bbdac802 Third party hosted pub registry authentication (#3007)
 b1bedc53 `--examples` for get/upgrade/downgrade/add/remove (#2857)

Change-Id: Ibf6ffe33820c97114958c1564a7c22a46ff73d9c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213348
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Jonas Jensen <jonasfj@google.com>
2021-09-14 16:05:00 +00:00
Riley Porter 0dd3c97147 Optimize js_util callConstructor for 0-4 arguments.
Some usages of `callConstructor` will have unnecessary checks
removed, when checks on the arguments can be elided. The
compilers will optimize further if they can.

Example optimizations: https://paste.googleplex.com/4594240957972480

Change-Id: I0e6e7e4d1268580cbfab84599b1c9da6fc64e7c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213114
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Riley Porter <rileyporter@google.com>
2021-09-13 22:43:10 +00:00
Mayank Patke 14940d1c9c Reland "[dart2js] Enable by default and remove the --experiment-late-instance-variables flag."
This is a reland of 681e292b02

Original change's description:
> [dart2js] Enable by default and remove the
> --experiment-late-instance-variables flag.
>
> Change-Id: Ibb3cfa6d7b02883c82909930f7eb1142803dbc0f
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/200902
> Commit-Queue: Mayank Patke <fishythefish@google.com>
> Reviewed-by: Stephen Adams <sra@google.com>

Change-Id: If4d3c12e7f6a71d2c305283597b679e8b925493c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/206980
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2021-09-13 21:59:20 +00:00
Mayank Patke a6c90f1601 [dart2js] Fix some unnecessary bailouts in inference.
Change-Id: If60fe11871da062c52265d821cbf0d7a1185e643
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209845
Reviewed-by: Stephen Adams <sra@google.com>
2021-09-13 21:59:20 +00:00
Mayank Patke f5b8cc2c76 [dart2js] Improve type inference for createSentinel.
Treating createSentinel as returning a value of type Never caused issues
whenever its result flowed into a union, since the union would just
simplify to its other component. This meant that if a late field started
out uninitialized and was later initialized to a constant, we would see
it as only ever having the constant value. This caused isSentinel to
always return false even if the field hadn't been initialized yet.

Instead, we support a late sentinel value in the abstract value domain
and use this value as the return type of createSentinel during
inference. Additionally, inference treats _lateReadCheck as a simple
narrowing to exclude the late sentinel value.

Change-Id: I086bfd77576930e3ca2a4cfc9bd63476b6636685
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210646
Reviewed-by: Stephen Adams <sra@google.com>
2021-09-13 21:59:20 +00:00