Commit Graph

21307 Commits

Author SHA1 Message Date
Erik Ernst 3d48edf1d6 Corrected unintended syntax error in constant_type_literal_test
Change-Id: I186119c2897e2cbbabed20c57cfed8405be7be0a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/187082
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2021-02-25 10:42:36 +00:00
Stephen Adams 6100737245 [tests] Copy comment from corelib_2/unsigned_shift_test to corelib
Accidentally omitted from https://dart-review.googlesource.com/c/sdk/+/186920

TBR=alexmarkov@google.com

Change-Id: I39d3942f411bc9987f4e817bd05932b460ceca2a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/187162
Auto-Submit: Stephen Adams <sra@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2021-02-25 02:28:55 +00:00
Stephen Adams 6f18bce08d [dart2js] Fix unsigned_shift_test
Original test contains int literals that are illegal on web.

Change-Id: I87ba80ae273792dd5572e9890a339d4d3df34fb6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/186920
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2021-02-24 22:01:24 +00:00
Erik Ernst 96ae7b357e Add type alias cyclicity test, with new syntax, generic function types
Change-Id: I3cf5fa5aeaf914951ceea46062c824c9e25ecbd8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/186290
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2021-02-24 13:47:14 +00:00
Daco Harkes d45fd0f9d5 [vm/ffi] Support inline arrays in Structs
Adds support for single dimension inline arrays in structs. Multi-
dimensional arrays will be supported in a future CL.

This CL adds:
- CFE static error checks for inline arrays.
- CFE transformations for inline arrays.
- VM consumption of inline array fields for NativeType.
- Test generator support for inline arrays + generated tests.

Previous CLs added support for inline arrays in:
- analyzer https://dart-review.googlesource.com/c/sdk/+/183684
  - updated in this CL to new API.
- ABI calculation https://dart-review.googlesource.com/c/sdk/+/183682

Closes: https://github.com/dart-lang/sdk/issues/35763

Open issue: https://github.com/dart-lang/sdk/issues/45101

CFE transformations are tested with expectation files:
TEST=pkg/front_end/testcases/(.*)/ffi_struct_inline_array.dart

Trampolines and CArray API are tested with end-to-end Dart tests:
TEST=tests/ffi(_2)/(.*)by_value(.*)test.dart
TEST=tests/ffi(_2)/inline_array_test.dart

Compile-time errors (both CFE and analyzer) are tested in:
TEST=tests/ffi(_2)/vmspecific_static_checks_test.dart

Change-Id: I014c0e4153f1b885638adce80de6ab3cac8e6bb2
Cq-Include-Trybots: luci.dart.try:dart-sdk-linux-try,dart-sdk-mac-try,dart-sdk-win-try,vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-mac-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-kernel-linux-debug-x64-try,vm-kernel-nnbd-linux-debug-x64-try,vm-kernel-nnbd-linux-debug-ia32-try,vm-kernel-nnbd-mac-release-x64-try,vm-kernel-nnbd-win-debug-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-debug-simarm_x64-try,vm-kernel-precomp-nnbd-linux-debug-x64-try,vm-kernel-precomp-win-release-x64-try,vm-kernel-reload-linux-debug-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,vm-kernel-msan-linux-release-x64-try,vm-kernel-precomp-msan-linux-release-x64-try,vm-kernel-precomp-android-release-arm_x64-try,analyzer-analysis-server-linux-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183640
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Clement Skau <cskau@google.com>
2021-02-24 13:02:45 +00:00
Riley Porter b6fedb1fa9 Added skips for tests that use eval on csp configuration.
Change-Id: I4c9ed1927dfe32761245998f53eb532894087ca2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/186746
Auto-Submit: Riley Porter <rileyporter@google.com>
Commit-Queue: Riley Porter <rileyporter@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2021-02-24 06:03:07 +00:00
Regis Crelier ba611b720b [VM/runtime] Dereference top-level TypeRefs type arguments during finalization and hashing.
This fixes https://github.com/dart-lang/sdk/issues/45060

TEST= added regression tests

Change-Id: Ie6e3fd8514ee5b42af1ab5a5c72883c2510da31d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/186421
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2021-02-24 02:39:27 +00:00
Riley Porter 3c02a9f1b2 Refactored html/js_util_test.dart and added more js_util test coverage.
Split out async, jsify, and html tests. Also split JS$ prefix test and
skipped by design for ddc which doesn't support the prefix.

