Commit graph

21529 commits

Author SHA1 Message Date
Jens Johansen 4a49580e7e [parser] Consume (and use) identifier looking like start of next top level declaration as class name
Fixes https://github.com/dart-lang/sdk/issues/46346

Change-Id: Ie688d0838b612c2eda157bbf9e2fa799bae96fb1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/203762
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-06-18 10:20:32 +00:00
Alexander Aprelev dab206dec8 [vm/tests] Fix names of regressions tests, delete no-longer-valid test
Deleted tests that are mixing classes without extending Object.

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

Change-Id: I9114e5bd9927a6a343ac72103a104227d59eba3f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/200932
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2021-06-17 20:56:11 +00:00
Stephen Adams 1c3ea7878e [dart2js] Do not do null assertions on operator==
`operator==` is special.

In the specification, `operator==` methods cannot be called with `null`,
so do not _need_ a null-check for `--null-assertions`.

However, in the dart2js implementation, `operator==` methods are
augmented to handle a `null` argument rather than check the argument
for `null` at every call site. So it is necessary to be _ensure_ there
is no code added for the `--null-assertions` check.



Change-Id: I859b99d680f6d0fad698e1b59eafa1ba0b1749b2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/203842
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2021-06-17 16:47:41 +00:00
Ryan Macnak d2e460675b [vm] Fix gcc build.
TEST=local build
Change-Id: I572aba5798a07ce5cb0cbda83d6eb3e44811ba5b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/203287
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2021-06-17 16:05:02 +00:00
Joshua Litt 343682c4ac Fix web/native/native_exceptions1_frog_test.
An earlier cl fixed the test in web_2, this is just backporting that
fix.

earlier cl:
https://dart-review.googlesource.com/c/sdk/+/200020

Change-Id: Id34bfbc77b5d7774f0e464170c65fd84fa5e9d17
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/203827
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2021-06-16 22:00:27 +00:00
Alexander Aprelev b791ee1b9e [gardening] Skip socket_sigpipe_test on jitk, simarm.
The test uses ffi and it spawns helper process, therefore it's not compatible with those bots.

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

TEST=ci

Change-Id: I680609c17c91133e7208bc2dc7ffe7c847f4987d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/203830
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2021-06-16 21:56:57 +00:00
Regis Crelier bae9560c8a [VM/runtime] Insert TypeRef when type parameter bound refers to type parameters.
Fixes https://github.com/dart-lang/sdk/issues/46276

TEST=added regression test

Change-Id: Iecdccd4af02c374d4d17d0c0d7985fdaeec5e42a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/202820
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2021-06-16 18:25:37 +00:00
Alexander Aprelev fb32ffd97f [io/mac/sigpipe] Ensure SIGPIPE is not triggered for client socket connect code.
Fixes https://github.com/flutter/flutter/issues/84499

TEST=socket_sigpipe_test.dart

Change-Id: I220558e74b41c1969efa422254867c11dd17ee91
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/203660
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2021-06-16 17:38:37 +00:00
Nicholas Shahan c83eeac5b8 [ddc] Avoid sending messages to console.debug
Calling `postEvent()` or `registerExtension()` from the
dart:developer library now sends messages via global functions
that can be set by the development infrastructure. For example,
these hooks are set by package:dwds.

When there is no debugger attached to the app, calling `postEvent()`
or `registerExtension()` will produce a warning once each to avoid
spamming the debug log with messages that do nothing.

For backwards compatibility, when a debugger is attached but the
hooks have not defined continue to write the events to the
console.debug log. This support will be removed when package:dwds
no longer reads from the log.
https://github.com/dart-lang/webdev/issues/1342

Change-Id: I126446666b5a85c68424546b8b1198d1582bba74
Issue: https://github.com/flutter/flutter/issues/75225
Fixes: https://github.com/dart-lang/sdk/issues/36143
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/202540
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Gary Roumanis <grouma@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2021-06-15 23:28:03 +00:00
Daco Harkes fed3cef63a [vm/tests] const maps are immutable
Bug: https://github.com/dart-lang/sdk/issues/45908

Change-Id: I15011ab63fb119a601ba5f147481f9e9aefafdd7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/203683
Reviewed-by: Clement Skau <cskau@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2021-06-15 14:08:52 +00:00
Gabriel Castro 820ba59dda [html] Fix nested JS Map to Dart assignment
Added check to convertNativeToDart_Dictionary to recursively convert native objects within a map to their Dart equivalent.

Fixes: https://github.com/dart-lang/sdk/issues/44319
Change-Id: I80a2bc0541454900b1c7d9635debaf72d7c120f2
Bug: 44319
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201200
Commit-Queue: Gabriel Castro <gabrielmcastro@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2021-06-14 21:18:08 +00:00
Konstantin Shcheglov ee6a8a4743 Stop using ConstantAstCloner.
With storing initializers and default values in summaries,
including offsets, we don't need cloning them to store into elements.

Presubmit in google3 looks green.
https://test.corp.google.com/ui#id=OCL:376954598:BASE:379074195:1623530623317:a06607e1

Change-Id: I6e403302d047eb3ce38822f5ac09f1a99decf667
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201986
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2021-06-13 17:33:42 +00:00
Lasse R.H. Nielsen b3ae822e5a Create tests for constructor tear-offs and related syntax changes.
Change-Id: I2e76322f57a331704a657b7cc471a61fd3227c94
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/197168
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2021-06-11 12:28:06 +00:00
Daco Harkes ddafaa0775 [vm/ffi] Update tests to cover MacOS arm64 after-struct alignment
Expands the test PassStruct9BytesPackedMixedx10DoubleInt32 to see how
the second integer is allocated.
Updates runtime/vm/compiler/ffi/unit_tests/structPacked to have the same
signature.

Fixes the structs by value test generator to output // @dart 2.9 for
legacy mode.
Deletes the copy of the test generator from tests/ffi, the copy did not
run in legacy mode.

TEST=only test changes

Change-Id: I65b7db56225a8e7963493dbccc2f296faca6fee1
Cq-Include-Trybots: luci.dart.try:vm-kernel-mac-release-arm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/202968
Reviewed-by: Tess Strickland <sstrickl@google.com>
2021-06-11 12:00:26 +00:00
Nicholas Shahan 0733c1f6b1 [ddc] Add unspecified nullability regression test
Change-Id: If82ef47aac1d67c5f6db636522ed0ef7de180f8d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/203121
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2021-06-10 20:18:53 +00:00
Alexander Aprelev bd4a6291e5 [io/stacktraces] Fix socket_connect_stacktrace_test exception expectations.
This is follow-up to 52aa8508f1.

TEST=socket_connect_stacktrace_test

Change-Id: I46eafa4852bed92eaf1a9035bcb3b007d700fc0e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/203280
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2021-06-10 18:27:40 +00:00
Alexander Aprelev 52aa8508f1 [io/stacktraces] Ensure websocket connect reports callers stacktrace.
Introduce dwarf-friendly socket connect stacktrace test.

TEST=socket_connect_dwarf_stacktrace_test

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

Change-Id: I428ac4b334d9d80ea06c64283ece3ff411abfa19
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/203160
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2021-06-10 16:16:50 +00:00
Alexander Aprelev c8ffded3ad [vm/regexp] Ensure recently added reg_exp_receive_port_test runs on dartkp.
This is follow-up to db17c490f8 where test was marked as skipped on dart_precompiled runtime.

Normalized corelib.status file so that presubmit reports relevant feedback with changes to it.

TEST=reg_exp_receive_port_test

Change-Id: Ib67d4c139040f27d1bd0b2b65ceb07269bacadd9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/202981
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2021-06-09 17:06:51 +00:00
Sergey G. Grekhov a6342dcfcb [co19] co19_2 status file updated
Change-Id: Ic246235bdffbd3dc7332352680e2a9ebcde205c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/202774
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2021-06-09 14:17:11 +00:00
Tess Strickland 7d44c20f2c [tests] Fixes for standalone{,_2}/check_for_aot_snapshot_jit_test.
* Skip on IA32, since it has no AOT mode.

* Use .bat/.exe suffixes on Windows.

* Look for gen_snapshot in <buildDir>/clang_x64 on MacOS ARM64.

* Avoid using Platform.script to find .dart source file locations, since
  some architectures generate a .dill for running JIT programs, which
  will be in the generated files directory, not the SDK directory.

* Try both 'dart <aotsnapshot>' and 'dart run <aotsnapshot>', which
  should both give the correct error message.

