Commit graph

41337 commits

Author SHA1 Message Date
Chloe Stefantsova a46de1c30c [cfe] Add implicit null-check on throw
Throwing `null` is not supported in sound null safety. This change
inserts an implicit `as Object` cast that result in a TypeError, rather
than a NullThrownError, in sound mode.

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

TEST=Covered by the existing tests

Change-Id: I041baf95becd2df1b940fdff7cde398a4e391ee7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247546
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2022-12-12 00:48:13 +00:00
Sam Rawlins 315ff0b8a2 analysis_server: quick fixes for records
* allow rename_to_camel_case to apply to record type field names
* allow replace_final_with_const to apply to record literals.

Change-Id: Id373180dae9f7a78677e30c4dbc535bbb87ce3f8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272486
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-12-10 23:12:23 +00:00
Sigmund Cherem 5f765bcf8f [dart2js] fix minified_names_test.
This test broke on a d8 roll back in January, since then other changes in the compiler
made the test drift further away from the original issue

Change-Id: I081dd48ae9eea2aec4117a377805c26675d2e557
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/271862
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2022-12-10 01:24:54 +00:00
Brian Wilkerson bb7e2c9b95 Remove some unnecessary ignores in test code
Change-Id: I55e332132b9f3e435d79dd03a7aa7459d796599a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274800
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2022-12-10 00:19:30 +00:00
Brian Wilkerson 1e4a974a5d Remove some unnecessary ignore comments in compiler
Change-Id: I323c846776637b91922abac73acc2eac6017d4de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274722
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-12-09 22:54:08 +00:00
Konstantin Shcheglov 78fb91e739 Resolve PatternAssignment and AssignedVariablePattern.
Change-Id: I79a7a3b7f5b5fed349c9d40d61a9e0f0fd3978ae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274723
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-12-09 22:46:28 +00:00
Brian Wilkerson de24bf1cce Remove some unnecessary ignore comments in dev_compiler
Change-Id: Ibb901e1e9d02d0480721240d4d5ecef070364135
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274726
Commit-Queue: Leon Senft <leonsenft@google.com>
Reviewed-by: Leon Senft <leonsenft@google.com>
2022-12-09 22:45:58 +00:00
Brian Wilkerson d9482e35ce Remove some unnecessary ignore comments in analyzer packages
Change-Id: I578285132f0d3f200cb2e9069750a1391940711d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274721
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-12-09 21:33:18 +00:00
Dan Chevalier 4981cbffe2 [ VM Service / DDS ] Add custom service stream support
Setting the `stream` parameter on `developer.postEvent` will now forward those events to a custom stream inside DDS.


The first use of this will be for widget inspection. A navigation event will be posted to a custom stream. Our IDE DAP can listen for the Event and react to it by navigating to the desired location in the code.

TEST=Updated observatory tests. Created new developer test to check assertions. Added DDS tests for new custom stream behaviour. Manually tested the postEvent and StreamListen with multiple clients

https://github.com/flutter/devtools/issues/4533

Change-Id: I870dc634c9a9a7d2ee3a6605319c2a18517ad197
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274061
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Dan Chevalier <danchevalier@google.com>
2022-12-09 20:18:30 +00:00
Brian Wilkerson 3d1cd6a536 Remove incomplete and inappropriate text from documentation
Change-Id: Ie3ecedcaba03ea3db2b5cb724d49add815d9f5be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274522
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2022-12-09 19:49:10 +00:00
Srujan Gaddam 74bfe6c244 Add bindings emitter for web libraries
Adds a generator that reads the platform libraries dill and outputs
maps that correspond to the various bindings e.g. `@Native` values
that exist in the web libraries. These maps will be consumed during
the analyzer run for lints.

Change-Id: I5b5bf91ff0e32964b97c9e52be414ec84ff88765
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272720
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Riley Porter <rileyporter@google.com>
2022-12-09 19:23:31 +00:00
Paul Berry d0fc6ec27b Flow analysis: account for implicit break at the end of switch statement cases.
Bug: https://github.com/dart-lang/sdk/issues/50419
Change-Id: Ie9b0dd3319dd4e28f53082794aa18ed422b0894b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274605
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2022-12-09 17:20:38 +00:00
Paul Berry 966aed6bd1 Shared pattern analysis: add support for pattern variable assignment.
Bug: https://github.com/dart-lang/sdk/issues/50585
Change-Id: I1939c6fd8fac205abeac5b0a9b3da9b3b4adca01
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274604
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2022-12-09 17:16:38 +00:00
Michael Thomsen 9f2a622d79 [3.0 alpha] Update CFE messages for Dart 3 sound null safety by-default
Fixes https://github.com/dart-lang/sdk/issues/50638

