Commit graph

10600 commits

Author SHA1 Message Date
Srujan Gaddam 8c62ad7596 [pkg:js] Validate createStaticInteropMock
This revisits the validation after the redesign. The changes from
before the redesign include:
- Accounting for multiple extensions on @staticInterop classes
- Users can implement any of the extension members for a given
export name, with the exception that if there is a getter/setter
pair, both should be implemented if any one of them are
- Since this validation goes on top of exports, the Dart class
needs not be processed, and we use the same export creation process
to create the mock

Change-Id: I05a7cff765d6d37d3955dd93676e2d55d2b201b3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262862
Reviewed-by: Riley Porter <rileyporter@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-10-24 17:37:09 +00:00
Srujan Gaddam 7f93985005 [pkg:js] Add validation for @JSExport and createDartExport
Creates an external createDartExport function in js_util.

Adds a number of checks for the annotation:
- Classes with the annotation should not have value in the annotation
- Classes with the annotation should have at least one instance member
somewhere in the hierarchy
- There are no export name collisions that are unresolvable accounting
for overrides
- Members with this annotation are instance members with a body only

Also adds checks to createDartExport:
- Checks that the type is a Dart class
- Checks that the type is marked as exportable

Change-Id: I52f27275966e9603e88921ce7897b7615178c4d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/259511
Reviewed-by: Riley Porter <rileyporter@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-10-24 17:37:09 +00:00
Srujan Gaddam 877713882c [pkg:js] Add @JSExport annotation
For use with createDartExport. Adds comments describing the basic
use of this annotation.

Change-Id: I7744b6732054e845bf405c2d64e7e458c36deab7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260742
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Riley Porter <rileyporter@google.com>
2022-10-24 17:37:09 +00:00
Kallen Tu 3fe9cb8bae Fix unhandled exception in _HttpClientConnection after removing dynamic.
Change-Id: If838ce8f479986a488eb38b90b381c78956f5f6d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/265188
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
2022-10-24 16:03:39 +00:00
Kallen Tu a5ad599cf0 Reland "Cast errors to HttpExceptions and add lint to convert to tidy up dynamic calls in core libraries."
`catchError` in http_impl also handles SocketExceptions.

Change-Id: I865bdd6bde4272f6cb657a86a1c78734e4ee331c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/263183
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2022-10-21 18:28:23 +00:00
Joshua Litt a73e8c2cf2 [dart2wasm] Support unmodifiable typed data views.
Also wires up a couple of missing APIs for some of the simd lists.

Change-Id: I9da5be59bc3b4553cb27c570f9d7c0b98b10409b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264890
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-10-21 17:28:35 +00:00
Alexander Aprelev 8c0df46887 [vm] Better implementation of hashCode function.
With this cl hashCode function for integers which used to be identity function becomes `uint128_t hash = value * constant; hash ^= hash >> 64; hash ^= hash >> 32; hash &= 0x3fffffff`. Note that the hashCode has to stay the same across platforms(64-bit/32-bit).

This dramatically improves performance of integer HashSet/HashMap lookups when integers differ in higher bits only(see the issue referenced below).

AOT ARM64 benchmarks:
===
WordSolverIdentity -3.630% (-0.9 noise)
BigInt.parse.0064.bits 15.43% (0.9 noise)
BigInt.parse.4096.bits 40.80% (1.6 noise)
BigInt.parse.0256.bits 42.01% (2.3 noise)
BigInt.parse.1024.bits 50.91% (2.6 noise)
IntegerSetLookup.DefaultHashSet 549916% (14727.6 noise)
IntegerSetLookup.DefaultHashSet 597150% (55520.2 noise)
IntegerSetLookup.HashSet 846924% (78126.7 noise)
IntegerSetLookup.HashSet 791864% (107221.1 noise)
===

AOT x64:
===
Havlak -14.25% (-1.7 noise)
DartMicroBench.Int64Div -7.091% (-1.2 noise)
ObjectHash.manual.5 -9.541% (-0.8 noise)
AsyncLiveVars.LiveInt1 4.726% (0.8 noise)
IsolateJson.SendAndExit_Decode1MBx1 9.067% (0.8 noise)
SplayHarderLatency 4.629% (0.9 noise)
TypedDataDuplicate.Float64List.32.loop 35.01% (1.8 noise)
IntegerSetLookup.DefaultHashSet 627996% (124823.6 noise)
IntegerSetLookup.HashSet 1245362% (244705.3 noise)
===