Cq-Include-Trybots: luci.dart.try:vm-kernel-nnbd-linux-release-x64-try,vm-kernel-nnbd-linux-release-ia32-try,vm-kernel-nnbd-linux-release-simarm-try,vm-kernel-nnbd-linux-release-simarm64-try,vm-kernel-linux-release-x64-try,vm-kernel-linux-release-ia32-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try,vm-kernel-win-release-ia32-try,vm-kernel-win-release-x64-try,vm-kernel-nnbd-win-release-x64-try,vm-kernel-nnbd-win-release-ia32-try,vm-kernel-mac-release-arm64-try,vm-kernel-mac-release-x64-try,vm-kernel-nnbd-mac-release-x64-try
Change-Id: Ic50b86fb51b5f2b30c6a4cb4fd8f0594bb1cf93d
Bug: https://github.com/dart-lang/sdk/issues/46306
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/202923
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Clement Skau <cskau@google.com>
2021-06-09 12:22:41 +00:00
Alexander Aprelev db17c490f8 [vm/regexp] Ensure regex sent in a message can be used by the receiver.
Fixes https://github.com/dart-lang/sdk/issues/46294

TEST=reg_exp_receive_port_test.dart

Change-Id: Ic9ecde42224d44035ecb60347e11aae0bd92cd09
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/202861
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2021-06-09 02:50:50 +00:00
Alexander Aprelev 80749188ca [io/socket] When socket connection fails report stacktrace of the callsite.
Currently stack trace reported on thrown exceptions is null.

TEST=socket_connect_stacktrace_test.dart

Bug: https://github.com/dart-lang/sdk/issues/44994
Change-Id: I188aff197ab519272f63f41387b94458c2f1cec7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/202802
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2021-06-08 16:17:47 +00:00
Riley Porter 30b3552ee3 Use static DartType for js_util optimizations.
Change-Id: I294af3925f15a438f8ad76b538de4ca3a227749e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/202440
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Riley Porter <rileyporter@google.com>
2021-06-07 17:27:42 +00:00
Lasse Reichstein Holst Nielsen 1154efb073 Fix null-safety migration bug in VM version of fuse JSON-UTF-8 decoder.
A JSON value can be `null`, so the return type must be `Object?`, not `Object`.

Fixes #46205.

Bug: http://dartbug.com/462051
Change-Id: I9a5522e09765457dcf8cd2639abbe385d97a3186
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/202623
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2021-06-07 11:43:02 +00:00
Joshua Litt 2ad8d3d23e [dart2js] Add test for empty holders in an output unit.
Change-Id: I364366c2a5e9ce5895dbc4096d17ad04374b69d6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/202310
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2021-06-04 17:55:17 +00:00
Martin Kustermann 706965fd2c [gardening] Fix string_overflow_test.dart
The test was originally introduced in [0]. This restores its state to
how it was written back then with some small adjustements.

[0] d8ef2ae7 https://codereview.chromium.org//16783003

TEST=standalone{,_2}/string_overflow_test

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

Change-Id: I255f676481f2ab6e906ebfe4612d394c29663dd0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/202482
Reviewed-by: Clement Skau <cskau@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2021-06-04 14:38:16 +00:00
Alexander Aprelev 05e5427800 [io/mac] Ensure FSEventsWatcher::Node is deleted synchronously with Callback that uses it.
This is follow-up to ed82bb6f4c

TEST=tests/standalone/io/file_system_watcher_large_set_test.dart

Change-Id: If02c922eafe1371c6e67196158896b9cb786bfd6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/202312
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2021-06-04 14:26:36 +00:00
Ryan Macnak bc3aa70e20 [vm, compiler] Fix size of sign-extension in x64c BigInt intrinsics.
TEST=ci
Change-Id: I99aa9875705823c22b5474bb1d66c7bc1aaac9fb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/202309
Reviewed-by: Liam Appelbe <liama@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2021-06-03 22:47:56 +00:00
Konstantin Shcheglov 4cc88389fd Issue 45672. Report constant errors when null value where non-nullable type is expected.
When in a legacy library, runtimeTypeMatch() with the legacy type.

Original: https://dart-review.googlesource.com/c/sdk/+/196042
Reverted as: https://dart-review.googlesource.com/c/sdk/+/196281

Presubmit looks green:
https://test.corp.google.com/ui#id=OCL:369597863:BASE:377223944:1622729657782:14c50e7

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

Change-Id: Ife02dbdc4c111dec22536de4c50c349381ba1b3f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/197109
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-06-03 16:58:57 +00:00
Alexander Aprelev 6c254fab89 [io/http] Don't add zero-valued content-length header on GET, HEAD, DELETE, CONNECT requests.
Per https://tools.ietf.org/html/rfc7230#section-3.3.2:
"... A user agent SHOULD NOT send a
Content-Length header field when the request message does not contain
a payload body and the method semantics do not anticipate such a
body."

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

Change-Id: I96b735c06038eb3d12a303ee5329228a9b594726
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194881
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2021-06-03 16:14:24 +00:00
Irina Arkhipets 79a61fab8f [co19] Remove Compiler-tear-offs tests from status files.
Change-Id: Ia41537d3a4c5951841de92507c62711d1f2d8fd5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/202240
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2021-06-03 10:49:04 +00:00
Robert Nystrom 0a3b4fca3e Rename some more incorrectly named tests.
Change-Id: Ia15c2accc2e5b192834bbd37bbd6a720bf52a3f8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201224
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2021-06-03 00:49:54 +00:00
Robert Nystrom e376bcd30f Rename "string/overflow.dart" -> "string/overflow_test.dart".
Change-Id: I32fa46c5750ee6d2410231322bf16fa7decb751d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201227
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2021-06-03 00:40:24 +00:00
Mayank Patke 7cdb6444f2 Add language tests for some late instance variable corner cases.
Change-Id: Ic269846684201bebab74ae83d269753fa40626f1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/200921
Reviewed-by: Stephen Adams <sra@google.com>
2021-06-02 23:21:24 +00:00
Tess Strickland a205935d9a [vm/compiler] Treat allocations generically in redundancy eliminator.
Instead of explicitly listing certain subclasses in some places, instead
allow any AllocationInstr subclass and just reject certain subclasses if
necessary.

Code size different in Flutter gallery (release-sizeopt):
* ARM7: Total -0.12%, instructions -0.14%, readonly -0.11%
* ARM8: Total -0.12%, instructions -0.15%, readonly -0.09%

TEST=Current test suite.

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-simarm64c-try,vm-kernel-precomp-linux-debug-simarm_x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64c-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-release-simarm64-try,vm-kernel-precomp-linux-release-simarm-try,vm-kernel-linux-debug-ia32-try,vm-kernel-linux-debug-x64-try,vm-kernel-linux-product-x64-try,vm-kernel-linux-release-simarm64-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-x64-try,vm-kernel-linux-debug-x64c-try
Change-Id: I4ce42d7185d4b3a83356e5131a5835fa858c4882
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201832
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2021-06-02 18:10:38 +00:00
Simon Binder be893fdf27 [vm/ffi] Add providesSymbol to DynamicLibrary
This adds the providesSymbol method to DynamicLibrary. It returns
whether the library contains a function with the given name.

As per dlsym(3), it is valid for dlsym to return nullptr in a success
case if the symbol actually has a NULL value. So I've changed the logic
to check for dlerror() after we invoke dlsym(), both in the existing
lookup and in the new method.

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

TEST=tests/ffi(_2)/has_symbol_test.dart

Change-Id: Ibcb1c051cc0cdd95a104fe86ef2fc76da5bafb5d
Cq-Include-Trybots: luci.dart.try:vm-precomp-ffi-qemu-linux-release-arm-try,vm-ffi-android-debug-arm64-try,vm-ffi-android-debug-arm-try,vm-kernel-linux-debug-x64-try,vm-kernel-win-debug-x64-try,vm-kernel-mac-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201900
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2021-06-02 16:01:43 +00:00
Alexander Thomas 997487db0f [testing] Fix line numbers in dwarf_stack_trace_test.dart
The test contained hardcoded line numbers that changed when the language
version comment was added[1].

[1] https://dart-review.googlesource.com/c/sdk/+/201564

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-x64-try
Change-Id: I2fda2b013a8ac3ee71dd98a6c243c00a5aeae823
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/202040
Auto-Submit: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2021-06-02 09:54:25 +00:00
Alexander Thomas 7baeabe0e4 [testing] Rely on language versions in the analyzer tests
https://github.com/dart-lang/co19/issues/1090

TEST=Standard tryjobs, all changes are in test code only.

Change-Id: Ie73174447ab165827335652cf035f85b7510ab55
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201564
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2021-06-02 07:47:46 +00:00
Paul Berry b7c6ad117f Remove hack that builds FunctionExpressionInvocation with synthetic arguments.
Now that we have an AST and visitor support for the FunctionReference
structure (which represents `Expression<TypeArguments>` for various
kinds of expressions), we no longer need to error recover this as a
FunctionExpressionInvocation with synthetic arguments.  The resolver
still doesn't resolve the syntax properly, but that's ok because it's
not permitted in valid code (for now we just treat it as having type
`dynamic`).

Fixes #46150.