Change-Id: I85c673d791731bbae3ff4015a7e134d9180170de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185281
Commit-Queue: Riley Porter <rileyporter@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2021-02-24 00:58:47 +00:00
Alexander Markov 7f8001218b [vm] Support unsigned shift operator int.>>>
TEST=runtime/tests/vm/dart/unsigned_shift_right_test.dart and other
tests for >>>.

Issue https://github.com/dart-lang/sdk/issues/30892
Issue https://github.com/dart-lang/sdk/issues/44914

Change-Id: I7f0a9e1e486be06576c5d9bff3659b0aa6d68c23
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184921
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2021-02-24 00:14:57 +00:00
Erik Ernst 822d353256 Update non-function type alias tests
The non-function type alias feature will no longer be supported in
legacy code. This CL moves all the tests on this topic in language_2
to language/nonfunction_type_aliases/mixed. This CL also splits each
of the tests in a legacy part (with @dart and Requirements) and a part
with null safety (containing the non-function type alias declarations
and a bit of code that it depends on), such that we are testing that
non-function type aliases can be used in mixed-version programs, as
long as they are declared in an opted-in library.

Change-Id: Ie1ba3511c95f48d98f6ed7ed56e362895b9d3b19
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184460
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2021-02-23 16:28:20 +00:00
Sigmund Cherem 8d7d867154 [web] delete tests that are no longer valid
Change-Id: I6300287e63666b13a5ba083e30d9d2778d458d85
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184281
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2021-02-22 20:01:49 +00:00
Johnni Winther bfee879e19 [dart2js] Add tests for bug in dart2js type promotion
Dart2js type promotion wrongfully uses the type promotion result of
the last argument of an invocation as the result of the invocation
itself.

Change-Id: I188514fdac4edbea24dffbd858c0f8be6cd6ccf0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185781
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-02-22 08:56:18 +00:00
Sergey G. Grekhov 7c7569ff0e [co19] Skip ffi tests on web platforms
Change-Id: I1e756bc1b4cb4e102aabeeb622bb950d086b46cb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/186100
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2021-02-22 08:49:03 +00:00
Alexander Aprelev 86de80224d [vm/io/ssl] Add OtherResources to the https_connection_closed_during_handshake_test so it works on precomp bots.
Fixes https://github.com/dart-lang/sdk/issues/45056

Change-Id: I4e373693aa483007abbf14df419b2a3edad76282
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185901
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2021-02-20 00:15:05 +00:00
Alexander Aprelev c051bdb43a [vm/io/ssl] Update test so it forces exception when server disconnect during handshake.
This is follow-up to https://dart.googlesource.com/sdk/+/c1677553d1ef529ecdbc1caba877ae2ab5e35bd4.

Fixes https://github.com/dart-lang/sdk/issues/45049

Change-Id: I9d66ae003897131ecb911fd68a8b30496f90ec24
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185720
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2021-02-19 17:33:24 +00:00
Lasse R.H. Nielsen c589747744 First go at "generic function type as type argument" test.
Flag does not exist yet, so this is completely a thought experiment.

Change-Id: I739c15c92e0b5c3efd46eaea4b09a75f8d287245
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180844
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2021-02-19 16:12:56 +00:00
Daco Harkes c7ca192d6e [cfe/ffi] Fix Struct invalid field crashes
Closes: https://github.com/dart-lang/sdk/issues/44985
Closes: https://github.com/dart-lang/sdk/issues/44986

TEST=tests/ffi(_2)/regress_4498[56]_test.dart

Change-Id: Ia21e6e41de14ef61843ce9bff0608a9235f08936
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185860
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2021-02-19 15:50:44 +00:00
Alexander Aprelev c1677553d1 [build] Update boringssl to 1607f54fed72c6589d560254626909a64124f091
Bug: https://github.com/dart-lang/sdk/issues/41061
Change-Id: I6a02cd3ba42030bf88646e89664515c04234fdb4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185487
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2021-02-18 23:57:20 +00:00
Zach Anderson 1d1f68fd6d Revert "[vm/ffi] Remove deprecated Struct.addressOf getter"
This reverts commit 65fab2397b.

Reason for revert: These can't be remove until the next dev roll of Flutter. See https://github.com/flutter/flutter/issues/76129.

