Commit graph

22137 commits

Author SHA1 Message Date
Kallen Tu 2083db9cdb [cfe] Emit error for mixing in class outside of its library except mixin classes.
It is an error to mix in a class declaration that does not have the 'mixin' modifier, outside of its library for class declarations in a library version lower than sealed class' release version.

Change-Id: I318bb243705748eae60482b6c3513669f1cbb90c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275440
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2022-12-29 21:26:00 +00:00
Daco Harkes 29a3e27e6f [tests/ffi] Switch over Android & QEMU to nnbd tests
This CL switches over the bots that are manually configured to
run the `ffi_2` test suite to the `ffi` test suite instead.
This changes these tests from legacy to nnbd mode.
The suites being converted are the Android and QEMU FFI tests.

This CL does _not_ switch over the bots that run the default suites.

This CL also skips all FFI tests that use the Dart API symbols on
Windows precompiled. These tests will never work in that mode and
should be skipped instead.

Analysis of FFI test bots: go/dart-ffi-legacy-test-turndown

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

Change-Id: I4e21ad5a036b83d8240fc662ed1c159305f2e297
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64c-try,vm-ffi-android-product-arm-try,vm-ffi-android-product-arm64c-try,vm-ffi-android-release-arm-try,vm-ffi-android-release-arm64c-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-precomp-ffi-qemu-linux-release-riscv64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277521
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
2022-12-27 15:18:59 +00:00
Ryan Macnak cb478b21f4 Don't mutate argument to dart:developer's postEvent.
Bug: https://github.com/dart-lang/sdk/issues/50713
Change-Id: Iadc3eb0b4306d7500a03bd77b8b6dc3c19227200
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275984
Commit-Queue: Dan Chevalier <danchevalier@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2022-12-22 23:10:13 +00:00
Kallen Tu d968d14314 [analyzer/cfe] Use the 'class-modifiers' flag for the 'mixin' class modifier.
Separating the class modifiers from the 'sealed' modifier.

Change-Id: Ifec865c9f612b147706be9b7c797167ef6788e90
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277043
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2022-12-22 17:49:58 +00:00
Jackson Gardner ce741bb017 [dart2wasm] Emit closures and contexts for subexpressions of asserts.
Change-Id: Ibe0741d360caa4747ad4a3eea888b1a9661af111
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277050
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Jackson Gardner <jacksongardner@google.com>
2022-12-22 16:27:39 +00:00
Jackson Gardner 061a9fbefb [dart2wasm] Add --enable-asserts flag.
Change-Id: I4cc9a55673374926e8b19cccf2be9888f166553d
Bug: https://github.com/dart-lang/sdk/issues/50801
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276772
Commit-Queue: Jackson Gardner <jacksongardner@google.com>
Reviewed-by: Jackson Gardner <jacksongardner@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2022-12-21 19:53:14 +00:00
Brian Quinlan 9b2b9df09e [io] Remove incorrect docs that listSupport is not available on Android.
Bug:https://github.com/dart-lang/sdk/issues/47894
Change-Id: Id79a37f5ba6a8118a30d2297c95cff5a7ca1a03f
TEST=unit
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276660
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2022-12-21 00:23:02 +00:00
Nate Biggs 398d47cd10 [dart2js] Add priority to dartDeferredLibraryLoader hook.
Change-Id: Ib77b20fc56aa67b4f3318f9dcd8fa65b62c56509
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275800
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-12-20 15:39:09 +00:00
Abitofevrything bc8606c34e [io/websocket] Cancel ping timer when WebSocket closes
Closes https://github.com/dart-lang/sdk/issues/50517

Change-Id: I04ea0f1b79e49aeab6c5fd049460335f0d02253e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274544
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2022-12-20 01:01:16 +00:00
Josh Soref 17ccbecc61 Spelling tests language
Closes https://github.com/dart-lang/sdk/pull/50763

GitOrigin-RevId: ee6187bc11c8211402b6aa722eb2c0826cba3d5b
Change-Id: I598004024a89e25710b9f16749ffb7c6fd6753c2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276340
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2022-12-19 16:30:06 +00:00
Josh Soref a8cb0b4f98 spelling: compliance
Closes https://github.com/dart-lang/sdk/pull/50762