Change-Id: I357175cc16bcf2f9027be2e1da66bb6ca70a9400
Bug: https://github.com/dart-lang/sdk/issues/46020
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199682
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-06-01 22:44:45 +00:00
Regis Crelier 7014f03aad [VM/runtime] Fix type test: a closure is T, when T is instantiated to Object.
Fixes https://github.com/dart-lang/sdk/issues/46165

TEST=added regression test

Change-Id: I3016f60560b00f077d5ef55a0b23ccfb7dbf0836
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201863
Reviewed-by: Liam Appelbe <liama@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2021-06-01 20:25:55 +00:00
Zach Anderson 8beec1d9cc Fix abstract unix socket test
There was a race between the subprocess listening on the socket and
the test trying to connect.

Also the Android bits of the test harness needed to be taught about
the abstract_socket_test program, similar to how process_test is
handled.

TEST=Fixes tests
Change-Id: I5e1c5d2e23e4bff2a01cd5c491a45e1c58d2578e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201861
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2021-06-01 17:30:54 +00:00
Erik Ernst e4647026a1 Correct symbol_reserved_word_test.dart, splitting it into two tests.
Also add one new test symbol_arbitrary_string_test.dart.

Change-Id: I12b07218a098a37b83d99525d2be3ec356ef1fd1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195503
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2021-06-01 15:55:03 +00:00
asiva 0742ed66a7 [VM/Tests] - Fix new abstract_socket_test.
- Skip in configurations that do not build the abstract_socket_test
executable
- Fix MemorySanitizer: use-of-uninitialized-value error

TEST=existing test - unix-socket-test

Change-Id: Ie9bf6dc1cd6bea98cd7859584473154f6ac49eee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201722
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2021-05-29 00:16:34 +00:00
Stephen Adams bac8e8b0c0 [language] Add test for super-tearoff default arguments
Change-Id: Iec5d525b1f7f60f3245b6dca65eda90279b5eead
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201540
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2021-05-28 02:48:08 +00:00
Robert Nystrom 0e5417a48f Rename mis-named NNBD language tests.
Without "_test" in the name, the test runner ignores them.

Change-Id: I7dc2da51b980b1b5512fc2c2087238129bf1bd78
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/200930
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2021-05-28 01:12:07 +00:00
Zach Anderson 5dc1f8db8c Trim abstract unix socket path length
Fixes https://github.com/dart-lang/sdk/issues/46149

TEST=unix_socket_test
Change-Id: Icc5273941f880f581cc2621431b5cecb7782c71e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201441
Commit-Queue: Zach Anderson <zra@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2021-05-27 21:50:24 +00:00
Sergey G. Grekhov a7273673a4 [co19] co19_2 status file cleanup
Change-Id: I69c7d0daf01dca4b84dfc84286d1bb2fa067a4a5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201480
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2021-05-27 08:15:04 +00:00
Daco Harkes 50640bdb81 [vm/ffi] Fix ia32 struct by value return with no arguments
On IA32 arguments are passed in registers. When a struct is returned
by value, a pointer is passed in on the stack containing the address to
which the return value is written. We did not account for this pointer
in the stack-height calculation.

This problem only surfaced when there are no arguments to the function.
Because if an argument is passed it has a higher stack height than the
pointer for the result being passed in.

Fix in: runtime/vm/compiler/ffi/native_calling_convention.cc

TEST=runtime/vm/compiler/ffi/native_calling_convention_test.cc
TEST=tests/ffi/regress_46127_test.dart

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

Change-Id: Ia78fe07cc7e3a3c8625143d491935a959b4a7895
Cq-Include-Trybots: luci.dart.try:vm-kernel-linux-debug-ia32-try,vm-kernel-nnbd-linux-debug-ia32-try,vm-precomp-ffi-qemu-linux-release-arm-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201269
Reviewed-by: Clement Skau <cskau@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2021-05-26 13:37:32 +00:00
Daco Harkes 1d38c98b69 [vm/ffi] Fix CFE crash on missing Array sizes
Closes: https://github.com/dart-lang/sdk/issues/46085

TEST=tests/ffi/regress_46085_test.dart

Change-Id: I04e05baccb6eb490ef32702677e3d5c1bb815560
Cq-Include-Trybots: luci.dart.try:vm-kernel-nnbd-linux-debug-x64-try
Fixed: 46085
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201264
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Clement Skau <cskau@google.com>
2021-05-26 11:02:22 +00:00
asiva 4dea737439 [VM/tests] issue/45618 - Avoid large outputs from tests
Change-Id: I382541458eb618fa9e02b19fee0781ddcc8a2e55
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201169
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2021-05-26 06:04:01 +00:00
Bob Nystrom 43260485de Revert "Rename a regression test so that the test runner runs it."
This reverts commit c362bc085c.

Reason for revert: Causes out-of-memory on CI.

Original change's description:
> Rename a regression test so that the test runner runs it.
>
> Change-Id: I5effc1641b08e4249da9945e638e3b2cb4f0024c
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201226
> Auto-Submit: Bob Nystrom <rnystrom@google.com>
> Commit-Queue: Bob Nystrom <rnystrom@google.com>
> Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>

TBR=lrn@google.com,rnystrom@google.com

Change-Id: Ic0c234a4b48cd51b500224d12acd7605928aa405
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201381
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2021-05-25 23:38:02 +00:00
Robert Nystrom c362bc085c Rename a regression test so that the test runner runs it.
Change-Id: I5effc1641b08e4249da9945e638e3b2cb4f0024c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201226
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2021-05-25 21:31:31 +00:00
Riley Porter f08edad8ce Optimize js_util setProperty calls for non-function values to
_setPropertyUnchecked version that can be inlined.

No change in the generated JavaScript for dart2js.

Change-Id: Ie4a8e5a34826b6c9083d34656aaa27050635cb21
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/200933
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Riley Porter <rileyporter@google.com>
2021-05-25 19:28:01 +00:00
Paul Berry 126c5fa680 Initial parser support for constructor tear-offs.
This CL adds parser support for use of `<typeArguments>` as a
selector.  This allows expressions like `List<int>` (type literal with
type arguments), `f<int>` (function tear-off with type arguments),
`C.m<int>` (static method tear-off with type arguments), `EXPR.m<int>`
(instance method tear-off with type arguments), and `EXPR<int>`
(tear-off of `.call` method with type arguments).

I will add parser support for `.new` as a constructor name in a
follow-up CL.

Change-Id: I157e732276421e8c3fd20c38c67ae9643993bd85
Bug: https://github.com/dart-lang/sdk/issues/46020, https://github.com/dart-lang/sdk/issues/46044.
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/197102
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2021-05-25 13:58:10 +00:00
Clement Skau 4a0d89bfc6 [test] Skip vmspecific_leaf_call_test in app_jitk
Jobs crash due to missing snapshots, caused by the tests intentionally
crashing.

TEST=-n app_jitk-linux-debug-x64 ffi_2/vmspecific_leaf_call_test

Cq-Include-Trybots: luci.dart.try:app-kernel-linux-debug-x64-try,app-kernel-linux-product-x64-try,app-kernel-linux-release-x64-try
Bug: https://github.com/dart-lang/sdk/issues/46125
Change-Id: Ic62d68e492f6f24cc4ca60151172f89137097398
Cq-Do-Not-Cancel-Tryjobs: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201185
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Clement Skau <cskau@google.com>
2021-05-25 13:47:10 +00:00
Robert Nystrom 23dd8fe188 Fix imports in prefix/new_test.dart.
Change-Id: I493d99d3e8b2150902dbeb8d1a2960d24a0c185f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/200931
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2021-05-25 12:00:30 +00:00
Robert Nystrom 14e672a6dd Rename library6.dart to make it a test.
Also update the comment since it used to be a negative test but is now
a positive test.

Change-Id: I8bc6fa9e112d2d84e61cd849f6f7cd37cebe9a47
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201081
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2021-05-25 11:55:40 +00:00
Robert Nystrom f6e920a994 Rename language(_2)/function_subtype/null.dart to actually be a test.
Change-Id: I8b0dc6c8d5509ccd77ae5e78de3e2e6ad8bd40cb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201062
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2021-05-25 11:19:50 +00:00
Robert Nystrom e9b9959d36 Add a missing import to the known prefix error tests.
Change-Id: I29656ba5a995a946d14bec6726459873ef9d1f49
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201223
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2021-05-25 09:47:31 +00:00
Robert Nystrom f462c16326 Fix import in "infer_aliased_factory_invocation_07_test.dart".
Change-Id: I8a3bfaf56715cd2971e2cbba763a998f86dd3bba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201228
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2021-05-25 09:46:20 +00:00
Clement Skau 4d5055805f [VM/FFI] Adds FFI leaf calls.
This CL adds FFI leaf calls by adding `lookupFunction(.., isLeaf)`
and `_asFunctionInternal(.., isLeaf)`, which generate FFI leaf calls.
These calls skip a lot of the usual frame building and generated <->
native transition overhead.

`benchmark/FfiCall/` shows a 1.1x - 4.3x speed-up between the regular
FFI calls and their leaf call counterparts (JIT, x64, release).