Change-Id: I511c5337099ae9576377ac8a82ef1bb78f6d34b1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273844
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Michael Thomsen <mit@google.com>
2022-12-09 16:55:03 +00:00
Brian Wilkerson 3166622ca1 Update the fix status file
Change-Id: I13fc20f8040be486a4d1d44647a871e7e1c69013
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274482
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-12-09 16:46:51 +00:00
Sigmund Cherem c91b73eaf7 [3.0 alpha] Remove dart:html's deprecated document.registerElement & registerElement2 APIs
Change-Id: I07fc124c55d1aeb678f39a4d72d3b4f581025a10
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273541
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2022-12-09 16:02:02 +00:00
Johnni Winther 6b73869b96 [cfe] Initial support for view constructors
Change-Id: I646c8e00cb819b5759f5df2b602f49a570d7f959
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274220
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-12-09 15:21:47 +00:00
Johnni Winther 64fd5139e2 [3.0 alpha] Remove error for use of the List default constructor
Contributes to https://github.com/dart-lang/sdk/issues/49529

Change-Id: I65d147aa8f5f692df00663f5fac024351da7aaa7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272161
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2022-12-09 13:13:14 +00:00
Daco Harkes 56e581aa34 [3.0 alpha] Move AbstractClassInstantiationError to dart:mirrors
Split off https://dart-review.googlesource.com/c/sdk/+/259041 so that
the VM changes can be landed separately.

TEST=tests/lib/mirrors/instantiate_abstract_class_test.dart

Bug: https://github.com/dart-lang/sdk/issues/49529
Change-Id: Ic06dee0dfeaea64d9d9ffd9511ec66d9d0837e7e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274383
Reviewed-by: Michael Thomsen <mit@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2022-12-09 12:53:28 +00:00
Paul Berry ea9b19c2c4 Begin implementing flow analysis for patterns.
This CL adds support for flow analysis with variable patterns and
guards, and integrates it with if-case elements, if-case statements,
pattern variable declarations, switch expressions, and switch
statements.  It includes support for guards.

No other types of patterns are handled yet.

Bug: https://github.com/dart-lang/sdk/issues/50419
Change-Id: Iacad82b472cba0e2e670981847258e4046017576
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274162
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2022-12-09 06:00:36 +00:00
Konstantin Shcheglov 09a5d048e8 Issue 50660. Fix 'get Source' for ParameterMember.
Bug: https://github.com/dart-lang/sdk/issues/50660
Change-Id: Ie6af7c60178b2010f4cd5254e563185eb7e27042
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274603
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-12-09 02:08:24 +00:00
Brian Wilkerson abda30f198 Replace NodeLocator in two more places
Change-Id: I34a67ae8b370ec4c400ac5b9195d537380aca3c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274080
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-12-09 01:13:28 +00:00
Aske Simon Christensen e38242621d [dart2wasm] Canonicalize boxed constant values
This saves space for the constant values, since the same value will
use the same constant box object, and it avoids runtime allocation of
boxes for literal values that are boxed directly.

New passing tests:

- language/super/bound_closure_test/01
- co19/LanguageFeatures/Patterns/constant_A05_t01
- co19/LibTest/collection/ListBase/ListBase_class_A01_t03
- co19/LibTest/collection/ListBase/ListBase_class_A01_t04
- co19/LibTest/collection/ListBase/ListBase_class_A01_t05
- co19/LibTest/collection/ListBase/ListBase_class_A01_t06
- co19/LibTest/collection/ListMixin/ListMixin_class_A01_t03
- co19/LibTest/collection/ListMixin/ListMixin_class_A01_t04
- co19/LibTest/collection/ListMixin/ListMixin_class_A01_t05
- co19/LibTest/collection/ListMixin/ListMixin_class_A01_t06
- co19/LibTest/core/List/List_all_t03
- co19/LibTest/core/List/List_all_t04
- co19/LibTest/core/List/List_all_t05
- co19/LibTest/core/List/List_all_t06