JIT ARM64:
===
IntegerSetLookup.DefaultHashSet_Random 73.80% (1.2 noise)
IntegerSetLookup.DefaultHashSet 344999% (6202.9 noise)
IntegerSetLookup.HashSet 483731% (7845.7 noise)
===

JIT x64:
===
CollectionSieves-Set-removeLoop -6.294% (-0.9 noise)
Utf8Encode.ru.10M 59.11% (0.8 noise)
Utf8Encode.ru.10k 71.62% (0.9 noise)
Utf8Encode.zh.10M 53.93% (0.9 noise)
Utf8Encode.ne.10k 71.34% (0.9 noise)
Utf8Encode.zh.10k 72.52% (0.9 noise)
Utf8Encode.ne.10M 53.17% (0.9 noise)
IntegerSetLookup.HashSet_Random 27.80% (1.1 noise)
String.replaceAll.String.Zero 8.659% (1.2 noise)
IntegerSetLookup.DefaultHashSet_Random 96.20% (1.3 noise)
IntegerSetLookup.HashSet 481037% (18028.8 noise)
IntegerSetLookup.DefaultHashSet 454450% (31501.3 noise)
==

Fixes https://github.com/dart-lang/sdk/issues/48641
TEST=ci

Change-Id: Id982e4aa30cd1d6a63f93c73917a8b921ad464a3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258600
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2022-10-20 20:31:20 +00:00
Joshua Litt be1ae6a91b [dart2wasm] Implement simd types naively.
Change-Id: If1114351ead04cefe950f477b11e236f2fc6d614
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264886
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-10-20 17:56:25 +00:00
Lukas Klingsbo 6e4e12922a DateTime copyWith extension
This change has been discussed for 8+ years and it would of course be preferred
to be added as an instance method, but since that is a breaking change I added it as an extension as discussed here:
https://github.com/dart-lang/sdk/issues/24644#issuecomment-1241695835

Change-Id: Iebb9f300e449920ae8891abac88f30b271321661
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258541
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
2022-10-20 10:50:25 +00:00
Daco Harkes bf420ae138 [vm/ffi] Update DynamicLibrary.process() documentation
https://dart-review.googlesource.com/c/sdk/+/260760 added support for
Windows to `DynamicLibrary.process()` but forgot to update the dartdoc
comment.

Change-Id: Ic8533e4d1bb23009753bcdef446e2cfe49dea0f6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264940
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2022-10-20 10:32:44 +00:00
Lasse R.H. Nielsen 61741732f4 Avoid treating any / in a URI path as "non-simple".
Bug disabled optimization for a lot of URIs.

Bug: http://dartbug.com/50239
Change-Id: I783ce9ff2c73e82f765463425cb038e1e3ee46ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264862
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2022-10-20 08:43:41 +00:00
Joshua Litt ea541423d0 [dart2wasm] Perform some missing runtime type normalizations.
This CL also changes the runtime algorithm to fully substitute
interface type parameters before performing type checks. This change is unfortunate, but necessary so that normalization of types works as expected. In the longer term we should cache generated types to avoid redundant work.

Change-Id: I9441ccdea8c6a9ac598cae043937cf683616d227
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262821
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2022-10-18 17:36:41 +00:00
Joshua Litt 9277495661 [dart2wasm] Fix paths for snapshot.
Change-Id: I6b26b6171b35d22cdb706d96fdb0045eef7e7264
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264100
Commit-Queue: Alexander Thomas <athom@google.com>
Auto-Submit: Joshua Litt <joshualitt@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2022-10-18 09:25:33 +00:00
Sigmund Cherem 770c9d77c5 [typed_data] Fix breakage introduced in recent change.
This fixes a regression introduced by
https://dart-review.googlesource.com/c/sdk/+/254501. The change
accidentally excluded some  clauses. This was not detected by the
CFE (it should be a static error), and as a result unsound
optimizations were made by dart2js.

Fixes https://dart-review.googlesource.com/c/sdk/+/254501

Change-Id: Iff52cba277546f2a9fab3c2c2736410d272dad7e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264601
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2022-10-18 01:16:27 +00:00
Joshua Litt 78f95a427b [dart2wasm] Switch to using declared nullability in subtype check.
Change-Id: Id993392aad23dd5a6c03e84a21323ff529992c6f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/263146
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2022-10-17 23:07:27 +00:00
nullrocket 263b163f47 [dart2js] Exempt native SharedArrayBuffer from structured clone.
Ensure SharedArrayBuffer is exempt from the structured clone aglorithm.

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

