Commit Graph

39964 Commits

Author SHA1 Message Date
Jens Johansen 8a1dbb160f [parser] Parse record literals
This is the first stab at implementing the record expressions from
https://github.com/dart-lang/language/blob/master/working/0546-patterns/records-feature-specification.md

Change-Id: I2adb6cb3cd50d4ee45e144e86ec7011d046f6170
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/253783
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Michael Thomsen <mit@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-08-16 06:36:36 +00:00
Sigmund Cherem fead8b897e [dart2js] remove support for reading sources from http (tech-debt)
Long ago the compiler had logic for reading sources via an http
connection. This is not a supported use case and there is no need to
keep this around anymore.

Change-Id: Ic59c154def264a52d9310133f76b153c9972899c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/251701
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2022-08-16 00:01:26 +00:00
Konstantin Shcheglov cccc959dd4 Implement UP for RecordType(s).
Change-Id: I9960fbdc5cadbd600ad2ae5c9991b83852c428d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255143
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-08-15 22:59:27 +00:00
Konstantin Shcheglov b9f0b2ed8b Implementations for RecordTypeAnnotation nodes.
Change-Id: Ice4425e70b62fc68d4ad3aa97faf6e56f4076781
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255144
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-08-15 22:35:26 +00:00
Ben Konyi eff8c305d9 [ Service / Timeline ] Enable Compiler, Dart, and GC timeline streams when --observe is provided
TEST=pkg/vm_service/test_timeline_default_streams_test.dart

Fixes https://github.com/flutter/devtools/issues/3444