TEST=Adds `tests/ffi{,_2}/vmspecific_leaf_call_test.dart`. Tested FFI tests.

Closes: https://github.com/dart-lang/sdk/issues/36707
Cq-Include-Trybots: luci.dart.try:vm-precomp-ffi-qemu-linux-release-arm-try,vm-ffi-android-release-arm64-try,vm-ffi-android-release-arm-try,vm-ffi-android-product-arm64-try,vm-ffi-android-product-arm-try,vm-ffi-android-debug-arm64-try,vm-ffi-android-debug-arm-try,vm-kernel-linux-debug-ia32-try,vm-kernel-win-debug-ia32-try,vm-kernel-win-debug-x64-try,vm-kernel-win-release-x64-try,vm-kernel-mac-debug-x64-try,vm-kernel-precomp-nnbd-mac-release-simarm64-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-precomp-asan-linux-release-x64-try,vm-kernel-precomp-linux-release-simarm_x64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,vm-kernel-precomp-ubsan-linux-release-x64-try,vm-kernel-precomp-tsan-linux-release-x64-try,vm-kernel-precomp-win-release-x64-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-reload-linux-debug-x64-try
Bug: https://github.com/dart-lang/sdk/issues/36707
Change-Id: Id8824f36b0006bf09951207bd004356fe6e9f46e
Cq-Do-Not-Cancel-Tryjobs: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179768
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2021-05-21 11:12:02 +00:00
Clement Skau cb2a625d7c [vm] Removes FLAG_enable_testing_pragmas from native_api_impl
This removes the need for passing the flag to use
Dart_ExecuteInternalCommand, which is done in several tests
that otherwise have nothing to do with testing pragmas.

Also adds status file skips for precomp-win targets that currently
crash due to https://github.com/dart-lang/sdk/issues/40579.

TEST=CQ

Bug: https://github.com/dart-lang/sdk/issues/46059, https://github.com/dart-lang/sdk/issues/46061
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-win-release-x64-try,vm-kernel-precomp-nnbd-win-release-x64-try,vm-kernel-win-debug-x64-try
Change-Id: I3024ad9bedb7a74abaaaa1020b7525e5d8b1bd47
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/200461
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2021-05-21 07:04:37 +00:00
Alexander Markov 88021fd67a [vm] Enable new kernel AST invocation nodes for the VM, take 2
This change was already reviewed at
https://dart-review.googlesource.com/c/sdk/+/197586.

Bugfix is in the separate change:
https://dart-review.googlesource.com/c/sdk/+/199365.

TEST=ci

Issue: https://github.com/dart-lang/sdk/issues/45340
Change-Id: I4311909e4893af53e88895512f03d3ef84c6bc5f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199366
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-05-20 18:53:45 +00:00
Alexander Aprelev 8d54a30825 [io/http] Introduce callback that embedder can override to provide custom HTTPClient connection validation.
For example, this can be used to ban insecure http connections, force use of https ones - see https://github.com/flutter/engine/pull/26226.

Issue https://github.com/flutter/flutter/issues/69685
Issue https://github.com/flutter/flutter/issues/54448

Change-Id: Id81aeae9aff0d469ac6f911e4e502b39ce9558bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/200524
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2021-05-20 15:17:52 +00:00
Lasse R.H. Nielsen cf627eb01c Change signature of HttpClient.authenticate{,Proxy}.
Allow the `realm` argument to callbacks to be `null`.
This is a breaking change, but it only affects null-safe code.

Also fix a bug in http_impl.dart where an error function with
an *optional* stack trace parameter would be called without a stack trace.

Bug: https://github.com/dart-lang/sdk/issues/44039
Change-Id: I4b38382328e26478661bf45f46cd3017631f4ebd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170094
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2021-05-20 13:13:42 +00:00
Daco Harkes f18c1bfb84 [cfe/ffi] Fix user-defined getters
https://dart-review.googlesource.com/c/sdk/+/198281 introduced support
for incremental compilation to the FfiTransform. This included reading
fields from already transformed structs and unions.

However, fields which already had been transformed are indistinguishable
from user-defined getters.

So instead of re-reading the information from the fields, for already
transformed structs, we read the information from the
`vm:ffi:struct-fields` pragma on the struct class.

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

TEST=tests/ffi/regress_46004_test.dart
TEST=pkg/front_end/testcases/incremental/regress_46004.yaml

Change-Id: Iebffda037913e71349bba9685dc16e2f478a0e7b
Cq-Include-Trybots: luci.dart.try:vm-kernel-win-debug-x64-try,front-end-nnbd-linux-release-x64-try,front-end-linux-release-x64-try,vm-ffi-android-debug-arm64-try,vm-precomp-ffi-qemu-linux-release-arm-try
Fixed: 46004
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/200640
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Clement Skau <cskau@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2021-05-20 13:12:22 +00:00
Konstantin Shcheglov e9b1d45382 Issue 46062. Report TYPE_ALIAS_CANNOT_REFERENCE_ITSELF on the name of the alias.
Bug: https://github.com/dart-lang/sdk/issues/46062
Change-Id: Ib5dfd6fe4008bf6f1f352f5682b85866355cd756
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/200527
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-05-19 15:45:21 +00:00
Irina Arkhipets 7c9abd9faa [co19] Constructor Tear Offs tests skipped as not implemented
Change-Id: I27b2ae9b091dbc3649ecf1a6dea8da19f4de5f84
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/200431
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2021-05-19 08:19:47 +00:00
Robert Nystrom 606feda047 Delete unused files in test folders.
These files are not tests nor are they used by any tests.

This change was split out from patch 198141 which had to be reverted.

Change-Id: I26ca5931bf9e300e694d69ac7558536c965349ee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/200562
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2021-05-19 08:05:05 +00:00
Robert Nystrom 58c692dfaf Fix name of async_star/pause_test2.dart.
Change-Id: I6e3e975a1181628c17ff972397c536b35ded1b2a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/200563
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2021-05-19 08:04:35 +00:00
Ben Konyi d7ccc3ca6a Revert "Fix orphaned files in tests/language/ and tests/language_2/."
This reverts commit 1989b7f376.

Reason for revert: Bots are sad, red, and purple

Original change's description:
> Fix orphaned files in tests/language/ and tests/language_2/.
>
> Some of these should be tests but were missing "_test". Others seemed
> to simply be dead code. Some should have been referenced but there were
> mistakes in the imports in other files.
>
> Change-Id: If6f1d9e52a4babbf9883ddd437fc3091179f2ef2
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198141
> Auto-Submit: Bob Nystrom <rnystrom@google.com>
> Commit-Queue: Bob Nystrom <rnystrom@google.com>
> Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>

TBR=lrn@google.com,leafp@google.com,rnystrom@google.com

Change-Id: I8d63af684023e99849addf9d1c3f87d6bcfbe89d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/200531
Reviewed-by: Ben Konyi <bkonyi@google.com>
2021-05-18 21:28:01 +00:00
Ben Konyi dd18a07c75 Revert "[vm/dart2js] Fix language/string/overflow_test.dart"
This reverts commit 6ad3aaf57c.

Reason for revert: Causing timeouts on bots (e.g., https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket.appspot.com/8846893706998473952/+/u/test_results/new_test_failures__logs_)

Original change's description:
> [vm/dart2js] Fix language/string/overflow_test.dart
>
> Changes the test to concatenate strings indefinitely. This way the test
> makes no assumptions about the amount of available memory, and the
> concatenation result always stays alive.
>
> Closes: https://github.com/dart-lang/sdk/issues/46055
>
> Change-Id: I1a0da68b2ab5cfc00cfe834f0666f6f797a69ec4
> Fixed: 46055
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/200460
> Commit-Queue: Daco Harkes <dacoharkes@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>

TBR=kustermann@google.com,dacoharkes@google.com

Change-Id: I2108723b5f2c746c858cf5d3f9fded09118ce6c5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/200532
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-05-18 21:24:44 +00:00
Brian Wilkerson 06638483e1 Improve the highlight range for conflicting_generic_interfaces
Change-Id: I4ec19c1ceba747f5f23f7c95462de323fe76ecf6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/200240
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-05-18 20:42:33 +00:00
Paul Berry bb7dbc004e Additional language tests for parsing behaviors around type arguments.
Change-Id: I8ae5e800588ece4e08add7b0c7afe6587c01c478
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/200200
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2021-05-18 14:06:13 +00:00
Daco Harkes 6ad3aaf57c [vm/dart2js] Fix language/string/overflow_test.dart
Changes the test to concatenate strings indefinitely. This way the test
makes no assumptions about the amount of available memory, and the
concatenation result always stays alive.

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

Change-Id: I1a0da68b2ab5cfc00cfe834f0666f6f797a69ec4
Fixed: 46055
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/200460
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2021-05-18 12:41:43 +00:00
Robert Nystrom 1989b7f376 Fix orphaned files in tests/language/ and tests/language_2/.
Some of these should be tests but were missing "_test". Others seemed
to simply be dead code. Some should have been referenced but there were
mistakes in the imports in other files.