GitOrigin-RevId: e85b436a4cb108176273ffeffd96cc4ba84df444
Change-Id: I391df2dfb65c69c658965d9ebfd2d2314841044c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276320
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2022-12-19 13:22:28 +00:00
Josh Soref df97aca1fa Spelling tests
Closes https://github.com/dart-lang/sdk/pull/50764

GitOrigin-RevId: ee2fe9a75d50e877f4ad2fe3743acdbc04f186ef
Change-Id: Ia73cd22da4e6ec95e84772aa4e1345ce2dbde215
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276360
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2022-12-19 12:56:47 +00:00
Riley Porter b6388f2ea0 [JS interop] Expose more JavaScript operators in js_util
Exposes helper functions in js_util to access the JavaScript operators
`delete`, `||`, `&&`, `!`, `!!`, and `typeof`.
Change-Id: I0676b143aa004c7b4ed1c6b695b8d1e78a60778d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276028
Commit-Queue: Riley Porter <rileyporter@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2022-12-17 00:31:27 +00:00
Nicholas Shahan d0d2e2591f [3.0 alpha][test] Remove use of NullThrownError
Change-Id: Ia28b44a9acdcb9a38ebb101029dc50b58d272b23
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275786
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2022-12-15 23:33:18 +00:00
Lasse R.H. Nielsen 2274ce9b05 Retire experiment flags introduced in 2.18.
Change-Id: I660bbf09c758f88589a10b0334ddd34c0620460d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275244
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Michael Thomsen <mit@google.com>
2022-12-15 13:18:50 +00:00
Michael Thomsen e4cc3c98e5 [3.0 alpha] Remove deprecated dart:core List() constructor.
TEST=ci

Bug: Contributes to https://github.com/dart-lang/sdk/issues/49529
Change-Id: Ic129ef2d89f625d9ec6a7a1c301cffddd60b2ff7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258920
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Michael Thomsen <mit@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2022-12-15 11:36:22 +00:00
Alexander Markov 7ebd4dd61c [3.0 alpha] Remove deprecated public class CyclicInitializationError
This deprecated class cannot be removed just yet because
we still need to throw something in case of cyclic initialization
in Dart legacy libraries (which are still supported).

Class CyclicInitializationError is copied for each implementation
(VM, dart2js and DDC) and made private. Each implementation now has
an independent private class which can be removed separately.

TEST=ci
Issue: https://github.com/dart-lang/sdk/issues/49529
Change-Id: I8100bbe16636c12c4cbabbb5fe770f4c648c4249
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275120
Commit-Queue: Michael Thomsen <mit@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2022-12-15 11:20:58 +00:00
Ryan Macnak 98af4110ad [vm] Increase supported range of TypeParameters to 16 bits.
TypeParameter::set_index was already asserting for 16 bits but silently truncating to 8 bits. The size of TypeParameter does not increase due to allocation rounding.

Add explicit range check to class finalization.

TEST=ci
Change-Id: Id4017f74b7dba47b00d64e77e787712c70290dac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275560
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-12-14 23:34:18 +00:00
Nicholas Shahan faf8027465 [tests] Update expectation to TypeError
TypeError is now expected in the place of NullThrownError which is
being removed in Dart 3.0.

Change-Id: Ibb7188d993216067650d4b994a303f2bcd1d2298
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275742
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2022-12-14 21:37:27 +00:00
Sam Rawlins a5392b932b Re-categorize all SDK_VERSION_* codes as StaticWarningCode
Change-Id: If7a83f9f3258ce369dbe3142fcd5c088d6d88e40
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275160
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2022-12-14 16:14:38 +00:00
Kallen Tu 120bfdc076 [analyzer/cfe] Parse 'mixin class' behind sealed flag.
Allow 'mixin class' modifier which allows a class to be used as a mixin.
https://github.com/dart-lang/language/blob/master/working/base-interface-final/feature-specification.md