Change-Id: Id7570a2dd16f02590e722115e4d7168c4a741d99
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273843
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
2022-12-08 22:11:32 +00:00
Nate Biggs 5dca4cbd42 [dart2js] Distinguish virtual calls from direct calls to recover some lost accuracy in types.
This recovers the accuracy of types that were previously being widened and even performs better than today's algorithm for some specific cases.

Change-Id: I0139a0fd662a91315282ba94e4c1a29d44056b9d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273501
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2022-12-08 21:19:54 +00:00
Kallen Tu b58f1b4ef3 [analyzer] Report error when mixing in a sealed mixin outside of its library.
Change-Id: I62be6c21bc2bf2a5af35203137aa75c7fd1ba934
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274142
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2022-12-08 21:18:24 +00:00
Brian Wilkerson 44e11d9dd4 Add a utility to find adjacent siblings in a selection
This will be used to allow multiple top-level declarations to be moved
together.

Change-Id: Ib1c59e9ff3e01891f8cb29b74e78183c36b1f02d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273828
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-12-08 20:48:58 +00:00
Nate Biggs 6144b6ed89 [dart2js] Clean up ssa/optimize.dart migration files.
Change-Id: I0aaf3e719ab6ab794840a6a07f58c3ee82a61e23
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274322
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2022-12-08 18:12:27 +00:00
Nate Biggs 25e650691f [dart2js] Migrate ssa/optimize.dart to null safety.
Change-Id: I3d6b177e30f27a73590e53d0d650fd2342c04ed2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274321
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-12-08 18:12:27 +00:00
Nate Biggs 531e356587 [dart2js] Migrate ssa/value_range_analyzer.dart to null safety.
Change-Id: I20d5d55c9a31f87bcb517e8d416ff01a712e0c4c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274320
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-12-08 18:12:27 +00:00
Aske Simon Christensen 96e2e55300 [dart2wasm] Fix a build error caused by colliding commits
Change-Id: Icc6c22896def0183766bb23dc2ca978fe15430ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274441
Reviewed-by: Martin Kustermann <kustermann@google.com>
Auto-Submit: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2022-12-08 15:48:01 +00:00
Danny Tuppeny c53f70509c [dds/dap] Filter private getters from debug views
These will fail unless the current stack frame happens to be in the library that declares them, which results in a lot of exceptions being shown in variable views.

Fixes https://github.com/Dart-Code/Dart-Code/issues/4296.

Change-Id: I5919e391f25a08920dcdf1bf648526d175af00f1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274040
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2022-12-08 15:02:04 +00:00
Martin Kustermann cdd0694a92 [gardening] Make qemu configurations get 2x the time
Running tests under qemu simulator are slow. To prevent tests from
flakily going over the timeout limit, we give them 2x the time.

Change-Id: I41f771d5b958d11d073fd9808663b0b9f298ad9e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274384
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2022-12-08 14:08:09 +00:00
Aske Simon Christensen a22e0ac5ea [dart2wasm] Compute correct type for generic function instantiation
Change-Id: I3811e37002ed6ae458600513bff3ac29482a6af3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/271104
Reviewed-by: Joshua Litt <joshualitt@google.com>
2022-12-08 13:54:57 +00:00
Aske Simon Christensen 8c717be409 [dart2wasm] Emit correct runtime type for tear-offs
The static type of a tear-off is the signature type of the method.
The runtime type is the same with the types of all covariant
parameters replaced by `Object?`.

Change-Id: I9bb36a36ec04e27deab2b31c977fadac515ad561
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273845
Reviewed-by: Joshua Litt <joshualitt@google.com>
2022-12-08 13:54:57 +00:00
Aske Simon Christensen ad06d73ace [dart2wasm] Use a flat index space for function type parameters
The current two-level indexing scheme for function type parameters
(depth and index) breaks down in the case of type substitution when
the substituted type is a generic function type, since its internal
type parameter types have been encoded assuming that the function type
had nesting depth zero, but after substitution its nesting depth can
be higher.

Relative indexing schemes such as De Bruijn indices will also not
work, since function type parameter types are constant types, and the
constant infrastructure assumes that the same constant always has the
same representation.

This change introduces a flat indexing scheme where function type
parameters are indexed using a single index which is independent of
the context in which the type parameter type appears. To avoid
collisions in the case of nested generic function types, every function
type has a type parameter offset, which conceptually shifts the
indexing range of its type parameters so it doesn't necessarily start
at zero.

Looking up a function type parameter in its environment thus involves
searching outwards until a function type is found whose type parameter
index range contains the index encoded in the function type parameter
type.

