configurations
This test tries to AOT compile a sample test program and run it in a JIT
VM to ensure a useful error message is output. This test doesn't make
sense in non-JIT test environments and should be skipped.
Fixes https://github.com/dart-lang/sdk/issues/44227
Fixed: 44227
Change-Id: I17abbf8512944ac77bb9cad1c486ae77aac26c7a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172401
Reviewed-by: Régis Crelier <regis@google.com>
Use of PositionalCount() and PositionAt() as indices in the arguments
array must account for the type arguments if present. Otherwise, we'll
either skip checking the last positional argument (in the former case)
or check against the wrong arguments (in the latter case).
In nosuchmethod_forwarding_arguments_test.dart, add cases that check for
the above mistakes.
In require_named_args_strong_test.dart, use the more specific
throwsTypeError or throwsNoSuchMethod checks instead of the generic
throwsError to ensure the correct error is thrown.
TEST=Changed tests to add extra cases for failures that can happen.
Cq-Include-Trybots: luci.dart.try:vm-kernel-linux-debug-x64-try,vm-kernel-nnbd-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-nnbd-linux-debug-x64-try
Change-Id: If5e6c310d36d244bb0650ded54e32e583732584e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171947
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
Also fix another test that was missing // OtherResources= annotations
When reproducing the failures, one has to remember to `rm -rf out/Release/generated_*`
Closes https://github.com/dart-lang/sdk/issues/44204
Change-Id: If838a5fcdf56bcb094ba2ca211163c3b5007a3c3
Fixed: 24
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171943
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
In app-jit mode the Platform.script is in a different place. The test
needs files next to it in order to run.
Change-Id: Icc05287c6cba37fcdc9f8cd54edefb3657a0084c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171887
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Adds some basic tests to check for runtime subtyping with JS
interop types. Uses function types only to check for subtyping
relationships. Extends some tests on is and as checks as well.
Change-Id: I9cbc91d0c475fba3213dd9a3443921232c286804
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170660
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
All code which was tested now throws a TypeError in both
sound and unsound null safe mode.
Change-Id: I304dfa6b8683223562f8613f3d14823fccab35bd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170439
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Change-Id: I4ecec92d5d0d51e050e2d3a189eede439e5b8de3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171520
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Simple calls to `List.generate` are expanded into a list allocation
and a loop. This generates better code for several reasons:
- There is no overhead for the function argument (closure allocation,
closure type, closure class)
- Global type inference is more precise since each List.generate list
is tracked separately, and the assignments in the loop give better
inference to the collection's element type.
To get precise element type inference, there are two new JSArray
constructors. Global type inference starts with the element type being
bottom for these elements, avoiding spurious nulls in the inferred
type.
Change-Id: I5efb90651ae3f9eb2e81af556704960cdf0b75c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168770
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
If the bound is not specified, CFE will use Object* in an opted-out library or Object? in an opted-in library, and not dynamic as before.
This workaround is therefore not needed anymore, and actually harmful as shown in the regression tests.
Closes https://github.com/dart-lang/sdk/issues/44136
Add regression tests.
Change-Id: I11a96cbebcb592f66f3965e38cb2411200df332b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171380
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
In error reporting on assignability where the expression has type
`Null` we use a special messages that doesn't state that
"'Null' is nullable". Cases where `Null` is part of the type or where
the expression of type `Null` is derived from a collection are not
special cased.
Closes#43998Closes#44093
Change-Id: Ic0c79e6362f2365eb3fe8222ccd2ef8fac4f188d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170433
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
A smoke test to exercise alignment of structs with various field types
to see how they are aligned on the stack. Only contains small structs
because most ABIs only pass structs less than 16 bytes on the stack.
Especially tests iOS64, where `AlignOf(struct{float32;float32;}) == 4`
but `AlignOf(struct{int32;int32;}) == 8` due to the special treatment
of homogenous floats in the arm64 ABI combined with iOS decision to not
align everything on the stack to at least word size.
Test tested on iOS64 through Flutter.
structs_by_value_tests_configuration.dart is the only non-generated
file.
The tests are tested in the dependent CL. Tests are ignored in status
file and are un-ignored in dependent CL.
Tests for https://github.com/dart-lang/sdk/issues/36730.
Change-Id: I6ec4523208db740b8ea3f8a4ab1e5717f1088467
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170691
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Change-Id: I64074eb4b49e514f3b7454de0fb244f21ef336a6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170580
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
Splitting out a failing test to increase coverage of other tests.
It is not clear that `a.addAll(a)` should throw if `a` is empty.
`a` is not modified by the action.
dart2js/DDC do not detect this case and I'm reluctant to add a check
for the case where `a` is in fact not modified.
The VM test is very specific to an identical argument and cannot
detect the case for `a = Mylist([])`.
Another option to this proposal is to simply delete the `[]` case.
In general, I'd like to move more ConcurrentModificationError tests
into assert statements.
Change-Id: I1f9559bdb43ea1bae0575413748c9d9d0de58b99
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170023
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
1. lib_2/isolate/issue_6610_test - the source is served from a http request, the autodetect code causes the code to be served multiple times leading to 'count' being incremented multiple times.
2. standalone_2/http_launch_test - source is served from http request and hence the CFE auto opt out does not work for the spawned isolate
3. standalone_2/io/named_pipe_script_test - serves the source using a named pipe and the autodetect code does multiple fetches of the source resulting in an error
4. standalone_2/io/test_extension_test - spawns processes from a directory that is not auto opted out by CFE
TESTS = Fixes existing legacy tests.
Change-Id: I3c78055136659850ce068d6ab254279839d2414b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170280
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
TESTS = existing tests are being fixed here
Change-Id: I9136017d29c11f73dd97c82364dc5ead8e2ae7d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169407
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
VM was not performing auto-detection of sound null safety mode
if --enable-experiment=non-nullable was not specified on the command
line. This change flips that logic to perform auto-detection unless
--enable-experiment=no-non-nullable is specified.
TEST=Added regression test runtime/tests/vm/dart/regress_44026_test.dart.
Fixes https://github.com/dart-lang/sdk/issues/44026
Fixes https://github.com/dart-lang/sdk/issues/44043
Change-Id: Ide8935e90dd3a8bd5a417aeb758605dedbb853eb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170201
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Changes Dart_NewWeakPersistentHandle to no longer auto delete the
weak persistent handle.
Changes the signatures of WeakPersistentHandleFinalizers to no longer
have access to the handle.
Flutter PR: https://github.com/flutter/engine/pull/19843
g3 presubmit: cl/318028238
Issue: https://github.com/dart-lang/sdk/issues/42312
TEST=runtime/vm/dart_api_impl_test.cc
Change-Id: I3f77db9954d9486759f903b78c03a494f73c68ba
Cq-Include-Trybots:dart/try:vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,app-kernel-linux-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-msan-linux-release-x64-try,vm-kernel-precomp-msan-linux-release-x64-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,dart-sdk-linux-try,analyzer-analysis-server-linux-try,analyzer-linux-release-try,front-end-linux-release-x64-try,vm-kernel-precomp-win-release-x64-try,vm-kernel-mac-debug-x64-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-kernel-nnbd-linux-debug-x64-try,analyzer-nnbd-linux-release-try,front-end-nnbd-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151525
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
The Dart exception is converted to a string, stored in a trap which
is passed through wasm, then converted back to a Dart exception.
Module instantiation can also throw a trap, because it internally
invokes the initialization function, if the module defines one. So I'm
handling this too.
Also, update to the new version of the wasm C API, which replaces some
foo_t** with foo_vec_t*.
Bug: https://github.com/dart-lang/sdk/issues/37882
Change-Id: I1e6952a191134734a892c42b2fb8ba3506bb0844
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169784
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
This CL:
- Fixes https://github.com/dart-lang/sdk/issues/43987 (an exception in custom formatting code)
- Restores (most of) debugger_test.dart to passing (which tests above)
- Fixes a type caching error also exposed by the above test
Note, this skips the golden file comparison. That appears to be very broken
(see comment).
Change-Id: I283b66a710f17765faed47aa099b0b8570e6cac1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170022
Reviewed-by: Gary Roumanis <grouma@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
This reserved space can only be allocated from after an allocation has failed from OutOfMemory, and once some portion of this space is used, refilling it is the first allocation performed after GC.
Also avoid greatly slowing down from ineffective scavenges as the memory limit is reached.
Bug: https://github.com/dart-lang/sdk/issues/43543
Bug: https://github.com/dart-lang/sdk/issues/43642
Bug: b/169880355
Change-Id: Ic7132cb34d7a7d13c67661f057f00dd74306251c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165862
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
+ fix test to expect erasure of `S & int` to `S` also when bound is `dynamic`.
Closes#43591
Change-Id: I44cb4c726648d4065bdf89bb2dbf71b2753c6c84
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169340
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
The dart2js_2 version still exists.
Prior to null safety, it was legal to assign `null` to a `bool`, so
things like boolean operators and control flow constructs required
null checks on their inputs. `--omit-implicit-checks` removed these null
checks, so we had to specify what the behavior would be in these cases.
(In general, `null` was just treated as a falsey value, since that's
what happens in JS.)
With null safety, it is no longer legal to assign `null` to a
(non-nullable) `bool`, so the backend freely optimizes boolean
expressions under this assumption. It's possible to smuggle `null` in
via a cast to `dynamic` and an implicit downcast to `bool`. The downcast
ordinarily fails at runtime but can be removed with
`--omit-implicit-checks`. We do not want to specify the behavior in this
case. We do not guarantee the behavior under `--omit-implicit-checks` of
code which would have failed with checks enabled.
Maintaining the old behavior would likely require us to be pessimistic
about nullability and miss optimization opportunities.
Fixes: https://github.com/dart-lang/sdk/issues/43471
Change-Id: I7e8e7c66f777ef631ef4054a8dfe211e3e2bef55
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169820
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
Tweaks.
Change-Id: I0fb8b4088c86e5b83f1c76db8a2dfa7c9023c1b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99000
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Bug: https://github.com/dart-lang/sdk/issues/42536
Bug: https://github.com/dart-lang/sdk/issues/42535
Since ddc would require a potentially breaking change to emit these
checks in unsound mode without opt-in and it's currently not possible
to emit these checks only in opt-in with dart2js, both are changed
to only emit checks in sound mode. In ddc, calling convention is
changed conditionally on sound mode as well to avoid emitting
unnecessary code in unsound mode.
Change-Id: I42f7bb5a53550f4ee5412fbbbfb6ca533c393e96
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169247
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
It now includes /ffi_test_functions_generated.cc and prints
instructions on how to use the generated bundle.
This CL adds some TODOs and deletes the non-migrated copy that was in
the NNBD folder.
Finally, this CL disable a check that fails because of static linking
on iOS.
Issue https://github.com/dart-lang/sdk/issues/39570.
Change-Id: Ie85d92568bb95eaafd2991725a1a31cdecd246be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169402
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Bug: https://github.com/dart-lang/sdk/issues/37896
dart2js disallows JS interop classes from extending Dart classes,
and ddc does not work as expected. Dart classes that extends JS
interop classes can't be declared in ddc and throw an error on
usage in dart2js. This CL adds static errors for both cases.
Change-Id: I72001d2e8bec046c0e1ab4c06fed8fcf84ade259
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/164840
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
This adds a mechanism similar to that used in async functions where
exceptions are caught in the synthetic code and passed into the
generated body to be rethrow'n.
This ensures the exception is throw'n from the same place as the
original yield*, as per the spec.
Bug: https://github.com/dart-lang/sdk/issues/42466
Change-Id: I054b9db568a49b046b6bb49f3e775bf093f83950
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160221
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
The 3 and 7 byte tests in
https://dart-review.googlesource.com/c/sdk/+/168829
had their sizes rounded up to the next power of two due to alignment of
fields inside the structs.
In order to properly exercise behavior on win32, win64 and iOS, this CL
changes those structs to only have uint8 fields to prevent alignment
influencing the sizes.
Old tests are renamed to exercise the size rounding due to alignment.
This also swaps around the two 9byte structs to have consistent naming
with the new 3 and 7-byte tests.
structs_by_value_tests_confguration.dart is the only non-generated file.
The tests are tested in the dependent CL. Tests are ignored in status
file and are un-ignored in dependent CL.
Tests for https://github.com/dart-lang/sdk/issues/36730.
Change-Id: If47cfcaebe56f43d50265f0d6e2749c56fe7b195
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169101
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Split off from https://dart-review.googlesource.com/c/sdk/+/140290/33
to make that CL smaller and review the test generator separately.
Because of the amount of corner cases in the calling conventions that
need to be covered, the tests are generated, rather than hand-written.
The tests are tested in the dependent CL. Tests are ignored in status
file and are un-ignored in dependent CL.
Change-Id: I5507f52229793fdf07da3066b49045fdb703a69d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168829
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Allows build systems to turn off native null assertions if the
default value ever changes.
Change-Id: I7265b2328e4e8834d8bbe19159fcac7ea916b451
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168763
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Modifies ddc and dart2js logic to only include null-checks on native
members inside the web libraries. Modifies tests to account for this
change.
Change-Id: If9c164fb90b761d3c4611d87ffeb02c2fa884457
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168585
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
These tests involve large list literals which are very slow to
compile in AOT/debug mode, or they perform a large amount of work
which is too slow on simulated architectures (simarm, simarm64).
Closes https://github.com/dart-lang/sdk/issues/43614
Change-Id: Iafe1407247cc69e641d1e63f47b4c3d9f6eea35f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168782
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Enabling WASI when building an instance sets up the default WASI
imports, and can optionally capture stdout/stderr. I'd like to set up
something similar for stdin, but Wasmer doesn't support that yet.
I also improved error handling in WasmRuntime by adding Wasmer's last
error to the thrown exceptions where appropriate.
Bug: https://github.com/dart-lang/sdk/issues/37882
Change-Id: I2d8546e878bcb43c7093490eac085aa62d318e96
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/167904
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
Const version of regression test for #43756
Change-Id: Ie21be7985e420290cf1c286fd299d5e8962f757e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168483
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Adding static methods/getters/setters to class/mixin/extension,
instance getters/setters/operators to mixin/extension, new-syntax
type alias.
Change-Id: I4e3f168d8db9c5f168b138c847bccf948c05c567
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168080
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
Change-Id: I4375c3374ba5d51b4431dbe22a0e8c867a4eb03d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/167720
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>