Change-Id: I6b4dac75f2ff09b7ef833c5e015b1baf7fa3883b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275144
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2022-12-14 15:41:58 +00:00
Ömer Sinan Ağacan 0bb3b53194 [tests] Update a test for dart2wasm
The test stacktrace_current compares two stack traces by masking any
line numbers.

With dart2wasm, V8 shows function offsets instead of line numbers, in
hex, which causes the test to fail with unrelated changes.

This updates the regex to mask hex numbers as well, making the test
stable with unrelated dart2wasm changes.

Change-Id: I8dd951d4bf29fe39b6ec5d8de7bf2c9c37a5b5b3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275600
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2022-12-14 13:41:46 +00:00
Jackson Gardner 1306a4c284 [dart2wasm] Add intrinsics for bitwise operations on booleans.
Change-Id: Ic09545535c954d72615ca035ed1b133fada5d733
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275080
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Jackson Gardner <jacksongardner@google.com>
2022-12-13 23:07:40 +00:00
Kallen Tu 93c3737674 [tests] Allow using classes as mixins within the same library and update a few language tests.
Change-Id: I4488b3ee7d04fe3a9c34ee3046f96e73984c0541
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274602
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2022-12-13 18:29:58 +00:00
Daco Harkes c3fce2f559 [test/ffi] Free pointer allocated via malloc
Closes: https://github.com/dart-lang/sdk/issues/50705
Change-Id: I96d0bdf5e7fe95b8841d9c7ba3db8e785574222e
Cq-Include-Trybots: luci.dart.try:vm-kernel-asan-linux-release-x64-try,vm-kernel-precomp-asan-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275260
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2022-12-13 16:41:47 +00:00
Dan Chevalier fd6fa010ec [ VM Service / DDS ] Add custom service stream support (Revised)
NOTES:
Original CL: https://dart-review.googlesource.com/c/sdk/+/274061
Revert CL: https://dart-review.googlesource.com/c/sdk/+/274802

Regression tests that failed after merging Original CL:
- https://ci.chromium.org/ui/p/dart/builders/ci.sandbox/pkg-mac-release/24046/overview
- https://ci.chromium.org/ui/p/dart/builders/ci.sandbox/pkg-mac-release-arm64/5999/overview

----------
DESCRIPTION:
Setting the `stream` parameter on `developer.postEvent` will now forward those events to a custom stream inside DDS.


The first use of this will be for widget inspection. A navigation event will be posted to a custom stream. Our IDE DAP can listen for the Event and react to it by navigating to the desired location in the code.

TEST=Made sure that regression from original PR could be reproduced, and then resolved by applying this change. Updated observatory tests. Created new developer test to check assertions. Added DDS tests for new custom stream behaviour. Manually tested the postEvent and StreamListen with multiple clients

https://github.com/flutter/devtools/issues/4533

Change-Id: I2b04a84b4daf11dd9d72f899928b5e1f62a5ae02
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275121
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2022-12-13 16:31:37 +00:00
Erik Ernst 010b3dff91 Update type variable cases in the regression_49396_test
The definition of flatten was adjusted in
https://github.com/dart-lang/language/pull/2696
such that it better preserves the type information when the type of `e`
in `await e` is a type variable. This CL changes the test to expect
the behavior of the newly specified flatten.

The test has been renamed to 'await_flatten_test.dart'.

Change-Id: Iaf67a53cd3cd181bcb3eb6e85beca7cc1af4d34a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274682
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
2022-12-13 15:39:40 +00:00
Ryan Macnak de310a0c7b [vm, compiler] Fix address encoding limit when loading type arguments.
TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/50671
Change-Id: I3a5ab9492d74fa770efd8e4c7cf90002a3793b9a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275081
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2022-12-12 23:23:53 +00:00
Daco Harkes e3e355e16a [vm/ffi] Fix FfiTrampolineData GC bug
This lets the GC visit FfiTrampolineData::c_signature again.