Change-Id: If6f1d9e52a4babbf9883ddd437fc3091179f2ef2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198141
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2021-05-18 00:36:52 +00:00
Paul Berry b2281e14f3 Add language tests for parsing behaviors around type arguments.
In these tests I've tried to test a lot of the corner cases
surrounding the addition of a `<type arguments>` selector to the
grammar (which we intend to do as part of constructor tearoffs), to
make sure that when we do so, we don't break any existing
functionality.

Change-Id: I765195cdd3745904f4aeb36663f59afe03381ab8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/200001
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2021-05-17 15:07:41 +00:00
Lasse R.H. Nielsen 46ceec41d2 Remove references to enabled nonfunction-type-aliases experiment.
Change-Id: I0cfd2ad9e59c985f632d7038a64d903f6b472dd1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199480
Auto-Submit: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2021-05-17 13:17:20 +00:00
Joshua Litt dda987b915 Fix native_exception1_frog_test.
Change-Id: Iec4e506dc896eca832c18da85395c6035704e7f1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/200020
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2021-05-14 23:13:28 +00:00
asiva fb90f11f4b [dart:io] - Fix incorrect setting of socket options for UNIX-DOMAIN sockets
- setting of UNIX-DOMAIN socket options was not throwing the correct error
- listen in HTTPServer was trying to set TCP_NODELAY for UNIX-DOMAIN sockets

Fixes :
 https://github.com/dart-lang/sdk/issues/45977
 https://github.com/dart-lang/sdk/pull/45978
 https://github.com/dart-lang/sdk/issues/45975

TEST=new test cases added

Change-Id: Ie0341f26b1ba0f9423c08a8de968053a2af1c730
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199640
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2021-05-14 01:53:48 +00:00
Riley Porter eb14bf2472 [ddc] Limit DDC to only skip reifying tearoffs in foreign JS when in the SDK.
Change-Id: I4a671b7064da89d7595e74b22135dc9817523622
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199540
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Riley Porter <rileyporter@google.com>
2021-05-12 20:46:51 +00:00
Lasse R.H. Nielsen 46b3b6352d Clean up null-aware tests.
Change-Id: I0e932695b00dc8fab34fbbeada5777cb4534150e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162510
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2021-05-12 15:21:10 +00:00
Lasse R.H. Nielsen a5e18113f3 Remove references to triple-shift and generic-metadata experiments.
TEST= removed flags from test. No behavior should change.

Change-Id: I401bfb68c082d1bd405a118d5eca6a47a807945f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199241
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2021-05-12 13:35:00 +00:00
Alexander Aprelev c395e5fe54 [vm/ssl] Reenable client certificate tests.
Fixes https://github.com/dart-lang/sdk/issues/26057

Change-Id: I172f7b8221f34d2bd16df324d96ad7a6ec88d54d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199301
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2021-05-12 10:01:30 +00:00
Daco Harkes 3b9bd26f3e [vm/ffi] Union transform fix offsets
TEST=tests/ffi/regress_45988_test.dart

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

Change-Id: Ie8bf76bb2cc1781a4b59e508d0e5f2ada85d22a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199422
Reviewed-by: Clement Skau <cskau@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2021-05-12 09:50:00 +00:00
Sigmund Cherem 3a0c27b74c [ddc] Add a regression test for issue #45874
Expandos collide after a hot restart. This currently fails because
the DDC implementation uses a static field (_keyCounter) to compute a
unique name for each expando. After a hot-restart the counter gets reset
and keys get reused accidentally.

A hacky fix would be to ensure this field is not reset after restarts,
but a more robust fix would be to use a weak map implementation like
dart2js does.

Change-Id: I991874aabf836be66cbd44de07dd38e681415ae7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199221
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2021-05-11 22:14:28 +00:00
Lasse R.H. Nielsen 5b64d1233b Fix null-safety migration error in CastMap.
Make expect use `Never` to signal non-completion instead of depending on `meta`.

Change-Id: Ibb4230e6b0cfbf995ad91a31c6620525cf6a8918
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194244
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2021-05-10 14:15:07 +00:00
Brian Wilkerson 29eb10d488 Unify 5 more codes for documentation purposes
Change-Id: Ib6595fe0962f0c314be3194f2b6566a0259735da
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198960
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-05-10 13:21:37 +00:00
Martin Kustermann 31364331e9 Revert "[vm] Enable new kernel AST invocation nodes for the VM"
This reverts commit 53e3c079b7.

Reason for revert: This change has seemingly caused errors of the form
```
stderr >> Unhandled exception:
stderr >> Invalid argument(s): Missing canonical name for Reference to <XXX>
stderr >> #0      BinaryPrinter.writeNullAllowedReference (package:kernel/binary/ast_to_binary.dart:894:9)
stderr >> #1      BinaryPrinter.visitTypedefType (package:kernel/binary/ast_to_binary.dart:2410:5)
stderr >> #2      TypedefType.accept (package:kernel/ast.dart:11115:42)
stderr >> #3      BinaryPrinter.writeNode (package:kernel/binary/ast_to_binary.dart:403:10)
stderr >> #4      BinaryPrinter.writeOptionalNode (package:kernel/binary/ast_to_binary.dart:496:7)
```

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

Original change's description:
> [vm] Enable new kernel AST invocation nodes for the VM
>
> TEST=ci
>
> Issue: https://github.com/dart-lang/sdk/issues/45340
> Change-Id: Ibb307d8df8ff4ae8f2efad177880634ec9e27905
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/197586
> Commit-Queue: Alexander Markov <alexmarkov@google.com>
> Reviewed-by: Johnni Winther <johnniwinther@google.com>
> Reviewed-by: Aske Simon Christensen <askesc@google.com>

TBR=vegorov@google.com,alexmarkov@google.com,johnniwinther@google.com,askesc@google.com

Change-Id: I05d010378cfcc5ba40f2be58b01b3ed27a8fc31e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Issue: https://github.com/dart-lang/sdk/issues/45340
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199000
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2021-05-10 12:32:38 +00:00
Alexander Markov 53e3c079b7 [vm] Enable new kernel AST invocation nodes for the VM
TEST=ci

Issue: https://github.com/dart-lang/sdk/issues/45340
Change-Id: Ibb307d8df8ff4ae8f2efad177880634ec9e27905
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/197586
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2021-05-09 21:00:28 +00:00
Alexander Markov 237c6eef9e [cfe] Improve support for new invocation nodes in constant evaluator
* FunctionInvocation and LocalFunctionInvocation nodes are now supported.
* Handling of List getters is added to InstanceGet.
* Removed incorrect constant evaluation of .hashCode and .runtimeType
  for List constants.

Issue: https://github.com/dart-lang/sdk/issues/45340
Change-Id: I73f3e64e805c0753325463b3e777a6c1b7d0b5fb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198181
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2021-05-09 20:04:38 +00:00
Konstantin Shcheglov 920d1d85e1 Stop reporting StrongModeCode.TOP_LEVEL_INSTANCE_GETTER
Initial: https://dart-review.googlesource.com/c/sdk/+/195302
Reverted: https://dart-review.googlesource.com/c/sdk/+/196282

Internal presubmit looks green.
https://test.corp.google.com/ui#id=OCL:372759773:BASE:372759779:1620532577947:b5e08140

Change-Id: I7348692e1f34f26a9aca48902abb16df50fda2c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198920
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-05-09 18:51:18 +00:00
Brian Wilkerson 62feca7095 Unify two diagnostic codes for documentation purposes
Change-Id: I1b37dc4584757da4833f111c2ea4c3d9511513db
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198901
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-05-09 15:51:28 +00:00
Stephen Adams 90127334ea [dart2js] Pass box to inlined generative constructor body
There was a rare mismatch between arguments and parameters when
inlining a constructor body.

The full arguments at the call site of a constructor body (always in a
generative constructor factory) and the parameters at inlining would
not agree on needing a 'box' for the constructor's closed-over mutated
variables (parameters and locals) when the box was needed only for
locals closed over in an assertion.

The fix is to make the condition for accepting a box match the test
for generating the box in the caller.

Bug: 45943
Change-Id: I3b056cb710ffac72bec6943809e04472a838e5bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198741
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2021-05-07 22:50:27 +00:00
Stephen Adams c65449b9fa [dart2js] Test for #45943
Bug: 45943
Change-Id: I5f4203f25cee80a1092c441c5061b8d0ad6bb1df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198720
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2021-05-07 01:57:24 +00:00
Sigmund Cherem c47ad2789e [ddc] Avoid collision of a top-level function name with parameter names.
Safari has a bug that makes it a syntax error for a function name
to overlap with names of parameters in functions with default
parameter values.