Change-Id: I2e541e4e0e1f3b421f76a7ad9bb670b8d60f740f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255765
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2022-10-17 21:48:13 +00:00
Kallen Tu fee8a22c31 Clean up VM core libraries by removing dynamic invocations.
Tested: No new behaviour. Covered by prior tests.
Change-Id: I739649a53c3982b673b1144e3c5aa98cc75f98a1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/263042
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2022-10-17 21:22:50 +00:00
Ryan Macnak d2a43581a3 [io] Avoid serializing unwritten bytes in async I/O.
TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/50206
Change-Id: Ibe6c326578ec4a2ca90634714e4628c02a5e5bcc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264260
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-10-17 17:42:54 +00:00
Joshua Litt 18e41ef31c [dart2wasm] Trivial fix for Int8List.
Change-Id: I352b1d7522dfe2d3f4570e0f4a379ddf883d170a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264264
Auto-Submit: Joshua Litt <joshualitt@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2022-10-17 09:48:59 +00:00
Ahmed Ashour c8bda70c66 Remove nbsp
Fixes #50202

Change-Id: I67e2f02f49deaf1bd9dc1f32a35310704f4d921b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264120
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2022-10-17 08:18:49 +00:00
Ryan Macnak 11bf5d8632 [vm] Extend string optimizations to UnmodifiableUint8List.
The language now prevents third-party implementations of Uint8List, so a regular `is` check guarantees a VM implementation.

TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/50194
Change-Id: I8b414e9609fe2f682dfbb16495a9efb99ecdd11c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264080
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2022-10-13 23:10:47 +00:00
Ahmed Ashour be5fe7bfe8 [core] Better variable name in dartdoc
Fixes #50180

Change-Id: I47157b50b45af7b54eca1013109f90ff1bab6b35
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/263621
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2022-10-12 09:00:33 +00:00
Kallen Tu 446ee14abf Cast sockets that set _owner and read closedReadEventSent of _NativeSocket
Change-Id: I0d3b24f503dcb167dd039e47228a665ca3d38453
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262272
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2022-10-11 13:12:33 +00:00
Alexander Markov cf111fdcfb [vm,corelib] Restrict Expando/WeakReference usage for records
From records specification:
```
Like numbers, records do not have a well-defined persistent identity.
That means Expandos can not be attached to them.
```

This change updates Expando and WeakReference API documentation
and adds a check to disallow attaching Expando or WeakReference
to a record.

TEST=co19/LanguageFeatures/Records/expandos_A01_t01

Issue: https://github.com/dart-lang/sdk/issues/49719
Change-Id: I6459f43a2deac697e201673589d73abedc8d413e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/263420
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2022-10-10 16:10:28 +00:00
Ömer Sinan Ağacan 651d566124 [vm] Remove old TODO
The issue in TODO was closed: #48634

Change-Id: Ie4610a04e29aac64a447514cd6be463419f5e64b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/263381
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2022-10-10 10:42:54 +00:00
Kallen Tu 7e1890d78b Revert "Cast errors to HttpExceptions and add lint to convert to tidy up dynamic calls in core libraries."
This reverts commit 5b7bd563d3.

Reason for revert: Broke VM tests, not always HttpException.

Original change's description:
> Cast errors to HttpExceptions and add lint to convert to tidy up dynamic calls in core libraries.
>
> Change-Id: I7ea73b232d13baf84e834d742ebc16f2a081e727
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262626
> Commit-Queue: Kallen Tu <kallentu@google.com>
> Reviewed-by: Lasse Nielsen <lrn@google.com>
> Reviewed-by: Leaf Petersen <leafp@google.com>

TBR=lrn@google.com,leafp@google.com,kallentu@google.com,dart-scoped@luci-project-accounts.iam.gserviceaccount.com

Change-Id: I1777750c07b84b267d0b62dbfe93d54a6bfee7ae
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/263180
Reviewed-by: Leaf Petersen <leafp@google.com>
2022-10-07 20:11:57 +00:00
Kallen Tu 5b7bd563d3 Cast errors to HttpExceptions and add lint to convert to tidy up dynamic calls in core libraries.
Change-Id: I7ea73b232d13baf84e834d742ebc16f2a081e727
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262626
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2022-10-07 18:12:28 +00:00
Johnni Winther 51cf541243 [vm,wasm] Share more patch libraries
This shares patch libraries between vm and wasm.

The shared libraries are those previously shared as parts which
need private access to other patch libraries.

TEST=existing

