This reverts commit fb057ea4e0.
Reason for revert: b/342552853
Original change's description:
> [js_runtime, js_dev_runtime] Implement `microsecond` field of `DataTime`
>
> - Move DateTime implementation for dart2js and DDC into a shared place to reduce duplication.
>
> - Add a _microsecond field to the web DateTime to track microseconds outside of the JavaScript Date.
>
> - The cute dart2js optimization whereby `DateTime.now().millisecondsSinceEpoch` is compiled to `Date.now()` still works.
>
> - Both implementations report better errors.
>
> - Fixed VM bug with in-range sentinel.
>
>
> Change-Id: I9156255bdb6ecc195500ae9bc88f91fb315b6297
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366963
> Reviewed-by: Alexander Aprelev <aam@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>
> Reviewed-by: Lasse Nielsen <lrn@google.com>
> Commit-Queue: Stephen Adams <sra@google.com>
Change-Id: I58572256a7710df4589bb5e41c7afee295c2388b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368103
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Auto-Submit: Ivan Inozemtsev <iinozemtsev@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
This changes the VM platform dill from agnostic to strong. The
VM no longer supports weak mode, so agnostic is not needed.
TEST=existing
Change-Id: I85defb6aec15262b71b4f1c199e77bd356826332
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366670
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Today, support for expression evaluation in DDC uses a lot of
information. To properly support compiling expressions in arbitrary
frames, we consume source-maps, module metadata, and full kernel
components at various stages of the process. This data is already
plumbed and available for non-sdk modules in our debugging systems
(frontend-server, webdev, g3), however it is not available the Dart
SDK module itself. Because of that, the expression compiler today
rejects all expression evaluation requests when the target is a Dart
SDK library.
Until the fix the availability of this data everywhere, we believe
we can support a limited form of expression evaluation: only
evaluation of libary level expressions. Basically, expressions
where scope data is not necessary and kernel outlines are sufficient to
compile the expression.
Here we introduce logic to recognize the first offset location of a
library, which is a clear indicator that no scope data is needed and
a library level expression evaluation is being requested.
This change is an attempt to help resolve
https://github.com/flutter/devtools/issues/7766. Note: just like
changes were needed here in the worker and test-compiler files, it
is possible that some change may be necessary in dwds and other
parts of the pipeline. Additional validation will be needed after
this lands.
Change-Id: Iff081a24ecb05092407279a0a7ed3d38c13cf41d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367981
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Fix follow up comments with an async rethrow test.
Tests that wildcard patterns still work while mixed with wildcard variables.
Bug: https://github.com/dart-lang/sdk/issues/55652
Change-Id: If6ab4de68ff27ad51215427a7183f1aed7229947
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367501
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
refactors builder implementations to fix some bugs, nested builders go through a separate constructor now which has all required params so we can ensure the parent maps are passed down.
update pubspecs/changelogs for release
Bug: https://github.com/dart-lang/sdk/issues/55425
Change-Id: I5bfe3bea3b7574de83d8b3774e92fd9101325b8d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368080
Commit-Queue: Jake Macdonald <jakemac@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
When iterating on core library changes or changes in the AOT compiler
many seconds are wasted waiting on gen_kernel/compile_platform to
parse Dart code. This happens because we are running these tools
from sources on prebuilt Dart SDK.
This CL allows SDK developer to opt-in into AOT compiling these
tools by adding `precompile_tools=true` to their DART_GN_ARGS.
AOT compilation is performed using prebuilt SDK - so these
executables do not need to be recompiled if core libraries or
VM changes reducing iteration cycles.
pkg/vm/tool/precompiler2 is tweaked to detect when DART_GN_ARGS
contains `precompile_tools=true` and use precompiled
gen_kernel.exe instead of running it from source.
Using precompiled compile_platform takes vm_platform_strong.dill
build from 20 seconds to 3 seconds.
Using precompiled gen_kernel takes small benchmark build from
~10 seconds to 2 seconds.
This relands 5cda2a871c with fixes
for Flutter build.
TEST=manually tested
Change-Id: I552861c80c152890655e41baaf6ea3fb3b03a57e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367961
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
This reverts commit 60a52f66f5.
This runs the strong suite, does coverage, and compares the coverage
(percentage) to the (hardcoded) expected percentage.
Change-Id: Ie2885fae05015394e49feadc95b294d46ee9ab8a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367901
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
If the enclosing class is a leaf node search for live matches in "canHit". Do this by iterating the class hierarchy starting at the enclosing class of the element and checking the supertype to see if they're included in the constraint set.
Change-Id: If859bbca1d2744303c03ac91d1601a05c61dfc2d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367220
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
These assignments don't impact any of the following code because we
no longer reference these fields.
Change-Id: I83e294c2dc7f4487f8fe9b2b284c9e6eaf050f1e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368040
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
With sound null safety, implicit "return null" at the end of function
should be taken into account only if return type is nullable.
TEST=pkg/vm/testcases/transformations/type_flow/transformer/regress_flutter148617.dart
Issue: https://github.com/flutter/flutter/issues/148617
Change-Id: I209fc9a3b10639fd4024d4b1807591498349e1f0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367980
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
The change adds a new reduction that recognizes the construction of a type environment from components
HTypeBind(HTypeEval(env, e1), HTypeEval(env, e2))
and replace with an equivalent expression that constructs the same derived type environment directly
HTypeEval(env, ...e1...e2...)
This change speeds up the benchmarks that iterate `Map.entries` by roughly 10-25%.
---
Type arguments are passed as separate values [1]. This means that the generative constructor factory `MapEntry<K,V>(this.key, this.value)` has four parameters - `MapEntry$(key, value, $K, $V)`. The passed arguments usually come from the same place, perhaps extracted from the type of the current object, `this.$ti._eval("1")` and `this.$ti._eval("2")`.
Inside `MapEntry$`, the type parameters are re-assembled into a type environment:
$K._eval("@<0>")._bind($V)
which is used to construct the object type
$K._eval("@<0>")._bind($V)._eval("MapEntry<1,2>")
After inlining:
$K = this.$ti._eval("1");
$V = this.$ti._eval("2");
$K._eval("@<0>")._bind($V)._eval("MapEntry<1,2>")
After GVN, and reducing the adjacent `._eval("1")._eval("@<0>")` to `._eval("@<1>")`:
t1 = this.$ti
t1._eval("@<1>")._bind(t1._eval("2"))._eval("MapEntry<1,2>")
The new reduction gives us:
this.$ti._eval("@<1,2>")._eval("MapEntry<1,2>")
which can be reduced further by combining adjacent HTypeEvals:
this.$ti._eval("MapEntry<1,2>")
[1]: It would be better to pass the type arguments as a single Rti object to avoid the extract-recombine pattern, but changing the calling convention is a more extensive change. In the meantime, this reduction cleans up the extract-recombine pattern when inlining brings the parts together.
Change-Id: I28801ce5d952d0f4e5ac1d55c252766159dcceef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367240
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
There were no tests of this component of the annotation's description:
> The annotation can also be applied to a class to implicitly
> annotate all of the valid members of the class
So I add those as well.
Bug: https://github.com/dart-lang/sdk/issues/48476
Change-Id: If5f0f4c6057f57b4dfd01d8f648110d69fbc5eb4
Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367880
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
The variant of the parameter, optional/required and named/positional, is inferred from the other parameters used in the method.
Change-Id: I0c26e5d16e759978410ba854c0fed0a75d33724f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/365826
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Moritz Sümmermann <mosum@google.com>
This reverts commit 5cda2a871c.
Reason for revert: broke Flutter build.
Original change's description:
> [tools] Allow precompiling gen_kernel and compile_platform
>
> When iterating on core library changes or changes in the AOT compiler
> many seconds are wasted waiting on gen_kernel/compile_platform to
> parse Dart code. This happens because we are running these tools
> from sources on prebuilt Dart SDK.
>
> This CL allows SDK developer to opt-in into AOT compiling these
> tools by adding `precompile_tools=true` to their DART_GN_ARGS.
>
> AOT compilation is performed using prebuilt SDK - so these
> executables do not need to be recompiled if core libraries or
> VM changes reducing iteration cycles.
>
> pkg/vm/tool/precompiler2 is tweaked to detect when DART_GN_ARGS
> contains `precompile_tools=true` and use precompiled
> gen_kernel.exe instead of running it from source.
>
> Using precompiled compile_platform takes vm_platform_strong.dill
> build from 20 seconds to 3 seconds.
>
> Using precompiled gen_kernel takes small benchmark build from
> ~10 seconds to 2 seconds.
>
> TEST=manually tested
>
> Change-Id: Ieec6ad4e1081023d140eb744f0a3cd0c754414ca
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367940
> Commit-Queue: Slava Egorov <vegorov@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>
Change-Id: Id3e4eb44d33516f31c165d9a1e55911e8d356e7f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367960
Commit-Queue: Slava Egorov <vegorov@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
I would like to add an option to our BUILD
files to precompile gen_kernel and
compile_platform to speedup iteration cycles
when working on core library changes.
To make this robust I would like to use
depfile to track dependencies and know
when compile_platform should be
recompiled.
TEST=pkg/dartdev/test/commands/compile_test.dart
R=kustermann@google.com
Change-Id: Id674f7353342c8275a8a0c4a70e3f5eaeb7f05d5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367023
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
When iterating on core library changes or changes in the AOT compiler
many seconds are wasted waiting on gen_kernel/compile_platform to
parse Dart code. This happens because we are running these tools
from sources on prebuilt Dart SDK.
This CL allows SDK developer to opt-in into AOT compiling these
tools by adding `precompile_tools=true` to their DART_GN_ARGS.
AOT compilation is performed using prebuilt SDK - so these
executables do not need to be recompiled if core libraries or
VM changes reducing iteration cycles.
pkg/vm/tool/precompiler2 is tweaked to detect when DART_GN_ARGS
contains `precompile_tools=true` and use precompiled
gen_kernel.exe instead of running it from source.
Using precompiled compile_platform takes vm_platform_strong.dill
build from 20 seconds to 3 seconds.
Using precompiled gen_kernel takes small benchmark build from
~10 seconds to 2 seconds.
TEST=manually tested
Change-Id: Ieec6ad4e1081023d140eb744f0a3cd0c754414ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367940
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Knowing whether Dart code is running in a WebAssembly context is useful
to potentially select different code paths exploiting differences in
JavaScript and WASM behavior or simply to report the information to
users (e.g. for crash reports).
Without such a constant, one has to rely on implementation differences
such as `identical(0, 0.0)` or check the available `dart:` libraries.
Both are error-prone, so having a reliable constant as an alternative
makes this easier.
Closes https://github.com/dart-lang/sdk/issues/55694
Change-Id: Ia969641e4b78223c394cbf251805cf77a30cb0fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/365822
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
This CL removes the "default" case when the switch must be exhaustive
and is exhaustive without the default. Found by modifying the CFEs
constant evaluator.
Change-Id: Iaba27864315875257502be8e74fc2ce34f6ce54d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367900
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
This is preparing _AbstractCorrectionProducer to be a sealed public
class for plugins:
* Move `_coveringNode` and `coveringNode` to
CorrectionProducer from _AbstractCorrectionProducer; these are only
used by CorrectionProducer subclasses.
* Seal CorrectionProducer; the ultimate subclasses should subclass
either ParsedCorrectionProducer or ResolvedCorrectionProducer.
* Make CorrectionProducerContext final.
Change-Id: Iccbe0d92042eb826c6c53499e052c37442e312ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367761
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
This introduces CorrectionApplicability.automaticallyButOncePerFile,
used in just 4 producers:
* AddNullCheck
* MoveDocCommentToLibraryDirective
* RemoveLibraryName
* RemoveUnnecessaryLibraryDirective
Also fixes FixProcessorMapTest to actually test registered fixes.
Change-Id: I2ed2d8d6a030f04ea3fa969988719bb9d4c2f8fb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367661
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
I convert the `noSuchMethod` tests to (imho) simpler tests of what
property access of `e` or `d` or `D` would look like on an int, via
extension getters.
The noSuchMethod test as it was written cannot be executed at runtime,
because (as of Dart 2, I think, maybe earlier), property access on
expressions is a compile-time consideration. And I think as a compile-
time error test, it's hard to see what it's testing.
Change-Id: I5c0ca728e6e812b8f35adb80b288be351c4b076a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367461
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Change-Id: If1995ff9938df8b08d12a2d7deaf9fc69e39a356
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367760
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Auto-Submit: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Change-Id: I49c75bcaa12eefc06b1e906983b482a51466c134
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367740
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Auto-Submit: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>