This CL changes DDC to generates code to circumvent this issue
when emitting top-level methods.  Fortunately, the Safari bug
doesn't trigger with ES6 methods, so we don't need to do anything
for Dart instance methods.

The only other occurrence of named functions in DDC are
`function*` generators that we emit. Those take no arguments,
so we don't need any additional renaming there.

Fixes #43520

Change-Id: I2e4588701a294a8f3c5b47956826ada4ed973e6c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198200
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2021-05-06 18:06:05 +00:00
Regis Crelier 1f55b7ca10 Reland "[VM/runtime] Refactor the representation of type parameters in the VM."
This is a reland of 8a21ab195a

Original change's description:
> [VM/runtime] Refactor the representation of type parameters in the VM.
>
> This introduces a new VM internal class 'TypeParameters' representing the declaration of a list of type parameters, either in a class or function.
> The reference to (or use of) a type parameter is still represented by the existing 'TypeParameter' class.
>
> Fixes https://github.com/dart-lang/sdk/issues/43901
> Fixes https://github.com/dart-lang/sdk/issues/45763
>
> TEST=existing ones and a regression test
>
> Change-Id: I1fde808bf753cc1cb829f2c4383c1836651cee80
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/189942
> Commit-Queue: Régis Crelier <regis@google.com>
> Reviewed-by: Alexander Markov <alexmarkov@google.com>

This fixes https://github.com/dart-lang/sdk/issues/45911

TEST=existing ones and a regression test

Change-Id: I709d38b1df3d73fe3c9796d5aca3cbbdcf77fd38
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198380
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2021-05-05 23:43:14 +00:00
Lasse R.H. Nielsen 3e9cdc5644 Seal typed-data types.
Change-Id: Ic20b68fc258ddbf5c007f9d357366d8a41d1f1e2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192186
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2021-05-05 18:04:05 +00:00
Robert Nystrom cc1f9b9564 Remove the last vestiges of two dead multitest outcomes.
A multitest section marked "dynamic type error" or "checked mode
compile time error" didn't actually do anything. It was silently treated
as "ok", which makes for a very confusing looking test.

Fixed the only remaining four tests that used "dynamic type error".
The other outcome was not used by any test.

Change-Id: I9727b3b524cf1effb0dd899bf206aa65dbd60803
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198180
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2021-05-05 15:39:45 +00:00
Michal Terepeta c6bffaf19e Revert "[VM/runtime] Refactor the representation of type parameters in the VM."
This reverts commit 8a21ab195a.

Reason for revert: Test failure: http://b/187227619

Original change's description:
> [VM/runtime] Refactor the representation of type parameters in the VM.
>
> This introduces a new VM internal class 'TypeParameters' representing the declaration of a list of type parameters, either in a class or function.
> The reference to (or use of) a type parameter is still represented by the existing 'TypeParameter' class.
>
> Fixes https://github.com/dart-lang/sdk/issues/43901
> Fixes https://github.com/dart-lang/sdk/issues/45763
>
> TEST=existing ones and a regression test
>
> Change-Id: I1fde808bf753cc1cb829f2c4383c1836651cee80
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/189942
> Commit-Queue: Régis Crelier <regis@google.com>
> Reviewed-by: Alexander Markov <alexmarkov@google.com>

TBR=rmacnak@google.com,alexmarkov@google.com,regis@google.com,sstrickl@google.com

Change-Id: If12caa1a84cb6d1c1b8225589f3c994d25abb120
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198282
Reviewed-by: Michal Terepeta <michalt@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Michal Terepeta <michalt@google.com>
2021-05-05 10:03:57 +00:00
Robert Nystrom ae8ee38d8b Remove an accidentally duplicated test.
Change-Id: I1b40500ccd9372e8c4fa6ddea4946059363c2afa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198081
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2021-05-05 07:18:02 +00:00
Robert Nystrom 29c850db57 Fix test names in corelib/.
Without "_test", they aren't run by the test runner.

Change-Id: I073ea7b8e127120b306036ff9bf5f25066133679
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198080
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Leaf Petersen <leafp@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2021-05-05 01:06:12 +00:00
Regis Crelier bde3097860 [vm/runtime] Consider instantiated type of instance method tear-offs in equality checks.
This fixes https://github.com/dart-lang/sdk/issues/45890

TEST=regression tests added

Change-Id: Id8d96e866e6da8ad848416a64967ed4fa0b29ce0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198101
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2021-05-05 00:07:52 +00:00
Nicholas Shahan 13943449b5 [ddc] Add missing nullability on FutureOr types
FutureOr types now to emit nullability when they are contained inside a
deferred type.

Issue: https://github.com/dart-lang/sdk/issues/45767
Fixes: https://github.com/dart-lang/sdk/issues/45870

Change-Id: I103b575e898b3d7754adbd272df6c4a7e03e50d1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/197902
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2021-05-04 19:46:51 +00:00
Regis Crelier 8a21ab195a [VM/runtime] Refactor the representation of type parameters in the VM.
This introduces a new VM internal class 'TypeParameters' representing the declaration of a list of type parameters, either in a class or function.
The reference to (or use of) a type parameter is still represented by the existing 'TypeParameter' class.

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

TEST=existing ones and a regression test

Change-Id: I1fde808bf753cc1cb829f2c4383c1836651cee80
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/189942
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2021-05-04 15:47:01 +00:00
Nicholas Shahan ec48e8f323 [ddc] Fix missing nullability on deferred types
Emits legacy and nullable wrappers to the types that appear in
circular hierarchies.

There is still missing nullability information if FutureOr appears
in the type hierarchy but that fix uncovers a larger issue with the
FutureOr type. See https://github.com/dart-lang/sdk/issues/45870.

Change-Id: If5894eaff632c5a961f1316d8803032fae2a0ec5
Fixes: https://github.com/dart-lang/sdk/issues/45767
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196600
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
2021-05-03 17:54:19 +00:00
Daco Harkes cb636850df [vm] Exclude current_context_var from ValidatePhis
current_context_var is special cased in the liveness analysis and never
pruned even though it does not have uses by instructions. The lack of
pruning caused the assert to fire. This CL adds the special casing to
this assert as well.

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

TEST=tests/language/vm/regress_45855_test.dart

Change-Id: Ica74a43bd2449dd994639c686253449146216458
Fixed: 45855
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/197541
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2021-05-01 09:28:17 +00:00
Kallen Tu 68d133d949 [cfe] Mutable lists and list add method in const functions.
Within constant evaluation, mutable lists can be created and altered with `add`.

Change-Id: I4ad86e3bea768844835dd732bff3ae135d6df8fb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/197280
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2021-04-29 17:52:36 +00:00
Joshua Litt e6a0238898 [dart2js] Use simple load ids on some bots.
Change-Id: I593a702b94f0c91d234d888750f260a022f49e77
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/197107
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2021-04-29 17:19:05 +00:00
Kallen Tu 2ac2871476 [cfe] NullConstant variable declaration value.
Change-Id: I6d5adea4d70d8cd34f565a729034e2636935033e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/197120
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2021-04-29 15:36:15 +00:00
Daco Harkes 79331c788c [cfe/ffi] Fix division by 0 on @Packed(0)
Fixes: https://github.com/dart-lang/sdk/issues/45838

TEST=tests/ffi/vmspecific_static_checks_test.dart

(Looks like `dart format` also slightly changed. Committing such that
the files are in line with the formatter again.)

Change-Id: Iefd8af8c38a7490175b2e25b46cedbf85f15f17d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/197340
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
2021-04-29 10:55:17 +00:00
Kallen Tu 4e2fac951d [cfe] Allow non-const constructor invocations in const functions.
Change-Id: Ieb8d3030c6132ccf9037e64cef3ba6c4eeaa90ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/197180
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2021-04-28 21:17:33 +00:00
Alexander Markov a98500a139 [vm/aot] Discard Code objects of invisible functions
Previously, Code objects of invisible functions were retained
in order to omit frames corresponding to such functions from stack
traces when stack trace is printed.

This change drops Code objects of invisible functions. That also
means that frames corresponding to such functions are no longer
skipped in binary DWARF stack traces.

In order to account for that, DW_AT_artificial attribute is added to
generated DWARF debug information to mark invisible functions.
Stack trace decoding now looks at this attribute and skips those
frames when symbolizing stack trace.

Flutter gallery in release-sizeopt mode:
Heap size of snapshot objects -4.2% (arm), -4.4% (arm64).

A large application in --dwarf_stack_traces mode:
Number of discarded Code objects increased from 72.4% to 83.7%
(out of all Code objects).
Heap size of Code objects -37.4%.
Heap size of all snapshot objects -5%.

TEST=tests/standalone/dwarf_stack_trace_invisible_functions_test.dart
Issue: https://github.com/dart-lang/sdk/issues/44852
Change-Id: Ib804852aba1e083670f1d9b9d66cbaab7dcdcff9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196583
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2021-04-27 23:31:02 +00:00
Konstantin Shcheglov 3a0a196fed Revert "Issue 45672. Report constant errors when null value where non-nullable type is expected."
This reverts commit ac27053055.