Original change's description:
> [vm/ffi] Remove deprecated `Struct.addressOf` getter
>
> This got deprecated in Dart 2.12 stable. Removing for the next release.
>
> Closes: https://github.com/dart-lang/sdk/issues/40667
>
> Change-Id: Ifdbcf76178be6fca8603d478d629b6b6655b7123
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184463
> Reviewed-by: Clement Skau <cskau@google.com>
> Commit-Queue: Daco Harkes <dacoharkes@google.com>

Change-Id: I94c22a206f3668ddb72d284afdc3b048d8b11aaa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185500
Commit-Queue: Zach Anderson <zra@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2021-02-17 21:47:42 +00:00
Daco Harkes 3593de9179 [vm/ffi] Change Pointer.elementAt and sizeOf to use static type
This CL changes the semantics of
`Pointer<T extends NativeType>.elementAt` and
`sizeOf<T extends NativeType>` to use the compile-time `T` rather than
the runtime `T`.

Issue: https://github.com/dart-lang/sdk/issues/38721

TEST=tests/ffi/data_test.dart
TEST=tests/ffi/sizeof_test.dart
TEST=tests/ffi/structs_test.dart
TEST=tests/ffi/vmspecific_static_checks_test.dart

Change-Id: Ifb25a4bd66d50a385d3db6dec9213b96dff21722
Cq-Include-Trybots: luci.dart.try:vm-precomp-ffi-qemu-linux-release-arm-try,analyzer-analysis-server-linux-try,analyzer-linux-release-try,analyzer-nnbd-linux-release-try,front-end-linux-release-x64-try,front-end-nnbd-linux-release-x64-try,benchmark-linux-try,dart-sdk-linux-try,pkg-linux-release-try,vm-ffi-android-release-arm-try,vm-ffi-android-release-arm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178200
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2021-02-17 11:39:42 +00:00
Johnni Winther 4f65d69e5e [cfe] Handle duplicate getables and conflicting setables
Change-Id: Iea3cb2d74799f891367c27e1d5a460aa6e7ef803
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183661
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2021-02-17 07:38:01 +00:00
Sam Rawlins ff6ddd2972 Analyzer: deduplicate errors when operator defined with bad parameters
If an operator declaration has both too many parameters, and one or more
optional parameters, just report the former error.

This is better UX, and is closer aligned to what the CFE reports.

Change-Id: I1f30ab9564f4bcdc49c1f3317add6c55cca29597
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185201
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-02-16 22:39:04 +00:00
Regis Crelier 4d5f027ccb [VM/runtime] Reland: Avoid comparing unfinalized type parameters.
This is done by simplifying the code looking for a type argument vector overlap between class and super class.

This is a reland of reverted https://dart-review.googlesource.com/c/sdk/+/184202
First patchset is the reverted CL.
A check for nullability was missing.

TEST=added regression test for the reland.

Change-Id: I77de3eded631d5223e9335ee9743b95878fe5bd7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185202
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2021-02-16 22:17:00 +00:00
Lasse R.H. Nielsen d352bc28b8 Remove (most) uses of the "non-nullable" experiment flag.
Since the flag is now enabled by default, there should be no mention of it.
There are still some uses in front_end/testcases that are not just removable
(it also uses `no-non-nullable`). There migth be more uses that are not
as easily found as grepping for `--enable-experiment

Removes two VM tests where fixing them meant they were just duplicating
the corresponding non *_2/ tests.
Fixes #44941

TEST= Large number of tests chaged.=(no-)?non-nullable`.

Change-Id: Ief755981ccde9a5482fcdf408c2929c74433a710
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183688
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2021-02-12 17:16:54 +00:00
Daco Harkes 34e3f571ac Reland "[vm/ffi] Disallow empty Structs"
Closes: https://github.com/dart-lang/sdk/issues/43974

TEST=tests/ffi/vmspecific_static_checks_test.dart

Change-Id: I35e6f5315826a751e5ce017a6a618c2c224c0f84
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180189
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2021-02-12 15:35:29 +00:00
Daco Harkes 65fab2397b [vm/ffi] Remove deprecated Struct.addressOf getter
This got deprecated in Dart 2.12 stable. Removing for the next release.

Closes: https://github.com/dart-lang/sdk/issues/40667