Change-Id: I3f772a54a512eb836e3e7279ee8d4d3437473393
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255181
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2022-08-15 21:02:36 +00:00
Brian Wilkerson 65058f87e1 Add visitor support for record literals
Change-Id: I8f5aff11786a75ce02a8f3483585dc0513ae2c86
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255142
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2022-08-15 20:00:46 +00:00
Konstantin Shcheglov 4eb511da43 Replace more Bazel with Blaze, some simplifications.
Change-Id: I096860e17ce56c2f602718f11706f24989c1f65b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255141
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-08-15 19:50:46 +00:00
Konstantin Shcheglov c66faf9f3a RecordElement.instantiate(), substitution, type alias.
Change-Id: Icd0e234e57d17a1c86140ed58fc9732da31bf1b3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254942
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-08-15 17:31:36 +00:00
Martin Kustermann 9a3bcbcdb0 [CFE] Improve [StringCanonicalizer] implementation
The current [StringCanonicalizer] implementation has some issues:

  * It hangs on to large [Uint8List]/[String] objects in it's cache
    => This requires users (such as analyzer) to clear the cache
       frequently

  * Has api that works on dynamic input (which is assumed to be String
    or List<int> / Uint8List)
    => Call sites have typing information we loose when doing the call

  * It uses dynamic [] calls to compare input bytes with cached bytes /
    input strings with cached strings
    => Dynamic calls come with overhead
    => Will cause substring generation for every character comparison
    => Will compare bytes with strings (which doesn't make sense)

To address these issues we

  * Use the canonicalized [String] to compare against instead of the
    (much larger) source strings, thereby no longer hanging on to large
    strings in the canonicalizer cache (it's still an issue with
    [Uint8List]s though)

  * Make seperate API for canonicalization of strings, sub-strings or
    sub-utf8-bytes and use it from the token implementation.

  * For canonicalization of strings use String.== (instead of
    char-by-char comparison)

  * For canonicalization of sub-strings use String.charCodeAt instead of
    [] (which creates substrings)

  * Seperate out cache node entries into two classes and reduce memory
    consumption of the nodes that represent strings by 16 bytes (it
    does an additional `is` check on lookups in the cache, but that is
    better than paying for dynamic calls on the payload - which
    causes the compiler to do implicit checks)

=> This CL reduces RAM consumption and makes CFE scan/scan_bytes benchmarks a little faster.

TEST=ci

Change-Id: I157c298d26d25ac5da82c32eedfa270a590156f0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255121
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2022-08-15 17:06:58 +00:00
Brian Wilkerson d353323510 Initial AST structure for record literals
Change-Id: I225365b90d2e006116b3a91307479839df07ec10
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255140
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2022-08-15 17:01:26 +00:00
Paul Berry 05eb57b0d1 Migration: add assemble_resources.dart script.
This script does the same job as `generate_resources.dart`, but it
doesn't search the filesystem for the input files to use, nor invoke
the compiler to create the `migration.js` file.  Instead, it simply
accepts a list of input files on the command line, and outputs their
contents in an appropriate form to be stored in `resources.g.dart`.

This script will allow us to integrate more cleanly with the internal
build system.

Change-Id: I4b5445d1f5fd7eccbb5fb36f6ee4fa97d2cea87e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254421
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2022-08-15 16:40:46 +00:00
Nate Biggs a547cfc096 [dart2js] Defer deserialized CodegenResults by members.
For large applications only ~60% of these objects are used. This defers their deserializtion until they're accessed in the codegen member map.

In local testing on large applications this saved ~200MB of memory usage in the linker phase.

Change-Id: I8ff87803fc23ef2d3f954646687e3fc67b68a4f7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254600
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2022-08-15 16:13:46 +00:00
Daco Harkes a304e5b156 [cfe/ffi] Test Finalizables in extension methods
`Finalizable`s with extension methods work by virtue of being
desugared into static methods and the `Finalizable`s being normal
arguments.

If we ever change the representation of extension methods,
`Finalizable`s would need to be treated specially. This test will
catch that.

TEST=pkg/vm/test/transformations/ffi_test.dart

Bug: https://github.com/dart-lang/sdk/issues/49643#issuecomment-1214847853

Change-Id: I68cfbc098386a88495d37417c6eb7295b89bfb95
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255123
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2022-08-15 13:29:37 +00:00
Martin Kustermann bc090dc469 [CFE] Adjust benchmarking script to support scanning based on Utf8BytesScanner
The CFE itself uses [Utf8BytesScanner] in it's normal operation. The
analyzer instead uses [StringScanner].

The performance script used today only measures scanning performance
based on [StringScanner].

=> This CL adds a `scan_bytes` subcommand that will measure scanner
   performance based on bytes (the CFE default mode).

The performance script discovers the files to scan for the benchmark by
using the analyzer to transitively scan/parse files and looking at the
imports. Doing so will - as a side effect- fill
[StringCanonicalizer] with values.

=> This CL cleans the [StringCanonicalizer] cache before doing the
   actual benchmarking.

TEST=ci

Change-Id: I996efe6b3551983df19ed5aad4fc4220c07336cd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255120
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2022-08-15 09:07:37 +00:00
Johnni Winther b928fd3083 [frontend_server] Add FrontendServer wrapper in test
This adds a FrontendServer class that wraps steam communication,
reducing the amount of boilerplate code needed to write frontend
server tests.

Change-Id: I9ff0fe6e04a83503e00eea9fc764231e50d6207a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/253666
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-08-15 06:57:46 +00:00
Brian Wilkerson 61af13bf29 Use var more consistently in the documentation generator
Change-Id: I44fedefa38c34ea6813cc845aab9a0ba29abd0e2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254944
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-08-15 03:50:16 +00:00
Konstantin Shcheglov fff672f417 Implement isSubtypeOf() for RecordType.
Change-Id: I42003fb5ce7bb374a37cc704a85f9eb16ca3aa42
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254841
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2022-08-13 17:12:25 +00:00
Konstantin Shcheglov 293c39cfce Add RecordElement, RecordTypeImpl, implement basic subtyping.
Change-Id: I54ac91dfc5a4e01b6f960b865d3d73d11bd0cd84
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255040
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-08-13 00:56:51 +00:00
Konstantin Shcheglov cc49399c65 Add all nodes to NodeLintRegistry.
Change-Id: I185bcad6cc749b4ee6b78779db162d0632154585
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254983
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-08-13 00:06:34 +00:00
Martin Kustermann b785f7dba8 Avoid logging information by-default and never discarding such logs
The analyzer wraps various functionality in logging calls like

    await logger.runAsync('Prepare linked bundles', () async {
      ...
    });

Doing so will cause time being measured and begin/end messages to be
written to a log. Those strings accumulate in a `StringBuffer` that
is never accessed.

For example running analyzer on a big app like flutter can cause
thousands of "--- Prepare linked bundles in 0 ms.  " strings to be
generated and hanged on to.

This CL makes us no longer generate such strings - only if the
creator of a context supplies a [PerformanceLog] explicitly (in which case
it is responsible for draining the messages written to it).

This reduces memory consumption when analyzing flutter by around 3 MB.

TEST=ci

Change-Id: I4979a964f13c63bd2a3cccef97fb702431731139
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254925
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2022-08-12 21:02:54 +00:00
Konstantin Shcheglov 7d87a37d57 Add RecordType interface.
Change-Id: I22ddc807cf9bc5429c7feb806631a78273fb4366
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254860
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-08-12 19:26:33 +00:00
Konstantin Shcheglov f1aea65363 Add ImplicitCallReference to NodeLintRegistry
Towards https://github.com/dart-lang/language/issues/2399

Change-Id: I4e31bec7703504711a5827e282b2b52d14ae6b05
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254465
Auto-Submit: Nate Bosch <nbosch@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-08-12 19:09:16 +00:00
Brian Wilkerson 33b0180e37 Remove an unused instance getter
Change-Id: I0655a7a3f205dadb555bb8e9f9411e0e08ef68f5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254982
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2022-08-12 18:55:33 +00:00
IslinaS 9e740799c6 [dart2js] Corrected package and library size calculation
Change-Id: I17aec52b8f39992e2c18e208da931a3465afb089
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/253712
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Islina Shan <islinashan@google.com>
2022-08-12 18:30:43 +00:00
Alexander Thomas 8d60314e12 [testing] Run static web tests on dartdevk
Change-Id: Icd4dc024de8ec775b320be1ff5fda9116443dd52
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254900
Auto-Submit: Alexander Thomas <athom@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2022-08-12 16:42:04 +00:00
Martin Kustermann 403b896d58 Reduce size of StringToken/StringTokenImpl by 16 bytes (25%).
Some instances of analyzer have a heap of 600 MB, containing 400k
StringToken/StringTokenImpl.

This CL combines two existing fields which will shrink those objects
by 16 bytes, which saves 6 MB.

We densly number all token & keyword types so they can be looked up in
an array.

TEST=ci

Change-Id: I8431db243d55a316e7a72678844d031356c40e79
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254920
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2022-08-12 14:07:43 +00:00
Brian Wilkerson dd45694e84 Remove some casts per review comments
Change-Id: I4160cec1524994145d6c0ec25ff4b35ae028a0cf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254723
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Danny Tuppeny <danny@tuppeny.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-08-12 13:55:58 +00:00
Konstantin Shcheglov 66038b732a Roll latest linter, 304042aaa933a02d2581ab9598dd2ddaebdbc803
Change-Id: I56edf420115793814b162eb779324619332ddb8d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254820
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-08-12 02:56:08 +00:00
Konstantin Shcheglov 5b3a78b675 Prepare to publish analyzer 4.6.0 and _fe_analyzer_shared 46.0.0
Change-Id: I3562b5e3ce0c7f744d4bf80a71adf8e97b9b57b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254740
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-08-11 23:31:18 +00:00
osama 602c7674c4 Fixing broken URL in the analyzer package
Closes https://github.com/dart-lang/sdk/pull/49645

GitOrigin-RevId: b84e83ada9264ccfb84c7a4e42482b013bcc4099
Change-Id: I91c00da6d7319ec7bcf31a073ac54d466ba1f2d3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254780
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-08-11 21:31:19 +00:00
Paul Berry f1043ad932 Flow analysis: discard property promotions after writes/captures.
This change ensures that when a variable `x` is written to or
captured, promotions of its fields (e.g. `x.y`, `x.y.z`, etc.) are
cancelled.  This is necessary for soundness of field promotion.

There is no effect on production code, since field promotion is not
yet enabled.

Bug: https://github.com/dart-lang/language/issues/2020
Change-Id: Ic0739ca80cc2afe6188ada6209cb558d8cea9b63
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254620
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2022-08-11 20:14:38 +00:00
Daco Harkes f592a11e51 [vm/ffi] NativeFieldWrapper FfiNative check receivers for nullptr
Changes `FfiNative` instance methods on `NativeFieldWrapperClass`es
that have `Pointer<Void>` conversion to check for `nullptr`.

If the native field has `0`/`nullptr` a `StateError` is thrown:
"Bad state: Native field is nullptr."

This only makes sense if the first native field is used to point to
the C++ object corresponding to the Dart object. As far as we know
all current use cases do so.

TEST=pkg/vm/testcases/transformations/ffi/ffinative.dart.expect
TEST=tests/ffi/vmspecific_ffi_native_test.dart

Closes: https://github.com/dart-lang/sdk/issues/49620
Change-Id: I92f760c33d391476010722358f9713fa4491ab61
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254200
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2022-08-11 17:39:57 +00:00
Brian Wilkerson 5c59f08857 Add more documentation to the server package
Change-Id: Id2413bc1f62ebc8ea42d3cac15adcb871c2cc234
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254720
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-08-11 17:05:38 +00:00
Alexander Thomas 54c3663c43 [testing] Make Compiler.dartdevc a fasta compiler
Change-Id: I801687994b979283adab0dec1e3f1c3319fe5dd1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254680
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2022-08-11 16:45:18 +00:00
Anna Gringauze af1d9eefe8 Remove erroneous cast
Closes: https://github.com/dart-lang/sdk/issues/49580
Change-Id: I3a31a7ef575c910aa2c87f3c3ca17452b9a0c311
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254562
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Anna Gringauze <annagrin@google.com>
2022-08-11 16:08:18 +00:00
Konstantin Shcheglov 82e33cc598 Add DartType.element2
Unfortunately my idea about checking for specific `DartType` subtype,
and only then asking for the element is too punitive. It almost
works in google3, but the amount and the kind of changes I had to
do make me realize that we should keep `get elementX` in `DartType`.

I guess this is the same as we had in AST when `get constructors`
does not make sense for mixins (?), but works for classes and enums,
and it is easier to pull it into the superclass.

Change-Id: Ibc4fac0b95d63748fa65de96d29300f477fdfc76
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254482
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-08-11 16:01:48 +00:00
Johnni Winther e0954f8e16 [cfe] Split ObjectAccessTarget into subclasses
This added subclasses to ObjectAccessTarget and moves the implementation
of getGetter/Setter/Function...Type methods to the subclasses.

Change-Id: I2d32b8df20b1d54dd5c60be392642d044c6fab11
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254160
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2022-08-11 14:39:27 +00:00
Paul Berry ac08c03dc6 Flow analysis: break up libraries.
This change breaks flow_analysis.dart into the following libraries:

- assigned_variables.dart (for the AssignedVariables class and related
  code)

- promotion_key_store.dart (for the PromotionKeyStore class)

- type_operations.dart (for the TypeOperations mixin and related code)

- flow_analysis.dart (for the rest of flow analysis)

And it breaks mini_ast.dart into the following libraries:

- flow_analysis_mini_ast.dart (functionality specifically concerned
  with testing flow analysis)

- mini_ast.dart (functionality not specifically related to flow
  analysis)

This is in preparation for trying to share some more type inference
behaviors between the analyzer and CFE.

Note that although the diff is big, the only changes in this CL are
moving code from one place to another, renaming some class members
from private to public, and updating imports.

Change-Id: I71768f03b1e75ed754c7b7af39f6cf7f03c4fe44
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254462
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2022-08-11 13:18:52 +00:00
Johnni Winther 50ac2500a1 [dart2js] Handle private names correctly in K/J-model
The library wasn't taken into account when handling computing class
members in the K/J-model and not handled correctly when computing
applicable selectors. This made dart2js unable to handle members with
a name private to a different library than the enclosing library.

Fixes #33732
Fixes #49226

Change-Id: I5ba143d87662bbd42e0ff02355054e4a937be8f8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/252665
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2022-08-11 06:56:32 +00:00
Brian Wilkerson 94d797ebee Add a refactor command
The command name is a bit unfortunate in that it isn't very readable for
debugging purposes, but it has the advantage that there isn't any
opportunity for it to get out of sync. That might be the wrong thing to
optimize for. Let me know what you think.

Change-Id: Iec5c2ad9703f51c7702d4d5094f0548b48fbaafd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254321
Reviewed-by: Danny Tuppeny <danny@tuppeny.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-08-10 22:52:41 +00:00
Sam Rawlins e139fb1527 Tidy some lint issues in analyzer
* Move many identifiers from snake_case or SCREAMING_SNAKE_CASE to
  camelCase. I think I restricted the changes to private API.
* Add an ignore in generated files for constant_identifier_names;
  we often just mirror names found in YAML files or whatever, where
  things are not necessarily named according to Effective Dart
  standards.
* Avoid some implementation imports which I think were accidental.
* Use single quotes in some more places.

Bug: https://github.com/dart-lang/sdk/issues/48784
Change-Id: I439fe50cb9f8f8f5e9c74ce594aea15e394ee7da
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254500
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2022-08-10 21:23:21 +00:00
Paul Berry e6c805a3c5 Flow analysis: split test harness class.
This change splits the `Harness` class into a base class, `Harness`,
which in principle can be used for testing type inference logic in
general, and a derived class `FlowAnalysisTestHarness`, which is
specialized for flow analysis tests.

This is in preparation for trying to share some more type inference
behaviors between the analyzer and CFE.

Change-Id: Ic56b8dd8748065ca59e246e0d804946cc69203c3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254280
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2022-08-10 20:47:41 +00:00
Joshua Litt 90478c34c4 [dart2wasm] Support typed data conversions across JS interop boundary.
Change-Id: Ie8aca2027ac47dafd79636d8ac06f3466817b8d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/253841
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2022-08-10 20:23:41 +00:00
Konstantin Shcheglov 67f33caa5f Updates to prepare for analyzer 'name' breaking changes.
Change-Id: I0ef4226d30f923996a29af0d8f22c59c0e52f3a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254464
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2022-08-10 20:17:31 +00:00
Konstantin Shcheglov f3d919308f Use different marker file to identifier Blaze workspace.
Bug: https://github.com/dart-lang/sdk/issues/49629
Change-Id: I8f1496735373494745a79d502488a217e3c71223
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254480
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2022-08-10 19:58:43 +00:00
Danny Tuppeny 61314e9588 [analysis_server] Fix flaky reanalyze tests
Change-Id: If6cef40f3215d6f826d72cad189de2ce5c677718
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/253661
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2022-08-10 18:56:08 +00:00
Konstantin Shcheglov d23c1b9d88 Roll dart_style 49bc3ff32b5578b6e19f8fd376d668130941ee29 into the repository.
Change-Id: I4caa7d921c54685a7d2fe185edfefd616ecaffbc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254065
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-08-10 17:40:38 +00:00
Sam Rawlins 104d43fa59 Null-check after await.
This involves changing the target expression which must be null-checked
or awaited. When we detect the FutureOr and the await expression, we
instead null-check the await expression.

Fixes #44041

Change-Id: I08cf03f6975e2e70d5c87ebda92e9538de19e02e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/253863
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2022-08-10 16:09:59 +00:00
Konstantin Shcheglov 43065920cc Rename Bazel to Blaze - files, classes, methods.
No changes to implementation yet, we still look for both Blaze and Bazel.

Bug: https://github.com/dart-lang/sdk/issues/49629
Change-Id: Iaf1b1cc2c9a8cf28d8bbfb5541819a1f5c8a3de6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254343
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-08-10 16:00:18 +00:00
Johnni Winther 1662441541 [cfe] Enable alternative-invalidation-strategy by default
Change-Id: If9f08f883318a5f0487beaa0f7dbd73366ed5074
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/251107
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-08-10 14:57:18 +00:00