Reason for revert: landed without necessary local changes

Original change's description:
> Issue 45672. Report constant errors when null value where non-nullable type is expected.
>
> Original: https://dart-review.googlesource.com/c/sdk/+/196042
> Reverted as: https://dart-review.googlesource.com/c/sdk/+/196281
>
> Presubmit looks green:
> https://test.corp.google.com/ui#id=OCL:369788056:BASE:369887187:1619108797262:daf61e5&include_skipped=true
>
> Bug: https://github.com/dart-lang/sdk/issues/45672
> Change-Id: I459b7ea3e1218d960583bf4b6ace5b2c40dc7f4a
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196300
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>

TBR=scheglov@google.com,brianwilkerson@google.com

Change-Id: Ia624c5c90195fd2477b068e245a644a62795d35c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/45672
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/197108
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-04-27 21:42:21 +00:00
Nate Bosch 71fc33e427 Enable experiment generic_metadata
Change-Id: Iff050e6a2a1c0c2b8baca211a523f9dd77cfbd4a
TEST=Existing tests for the feature.
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193748
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Leaf Petersen <leafp@google.com>
2021-04-27 20:16:08 +00:00
Brian Wilkerson d92ed4d72f Unify duplicate_field_formal_parameter and final_initialized_multiple_times
I started doing this the normal way, but the two codes appear to differ
only based on whether the field was final, and I don't think that factor
is important to the nature of the error, so I think a single code is
sufficient.

Change-Id: I693dcfb1a2a4b47a8b82fe4860e7a61c82ca062e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196880
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-04-27 17:32:18 +00:00
Konstantin Shcheglov ac27053055 Issue 45672. Report constant errors when null value where non-nullable type is expected.
Original: https://dart-review.googlesource.com/c/sdk/+/196042
Reverted as: https://dart-review.googlesource.com/c/sdk/+/196281

Presubmit looks green:
https://test.corp.google.com/ui#id=OCL:369788056:BASE:369887187:1619108797262:daf61e5&include_skipped=true

Bug: https://github.com/dart-lang/sdk/issues/45672
Change-Id: I459b7ea3e1218d960583bf4b6ace5b2c40dc7f4a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196300
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-04-27 17:14:48 +00:00
Daco Harkes 0aaf26d265 [vm] Fix OSR entry missing phis in indirect joins
Closes: https://github.com/dart-lang/sdk/issues/45260

TEST=tests/language/vm/regress_45260_test.dart
TEST=Added assert + optcounter bot.

Change-Id: Ic55ecf14678047a006c20bd8be4dd20c39ec4272
Cq-Include-Trybots: luci.dart.try:vm-kernel-optcounter-threshold-linux-release-ia32-try,vm-kernel-optcounter-threshold-linux-release-x64-try
Fixed: 45260
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196320
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2021-04-27 13:12:48 +00:00
JustWe ac2cd2d73c [vm/ffi] Array dimensions non-positive check in CFE
Bug: https://github.com/dart-lang/sdk/issues/45540
Closes: https://github.com/dart-lang/sdk/pull/45785

TEST=tests/ffi/vmspecific_static_checks_test.dart

GitOrigin-RevId: e4c091a617acf36f60de7ddfc957a58323663813
Change-Id: I393e1dbbf34aa9f72e2e942c3a40c2f37c90e0c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196246
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2021-04-27 06:56:28 +00:00
Kallen Tu 8a0801572c [cfe] Instance method invocations for const functions.
Change-Id: I2e7d8b3859f09dd906e78e6e6d44722a0aabaeb6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196140
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2021-04-26 18:11:47 +00:00
Leaf Petersen b101a7d002 Add language versions to _2 test libraries
Change-Id: Ib33169c3e0ffc870915c189404074a1dea472546
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196548
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Leaf Petersen <leafp@google.com>
2021-04-26 17:58:57 +00:00
Kallen Tu 931f7dc2e6 [cfe] List [] for const functions.
Change-Id: Ibbd9b828334609bca3d700bd5af7049b78b8a33a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196200
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2021-04-26 16:40:17 +00:00
Brian Wilkerson aaf35b839a Unify some error codes for documentation purposes
Change-Id: I3a0f66f29a446d677b459dc92f5bdded9f480719
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196801
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-04-25 14:59:36 +00:00
Martin Kustermann e50a59d2f2 [gardening] Add stdout/stderr from subprocess if subprocess failed and makes test fail
Locally this test doesn't seem to fail though it did so on a nightly builder.
If the test fails again we'll have more information on what goes wrong.

TEST=Adding more information to test.

Change-Id: Id5ca71d42322c813ba3cfd56e9dfe335160e2e7b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196497
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
2021-04-23 10:23:31 +00:00
Dan Field 5776d576a0 Reland "Make throwing Zone.uncaughtError handlers propagate the error to their parent zone."
This reverts commit f0a8b63402.

Reason for revert: The Flutter SDK issues have been resolved - see https://github.com/flutter/flutter/issues/80969 and https://github.com/flutter/flutter/pull/81014

Original change's description:
> Revert "Make throwing Zone.uncaughtError handlers propagate the error to their parent zone."
>
> This reverts commit 88a351f3d2.
>
> This broke the Dart SDK -> Flutter Engine roller. Flutter issue at https://github.com/flutter/flutter/issues/80969
>
> Change-Id: Idaf255a730c7b6054e6cd929b6770dbe66860151
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196561
> Reviewed-by: Zach Anderson <zra@google.com>
> Commit-Queue: Zach Anderson <zra@google.com>

# Not skipping CQ checks because this is a reland.

Change-Id: Icd98c550c63160f35cc5da40af7ca6bf2cbf180e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196621
Reviewed-by: Dan Field <dnfield@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Dan Field <dnfield@google.com>
2021-04-23 05:24:41 +00:00
George Wright f0a8b63402 Revert "Make throwing Zone.uncaughtError handlers propagate the error to their parent zone."
This reverts commit 88a351f3d2.

This broke the Dart SDK -> Flutter Engine roller. Flutter issue at https://github.com/flutter/flutter/issues/80969

Change-Id: Idaf255a730c7b6054e6cd929b6770dbe66860151
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196561
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2021-04-22 22:20:16 +00:00
Kallen Tu 5c36a30de2 [cfe] Instance field get for const functions.
Change-Id: Ie090cbf47d1e5be82e59a3f782dea8b4c1c75c91
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196380
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2021-04-22 22:14:01 +00:00
Sergey G. Grekhov 391d5c409b [co19] Status files cleanup
Change-Id: Ia22499d5681213017b09eac818f4f57e1fba2885
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196485
Reviewed-by: Erik Ernst <eernst@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2021-04-22 13:40:48 +00:00
Sergey G. Grekhov 2988d39d59 [co19] Enables slow tests on dartdevk and dartdevc
Change-Id: Id44d372ed90c54523c9dde4659b4776923dfcadf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196488
Reviewed-by: Erik Ernst <eernst@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2021-04-22 13:40:46 +00:00
Paul Berry e3443b9f53 Flow analysis: implement "why not promoted" for binary/unary operator target.
Bug: https://github.com/dart-lang/sdk/issues/44898
Change-Id: If464a54bdb63fc661db312df5dc10f108049286a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196240
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-04-22 12:21:46 +00:00
Irina Arkhipets 6645753681 [co19] Tests skipped for analyzer
Change-Id: I8c54082c937b28a74500740a0576f4b29c8989f3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196325
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2021-04-22 10:37:36 +00:00
Emmanuel Pellereau 335f55a601 Revert "Optimize js_util setProperty calls for non-function value types."
This reverts commit 853597a978.

Reason for revert: Breaks google3 (b/186088197)

Original change's description:
> Optimize js_util setProperty calls for non-function value types.
>
> No change in the generated JavaScript for dart2js base on a sample
> foo.dart file and tests/lib/js/js_util/properties_test.dart
>
> Bug: #44533
> Change-Id: Ib6866fa7fca1f13b03c75dd4f1eac904b18811e3
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193838
> Reviewed-by: Sigmund Cherem <sigmund@google.com>
> Commit-Queue: Riley Porter <rileyporter@google.com>

TBR=sigmund@google.com,srujzs@google.com,rileyporter@google.com

Change-Id: I3f08d29e2d6a1a7846b8d67fadc314ad947f54cf
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: #44533
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196484
Reviewed-by: David Morgan <davidmorgan@google.com>
Commit-Queue: David Morgan <davidmorgan@google.com>
2021-04-22 09:27:29 +00:00
Riley Porter 853597a978 Optimize js_util setProperty calls for non-function value types.
No change in the generated JavaScript for dart2js base on a sample
foo.dart file and tests/lib/js/js_util/properties_test.dart