https://dart-review.googlesource.com/c/sdk/+/272201 stopped adding
FfiTrampolineData::c_signature to snapshots. However, instead of
skipping it manually in app_shapshot.cc, we skipped it in
raw_object.h, which also caused the GC to skip it.
This CL adds it back in as we need it in JIT snapshots. This way we
keep it consistent between AOT/JIT snapshots.

TEST=tests/ffi/regress_b_261224444_test.dart

The c signatures of FFI trampolines were not properly traced in the
precompiler, causing us to hit an assert when the classes mentioned in
those types where only referenced from a signature and not retained
for any other reason.

TEST=tests/ffi/native_assets/process_test.dart (dartkp)

Closes: https://github.com/dart-lang/sdk/issues/50678
Bug: b/261224444
Change-Id: I84fc880744c2045ea3e2ef4f37df454b80b2faeb
Cq-Include-Trybots: luci.dart.try:vm-precomp-ffi-qemu-linux-release-arm-try,vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64c-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-reload-linux-debug-x64-try,app-kernel-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64c-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-nnbd-linux-debug-x64-try,vm-kernel-linux-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274387
Reviewed-by: Martin Kustermann <kustermann@google.com>
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2022-12-12 15:46:33 +00:00
Lasse R.H. Nielsen 767049139a [3.0 alpha] Remove deprecated dart:core apis
- Remove `proxy` and `Provisional` annotations.
  - Remove `Deprecated.expires` getter.

Change-Id: I4521b48bb92e5f8420c778686f4efa9c6426cebb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258004
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Michael Thomsen <mit@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2022-12-12 11:46:58 +00:00
Dan Chevalier 3ed65601b0 Revert "[ VM Service / DDS ] Add custom service stream support"
This reverts commit 4981cbffe2.

Reason for revert: Mac regression test failed.

Original change's description:
> [ VM Service / DDS ] Add custom service stream support
>
> Setting the `stream` parameter on `developer.postEvent` will now forward those events to a custom stream inside DDS.
>
>
> The first use of this will be for widget inspection. A navigation event will be posted to a custom stream. Our IDE DAP can listen for the Event and react to it by navigating to the desired location in the code.
>
> TEST=Updated observatory tests. Created new developer test to check assertions. Added DDS tests for new custom stream behaviour. Manually tested the postEvent and StreamListen with multiple clients
>
> https://github.com/flutter/devtools/issues/4533
>
> Change-Id: I870dc634c9a9a7d2ee3a6605319c2a18517ad197
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274061
> Reviewed-by: Ben Konyi <bkonyi@google.com>
> Commit-Queue: Dan Chevalier <danchevalier@google.com>

TBR=bkonyi@google.com,dart-scoped@luci-project-accounts.iam.gserviceaccount.com,danchevalier@google.com

Change-Id: Ia1dce25444a6329c0553c931c9a6dbbec65ee583
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274802
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Dan Chevalier <danchevalier@google.com>
2022-12-12 11:24:37 +00:00
Michael Thomsen b3304af17d [3.0 alpha] Remove deprecated onError API on int.parse, double.parse, and num.parse
Change-Id: I9ed24c380bf716cb893b99ba228e34f4671cc8fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/259042
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2022-12-12 09:54:54 +00:00
Michael Thomsen 4028b9b0fe [3.0 alpha] Remove deprecated NoSuchMessageError API
Contributes to https://github.com/dart-lang/sdk/issues/49529

Change-Id: I2cef41b991c59869f606235929347449e17022cf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/271082
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2022-12-12 09:48:05 +00:00
Chloe Stefantsova a46de1c30c [cfe] Add implicit null-check on throw
Throwing `null` is not supported in sound null safety. This change
inserts an implicit `as Object` cast that result in a TypeError, rather
than a NullThrownError, in sound mode.

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

TEST=Covered by the existing tests

Change-Id: I041baf95becd2df1b940fdff7cde398a4e391ee7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247546
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2022-12-12 00:48:13 +00:00
Dan Chevalier 4981cbffe2 [ VM Service / DDS ] Add custom service stream support
Setting the `stream` parameter on `developer.postEvent` will now forward those events to a custom stream inside DDS.


