Commit graph

93068 commits

Author SHA1 Message Date
Nicholas Shahan 3cff63ff26 [ddc] Seal the native Object prototype in test infra
Update tests to avoid getting or setting `.__proto__`.

Change-Id: I2e80dfc32f162de4f5b3fe5ac74a9e6818a7e55e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317845
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2023-08-10 19:45:59 +00:00
Nicholas Shahan 30869bf7c4 [js] Add Dart Object API tests for interop objects
Change-Id: I806ef3e5ed2468eecd91427a3e28cc0859aa81fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317844
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2023-08-10 19:44:00 +00:00
Danny Tuppeny 846049965a [analysis_server] Fix flaky test
This test was writing a package_config after starting the analysis server which causes the context roots to be rebuilt (during which there is a period when there are no roots/drivers), and then not waiting.

This change creates the file before server initialisation.

Change-Id: Id0111f16200a905dd538e217199133122be84246
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/319801
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-08-10 19:01:24 +00:00
Ryan Macnak be3d5ff3cc [vm] Shrink the surface of app_snapshot.h.
TEST=ci
Change-Id: I902eb21c89fb2344bd1870cab2436f204817bdef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/319580
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-08-10 18:53:37 +00:00
Konstantin Shcheglov 53cccf9c8b Extension types. Report when implemented extension type representation is not a supertype of the declared extention type.
Change-Id: Iebb19c3f57046db600305993cc69dae04946889d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/319861
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-08-10 18:38:04 +00:00
Danny Tuppeny acefe9ab6d [analysis_server] Extract LSP registration options from ServerCapabilitiesComputer
This is a non-functional refactor that extracts the growing set of capabilities and options from ServerCapabilitiesComputer into files alongside the handlers they relate to.

The motivation for this is that for LSP-over-Legacy we'll need to accept client capabilities (and return server capabilities). The server capabilities will be different to the standard LSP ones (they will be a subset, and we might not support dynamic registration - at least initially). However the features we do support will have the same registration options, so to avoid duplicating them this moves the registration options away from the creation of the ServerCapabilities.

In future, we might consider further wrapping up a "feature" (which consists of these registration options, and the related handlers), but this change is already quite large and I just wanted to progress capabilities for LSP-over-Legacy so we can handle things like Code Actions (which require executeCommand and possible reverse-requests for applyEdit).

Change-Id: Iecd0aa36626fa44826f7d4dbd6e6c0d758075239
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/319840
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-08-10 17:10:48 +00:00
Konstantin Shcheglov 94a0ce7757 Extension types. Report CONFLICTING_GENERIC_INTERFACES.
Change-Id: Idd4a844ba5ee993b70c08aa9227e2f3a95fcc2f2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/319782
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2023-08-10 17:01:31 +00:00
Brian Wilkerson 98608662e7 Move more of KeywordContributor to the new framework
Change-Id: I2b257545a3af7fa2f803e8f954d14cd3679c35c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/319781
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-08-10 16:58:51 +00:00
Joshua Litt fc35778ff7 [dart2wasm] Fix bug with print kernel.
Change-Id: I8ad7e1815af519dc511afc192f2e44621fa90be5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/319820
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
Auto-Submit: Joshua Litt <joshualitt@google.com>
2023-08-10 16:31:56 +00:00
Stephen Adams 7f08f8e494 [dart2js] Add interceptors for JavaScript Symbol and BigInt
The interceptors provide a Dart `toString` method that uses the JavaScript `toString` method.

Issue: #53106

Change-Id: I1cf1df9e24fb4fd2d79679f1f014f39f083be7e9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/319563
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2023-08-10 14:42:38 +00:00
Jens Johansen aba5663d0a [analyzer] Deduplicate _Info* instances
When having several contexts we'll end up having many copies of the same
_Info* instances. This CL deduplicates it.
TL;DR: On flutter/flutter (82 contexts) this, when run from a clean
cache, reduces the memory usage by 600-800 MB (~15%).

Details:

All numbers from runs made from analyzer source with a clean cache on
flutter/flutter (82 contexts), memory usage after a forced GC:

Runtime:
No difference proven at 95.0% confidence

Current memory (GB):
Difference at 95.0% confidence
        -0.683333 +/- 0.0627592
        -13.3987% +/- 1.23057%
        (Student's t, pooled s = 0.0276887)

Peak memory (GB):
Difference at 95.0% confidence
        -0.643333 +/- 0.0746028
        -12.5243% +/- 1.45236%
        (Student's t, pooled s = 0.032914)

Heap (used) (GB):
Difference at 95.0% confidence
        -0.77 +/- 0
        -17.5799% +/- 0%
        (Student's t, pooled s = 0)

Heap (capacity) (GB):
Difference at 95.0% confidence
        -0.69 +/- 0.05552
        -15.2993% +/- 1.23104%
        (Student's t, pooled s = 0.0244949)

_List (MB):
Difference at 95.0% confidence
        -59.2333 +/- 0.0925333
        -6.91547% +/- 0.0108032%
        (Student's t, pooled s = 0.0408248)

_Uint32List (MB):
Difference at 95.0% confidence
        -105.433 +/- 1.06715
        -17.3382% +/- 0.175489%
        (Student's t, pooled s = 0.470815)

_OneByteString (MB):
Difference at 95.0% confidence
        -403.667 +/- 2.37542
        -58.1206% +/- 0.342017%
        (Student's t, pooled s = 1.04801)

Raw data:

NOW:

Runtime (ms): 151855
current memory	4.46GB
peak memory	4.54GB
heap 3.61GB of 3.86GB
797.3 MB 6067774 _List
503.1 MB 2574937 _Uint32List
291.7 MB 2233396 _OneByteString
233.0 MB 338029 _Uint8List
158.7 MB 3466691 Reference
116.1 MB 1901830 _Map

Runtime (ms): 152410
current memory	4.40GB
peak memory	4.49GB
heap 3.61GB of 3.80GB
797.3 MB 6067637 _List
503.0 MB 2574976 _Uint32List
290.7 MB 2232326 _OneByteString
226.8 MB 339447 _Uint8List
158.7 MB 3466691 Reference
116.1 MB 1901830 _Map

Runtime (ms): 153205
current memory	4.39GB
peak memory	4.45GB
heap 3.61GB of 3.80GB
797.3 MB 6067638 _List
501.9 MB 2556644 _Uint32List
290.2 MB 2235718 _OneByteString
226.7 MB 338584 _Uint8List
158.7 MB 3466691 Reference
116.1 MB 1901830 _Map




BEFORE:

Runtime (ms): 159178
current memory	5.09GB
peak memory	5.15GB
heap 4.38GB of 4.51GB
856.6 MB 7366027 _List
696.0 MB 3780593 _OneByteString
608.1 MB 5239817 _Uint32List
226.9 MB 341102 _Uint8List
158.7 MB 3466691 Reference
116.1 MB 1901829 _Map

Runtime (ms): 153913
current memory	5.11GB
peak memory	5.13GB
heap 4.38GB of 4.51GB
856.5 MB 7366249 _List
693.8 MB 3730773 _OneByteString
608.1 MB 5239925 _Uint32List
233.0 MB 338205 _Uint8List
158.7 MB 3466691 Reference
116.1 MB 1901829 _Map

Runtime (ms): 157729
current memory	5.10GB
peak memory	5.13GB
heap 4.38GB of 4.51GB
856.5 MB 7366221 _List
693.8 MB 3730773 _OneByteString
608.1 MB 5239924 _Uint32List
233.0 MB 337860 _Uint8List
158.7 MB 3466691 Reference
116.1 MB 1901829 _Map

Change-Id: I5697ff0efd40c9325f7f15d8092655b80b4876ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/318940
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-08-10 09:58:31 +00:00
Mayank Patke 4c1bafa809 Reland "[dart2js] Add runtime type check for await."
This is a reland of commit c81711bdda

Original change's description:
> [dart2js] Add runtime type check for `await`.
>
> See https://github.com/dart-lang/sdk/issues/49396 for details.
>
> Fixes: #50601
> Change-Id: Ie89130cffe642b3e4935d7d02fe2e34f7fc8b12e
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316320
> Commit-Queue: Mayank Patke <fishythefish@google.com>
> Reviewed-by: Stephen Adams <sra@google.com>

Change-Id: Ida3258ee3768e8bff0161019511647db8b161473
Bug: #50601
Bug: b/295131730
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/319462
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2023-08-09 23:17:18 +00:00
pq fd97cd45ef enforce @redeclare annotation target restrictions
See: https://github.com/dart-lang/sdk/issues/53121

Change-Id: I994aac6c733704ac7adc4a7923ee733cdc77aacb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/319561
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-08-09 22:45:43 +00:00
pq f72c1eba83 update analyzer owners
Change-Id: I5618b46dfa7412c52733a7ad4211aaa1438421e1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/319602
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-08-09 22:44:26 +00:00
Konstantin Shcheglov 4dffed5065 Extension types. Report when implemented not extension type superinterface is not a supertype of the representation type erasure.
Change-Id: Ib1f2bfcfe51edb6bcbc54d7165f148810e3df4ab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/319600
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-08-09 22:18:27 +00:00
Parker Lougheed 6f645c8f1c [analysis_server] Fix TODO in diagnostic_describe_all_properties test
Change-Id: Id81194e0bf07aaa90777055597a9dba914060d3a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/319620
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-08-09 22:04:58 +00:00
Konstantin Shcheglov e5a16ae775 Extension types. Report self reference in implements clause.
Change-Id: Icd26dcd6cf7521e075d6a8f13a985f3185c02369
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/319584
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-08-09 20:56:25 +00:00
pq 8db531a948 update mocked package:meta to 1.10
Change-Id: I6d3afd37a31302855d426085547eda67a145efd8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/319385
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-08-09 20:23:48 +00:00
Danny Tuppeny aee6d0af18 [analysis_server] Restore use of pathContext.fromUri() for parsing file URIs in the LSP server
This reverts be4189f047 plus adds an additional test to verify pkg:path to behaviour (to catch future regressions or if pkg:path has to be reverted, this will need reverting too).

This relies on the fix made at https://github.com/dart-lang/path/issues/148 which rolled into the SDK in f1de897762.

Change-Id: I1dea45e2017f7505bc4aca97f6c07c1a6e445a5e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/319523
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-08-09 19:39:22 +00:00
Konstantin Shcheglov 49ec5d5e7a Extension types. Tests for type literal.
Change-Id: I552119f6d2ff913c112d89cdf892ca7cbfdbef48
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/319581
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-08-09 18:46:08 +00:00
Konstantin Shcheglov 0540ac84e1 Extension types. Report an error for super formal parameters.
Change-Id: I0e577dbe9d27913ce633951c68b2891f48699ca6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/319560
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-08-09 18:45:51 +00:00
Konstantin Shcheglov 00e30a89ff Extension types. Test InstanceCreationExpression and secondary constructor.
Change-Id: Id9b0ab27f4f851ecb992c15d1b1bfb1742d77b84
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/319582
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2023-08-09 18:44:14 +00:00
Ryan Macnak a7e20dd2b0 Revert "[vm, gc] Mark through new-space."
This reverts commit 6194209b28.

Reason for revert: issues on arm32

Original change's description:
> [vm, gc] Mark through new-space.
>
>  - Initial and final marking no longer visit all of new-space, reducing the STW pause for major GC.
>  - A scavenge during concurrent marking must forward / filter objects in the marking worklist that are moved / collected, increasing the STW pause for minor GC.
>  - Unreachable intergenerational cycles and weak references are collected in the next mark-sweep instead of first requiring enough scavenges to promote the whole cycle or weak target into old-space.
>  - Artificial minor GCs are no longer needed to avoid memory leaks from back-to-back major GCs.
>  - reachabilityBarrier is now just a count of major GCs.
>
> TEST=ci
> Change-Id: I3668a2e56821f9eadf96e38c228dab27be656016
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/309826
> Reviewed-by: Siva Annamalai <asiva@google.com>
> Commit-Queue: Ryan Macnak <rmacnak@google.com>

Change-Id: I434eb595c9e7858efc8c9b07cbca954e5649f506
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/319321
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2023-08-09 18:13:17 +00:00
pq c41bd0326d meta 1.10.0
Change-Id: I14e701e49d04cc8eb32dd2885af52fcbce03cc49
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/319384
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-08-09 18:07:32 +00:00
Elliott Brooks 9b2fb8da0e Update webdev dep
Needs to be submitted after cl/554516303 (unblocks the google3 rolls)
Bug: https://github.com/dart-lang/webdev/issues/2172

Change-Id: I35153cf414412a6118407d0955eef613179751ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/319141
Reviewed-by: Anna Gringauze <annagrin@google.com>
Commit-Queue: Elliott Brooks <elliottbrooks@google.com>
2023-08-09 18:04:25 +00:00
Konstantin Shcheglov 3e93bc89d4 Don't sort context messages when verify diagnostics.
Change-Id: I03d9020db1d155798752c253d67ecee2bb36aa5e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/319383
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-08-09 17:24:14 +00:00
Parker Lougheed 5656b3384e [analyzer] Remove failing test for removed diagnostic
The diagnostic this is testing was removed in 415ff8ece8, causing this test to fail since no diagnostic is reported anymore.

Change-Id: I4cc657094f93dd58a0750847496dccb53e3e8cde
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/319540
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-08-09 17:21:46 +00:00
Danny Tuppeny f1de897762 [deps] rev path
Gets a fix for supporting encoded colons in fromUri() (https://github.com/dart-lang/path/issues/148).

Change-Id: I191b770f3ca3b616ee862a640ad2c17600871fbe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/319522
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2023-08-09 17:04:57 +00:00
pq 98070ec188 Add @redeclare
See: https://github.com/dart-lang/sdk/issues/53121

Change-Id: I812bc49b58cdf15e9c0c8bcc62a846b51f5dff70
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/319100
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-08-09 16:59:00 +00:00
Parker Lougheed 061396f38d [analyzer] Add back removed diagnostic messages
It adds them back and specifies `removedIn: "3.2"` to prevent generation of error codes.

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

Bug: https://github.com/dart-lang/sdk/issues/53120
Change-Id: Icc6e861f317b582d15d463867f08ba70ffee9f2b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/319382
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-08-09 16:53:36 +00:00
Konstantin Shcheglov ffcb38d702 Extension types. Report super constructor invocations.
Change-Id: Ib3da4c7f19864bbbb6d9f53769375fe9f1cf7daa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/319300
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2023-08-09 16:50:56 +00:00
Konstantin Shcheglov 3564f5c163 Issue 53142. Ignore pre-release field when reporting sdk_version_since.
Bug: https://github.com/dart-lang/sdk/issues/53142
Change-Id: Ifeff83ef56cd560a850e012bcabfebf63c391353
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/319302
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-08-09 16:02:20 +00:00
Ryan Macnak 6194209b28 [vm, gc] Mark through new-space.
- Initial and final marking no longer visit all of new-space, reducing the STW pause for major GC.
 - A scavenge during concurrent marking must forward / filter objects in the marking worklist that are moved / collected, increasing the STW pause for minor GC.
 - Unreachable intergenerational cycles and weak references are collected in the next mark-sweep instead of first requiring enough scavenges to promote the whole cycle or weak target into old-space.
 - Artificial minor GCs are no longer needed to avoid memory leaks from back-to-back major GCs.
 - reachabilityBarrier is now just a count of major GCs.

TEST=ci
Change-Id: I3668a2e56821f9eadf96e38c228dab27be656016
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/309826
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-08-09 15:57:17 +00:00
Danny Tuppeny 6229694c74 [analysis_server] Don't remove unused parameters when running fix-all-on-save
Fixes https://github.com/Dart-Code/Dart-Code/issues/4655

Change-Id: I09269766124f7b77fde7c499c6f69a09989d1766
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317684
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-08-09 15:49:06 +00:00
pq eb2af1a41a +implicit_reopen link
Change-Id: I7e4468ab77b86437bd0483698cf2be873b9f57c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/319002
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-08-09 15:43:19 +00:00
Ryan Macnak b11340bc4a [test] Skip service tests on Linux ARM64.
TEST=ci
Change-Id: I4277a4f4f2c3bd9dedd9e325167b67130b5afc2d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/319260
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2023-08-09 15:32:13 +00:00
Tess Strickland 7f943ea210 [benchmarks] Fix MemoryCopy when elapsed time is too small.
Otherwise, we might get +Inf which will then fail on the conversion
to an integer in ceil().

Change-Id: Ibba49257e6801894f1e7724aa7a998ba579f7be3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/319520
Auto-Submit: Tess Strickland <sstrickl@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2023-08-09 15:28:55 +00:00
Parker Lougheed 401fa6130f [analyzer] Mark diagnostics as published and fix spelling mistakes
Change-Id: Ib9bc435b88611724cf0527d942990991ecf8d024
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/319340
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-08-09 15:16:03 +00:00
Kyle Turney 3c8fccf7a4 add fix for removing the leading underscore in constructor parameter lists
Closes https://github.com/dart-lang/sdk/pull/53122

GitOrigin-RevId: 802bc7caf2816906cc38de44784c20531675fdc2
Change-Id: I1adbd74ec20f2a4e2d78d6da9dd538d03ca0475e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/318200
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-08-09 15:08:47 +00:00
(AJ) Zin Kyaw 1265ffa9c5 Added missing content-disposition header
Closes https://github.com/dart-lang/sdk/pull/53129

GitOrigin-RevId: beb751dd77fcc201323199eb297265e2177c60b3
Change-Id: Ic693d15d44a7478f4387668d85a3b3c85adc191e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/318620
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2023-08-09 13:36:10 +00:00
Tess Strickland d984fd77f6 [benchmarks] Add MemoryCopy benchmark suite.
The MemoryCopy benchmark suite measures the overhead of copying
data between compatible TypedData or Pointer values.

Change-Id: Iaf5ea27b7f9177f4800880da36234afd2b908db2
Bug: https://github.com/dart-lang/sdk/issues/42072
Bug: b/294114694
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/318661
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2023-08-09 13:28:44 +00:00
Vyacheslav Egorov 5ddb1b8ea7 [vm/service] Use getline to read /proc/self/smaps
Previously the code was using `fgets` with a fixed
size buffer. This lead to a confusing behavior where
lines longer than 255 characters would be read
in multiple chunks and cause crashes in the parsing code.

Additionally make extraction of the path component slightly
more robust by searching for path field forward rather than
backwards. Path might contain white space and searching
backwards might stumble on that.

This is a reland of 95474f44f1
with changes to android min-sdk to make android ARM builds
succeed (getline requires SDK 18+).

TEST=manually

Change-Id: I8b36fcd178680aed7f856bc884a5cd188a5f6e85
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/319480
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2023-08-09 12:59:31 +00:00
Johnni Winther 0769b22b4f [cfe] Support interface member access on extension types
Change-Id: I53975b71683e119fe6abec72341cdcd814244f58
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/318982
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-08-09 12:19:39 +00:00
Erik Ernst 30201181ce Update Dart.g to support extension types, not inline classes
Change-Id: I785eae3d32363db95a3cad00ee3c2c827a5ec9da
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/319400
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
2023-08-09 11:34:28 +00:00
Martin Kustermann 07549ac9ab [vm] When marking an instruction as deopt to before an instruction, ensure prune-count=0
The [Environment] represents 2 different things:

  * before (env, deopt-id): The state of unoptimized frame right before
    the IL instruction is executed

  * after (env, deopt-id): The state of unoptimized frame right after
    the call machine instruction instruction (i.e. which may not be
    after the IL instruction - as it may still have to drop arguments)

The environment's prune-count specifies the number of entries from the
[Environment] to be removed to get from before-env to after-env.

This prune-count includes generally most of `<IR>::InputCount()` - as
most IR instructions consume their inputs (which location summary may
e.g. require in registers) before doing any call. Though it doesn't include
arguments as we currently have a stack-based calling convention and both
optimized and unoptimized code will explicitly drop them after the machine
call instruction.

Our optimizing compiler may emit speculative instructions. Those will
receive an environment that makes before (env, deopt-id) and after (env,
deopt-id) the same - as both eager and lazy deopt will target a
before (env, deopt-id).

=> We should ensure that the prune-count is set to 0, ensuring we won't
prune anything in case an IL instruction was marked with
`MarkAsLazyDeoptToBeforeDeoptId`.

=> This is a preparation for inlining force-optimized functions: If we
inline them and some callee IL instruction performs lazy deopt it should
re-try the call without any pruned inputs.

TEST=ci

Change-Id: I091c9fa962b376200dc5cfb6ea8c9a47ef43810f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/319440
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2023-08-09 11:31:47 +00:00
Oleh Prypin 27ad1a74dd Revert "[dart2js] Add runtime type check for await."
This reverts commit c81711bdda.

Reason for revert: `Internal Error: Runtime type information not available for type_variable_local` - b/295131730

Original change's description:
> [dart2js] Add runtime type check for `await`.
>
> See https://github.com/dart-lang/sdk/issues/49396 for details.
>
> Fixes: #50601
> Change-Id: Ie89130cffe642b3e4935d7d02fe2e34f7fc8b12e
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316320
> Commit-Queue: Mayank Patke <fishythefish@google.com>
> Reviewed-by: Stephen Adams <sra@google.com>

Change-Id: I481b119b6569d1bc9cf2ab80d997a3eb6d06f674
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/319421
Reviewed-by: Alexander Thomas <athom@google.com>
Auto-Submit: Oleh Prypin <oprypin@google.com>
Commit-Queue: Oleh Prypin <oprypin@google.com>
2023-08-09 11:23:19 +00:00
Oleh Prypin 9f0f33c676 Revert "[analyzer] simplify the libraries.dart file"
This reverts commit 1948b0a9fe.

Reason for revert: causes `promiseToFuture` to become undefined - b/295129286

Original change's description:
> [analyzer] simplify the libraries.dart file
>
> Change-Id: I86bc196eaddd9a80c02f38c8d947d3c0f4c63394
> CoreLibraryReviewExempt: the sdk_library_metadata/libraries.dart is only used by the analyzer
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317803
> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
> Commit-Queue: Devon Carew <devoncarew@google.com>

Change-Id: I4810c408b996cefd46c0a40cc36818d34aa86071
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/319402
Auto-Submit: Oleh Prypin <oprypin@google.com>
Commit-Queue: Oleh Prypin <oprypin@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2023-08-09 10:27:47 +00:00
Martin Kustermann b11aec8f64 [vm] Change IL instructions to be more precise if instruction only lazy-deopts
TEST=ci

Change-Id: I5b46856dfde192779001abd8edaeb37890ca06af
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/319420
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2023-08-09 10:25:28 +00:00
Ömer Sinan Ağacan 605b5a2e61 [dart2wasm] Transform List factory calls to implementation class calls
This is mainly used in [1] to allow using unboxed int lists when a
factory type argument is `int`, which then allows inlining unboxed int
list `[]` and `[]=` and storing and loading `int` values unboxed.

This implementation is mostly a copy of VM's transformer with the same
name. However we can't reuse VM's pass as we do different
transformations in [1].

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

Change-Id: I16c06fc2b2edb1a5498807fc5c0fee839c003965
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/318921
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2023-08-09 09:31:59 +00:00
Aske Simon Christensen 3df48faff1 [wasm_builder] Fix failure type of br_on_cast[_fail]
The Wasm validation rules state that the failure type is sharpened to
non-nullable if the cast target type is nullable.

Change-Id: I77596c31ea7443c5dace543d13024262879a5fb5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/318660
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2023-08-09 08:24:37 +00:00