Bug: #44533
Change-Id: Ib6866fa7fca1f13b03c75dd4f1eac904b18811e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193838
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Riley Porter <rileyporter@google.com>
2021-04-21 19:01:11 +00:00
Paul Berry b6fbee21d9 Flow analysis: additional "why not promoted" test cases.
These test cases already work properly, but they weren't previously
covered by tests.

Bug: https://github.com/dart-lang/sdk/issues/44898
Change-Id: I4fc6506230af203a361631afc542e0db08bd6f27
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196106
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-04-21 13:38:20 +00:00
David Morgan d8479de94b Revert "Stop reporting StrongModeCode.TOP_LEVEL_INSTANCE_GETTER"
This reverts commit 649f7cf689.

Reason for revert: Breaks google3: b/185875256

Original change's description:
> Stop reporting StrongModeCode.TOP_LEVEL_INSTANCE_GETTER
>
> Change-Id: I947e1edb042825a5cfc3394d2554ad3272f86b91
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195302
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: Ic019fa570f048e213290ac04d02d1b4655415b47
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196282
Reviewed-by: David Morgan <davidmorgan@google.com>
Commit-Queue: David Morgan <davidmorgan@google.com>
2021-04-21 10:22:18 +00:00
Lasse Reichstein Holst Nielsen 88a351f3d2 Make throwing Zone.uncaughtError handlers propagate the error to their parent zone.
Avoids infinite recursion when the uncaught error is handled by the same,
potentially still failing, uncaught error handler.

Bug: https://github.com/dart-lang/sdk/issues/45616, https://github.com/dart-lang/sdk/issues/45617
Change-Id: I60ee0f1220b7345f4a41e1f1b323b8da47ed326e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194402
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Auto-Submit: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2021-04-21 07:52:58 +00:00
David Morgan d46cc75617 Revert "Issue 45672. Report constant errors when null value where non-nullable type is expected."
This reverts commit 9abc59e74c.

Reason for revert: Breaks google3: b/185915025

Original change's description:
> Issue 45672. Report constant errors when null value where non-nullable type is expected.
>
> Bug: https://github.com/dart-lang/sdk/issues/45672
> Change-Id: I9d006955523bf470c762fde57444e3596e4dccae
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196042
> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>

TBR=scheglov@google.com,brianwilkerson@google.com

Change-Id: I0b16cf82414623a2fbda17813aeb0c24f080e568
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/45672
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196281
Reviewed-by: David Morgan <davidmorgan@google.com>
Commit-Queue: David Morgan <davidmorgan@google.com>
2021-04-21 06:44:41 +00:00
Paul Berry add079c222 Flow analysis: Fix test function name.
In a previous commit, I accidentally named these test functions
`test`.  Replace with a more descriptive name.

Bug: https://github.com/dart-lang/sdk/issues/44898
Change-Id: I662b6003a893dbb05fea88000f39e4e56b0cb725
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196107
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-04-20 21:59:18 +00:00
Kallen Tu 95229aa779 [cfe] Map [] operator enabled for const functions.
Change-Id: I19b0980fc100b3cd19da1875ec9fb08cdd1de70b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195620
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2021-04-20 20:19:18 +00:00
Paul Berry 5662ce3813 Add test runner support for context messages without location information.
The CFE implementation of "why not promoted" functionality for
non-promotion of `this` doesn't associate the context message with any
location information, because there is no relevant location to cite.
For example, the output can look like this:

    tests/language/why_not_promoted/this_error_test.dart:16:10: Error: Property 'isEven' cannot be accessed on 'int?' because it is potentially null.
    Try accessing using ?. instead.
        this.isEven;
             ^^^^^^
    Context: 'this' can't be promoted.
    See http://dart.dev/go/non-promo-this

The test runner assumes that all messages have a location, so it
wasn't picking up on this context message at all.  This CL avoids the
problem by having the test runner associate any location-less context
message with the error above it.

(Note that the analyzer doesn't have this problem; all of its context
messages have locations).

Change-Id: Ied52daa8b0090f28617e7d3784233aa44dcc897a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195301
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-04-20 18:46:38 +00:00
Konstantin Shcheglov 9abc59e74c Issue 45672. Report constant errors when null value where non-nullable type is expected.
Bug: https://github.com/dart-lang/sdk/issues/45672
Change-Id: I9d006955523bf470c762fde57444e3596e4dccae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196042
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-04-20 17:54:10 +00:00
Konstantin Shcheglov 649f7cf689 Stop reporting StrongModeCode.TOP_LEVEL_INSTANCE_GETTER
Change-Id: I947e1edb042825a5cfc3394d2554ad3272f86b91
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195302
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-04-20 04:53:39 +00:00
Kallen Tu 2d330c7985 [cfe] String [] operator for const functions.
Change-Id: Ia1ad96cd77d94c096bf8a10aa0377f37c79ed398
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195560
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
2021-04-19 17:17:48 +00:00
Xiao Yu d968304570 Reland "Revert commits part of #40548 which still has some design debates and breaks valid local network http traffic"
This is a reland of d84f359786

Original change's description:
> Revert commits part of #40548 which still has some design debates and breaks valid local network http traffic
>
> Bug: https://github.com/flutter/flutter/issues/72723
> Change-Id: Ib5f809fccf1fad69add441fd40c463da8dc8be36
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192953
> Auto-Submit: Xiao Yu <xster@google.com>
> Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
> Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
> Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>

Bug: https://github.com/flutter/flutter/issues/72723
Change-Id: I466d888b3f324a996f0bef0463e7ab3df3179c56
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195485
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Xiao Yu <xster@google.com>
2021-04-16 20:25:36 +00:00
Kallen Tu 2ab4ef2a13 [cfe] AbortStatus in return statements in constant evaluator.
Change-Id: I2b11774a43b9aa741ada913405154b3abbcf420f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195400
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2021-04-16 17:56:16 +00:00
Dmitry Stefantsov 025bcc486d [cfe] Use the supertype locations when reporting errors
Closes #45626.

Bug: https://github.com/dart-lang/sdk/issues/45626
Change-Id: I672efb0bba516534151630e6627959e0971840e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195515
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2021-04-16 15:49:12 +00:00
Erik Ernst cf7bfc5d3c Fix corelib/type_tostring_test.dart
Change-Id: I6eb9c6ca54bb4f00bfd1011d10f291ea5f672972
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195508
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2021-04-16 07:33:57 +00:00
Nicholas Shahan 8e2539d24c [ddc] Fix equality tests for Functions
Marks `Function` as an extensible type so that DDC knows to use the
symbolized version of the equals operator.

The `Function` class at runtime already has its equals method attached
as the "symbolized" version. Consider `a == b`. When DDC knows `a` is
statically a raw `Function` and non-nullable (more likely with sound
null safety) the generated code should call the symbolized equals
member ex: `a[$_equals](b)`. Without this change the generated code
would be `a.equals(b)` and fail at runtime because the method does
not exist.

With this change co19_2/LibTest/core/Function/operator_eq_A01_t01
starts passing.

Change-Id: I80dd2abbbb04f1b7ab7e21dd14561a45f6e81459
Fixes: https://github.com/dart-lang/sdk/issues/45601
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194204
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2021-04-15 22:02:07 +00:00
Paul Berry 0ccb2771a3 Analyzer: change extent for assignability errors with named arguments
Previously, if a type mismatch occurred on a named argument, e.g.:

    int.fromEnvironment('foo', defaultValue: 'BAD')

the error would be reported on the entire NamedExpression
(`defaultValue: 'BAD'` in this example).  Now, the error is just
reported on the expression (`'BAD'` in this example).  This makes the
analyzer behavior more self-consistent (since now assignability errors
are now consistently reported at the site of the expression that can't
be assigned).  It also makes the analyzer behavior more consistent
with the CFE.

This will make it possible, in a follow-up CL, to eliminate a lot of
the inconsistencies between analyzer and CFE in the "why not promoted"
ID tests.

Change-Id: I17db256959d730a22a5766f65d5c0736b627f244
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195489
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-04-15 21:38:37 +00:00
Xiao Yu f560d90059 Revert "Revert commits part of #40548 which still has some design debates and breaks valid local network http traffic"
This reverts commit d84f359786.

Reason for revert: removed some private looking but actually vm-entrypoints used by Flutter engine https://buganizer.corp.google.com/issues/185462669

Original change's description:
> Revert commits part of #40548 which still has some design debates and breaks valid local network http traffic
>
> Bug: https://github.com/flutter/flutter/issues/72723
> Change-Id: Ib5f809fccf1fad69add441fd40c463da8dc8be36
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192953
> Auto-Submit: Xiao Yu <xster@google.com>
> Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
> Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
> Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>

TBR=lrn@google.com,vegorov@google.com,xster@google.com

Change-Id: Ie746805ab7ef214bc4ba6f3582eb1d32672360ee
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/flutter/flutter/issues/72723
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195484
Reviewed-by: Xiao Yu <xster@google.com>
Commit-Queue: Xiao Yu <xster@google.com>
2021-04-15 15:29:28 +00:00