Cq-Include-Trybots: luci.dart.try:dart2wasm-linux-x64-d8-try
Change-Id: I750a20de5a78362e84b87b2bfe1e5395ca4d3769
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262341
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-10-07 13:19:19 +00:00
Jackson Gardner 47dd60fed0 Refactor run_wasm.js into an ESM module that is reusable in the browser.
Change-Id: I1566febad2b4e1399f50bb923ad0596f04aa1a40
Cq-Include-Trybots: luci.dart.try:dart2wasm-linux-x64-d8-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262268
Reviewed-by: Joshua Litt <joshualitt@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Jackson Gardner <jacksongardner@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2022-10-07 03:09:39 +00:00
Kallen Tu b3e57bd2f7 Remove dynamic call in _JsonMap.
Change-Id: I73297a65a59aeefee9f170aa640b9d5d20e7bf9e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262271
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2022-10-06 18:12:02 +00:00
Ömer Sinan Ağacan 113f249e06 [dart2wasm] Implement null instance tear-offs
Fixes https://github.com/dart-lang/sdk/issues/50111

These tests now pass:

corelib/null_closurized_method_tostring_test
corelib/null_test
language/nnbd/static_errors/unchecked_use_of_nullable_cascaded_test/10
language/nnbd/static_errors/unchecked_use_of_nullable_test/14
language/nnbd/static_errors/unchecked_use_of_nullable_test/15
language/null/to_string2_test
language/null/to_string_test

Change-Id: Iba5152aa986df24cc96ee81854d9a538aa839e74
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262601
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2022-10-06 12:54:53 +00:00
Stephen Adams aaed0ce048 [dart2js] Add subtyping of record types against Record interface
- Fix bug with nullable record type, e.g. `(int,int)?`.

Change-Id: Ie8006e8ec3a9ffd675519df2ab7b4d101d8d5dcd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262843
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2022-10-05 21:56:07 +00:00
Stephen Adams edf0da2df4 [dart2js,js_runtime] Record type recipes and runtime subtype test
Change-Id: I54adb8b6184a19667a296a670fecb37d7ce9dce7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262126
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2022-10-05 16:48:01 +00:00
Joshua Litt 16d06dac06 [dart2wasm] Restore caller's zone when returning from await.
Change-Id: Ifd0013eb130ff98bf2127991b685258ced115824
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262480
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2022-10-05 16:37:59 +00:00
Joshua Litt fd39eab463 [dart2wasm] Build snapshot as part of the SDK.
Change-Id: Iea75c14b6709f2347fe82af2ef226a1ed068d8a6
Cq-Include-Trybots: luci.dart.try:dart-sdk-linux-try,dart-sdk-mac-arm64-try,dart-sdk-mac-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261502
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2022-10-05 11:55:22 +00:00
Johnni Winther 99f60a5e66 [cfe,vm] Support 'records' experiment in the sdk
This adds support for the experimental 'records' feature in the sdk
by settings its experimental release version to 2.19 and opting the sdk
into the feature the allowed_experiments.

Change-Id: I7a30212e5724e5d8ae3208f177103764b9aed737
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262760
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2022-10-05 09:00:30 +00:00
Kallen Tu ce7c036db2 Make _detachRaw an external method of Socket to avoid dynamic calls.
Change-Id: Iba40ba3b0f0defea7efa750688386c7fe21bbae7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261260
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2022-10-05 01:44:22 +00:00
Johnni Winther 5b2e23eab0 [cfe,vm,wasm] Handle private injected members like augmentations
This changes the way the CFE handled private injected members. Previously
these were "hidden" within the patch library in which they were declared.
Now they are, like with members injected in augmentation libraries, fully
integrated and accessible within the origin library and all its patches.

This change revealed that the vm and wasm platforms had some
inconsistently declared classes in which injected private members that
were not implemented by all implementing classes. For these, throwing
stubs have been added.

Cq-Include-Trybots: luci.dart.try:dart2wasm-linux-x64-d8-try
Change-Id: I330eade944964ef43b83aa416baef75e3649d023
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262340
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-10-04 14:43:43 +00:00
Chloe Stefantsova 1d768f3c75 Reland "Reland "[cfe,corelib] Add class 'Record' to the core library""
This is a reland of commit 4b6a8f35b9

Original change's description:
> Reland "[cfe,corelib] Add class 'Record' to the core library"
>
> Part of https://github.com/dart-lang/sdk/issues/49713
>
> Change-Id: I56bfca49492d14bb561b32993fd9adfe775b7400
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/259583
> Reviewed-by: Johnni Winther <johnniwinther@google.com>
> Reviewed-by: Slava Egorov <vegorov@google.com>
> Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>