Change-Id: Ifdbcf76178be6fca8603d478d629b6b6655b7123
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184463
Reviewed-by: Clement Skau <cskau@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2021-02-12 09:16:02 +00:00
Daco Harkes f358afca9e [vm/ffi] Migrate package:ffi Utf8 and Utf16 uses
Change-Id: I41d79969881015266273a3ce566ee402df11791d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184481
Reviewed-by: Clement Skau <cskau@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2021-02-11 13:13:32 +00:00
Lasse R.H. Nielsen 9cbed61204 Fix type bug in dart:io HTTP client code.
This would have been caught if the static type had not
been made `Future<dynamic>`.

Fixes #44895

BUG= http://dartbug.com/44895
TEST= standalone/io/regress_44895

Change-Id: I237c552fdb42943b395352a7232b34ab5488ac6b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184261
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2021-02-10 18:00:11 +00:00
Daco Harkes a45276ab91 Reland "[vm/ffi] Roll package:ffi to Allocator and Opaque"
This can only be landed when `Allocator`, `Opaque`, and `AllocatorAlloc`
have rolled into Flutter/engine, that into Flutter/flutter, and into g3.

Deletes all the copies of `_CallocAllocator` and uses the one from
`package:ffi` instead.

Bug: https://github.com/dart-lang/sdk/issues/44622
Bug: https://github.com/dart-lang/sdk/issues/43974
Bug: https://github.com/dart-lang/sdk/issues/44621
Bug: https://github.com/dart-lang/sdk/issues/38721

Change-Id: I486034b379b5a63cad4aefd503ccd0f2ce5dd45e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180188
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2021-02-10 10:19:28 +00:00
Johnni Winther 504d63288e [cfe] Handle setter conflicts
Handle setter conflicts with non-setters and implicit setters.

Closes #44003
Closes #44844

Change-Id: I32c5e4022c187578e2cd37d13151c27451666dbc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183660
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-02-09 15:56:35 +00:00
Mayank Patke b615f08e58 [dart2js] Add failing tests for issue #41449.
Bug: https://github.com/dart-lang/sdk/issues/41449
Change-Id: I5526d3f6d15945bdf2ba0f790e1c803471b139c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183120
Reviewed-by: Stephen Adams <sra@google.com>
2021-02-08 23:23:34 +00:00
Stephen Adams 08f90cad84 [dart2js] Use 'num(ber)' wherever possible instead of 'double'
JSDouble represents doubles that are not integers. It is usually wrong
to use JSDouble, so use JSNumber instead where we mean 'all double
values'.

This fixes #44818 by not mistakenly pretending that division cannot
have an integral result.

Will follow up with a CL to rename JSDouble.

Fixed: 44818
Change-Id: Ic324df2ee1f2c7434bc0b064c0dbd7b6800ad93b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183360
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2021-02-08 22:06:54 +00:00
Paul Berry 680f5e6da5 Clean up error message nomenclature around metadata vs annotations.
Change-Id: I866900d2c4baca6ee000885f2126de2a97e643ad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182800
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-02-08 22:00:04 +00:00
Johnni Winther 6849d737a6 Reland: [dart2js] Refactor closure data to use AST nodes instead of locals
This CL avoids creating locals using KernelToLocalsMap when computing
closure data for the J-model. Instead the closure data uses
ir.VariableDeclaration, JTypeVariable, and internal locals (ThisLocal
and BoxLocal) internally, and the accessor function require passes
a KernelToLocalsMap to convert the internal model to a Locals upon use.
The converted Locals are cached internal for performance only.

This prepares for splitting the GlobalLocalsMap and KernelToLocalsMap
from the JClosedWorld.

Previously landed in https://dart-review.googlesource.com/c/sdk/+/180820
but reverted.

Change-Id: Ic6a2ab63de7cb31c89dd50ca2af3f205a792fd74
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183000
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2021-02-06 08:11:16 +00:00
Ben Konyi 848121e6d4 Reland "[ CLI ] Improved consistency of -D and --define across tools and commands"
- Added support for --define to the VM and dart2js
- Added support for -D and --define for `dart run` and `dart compile js`

Remaining improvements:
- Add support for providing multiple comma separated values for `dart
  run`, `dart`, and `dart2js`

Related issue: https://github.com/dart-lang/sdk/issues/44562

TEST=Updated CLI tests and added new dart2js tests.

This reverts commit e49937769f.