The first use of this will be for widget inspection. A navigation event will be posted to a custom stream. Our IDE DAP can listen for the Event and react to it by navigating to the desired location in the code.

TEST=Updated observatory tests. Created new developer test to check assertions. Added DDS tests for new custom stream behaviour. Manually tested the postEvent and StreamListen with multiple clients

https://github.com/flutter/devtools/issues/4533

Change-Id: I870dc634c9a9a7d2ee3a6605319c2a18517ad197
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274061
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Dan Chevalier <danchevalier@google.com>
2022-12-09 20:18:30 +00:00
Michael Thomsen 9f2a622d79 [3.0 alpha] Update CFE messages for Dart 3 sound null safety by-default
Fixes https://github.com/dart-lang/sdk/issues/50638

Change-Id: I511c5337099ae9576377ac8a82ef1bb78f6d34b1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273844
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Michael Thomsen <mit@google.com>
2022-12-09 16:55:03 +00:00
Sigmund Cherem c91b73eaf7 [3.0 alpha] Remove dart:html's deprecated document.registerElement & registerElement2 APIs
Change-Id: I07fc124c55d1aeb678f39a4d72d3b4f581025a10
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273541
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2022-12-09 16:02:02 +00:00
Nicholas Shahan f0c270e96d [ddc] Temporarily skip tests that timeout
The timeouts are crashing the test infra when trying to deflake
the failures and preventing more results from getting uploaded.

These tests are timing out right now on the canary bot because
support for the new runtime types hasn't been fully landed. They
should be enabled again after all the support has landed and
should have results at parity with the non-canary configurations.

Change-Id: Ia8814c02445acccb906c4b376c82da88480155b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274483
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2022-12-09 02:29:31 +00:00
Alexander Aprelev fb22336c28 [vm/sse41] Fix use of pextrd when sse41 is not available.
BUG=https://github.com/dart-lang/sdk/issues/50640
TEST=ci

Change-Id: Ief12c270cb59dace99e3a2845cb44ed5085dbdaf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274081
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2022-12-08 23:29:14 +00:00
Kallen Tu b58f1b4ef3 [analyzer] Report error when mixing in a sealed mixin outside of its library.
Change-Id: I62be6c21bc2bf2a5af35203137aa75c7fd1ba934
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274142
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2022-12-08 21:18:24 +00:00
Ryan Macnak 0150cddace [vm] Fix call-through-getter runtime handling.
This should look for `dyn:call` instead of `call`. If it was a non-dynamic call, we would hit an invoke-field-dispatcher instead.

TEST=ci
Bug: https://github.com/flutter/flutter/issues/116405
Change-Id: I98c441fec2eb53ab23ac1dd52db3aa4eaa5cbc6d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274265
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-12-08 17:48:49 +00:00
Aske Simon Christensen ad06d73ace [dart2wasm] Use a flat index space for function type parameters
The current two-level indexing scheme for function type parameters
(depth and index) breaks down in the case of type substitution when
the substituted type is a generic function type, since its internal
type parameter types have been encoded assuming that the function type
had nesting depth zero, but after substitution its nesting depth can
be higher.

Relative indexing schemes such as De Bruijn indices will also not
work, since function type parameter types are constant types, and the
constant infrastructure assumes that the same constant always has the
same representation.

This change introduces a flat indexing scheme where function type
parameters are indexed using a single index which is independent of
the context in which the type parameter type appears. To avoid
collisions in the case of nested generic function types, every function
type has a type parameter offset, which conceptually shifts the
indexing range of its type parameters so it doesn't necessarily start
at zero.

Looking up a function type parameter in its environment thus involves
searching outwards until a function type is found whose type parameter
index range contains the index encoded in the function type parameter
type.

Change-Id: I544056d52711ff829b170f78a7274a93871825a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272361
Reviewed-by: Joshua Litt <joshualitt@google.com>
2022-12-08 13:54:57 +00:00
Aske Simon Christensen f72f2e92d5 [dart2wasm] Re-enable async tests that no longer time out
Issue: https://github.com/dart-lang/sdk/issues/50122