Change-Id: Idaab98c028312ca36bd07f569374ca8b76151a02
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260101
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2022-10-04 12:29:47 +00:00
Nicholas Shahan da79baa962 [ddc] Fix bug in FutureOr type normalization
The correct normalization should only normalize FutureOr<Never>
when Never is non-nullable.

Change-Id: I592f3a4856c219b33a8f1ac8377567a956e1148c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261000
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2022-10-03 20:09:38 +00:00
Johnni Winther 00f85bbb6c [vm,wasm] Share patch libraries
This shares patch libraries between vm and wasm.

The shared libraries are those previously shared as parts, except
the libraries that need private access to other patch libraries.

Change-Id: I69598a0d2ede5138e9ce33fb59dfa46c987eb38a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262320
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2022-10-03 15:50:19 +00:00
Joshua Litt 29de68d38e [dart2wasm] Correctly handle null when jsifying maps.
Change-Id: Ibda04bf6012447dcab86079da8d4d41771e8e9bc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262102
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2022-09-30 21:09:29 +00:00
Kallen Tu 646886c968 Type Socket in _HttpConnection to avoid dynamic invocations.
Change-Id: I55b4312dcf6f2af79f183f21b8d2722f62f0aece
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258515
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2022-09-30 19:29:56 +00:00
Joshua Litt c6b141e9e5 [dart2wasm] Fix bug in dartify.
Change-Id: Ia922d3ac6e3849db13877259c65c7d8d884c5828
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262100
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2022-09-30 18:14:07 +00:00
Sigmund Cherem dad1db4e20 [dart2js] remove unused helpers
These helper methods were used by generated code long ago, before
Dart 2 I believe.  There appears to be no uses of these methods in
our code generation today (last use in the compiler was removed in https://dart-review.googlesource.com/c/sdk/+/75300/2/pkg/compiler/lib/src/common_elements.dart 4 years ago), so I believe we can remove them.

Change-Id: I09647000e4b2643a54246cb77a6d0d06b78abeb3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260961
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2022-09-30 16:21:46 +00:00
Johnni Winther 599836a2c5 [cfe,vm] Make patch parts into actual parts
This changes the VM patch files to use parts explicitly, making
handling of patch libraries similar to regular libraries.

Cq-Include-Trybots: luci.dart.try:dart2wasm-linux-x64-d8-try

Change-Id: I6280d62edba3d12a1f77ae6a7f64e1e9b5d18227
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/224949
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-09-30 15:25:11 +00:00
Nicholas Shahan 457d9fe537 [web] Remove implicit casts from dynamic in DDC
DDC:
Adding return types avoids casts on the returned values and
using JS foreign functions avoids the cast when setting the
value during truncation as well as avoiding the extra
method dispatch for setting and getting elements.

Dart2js:
Updated the return types for consistency but the dynamic
return type was already being inferred to avoid casts.

Change-Id: Ic9abaffd8dee3d12793d5083c78d35a9ada47527
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261787
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2022-09-29 23:22:29 +00:00
Aske Simon Christensen 0ef1afa10f [dart2wasm] Remove obsolete patch annotation declaration
Required to match https://dart-review.googlesource.com/c/sdk/+/224946

Change-Id: I271fca2b408583ad0a645b6bcbea3f3ac129e015
Cq-Include-Trybots: luci.dart.try:dart2wasm-linux-x64-d8-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261901
Auto-Submit: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2022-09-29 17:57:47 +00:00
Alexander Markov 824028f96f [vm] Move _Record class to record_patch.dart
TEST=ci

Issue: https://github.com/dart-lang/sdk/issues/49719
Change-Id: Ibf818df1f57afa93051123d0c9493913e7f9ab76
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260641
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2022-09-29 14:12:57 +00:00
Johnni Winther 3cfca8e38c Make internal/patch.part a part of dart:_internal
`internal/patch.dart` is changed to be an actual part of
`dart:_internal` and backends are changed to all use the `patch`
constant from `dart:_internal` in `@patch` annotations.

This is done in preparation for changing the import uri of a
patch library builder to be its file uri, with which the
`internal/patch.dart` part can no longer declare itself as
`part of 'dart:_internal';` through a patch library.

Change-Id: I884e939d4a56782e64fb527cdf900769c2b2fcfd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/224946
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-09-29 11:52:37 +00:00