Change-Id: I5f9275b829665eb5e8695403d67f230e752ab0e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183180
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2021-02-05 23:53:28 +00:00
Paul Berry 3bf29dc8ff Test that generic metadata is unsupported inside function bodies.
Currently we don't support generic metadata, but we'll be adding
support soon (https://github.com/dart-lang/language/issues/1297).
When we add it, we'll still want to have tests to make sure that it's
not allowed in older language versions.

The tests we currently have to make sure it's not allowed only test
annotations occurring outside of function bodies, however the front
end code paths for handling code inside function bodies are
sufficiently different that it makes sense to test inside function
bodies too.

Bug: https://github.com/dart-lang/sdk/issues/44838
Change-Id: I846f2fc2e5ae090f21744ed6407b21a48a6d08ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182601
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2021-02-05 20:57:18 +00:00
Lasse R.H. Nielsen 222b894d62 Change resolve for package:URIs to not remove package name.
A "package URI" is defined as one with a `package` scheme,
no authority, a first path segment terminated by `/` which
contains no escapes and is not all `.` characters.
This is the definition of package names accepted by .packages
as well: Valid path characters and not all dots.

Change-Id: I9a161d47732e8bf873d278774315c72a4a928823
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117542
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2021-02-05 18:31:48 +00:00
Srujan Gaddam bea97da4a2 [pkg:js] Language version @Native/@JS class conflict check
Bug: https://github.com/dart-lang/sdk/issues/44797

This check was previously introduced without a language version,
and therefore lead to a breaking change on SDK update. It's now
versioned for releases >= 2.13, allowing users to migrate easier.
It also adds a hint for the error, providing alternatives for
users whose code triggers this check.

Change-Id: I4f61066a917ddb18071508291cde00710802fc5d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182920
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2021-02-05 00:23:42 +00:00
Sigmund Cherem 912005267d [web] rename suite dart2js -> web.
Change-Id: I46be49b2effec3e38a3dc44cd45cfe736f77fa78
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182680
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2021-02-04 23:11:32 +00:00
Clement Skau 2236883ff2 [SDK] Removes non-exiting tests from .status
TEST=Tested all configurations.

Change-Id: Iec00d7e6ea56221ffebcf044de22647907f598f1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182500
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Clement Skau <cskau@google.com>
2021-02-04 06:46:13 +00:00
Daco Harkes fb624c4209 Reland "[vm/ffi] Change Pointer<T extends Struct>.ref to use static type"
This CL changes the semantics of `Pointer<T extends Struct>.ref` to use
the compile-time `T` rather than the runtime `T`.

This enables tree shaking of subtypes of Struct and optimizing `.ref`.

Bug: https://github.com/dart-lang/sdk/issues/38721

TEST=tests/ffi/vmspecific_static_checks_test.dart
TEST=tests/ffi/*struct*test_.dart

Change-Id: Ie19bc3259d1cb721d0ce56d68e82d09dc3a4ad0e
Cq-Include-Trybots: luci.dart.try:analyzer-linux-release-try,analyzer-nnbd-linux-release-try,app-kernel-linux-debug-x64-try,dart-sdk-linux-try,front-end-nnbd-linux-release-x64-try,pkg-linux-debug-try,vm-kernel-linux-debug-x64-try,vm-kernel-nnbd-linux-debug-x64-try,vm-kernel-precomp-nnbd-linux-debug-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180190
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2021-02-03 10:55:49 +00:00
Daco Harkes ae4631e100 [vm/ffi] Fix test sizeOf struct on arm32
Bug introduced in https://dart-review.googlesource.com/c/sdk/+/182262.

See documentation on alignment in the following places:
- pkg/vm/lib/transformations/ffi.dart
- runtime/vm/compiler/ffi/abi.cc
- runtime/vm/compiler/ffi/native_type.cc

Closes: https://github.com/dart-lang/sdk/issues/44835

Change-Id: I114dd4286e559bb230e1ee27ae5cfd8a0b0d2927
Cq-Include-Trybots: luci.dart.try:vm-precomp-ffi-qemu-linux-release-arm-try,vm-ffi-android-debug-arm-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182501
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Clement Skau <cskau@google.com>
2021-02-03 10:21:08 +00:00
Riley Porter cfa35be6f0 [package:js] Added checks for external non-JS members.
Adds static errors in web backends requiring external members to be
annotated with @JS(). Members can be annotated directly, or on the
enclosing class or library.

Also removes duplicate checks in dart2js for non-native external
members that are now covered by the checks on external @JS members.

Change-Id: I2b17456f8f546f80f1ea6a817360c7f4c40f9640
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180442
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Riley Porter <rileyporter@google.com>
2021-02-03 02:14:18 +00:00
Martin Kustermann c3def74ffe [vm/io] Shrink buffers using realloc() if actual used data is small
Issue b/178993708

TEST=standalone{,_2}/io/large_file_read_small_file_test

Change-Id: I3c6f09f4f79f6dd1150db2918cefed3587e34012
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182268
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2021-02-02 20:04:22 +00:00
Daco Harkes 75c17483d3 [vm/ffi] Rewrite .ref calls in CFE
This rewrites `Pointer<Struct>.ref` and `Pointer<Struct>[]` calls in
the CFE to skip the runtime entry when the type argument is constant.

The runtime entry is still used when the type argument is generic.
Forcing the type argument to be constant and removing the runtime entry
will be done in follow up CLs.

Bug: https://github.com/dart-lang/sdk/issues/38721
Bug: https://github.com/dart-lang/sdk/issues/44621

Removing the runtime entry speeds up `.ref` significantly.
before: FfiStruct.FieldLoadStore(RunTime): 18868.140186915887 us.
after: FfiStruct.FieldLoadStore(RunTime): 270.5877976190476 us.
Measurements from Linux x64 in JIT mode.

Closes: https://github.com/dart-lang/sdk/issues/38648

TEST=tests/ffi/structs_test.dart

Change-Id: I82abd930b5a9c5c78a8999c2bc49802d67d37534
Cq-Include-Trybots: luci.dart.try:analyzer-linux-release-try,analyzer-nnbd-linux-release-try,app-kernel-linux-debug-x64-try,dart-sdk-linux-try,front-end-nnbd-linux-release-x64-try,pkg-linux-debug-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,vm-kernel-reload-linux-debug-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182265
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Clement Skau <cskau@google.com>
2021-02-02 16:33:54 +00:00
Daco Harkes 64bf73460f [vm/ffi] Rewrite sizeOf calls in CFE
This rewrites `sizeOf` calls in the CFE to skip the runtime entry when
the type argument is constant.

The runtime entry is still used when the type argument is generic.
Forcing the type argument to be constant and removing the runtime entry
will be done in follow up CLs.

Bug: https://github.com/dart-lang/sdk/issues/44621
Bug: https://github.com/dart-lang/sdk/issues/38721

TEST=tests/ffi/sizeof_test.dart

Change-Id: I17d14432e6ab22810729be6b5c2939a033d382c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182262
Reviewed-by: Clement Skau <cskau@google.com>
2021-02-02 16:33:54 +00:00
asiva 34f9734b41 Revert "[cfe] Handle conditional await in CFE"
This reverts commit 14032a6209.

Reason for revert : Several customer flutter tests are failing because
of the change in behavior.

TEST=revert of previous CL.

Change-Id: Ia235aa93b9c81fbab066803dc0625856f93acceb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/181860
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2021-02-01 23:41:01 +00:00
pq 2ecc9b76c8 initial sdk API fix data
Some simple SDK API changes codified in fix data w/ accompanying tests.

Tests are in `tests/lib/fix_data` and run on the pkg bots.

Sample run:

https://ci.chromium.org/ui/p/dart/builders/try/pkg-linux-release-try/46526/steps?succeeded=true&debug=false
https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket.appspot.com/8856735093298466576/+/steps/validate_SDK_API_data-driven_fixes/0/stdout


Change-Id: Id0959d6cde4003f114056c21b9969f2792f21a6f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180940
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2021-02-01 18:47:59 +00:00
Dmitry Stefantsov 425e4dbe09 [cfe] Sort type variables topologically before building the bounds
Closes #44455.
Closes #34803.
Closes #42434.

Bug: https://github.com/dart-lang/sdk/issues/44455
Bug: https://github.com/dart-lang/sdk/issues/34803
Bug: https://github.com/dart-lang/sdk/issues/42434
Change-Id: I3be93b0d4a251de79c3bfe9829143f0fbec201ab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/181402
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-02-01 18:46:29 +00:00
Lasse R.H. Nielsen 60e001acf8 Add tests for the user-definable >>> operator.
Change-Id: I485d8cae7499fd31a69f279c64c3f465241a474d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180843
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2021-01-29 12:49:46 +00:00