Change-Id: I544056d52711ff829b170f78a7274a93871825a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272361
Reviewed-by: Joshua Litt <joshualitt@google.com>
2022-12-08 13:54:57 +00:00
Daco Harkes 3f3c6b4b8c [cfe] Remove FallThroughError reference
I don't believe this is used anywhere, but causes failures once the
class is removed from the core libraries.

Split off from https://dart-review.googlesource.com/c/sdk/+/259041

Bug: https://github.com/dart-lang/sdk/issues/49529
Change-Id: I9a215c981b0359b1d4521df9a330ec263b3b6c04
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274382
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2022-12-08 12:48:24 +00:00
Aske Simon Christensen b85f0c7524 [dart2wasm] Scripts for compiling and running benchmarks
Change-Id: I01d8653e60c9667aefcbcef7f1871f408a539482
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/271721
Reviewed-by: Jonas Termansen <sortie@google.com>
2022-12-08 11:56:56 +00:00
Ömer Sinan Ağacan 636232628b [dart2wasm] Implement missing features in dynamic invocations
This reimplements dynamic call code generation to add support for type
checking, named parameters (optional and required), and fixes a few
related bugs on the way.

Currently we do not try to be as efficient as possible. The goal with
this patch is to implement it correctly.

Summary of the changes:

- For every dynamic access kind and member name, we generate a new
  "forwarder" function. Dynamic gets, sets, and invocations are compiled
  to calls to the forwarders with the right access kind (invocation,
  get, set) and member name.

  For example, if the program has dynamic invocation of a member "f", we
  create an "invocation forwarder for f". If it has a dynamic get of a
  member "x", we generate "getter forwarder for x".

- Forwarder functions take 4 arguments:

  - Receiver of the invocation, get, or set.

  - A Dart list for type arguments in the invocation. For gets and sets
    the list is empty.

  - A Dart list for positional arguments in the invocation. For gets the
    list is empty. For sets, the list only has one element.

  - A Dart list for named arguments. For gets and sets the list is
    empty. The list has alternating elements of type `Symbol` and
    `Object?`, for the name and value of the named parameters.

- A forwarder function compares receiver class ID with the potential
  targets of the call. When it finds a match, it compares the callee
  "shape" with the parameters passed in the call site.

  As it compares the shapes it adjusts argument lists:

  - Creates default values for missing optional positional and named
    arguments

  - Reorders the named argument list to match order expected by the
    callee

  If it can't find a matching class ID and a member with the right name
  and shape, it calls `noSuchMethod` on the receiver.

  If it finds a matching class ID and a member, it calls the "type
  checker" for the member, passing the original receiver and adjusted
  argument lists.

- A "type checker" implements argument type checking for a member, and
  it's a member of the same class as the member it's checking types
  for. This is to allow accessing class-bound type parameters when
  generating type checking code.

- Type checking is implemented using `_isSubtype` on arguments in the
  lists.

- When type checking is successful a type checker calls the original
  member, passing the arguments as expected by the member.

  If type checking is unsuccessful it throws a type error.

Most of the changes are for generating Wasm functions that compare
shapes, adjusts argument lists, and checks types.

Changes to members:

- `Translator.dynamics` fields is renamed to
  `Translator.dynamicForwarders`

- New field `Translator.dynamicForwarderFunctionType` added for the Wasm
  function type of forwarder and type checker functions.

- Two new code gen utilities added:

  - `Translator.indexList`: generates code that indexes a Dart list

  - `Translator.getListLength`: generates code that gets length of a
    Dart list

- New `Reference` extensions added to get type checker function
  references of members

- New runtime library `named_parameters` implements two helper functions
  for dealing with named argument lists

- The library `dynamic_dispatch` is replaced by `dynamic_forwarders`,
  which consists of two classes:

  - `DynamicForwarders`: maintains mapping from call kind (get, set,
    invocation) and member name to forwarder functions.

  - `Forwarder`: a single forwarder, implements code generation for
    forwarder functions.

- `CodeGenerator` gets 3 new members:

  - `_callForwader` generates call to a forwarder

  - `_generateFieldSetterTypeCheckerMethod` generates code for a type
    checker of a setter function.

  - `_generateProcedureTypeCheckerMethod` generates code for a type
    checker of a method.

Fixes #50367

