Reduces VM code size by about 15k.
Change-Id: Icaa1a5278855f88f7ce702802d6aaa62639cfac5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/205120
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
In order to simplify removal of instance fields with initializers which
may have side effects, such field initializers are moved to constructor
initializer lists before type flow analysis.
In case of multiple generative non-redirecting constructors AST of
field initializers is cloned. Moving and cloning of initializers is
performed before the analysis to avoid maintaining and spreading
inferred TFA information attached to AST nodes.
TEST=pkg/vm/testcases/transformations/type_flow/transformer/instance_fields_with_initializers_nnbd.dart
Fixes https://github.com/dart-lang/sdk/issues/46402
Change-Id: I4dc9c44c441ece5792f0748789ece117a2814581
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/204943
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
The purpose of this CL is to clean up test code that references `main`
in a way that will be invalid when the tests are converted to analyze
the test code under null safety by default. This is the first of three
such CLs.
In all three I only touched test files that contained an invalid use of
`main`, but in any file I touched I removed any use of `main` where the
name of the function/method was not critical to the test.
Change-Id: Ib753302a4c3ffc7eb5f248e9c6000e80dc77fca9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/205062
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
We should rename ClassMemberLocation to reflect the wider usage, but I
thought it would be better to do that in a separate CL.
Closes: https://github.com/dart-lang/sdk/issues/38693
Change-Id: I657f7945022b09eb8deb89d8f2f5d43164fe53cb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/205061
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
This fixes existing problems in the SDK documentation, and corrects
expressions that were invalid but ignored in the previous version of
dartdoc.
Change-Id: Ic06b6bce7a886f8e5ce797594d37e382fe37bd40
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/205068
Commit-Queue: Janice Collins <jcollins@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
Currently the TSAN JIT run runs all tests in one go, that causes the bot
to run OOM. Instead we'll run it in batches, to limit the amount of RAM
TSAN needs to accumulate until end of program.
TEST=Existing test suite.
Change-Id: I6e5b3e9201dda94bbe4deb39a9fd01c8f84329f1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/204983
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Change-Id: Ief2313b6c7f859622f8970cb3abb42ba98c89084
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/202243
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
* No longer ammend the "actual" file with test code. Instead do like
the expression compilation and create a new library builder that
can access the same things as the original builder and use that.
This has the benefit of not invalidating anything really, meaning it's
much faster.
Change-Id: I65fc45d17217a62a04dd43ab14806d759d0fdca8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/204961
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
The [DateTime.parse](https://api.dart.dev/stable/2.10.4/dart-core/DateTime/parse.html) method accepts out-of-range components. For example, parsing the string "2020-01-42" produces "2020-02-11".
This was raised as a bug in https://github.com/dart-lang/sdk/issues/11189, but after more than 7 years that issue was closed with the solution being "use parseStrict from the intl package" instead.
This pull request simply **updates the documentation of DateTime's _parse_ method** so that users know:
1. This is how the method behaves. Otherwise they might be surprised when it unexpectedly happens in their code.
2. This behaviour is a feature and not a bug. Otherwise they might raise another issue for it.
3. The _parseStrict_ method in the intl package exists. Otherwise they might reinvent the wheel.
Closes https://github.com/dart-lang/sdk/pull/44521https://github.com/dart-lang/sdk/pull/44521
GitOrigin-RevId: a88ada479d6664cac69a6dc44de3fe2a41f8e9be
Change-Id: Ic45e4db118bd3fad3a612659a35ca7a5d80937b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176680
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Use the depot_tools provided gsutil in the update script.
Cq-Include-Trybots: luci.dart.try:dart2js-minified-strong-linux-x64-d8-try,dart2js-strong-hostasserts-linux-ia32-d8-try
Change-Id: Ia12e61d6ba76a0cd89923d6f8821f7a3e2919cea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/204205
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Previously, when checking S <: T, we only checked if S and T had the
same interface name once. However, it's possible that redirections
eventually cause them to become equal. For example, if S is an interop
type and T is JavaScriptObject, after following the redirection from S
to JavaScriptObject, we end up checking JavaScriptObject <:
JavaScriptObject. Therefore, we need to recheck after following each
redirection.
Change-Id: Ie3eb9530627a0e48a5ea704fd4078ae238a65c78
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/204744
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Change-Id: I866378cba43db7f559e37d3c0bf163843f74d186
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/204941
Auto-Submit: Kevin Moore <kevmoo@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
macOS arm64 builds only create the x64 gen_snapshot by default because
they are cross-compiled in Rosetta. Adding the gen_snapshot target
ensures that we have a gen_snapshot for arm64 as well.
These bots require clang which currently isn't provisioned on shards, so
they are running on the main bot.
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-nnbd-mac-release-arm64-try
Change-Id: I842f37019a65dfb30e522d2d9bead5e62bb3ff79
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/204505
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
- Fix default value assignment when passing a list of positional
arguments that isn't a dart:core `List` at runtime.
- Fix modification of the original list passed as positional arguments
when also passing named arguments.
Change-Id: I3aef6b1584f159c92251b963ffb927e1f75d3472
Fixes: https://github.com/dart-lang/sdk/issues/46457
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/204900
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
* Add tests of extraction of comments
* Add tests of extraction of tests
* Add tests (both positive and negative) of actually running tests
* Use parser for extracting tests so it correctly parses stuff with
commas and braces for instance.
Change-Id: I48a7e8ae179d53371a9bcfed982f0df177306c12
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/204502
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
No qemu-using CI bot runs vm/cc tests currently, but this allows
developers to run vm/cc tests locally using qemu. This way, tests
like those from assembler_arm_test.cc can be tested both with and
without our own ARM7/ARM8 simulators.
Change-Id: I7fd97e411936954b59d9f0fc65e16c518e9ee332
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/204781
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Clement Skau <cskau@google.com>
The storebuffer verification code did check that objects in the store
buffer do not have the IsCardRemembered bit set.
This CL adds some extra checks to also ensure the bit is correctly set
(or said differently, that we never add large arrays to the store
buffer)
TEST=Existing test coverage.
Change-Id: I764ac15eec30fef3769706972e1783a31f911e57
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/204800
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Adding explicit source maps to the operator created a breakable location
when viewing source-mapped dart code in chrome devtools. There isn't a
breakable point in the javascript for a `!` operator so trying to enable
the breakpoint visible in the dart code would trigger some "other
breakpoint".
Recent changes in the V8 debugger have changed which "other breakpoint"
would be triggered.
16b0767adc
This causes our tests to fail and makes the user
interaction a little confusing. Removing the extra source map here seems
to be the most reasonable solution because it prevents a possible
breakpoint from appearing where there isn't a breakable location.
Now, the ! operator doesn't introduce any new source mapping it simply
continues the previous mapping.
Change-Id: I5903bfeaf1bcb2e2a3ce883433153575aa1fd05a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/204742
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
This change teaches tree shaker to drop default values of parameters of
methods if their bodies are dropped (for example if a method is only
used as an interface target).
TEST=pkg/vm/testcases/transformations/type_flow/transformer/regress_46461.dart
Fixes https://github.com/dart-lang/sdk/issues/46461
Change-Id: Icb50d7ec6acd91e68ceaa3b826c15d09d1c05701
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/204840
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
The CLI was not providing the ipv6 flag to DDS, resulting in a "Could
not start Observatory" error.
Change-Id: Idff0f525455f121b8f1e89bc4ad20a01cd1165ef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/204860
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
This change concludes switching to the new invocation nodes in the VM.
Support for the old invocation nodes (MethodInvocation, PropertyGet
and PropertySet) is removed from the VM and VM-specific kernel
transformations.
TEST=ci
Closes https://github.com/dart-lang/sdk/issues/45340
Change-Id: I0717732feb1b9c6ebdf0f6079ed42a90d00970a5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/204741
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
The call specializer replaces implicit setter calls with
AssertAssignable+StoreInstanceField. If the former lazy-deopts it will
deopt to after-call and therefore the StoreInstanceField will not be
performed.
This CL makes use of newly added infrastructure that can mark such
instructions as lazy-deopt to before-call, therefore causing a
re-try of the instance call.
Fixes https://github.com/dart-lang/sdk/issues/46446
Issue https://github.com/dart-lang/sdk/issues/45213
TEST=vm/dart{,_2}/deopt/restart_call_on_deopt_regress_46446_test
Change-Id: I460e9a3c86b89a1ae127145024ace2d3d860d0af
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/204721
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
When running the weekly test it launches a leak test for flutter first
without the experimental invalidation and then with. As the test starts
with checking out flutter gallery the second launch has to wait for the
first to be done with that.
That stopped working with 8bd4c53381 as
the (in that CL) newly added test trickered that wait to stop (by
printing a "globally listened for" observatory listening on line).
This CL fixes that by only listening for data from the correct process.
It further more makes final error-reporting better.
Change-Id: I1ead96ae4c31616b1e7dc3044ae22437d7f605d5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/204783
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Previously one would for instance get an error when trying to expression
compile an expression like `Foo._private()` on a class like
```
class Foo {
static int _private() { return 42; }
}
int _private() { return 42; }
```
whereas the expression `_private()` would be fine.
This CL fixes that, so both expressions are accepted.
Change-Id: I959bd5bf8bf5770852add3b979c8382d005ecf41
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/204782
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Adding this representation allows us to create slots for storing
and retrieving values from uint16_t-typed object fields in the runtime.
Also generalize BoxUint8Instr to BoxSmallIntInstr, which holds any
unboxed integer representation where the value is guaranteed to fit
into a Smi.
To unify the implementation of BoxSmallIntInstr across architectures,
we add ExtendValue(Register dst, Register src, OperandSize sz), which
extends the sz-sized value in src to a full register size in dst. If
sz is a signed OperandSize, then the resulting value is sign
extended appropriately.
We also add MoveAndSmiTagRegister / ExtendAndSmiTagValue, which is like
the base operation but also tags the value as a Smi. On some
architectures, this can be performed using a single instruction.
Also adds sbfx/ubfx on ARM for use in ExtendValue.
TEST=Existing tests for BoxSmallIntInstr, followup CL for the new
representation.
Cq-Include-Trybots: luci.dart.try:vm-kernel-linux-debug-x64-try,vm-kernel-linux-debug-x64c-try,vm-kernel-nnbd-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64c-try,vm-kernel-precomp-nnbd-linux-debug-x64-try,vm-kernel-reload-linux-debug-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-precomp-linux-debug-simarm_x64-try,vm-kernel-precomp-nnbd-linux-debug-simarm_x64-try,vm-kernel-linux-debug-ia32-try,vm-kernel-nnbd-linux-debug-ia32-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try,vm-kernel-precomp-linux-debug-simarm64c-try,vm-kernel-precomp-linux-debug-simarm_x64-try,vm-kernel-precomp-linux-release-simarm-try,vm-kernel-precomp-linux-release-simarm64-try,vm-kernel-precomp-nnbd-linux-debug-simarm_x64-try,vm-kernel-linux-debug-simarm64c-try,vm-kernel-precomp-nnbd-linux-release-simarm64-try,vm-precomp-ffi-qemu-linux-release-arm-try
Change-Id: I9c0b3a23f5e28480e0bfbde55b9494f7b822dcfa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/203761
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>