Change-Id: I311c7a709e74381c84cb9c42cceb3d5c9cde4d61
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/267960
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2022-12-08 13:43:41 +00:00
Srujan Gaddam 293ae7dabe [ddc] Add interop classes for static members
Fixes https://github.com/dart-lang/sdk/issues/46967

Creates classes for non-external factories and static members, and
modifies invocations to point to these members instead. Tear-offs of
interop constructors (external or otherwise) are now supported since
they're just non-external static methods.

Change-Id: Id754fb4bc872051a8df4169aefd4bdc078452fb5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/270501
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2022-12-08 04:57:50 +00:00
Konstantin Shcheglov fd30c4f269 Report XYZ_FROM_DEFERRED_LIBRARY during constant evaluation.
Change-Id: I3cf2fa1dfcee3d9a2ddc6d506465d26a40181524
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274141
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-12-08 00:19:34 +00:00
Alexander Markov 66f1dee48c [vm] Runtime type check in await
'await e' should check that e is a Future<flatten(S)>, where S is a
static type of e before awaiting e. If e is not a Future<flatten(S)>,
then 'await e' should await Future.value(e) instead of e. So futures
of incompatible type are not awaited and soundness is not violated.

TEST=tests/language/async/await_type_check_test.dart
(Based on https://dart-review.git.corp.google.com/c/sdk/+/267422.)

Fixes https://github.com/dart-lang/sdk/issues/50529
Part of https://github.com/dart-lang/sdk/issues/49396

Change-Id: Ia418db1be6736710abc9be87d95584c50cbc677e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273002
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2022-12-07 22:46:22 +00:00
Kallen Tu 7ff20a67ca [analyzer] Report error when subtyping a sealed class outside of its library.
Change-Id: Iee6c9120d096ed49592ca3d155c81c876ceb5c34
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273832
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2022-12-07 22:00:28 +00:00
Martin Kustermann 4be2981c2d [vm/ffi] Ensure there's a single Function object per ffi-callback + exceptional-return combination
Right each `Pointer.fromFunction()` invocation will lead to creation of
a new ffi trampoline function & it's following JITed code. In AOT we
have exactly one ffi trampoline per target/native-signature/exceptional-return
combination.
=> This CL ensures we have only one such function.

Furthermore each `Pointer.fromFunction()` will currently perform 2
runtime calls in JIT: One to create a `Function` object, the other to
JIT that function & register callback metadata.
=> This CL ensures we won't do a runtime call to get a function, instead
   do it at compile-time (as in AOT)

Furthermore we eagerly assign a callback-id to the unique/deduped ffi
trampoline callbacks. Only when the application requests a pointer, do
we populate metadata on the `Thread` object.

This CL doesn't (yet) change the fact that in JIT mode we have
isolate-specific jit trampolines (that will call now shared ffi trampoline
functions).

We also avoid baking in C++ runtime function pointers in generated
code. As a result we can now preserve ffi trampolines across AppJIT
serialization.

As a nice side-effect, we remove 100 lines of code.

TEST=ffi{,_2}/ffi_callback_unique_test

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

Change-Id: I458831a47b041a088086f28f825de2a3849f6adc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273420
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2022-12-07 20:47:13 +00:00
asiva e70e2bc1b7 [Dart 3.0 alpha] Fix some test issues (legacy mode argument not passed in)
TEST=ci

Change-Id: Iebb31a509b99837e41cf3823ca366c1560777af6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273920
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2022-12-06 19:34:47 +00:00
asiva 606a64a743 [3.0 alpha][VM/Runtime] - Flip flag to make strong null safety the default.
- Flip flag to make strong null safety the default
- Remove code that auto detects null safety mode from source files,
  it is necessary to specify --no-strong-null-safety to opt out.
- Retains sniffing of AOT/JIT snapshots and kernel files to determine
  null safety mode, the opt out has to be done when generating these
  file.

TEST=ci

Change-Id: If2c9608eedb7c46d9c3cd85e261ee9640e0d28eb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261140
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-12-06 04:04:23 +00:00