Change-Id: I2b9d84237c8517bd217166d8acb67e025f0498fb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272261
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2022-12-08 10:45:12 +00:00
Jens Johansen 09a9a89d65 [analyzer] Deduplicate strings in Declaration
This CL removes some duplication of Strings:
 * Most duplication in `relevanceTagsInFile` (`ElementKind.CLASS`, etc)
   when loaded from file.
 * Usage of `()` for `parameters`.
 * Empty string return type.
 * Known type return type.

On the analyzer instance I've measured on (8 folders with analyzer etc
open) this saves:

Before CL: 161851 kb  2158725   _OneByteString dart:core
        1:  154622 kb  2001695   _OneByteString dart:core // removes most practical duplication from relevanceTagsInFile
        2:  153247 kb  1957751   _OneByteString dart:core // Removes () parameters
        3:  152970 kb  1939890   _OneByteString dart:core // Removes empty string return type
        3:  151287 kb  1886063   _OneByteString dart:core // removes void, String, bool, int, Future<void> return type

That's a total of 10,564 kb or 272,662 instances.
This is also ~1.7% of total ram usage.

Change-Id: Ide2ae55ae052d9f8bc382805a204dce48bf2b263
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273742
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2022-12-08 09:48:20 +00:00
Ahmed Ashour 66990edcf5 [analysis_server] fix RemoveDeadCode with forParts
Bug #43511

Change-Id: I82854382928cd29bfc7c646f0c202d28603f8836
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/271200
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-12-08 06:33:09 +00:00
Srujan Gaddam 293ae7dabe [ddc] Add interop classes for static members
Fixes https://github.com/dart-lang/sdk/issues/46967

Creates classes for non-external factories and static members, and
modifies invocations to point to these members instead. Tear-offs of
interop constructors (external or otherwise) are now supported since
they're just non-external static methods.

Change-Id: Id754fb4bc872051a8df4169aefd4bdc078452fb5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/270501
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2022-12-08 04:57:50 +00:00
Stephen Adams 49f9a85be2 [dart2js] Clean up migration interface
Change-Id: Ie40716265fce4cdb7ce298d8cbbf6c86fe06c05d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274267
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2022-12-08 04:17:51 +00:00
Brian Wilkerson 8569d24f3e Attempt to fix the windows bot
Change-Id: Id1743f8998c2cb2553b5cfed801e9caef9c1d7c9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274264
Auto-Submit: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2022-12-08 02:20:17 +00:00
Stephen Adams 2dbd64bb29 [dart2js, js_runtime] Make JSNull.== an external method
Change-Id: I5a69b4f085a1d418fe60af7a8726bc713b54a0bd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273462
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-12-08 02:14:00 +00:00
Brian Wilkerson de36e1cfb7 Enable patterns in server tests
Change-Id: I1d256b4c1c0cc20cb3e46087cd896d0920f82690
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274084
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-12-08 02:12:14 +00:00
Konstantin Shcheglov 44b877b55a Create AssignedVariablePatternImpl or DeclaredVariablePatternImpl.
Change-Id: I8009a0b3c46cdaec199a38e2c25a5792ae8cd9e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274266
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-12-08 01:57:48 +00:00
Jackson Gardner 00ca59a478 [dart2wasm] Support --multi-root and --multi-root-scheme flags.
Change-Id: I111748742677073bb3cf4c1655b69cb21d42f546
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274089
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Jackson Gardner <jacksongardner@google.com>
2022-12-08 00:59:23 +00:00
Nicholas Shahan 1edc2ecd3f [ddc] Support warnings/errors in weak mode
In the new runtime type system when running with weak null safety,
perform type tests multiple times to produce optional warnings or
errors when a test passes but would fail in sound null safety.
This is the same technique DDC uses with the current type system.

Issue: https://github.com/dart-lang/sdk/issues/48585
Change-Id: Ic1514987a6f4ffeb127a0d2be5ec15b606016212
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/266543
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Anna Gringauze <annagrin@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2022-12-08 00:52:18 +00:00
Konstantin Shcheglov fd30c4f269 Report XYZ_FROM_DEFERRED_LIBRARY during constant evaluation.
Change-Id: I3cf2fa1dfcee3d9a2ddc6d506465d26a40181524
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274141
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-12-08 00:19:34 +00:00
Konstantin Shcheglov fe968d979e Handle Tag.MemberLegacyWithoutTypeArguments, don't write empty type arguments.
Change-Id: I838a046a4dfa7744528e85ceae90efe0403b1ef6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274261
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-12-07 22:57:58 +00:00