The reverts the change to flatted nested conditional expressions since
audience reaction to that was pretty negative.
See: https://github.com/dart-lang/dart_style/pull/1019
Change-Id: Ie9e4460f75c5b7e99e5a6d60e9c38b50ba0bc44a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194883
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
When the two types have the same name but are from different libraries
showing the library URI will help users understand the failure better.
Change-Id: I5ab4412e676272111d41f688ef2d1cc83afbe627
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194116
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Adds a way to express native effects in Dart expressions in kernel.
This CL adds a `void _nativeEffect(Object)` to `dart:internal`.
The semantics of `_nativeEffect` are to not execute its arguments and
return `null`.
This CL uses this `_nativeEffect` to make sure that we never execute
the struct constructor invocations used to simulate the native behavior
of FFI trampolines.
Closes: https://github.com/dart-lang/sdk/issues/45607
TEST=tests/ffi(_2)/native_effect_test.dart
Change-Id: Ie06de145e49f8b1cae9e148c2d5d97d5cd8e6878
Cq-Include-Trybots: luci.dart.try:vm-precomp-ffi-qemu-linux-release-arm-try,vm-ffi-android-debug-arm64-try,vm-kernel-precomp-asan-linux-release-x64-try,vm-kernel-precomp-dwarf-linux-product-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,analyzer-analysis-server-linux-try,analyzer-linux-release-try,dart-sdk-linux-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-reload-linux-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194421
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
In AppJIT mode we run from a snapshot and won't have an incremental
compiler available. That also means expression evaluation is not
supported.
The specific test that was failing was
service_2/evaluate_activation_in_method_class_test/service
though this CL skips all evaluation tests.
The CL also align the service and service_2 status files more.
TEST=Only updates status file to skips tests.
Change-Id: I8dbb3aeeb686370d898c59da3729f5e0c52df411
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194685
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
This is a reland of 553bfea531
Original change's description:
> Mark AstTestFactory as internal.
>
> I want to continue disallowing users to create AST nodes.
>
> Change-Id: I6597fcf4fbb767cde35320e3b8777873faf5c5bd
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194600
> Reviewed-by: Samuel Rawlins <srawlins@google.com>
> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Change-Id: I097fc5f665880666829eeb982f7fa3b450bb203e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194681
Reviewed-by: Ivan Inozemtsev <iinozemtsev@google.com>
Commit-Queue: Ivan Inozemtsev <iinozemtsev@google.com>
Change-Id: Icdc53787210a953c94ef9cd6fec69fe79b06c22e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194401
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Karl Klose <karlklose@google.com>
Now that we store the body of a try statement as a separate Statement
object, we can use it directly; it's not necessary to create a
synthetic node for it. This is more similar to what the analyzer and
CFE do.
Change-Id: I7c9a62aa917e966f0dd176f90b72865a38addd65
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194545
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
This makes the flow analysis tests more similar to the anaylzer and
CFE implementations, which look up the type of a `this.` property get
at the time it is analyzed, rather than storing it in the AST node.
Change-Id: Idee2a9c3ba0acbd2752db511c1aabfdff075b363
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194544
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
I want to continue disallowing users to create AST nodes.
Change-Id: I6597fcf4fbb767cde35320e3b8777873faf5c5bd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194600
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Two changes:
- Eliminate the `_Visitable` class, which was no longer used.
- Stop passing flow analysis as an argument to the _visit methods;
instead access it through the Harness class. This paves the way for
future changes that will generalize this code for testing things
other than flow analysis.
Change-Id: I94e9208e9eec6f16c03160efa1f676e57d47a59f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194541
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
There's no harm in making the TypeOperations object available to
clients, and it will make it easier in the future to create other
shared analysis based on flow analysis.
Change-Id: Id6b603ab2a7baa64d423c87bf031ff6a12874840
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194501
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
One file used 'pkg_path' which really threw me; I'd never seen it before. Two
more used 'pathos'. All other files in the package use 'as path', except a few
spots which do not use a prefix.
Change-Id: I94577c1783162c52c7f8dc3c6bf02e9a0b9159df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194500
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
This is a reland of d0f55d0e42
Original change's description:
> [dart2js] Add support for bundling fragments.
>
> Also changes the default to bundling rather than interleaving fragments.
>
> Change-Id: Id79d03a8a8b5be7465b8535f6c9c47dfad120c9c
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191484
> Commit-Queue: Joshua Litt <joshualitt@google.com>
> Reviewed-by: Stephen Adams <sra@google.com>
> Reviewed-by: Sigmund Cherem <sigmund@google.com>
Change-Id: I0347ddb6dd93eb57f0abc259fc477ec3a9d7231b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194323
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
This Splits the NativeCompoundType into NativeStructType and
NativeUnionType.
The calling conventions themselves did not have to be updated at all,
they rely on the 'queries' on NativeTypes.
Some interesting corner cases in the native calling conventions are:
1. Arm64 and arm hardfp still regard unions as homogeneous floats, even
if the union members are different sizes.
2. Unions can be larger than their members if their largest member has
a smaller alignment than a smaller member.
3. When a specific range in a struct contains floating points in one
member, but integers in another, the integers take precedence.
Bug: https://github.com/dart-lang/sdk/issues/38491
tools/build.py run_ffi_unit_tests && tools/test.py ffi_unit
TEST=runtime/vm/compiler/ffi/native_calling_convention_test.cc
TEST=runtime/vm/compiler/ffi/native_type_test.cc
These tests are exercised on vm-precomp-ffi-qemu-linux-release-arm-try.
Change-Id: Ib97769457d1ad0fce47601e9e4a3008bd837167f
Cq-Include-Trybots: luci.dart.try:vm-precomp-ffi-qemu-linux-release-arm-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194422
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
The DateTime conversion to local time amounts to solving an
equation, finding an offset where the current local time is that offset.
The current approach doesn't actually do that, it just tries to simulate
the JS approach, with a tweak to avoid DST change issues, but that tweak
assumes that all time zone adjustments are one hour changes.
This CL should work correctly for time zone changes of up to one hour,
but might still fail for changes of more than one hour.
It works by trying more offsets, which obviously has a performance cost,
which depends on how efficient the operation system is at providing
the local time zone for a specific milliseconds-since-epoch.
Change-Id: I80dc6e62e0639d9966d3c5a06430787d8acc4ff1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182041
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
I decided against landing https://dart-review.googlesource.com/c/sdk/+/194321
It gets too bulky.
So, we will migrate producers, and only then tests, and will know
our null safety mistakes.
Change-Id: I7b358549fc33c9d9a02aef80f30a676c7875f85a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194326
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
I'm not sure if the output truncation was ever practically useful. But
it causes problems now that we have a CFE test that wants to validate
that the CFE can produce many errors in one go.
I thought about allowing a test to extend the truncation size, but I
figured the simplest fix was to just not truncate at all and make the
test runner a little simpler. Also did a little clean up on this
ancient code while I was at it.
Fix#44493.
Change-Id: Ie678c80e7114e0fb7f68931335075e3d319fb53a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178940
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: William Hesse <whesse@google.com>
This change removes code duplication between
LoadIndexedInstr::representation() and
StoreIndexedInstr::RequiredInputRepresentation(), multiplied by 4
target architectures.
This change also removes duplicated logic from FFI load and store
intrinsics.
TEST=ci
Change-Id: I9f10cc8c70288ecaea33a337a880c181ecbfcd6a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194281
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>