Our tests (including code in core libraries) are never run with
assertions enabled.
=> Add the necessary configuration support in test_matrix.json
=> We'll then add a new builder running one configuration with asserts.
Change-Id: Id1bc27ddf7d683846510af4711679ad14f0e4168
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370620
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
This adds CompilationUnit as a supertype of LibraryBuilder as a
first step towards splitting libraries from compilation units.
The SourceLoader._builders are now compilation units and lookups
in to the SourceLoader are split into compilation units, loaded
library builders and source library builders.
Change-Id: If9958a5a67443170cc1a538106d9efd424e36889
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369643
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Dead Code Elimination can remove `RecordCoverageInstr`, but shouldn't.
This CL makes it stay by returning true in `HasUnknownSideEffects`
making `MayHaveVisibleEffect` return true, making Dead Code Elimination
keep it.
Note that `RecordCoverageInstr::Canonicalize` will still let it go away
if the position is already covered which is what we want.
Bug: https://github.com/dart-lang/sdk/issues/42061
TEST=pkg/vm_service/test/coverage_closure_call_after_optimization_test.dart,vm/cc/IL_RecordCoverageSurvivesOptimizations
Change-Id: Ifd72f9071a51924fd71f3dae91687acb1467047d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370220
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Currently if we have a `<obj> is/as Iterable<T>` check we will
* allocate a `WasmArray<_Type>` array and put value for `T` in it
* allocate a `_InterfaceType` object with the array as type arguments
* call to RTT which is looping over the type arguments array
With this CL we recognize in the compiler if we generate tests against
interface types and specialize the most common cases (0, 1 or 2 type
arguments). This in return will make us
* call to 0/1/2 specialized RTT isInterfaceSubtype implementation
which will use unrolled loops to do the checking.
=> We avoid allocation of `_InterfaceType` always
=> We avoid allocation of `WasmArray<_Type>` for length=0/1/2
=> We have faster checking due to unrolled loops.
(It is very unlikely binaryen can achieve the same, as it would
need to do very aggressive inlining & loop unrolling to get to the
same result. If we'd force it to inline then every is/as check
would be very large).
Issue https://github.com/dart-lang/sdk/issues/55516
Change-Id: Ia99548d514683f678178ea30d07aeb742ae914ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370260
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
We make the compiler emit a special index (namely 0) into the
canonical type argument substitution table iff no substitution has to be
performed.
This is very common:
```
class List<T> implements Iterable<T> {}
```
=> The translation of the type arguments from `List` to those of
`Iterable` is a NOP and can therefore be skipped.
Issue https://github.com/dart-lang/sdk/issues/55516
Change-Id: I16ad8d7196656dddeba15801e80c2e23ae0af51b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370242
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
When an implicit or explicit `as` check fails we throw a [TypeError]
exception with a stack trace. Though that stack trace doesn't really
have to have the top-frame being where the check failed, it's fine if
there's an additional frame from the runtime code that actually throws
the exception.
Doing so removes `StackTrace.current` from every `as` check and
therefore reduces size.
Change-Id: Ia34b59ebaa54b8cdcd2dc7b153a1e4e2fe1dd0e9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370340
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
This CL optimizes the RTT data structures by
* Having a canonical table for substitution arrays
* Stores the (canonical) substitution index to use right next
to the super class id, thereby
* Removing an indirection when looking up substitutions
See more information in `sdk/lib/_internal/wasm/lib/type.dart`
This reduces
* `Hello.Compile.Size.wasm.opt` by ~ 4%
* `FluteComplex.Compile.Size.wasm.opt` by ~0.5%
Issue https://github.com/dart-lang/sdk/issues/55516
Change-Id: If0a50780a9a604886bd67a08a2f345103f0bcb32
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369641
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
The implicit covariance type checks are currently performed by always
calling out to RTT. Those can use our existing optimized implementation
for is/as checks.
This reduces code size of -O2 mode as well as makes certain
benchmarks significantly faster (e.g. UIMatrix* 2x faster)
Change-Id: Ib5224a310b2188b9edb2de1e800d2e60010d11f1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370280
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Followup to fb057ea4e0
Now that the web implementation of DateTime supports microseconds, the test special cases for not supporting microseconds can be removed.
Change-Id: I10991b25e42d643ae58850d7190621c9d11877b8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367680
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
This fixes a bug where a semantic tokens request could use an incorrect LineInfo for mappings if sent immediately after an overlay update because:
a) we computed a LineInfo from the source instead of using one consistent with the resolved unit
b) we read the file state in a way that did not take into account the latest overlay updates if the analysis driver hadn't handled the changed file
The second issue could affect other requests too because server.getLineInfo() is used in a number of places (to support plugins). This change reverts reading the file state directly, but also updates semantic tokens to prefer using the LineInfo from the resolved unit when we have one (only falling back to computing one from current sources for non-Dart files, which can be handled by plugins).
Fixes https://github.com/dart-lang/sdk/issues/55084
Change-Id: I77ab6ad63a78ebd062b264d901a9ae8568b9096e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370021
Reviewed-by: Sam Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Spelled out at https://github.com/dart-lang/linter/issues/1020
Fixes https://github.com/dart-lang/linter/issues/1020
This CL does not change the categories/groups that any rule has. We
can add/change categories in later CLs.
Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try
Change-Id: Ief2856a6c472492bbad19fc95df172ef8d19fe7b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369861
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Sam Rawlins <srawlins@google.com>
Local variables named `_` are no longer in scope and can't be used when the wildcard variables experiment is enabled.
Bug: https://github.com/dart-lang/sdk/issues/55655
Change-Id: I13a7a9fcfb92e4b64bd51b5ccfe657f5a0633233
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369507
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
* Generalizes `RemoveExtraModifier` to a new `RemoveLexeme` producer that works for keywords and modifiers.
* Adds a new (keyword) quick-fix for the `GETTER_CONSTRUCTOR`
See: https://github.com/dart-lang/sdk/issues/55917
Change-Id: I0e7fbc33aa970f0754c9533b3ecbd4e9dd9ddb30
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370100
Auto-Submit: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Revisions updated by `dart tools/rev_sdk_deps.dart`.
crypto (0a10171..7a9428a):
7a9428a 2024-06-04 Kevin Moore Bump lints dep (dart-lang/crypto#172)
dartdoc (45627f9..ddb8fb4):
ddb8fb44 2024-06-03 Konstantin Scheglov Use package:analyzer/source/source.dart (dart-lang/dartdoc#3780)
http (7bfbeea..a3567f8):
a3567f8 2024-06-05 Brian Quinlan Prepare to release cronet_http 1.3.1 (dart-lang/http#1228)
7addc61 2024-06-05 Hossein Yousefi [cronet_http] Upgrade jnigen to 0.9.2 to close `#1213` (dart-lang/http#1225)
eb87a60 2024-06-04 Anikate De pkgs/ok_http: Close the client (override `close()` from `BaseClient`) (dart-lang/http#1224)
9f022d2 2024-06-04 Anikate De pkgs/http_client_conformance_tests: add boolean flag `supportsFoldedHeaders` (dart-lang/http#1222)
90837df 2024-06-03 Anikate De pkgs/ok_http: Condense JNI Bindings to `single_file` structure, and add missing server errors test (dart-lang/http#1221)
logging (73f043a..dbd6829):
dbd6829 2024-06-04 Sarah Zakarias Update `topics` in `pubspec.yaml` (dart-lang/logging#165)
test (2464ad5..83c597e):
83c597e5 2024-06-05 Jacob MacDonald enable asserts in dart2wasm tests (dart-lang/test#2241)
60353804 2024-06-04 Nate Bosch Remove an unnecessary `dynamic` (dart-lang/test#2239)
43ad4cd8 2024-06-03 Kevin Moore random cleanup (dart-lang/test#2232)
18db77c3 2024-06-02 Kevin Moore prepare to publish test_api (dart-lang/test#2238)
cd72e8d8 2024-06-02 Kevin Moore Prepare to publish (dart-lang/test#2237)
9c6adaa7 2024-06-01 Kevin Moore fixes (dart-lang/test#2235)
0110a80b 2024-06-01 dependabot[bot] Bump the github-actions group with 2 updates (dart-lang/test#2236)
b1b2c029 2024-06-01 Martin Kustermann Fix `dart run test -p chrome -c dart2wasm` (dart-lang/test#2233)
tools (86b3661..4321aec):
4321aec 2024-06-05 Andrew Kolos [unified_analytics] Suppress any `FileSystemException` thrown during `Analytics.send` (dart-lang/tools#274)
e5d4c8b 2024-06-03 dependabot[bot] Bump actions/checkout from 4.1.5 to 4.1.6 in the github-actions group (dart-lang/tools#271)
web_socket_channel (45b8ce9..bf69990):
bf69990 2024-06-03 Thibault Chatillon bump web_socket dependency 0.1.3 -> 0.1.5 (dart-lang/web_socket_channel#370)
5b428dd 2024-06-02 dependabot[bot] Bump actions/checkout from 4.1.5 to 4.1.6 in the github-actions group (dart-lang/web_socket_channel#371)
afd1e3c 2024-05-23 Brian Quinlan Remove `--fatal-infos` from `dart pub downgrade` analysis (dart-lang/web_socket_channel#367)
cb20b71 2024-05-23 Sarah Zakarias Add `topics` to `pubspec.yaml` (dart-lang/web_socket_channel#362)
8514229 2024-05-22 Kevin Moore Bump and fix lints (dart-lang/web_socket_channel#366)
webdev (a97c2a1..9ada46f):
9ada46fc 2024-06-05 Nicholas Shahan Hide more temporary variables when debugging (dart-lang/webdev#2445)
yaml_edit (963e7a3..08a146e):
08a146e 2024-06-06 Kavisi Fix splice list insertion (dart-lang/yaml_edit#84)
561309e 2024-06-01 dependabot[bot] Bump actions/checkout from 4.1.5 to 4.1.6 in the github-actions group (dart-lang/yaml_edit#85)
b582fd5 2024-05-31 Kavisi Fix error thrown when inserting keys (dart-lang/yaml_edit#80)
Change-Id: I36acbc26fe97d8a1e3fdfa5f4855cc4be7d84dd7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370080
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Previously, if a record literal had named fields, type inference of
the literal fields would happen as part of the process of
hoisting. This was a problem because the hoisting process requires
visiting the fields in reverse order, so as a result, the order in
which subexpressions were type inferred was the reverse of the order
in which they would be executed, leading to unsound type promotion
behavior.
Fixes#55914.
Bug: https://github.com/dart-lang/sdk/issues/55914
Change-Id: I2d8930e0e1d7579d065bfb850aa7472d28a8012c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369761
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
google3 makes heavy use of symlinks, with no guarantee that the relative
location of files with respect to each other will be maintained after
the symlinks are resolved. This causes issues when trying to locate the
DartDev snapshot using the VM executables resolved path as a base.
This change updates the DartDev snapshot detection logic to first try to
find the snapshot using the resolved executable path before falling back
to using the unresolved path used to launch the VM (e.g., the path
specified by argv[0]).
TEST=pkg/dartdev/test/
Change-Id: I19a41c440ac82cbc671dafb3bda23a31fb4cdc0c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370000
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
The agnostic mode was added to allow the platform dill embedded in
the VM to support both weak and strong mode. Since weak mode is no
longer supported in the VM, the agnostic mode can new be deleted.
All uses of the agnostic in Dart and Flutter have been removed prior
to this change.
Change-Id: Iff0f69d9cd64e887e01cd7e7d336a97761bd6d4b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366801
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
No client of the VM uses this flag, only tests, and this flag was always
set to false in AOT mode. Thus, remove uses of this flag and instead
always lazily create dispatchers as needed when resolving method names
in JIT mode.
Remove the implicit value of `allow_add` for some Resolver
static methods. For callers that previously depended on the implicit
`true` value (which includes the AOT precompilier), pass `true` for
uses in the compiler and pass `!FLAG_precompiled_mode` for uses in the
runtime. Assert that `allow_add` is false when these methods are invoked
from the precompiled runtime.
Remove Resolver static methods that are no longer used.
TEST=ci
Change-Id: Ib6a7354f7a859e86743c381513a4129c14895753
Cq-Include-Trybots: luci.dart.try:vm-linux-debug-x64-try,vm-linux-release-x64-try,vm-aot-linux-debug-x64-try,vm-aot-linux-release-x64-try,vm-aot-mac-release-arm64-try,vm-mac-debug-arm64-try,vm-mac-release-arm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366668
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
In the backend, handle the following cases that were assumed not to
happen before:
* If the index and offset are both 0, then the operation is a no-op
and so the output register should be the same as the first input.
(Should only happen if the instruction is used in a non-optimizing
context, as otherwise it is removed by canonicalization.)
* If the scaled index can be used as an instruction immediate and the
offset is 0, then emit the appropriate instruction(s).
* If the scaled index and offset can both be used as immediates to
instructions, but their sum (the total offset in bytes) cannot, then
allocate a register for the index and fall back to the non-constant
index case.
CalculateElementAddress::Canonicalize now only performs removal of
no-op instructions.
This CL also fixes a switch on the instruction tag in
FlowGraph::RenameRecursive to appropriately convert UnboxedConstant
instructions to initial definitions of the FlowGraph as it already does
for Constant instructions.
TEST=vm/dart/regress_55877
Issue: https://github.com/dart-lang/sdk/issues/55877
Cq-Include-Trybots: luci.dart.try:vm-aot-linux-debug-simarm_x64-try,vm-aot-linux-debug-simriscv64-try,vm-aot-linux-debug-x64-try,vm-aot-linux-debug-x64c-try,vm-linux-debug-ia32-try,vm-linux-debug-x64-try,vm-linux-debug-x64c-try,vm-linux-debug-simriscv64-try,vm-mac-debug-arm64-try,vm-aot-mac-release-arm64-try
Change-Id: I613d6c8770fe02facf6bbdb3d2b11f842b51540d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369642
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
I plan using it to implement serialization of MacroExecutionResult(s).
Bug: https://github.com/dart-lang/language/issues/3877
Change-Id: I34d95ab6fd2c335ceb2a957c9222947b85e986a1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369841
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
This CL doesn't set up the analyzer to surface links to these destinations, just includes the new format in the diagnostic messages file.
Change-Id: I6c227448b42a5abac53d5c6a863e599c7e8809da
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368081
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Marya Belanger <mbelanger@google.com>
- use the new RelevanceComputer to compute relevance for CandidateSuggestion's before calling into the SuggestionBuilder, as
part of the new flow for completions.
- reuse the RelevanceComputer where possible in SuggestionBuilder.
Change-Id: I8fdfaee81e68bc66f726c40a76ab6c81099a2cc6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369840
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
Late local variables are lowered by the CFE into a local:
* backing store variable
* get method
* set method
* isSet local variable (optionally when the type is nullable)
This change updates the name in JavaScript used for the backing store
variable to match the name for the late variable from the original
source. It also updates the scope information passed for expression
evaluation to remove the lowered name and replace it with the original
so evaluations will work as well.
The name change avoids the hiding performed by the debugger on
recognized temporary names so it appears in the list of local variables.
b/343405209
Issue: See https://github.com/dart-lang/sdk/issues/55918
Change-Id: I6b65a62baf6f26f6e9cfee9f14667d021e16645e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369506
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>