Commit graph

93046 commits

Author SHA1 Message Date
Ömer Sinan Ağacan 28453a6255 [dart2wasm] Handle unchecked as expressions
Fixes #53104.

Change-Id: I8a1a47775226f73445551ca4bd9f471c8dedfe93
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/318220
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
Auto-Submit: Ömer Ağacan <omersa@google.com>
2023-08-04 14:06:49 +00:00
Martin Kustermann 21d8e30728 [vm] Cleanup kernel loader code
After simplifying the handling of annotations in the kernel loader in
[0] we no longer need to use handle-based access to pragmas.

Also use bit field to represent detected pragmas.

[0] https://dart-review.googlesource.com/c/sdk/+/290502

TEST=ci

Change-Id: I2e21c9e96accce1580964e617f05e4316563b463
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/318260
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2023-08-04 13:40:32 +00:00
Johnni Winther 235aed1208 [cfe] Avoid crash on pattern switch statement in constant evaluator
In response to https://github.com/dart-lang/sdk/issues/53111

Change-Id: I4403b2c92fe983fcfc6d5cd8542c58d9468b5b26
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317884
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-08-04 13:09:37 +00:00
Martin Kustermann 587e6308bf [vm] Fix expression evaluation in context of closures
When evaluating an expressino at a breakpoint that's inside a closure,
the closure may refer to anything it closes over. That includes the
`this` from an enclosing method.

So depending on whether a closure's parent chain is an instance method
or a static method, the expression evaluation function is going to be an
instance method or a static method.

=> We walk up the parent chain to determine the correct enclosing class.
=> This avoids making a Type object with a cid from a top-level class (see [0])

Handling this correctly will now try to get the `this` when invoking an
eval function that has an enclosing instance method. Though we may often
have "<optimized out>" the `this` (e.g. due to not capturing it in
closure context chain).

=> We still allow running the expression evaluation function in this
case, but only if the expression being evaluated doesn't access `this`.

A similar issue occurs when trying to use variables in the eval
expression that the closure didn't capture. This results in a confusing
CFE compile-time error. This is a separate issue and tracked in [1].

=> We update the test to distinuish the cases that this CL makes passing
and those that are failing due to [1].

Fixes [0] https://github.com/dart-lang/sdk/issues/53061
See also [1] https://github.com/dart-lang/sdk/issues/53087

TEST=Fixes part of service/evaluate_activation_test failures

Change-Id: I3bb24e7338c7b2f12d5340311d944cb59a455641
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317540
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2023-08-04 11:07:46 +00:00
Sergey G. Grekhov dcf4fd7055 [co19] Roll co19 to bbb3feb38db0a9c4489736229ea9b06215a1706b
2023-08-03 sgrekhov22@gmail.com dart-lang/co19#2142. Rename and move static analysis extension type tests (dart-lang/co19#2164)
2023-08-03 sgrekhov22@gmail.com dart-lang/co19#2142. Add more static analysis inline class tests (dart-lang/co19#2163)
2023-08-02 sgrekhov22@gmail.com dart-lang/co19#2142. Turn static analysis inline classes tests to extension type tests. Part 2 (dart-lang/co19#2161)
2023-08-02 sgrekhov22@gmail.com dart-lang/co19#2142. Move dynamic semantics member invocation tests to Extension-types folder (dart-lang/co19#2156)
2023-08-02 sgrekhov22@gmail.com dart-lang/co19#2142. Change static analysis inline class tests to be extension type tests. Part 1 (dart-lang/co19#2157)
2023-08-01 49699333+dependabot[bot]@users.noreply.github.com Bump actions/setup-java from 3.11.0 to 3.12.0 (dart-lang/co19#2160)
2023-07-28 sgrekhov22@gmail.com dart-lang/co19#2142. Change dynamic semantics member invocation tests to be extension type tests (dart-lang/co19#2154)

Change-Id: Icfb257200f9922971390c96bf8fb51093c4becfe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/318060
Reviewed-by: Alexander Thomas <athom@google.com>
2023-08-04 08:21:19 +00:00
Jens Johansen 918ef141e8 [CFE] Add weak suite semi fuzz failures to status file
Change-Id: I05a86222b40ea84e41f42dafab771eb24051e196
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317941
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2023-08-04 06:41:38 +00:00
Nate Biggs 37fba7b9dc [dart2js] Add alias mapping for deferred import IDs.
Today the deferred import mapping is missing a way to match a specific user-defined deferred load alias to a corresponding runtime load ID. This adds a new field, "importPrefixToLoadId", under each library entry, which is keyed by library URI, which maps from the user-defined deferred load ID to the Dart2JS runtime load ID.

Example using https://github.com/dart-lang/sdk/blob/main/tests/language/deferred/split_constants_canonicalization_test.dart:
```
{
  "_comment": "This mapping shows which compiled `.js` files are needed for a given deferred library import.",
  "split_constants_canonicalization_test.dart": {
    "name": "<unnamed>",
    "imports": {
      "1": [
        "out.js_1.part.js"
      ],
      "4": [
        "out.js_2.part.js"
      ]
    },
    "importPrefixToLoadId": {
      "a": "1",
      "b": "4"
    }
  },
  "split_constants_canonicalization_a.dart": {
    "name": "<unnamed>",
    "imports": {
      "2": [
        "out.js_4.part.js",
        "out.js_3.part.js"
      ],
      "3": [
        "out.js_4.part.js",
        "out.js_5.part.js"
      ]
    },
    "importPrefixToLoadId": {
      "a_1": "2",
      "a_2": "3"
    }
  },
  "split_constants_canonicalization_b.dart": {
    "name": "<unnamed>",
    "imports": {
      "5": [
        "out.js_4.part.js",
        "out.js_6.part.js"
      ],
      "6": [
        "out.js_4.part.js",
        "out.js_7.part.js"
      ]
    },
    "importPrefixToLoadId": {
      "b_1": "5",
      "b_2": "6"
    }
  }
}
```

Change-Id: Ia6a6f8e45613c0081485e3fe5ddc84627749ee8e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317222
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2023-08-03 22:13:40 +00:00
Nate Biggs 29dcf29314 [dart2js] Easy runtime improvements in SSA.
There are two changes here that account for ~5% of the cycles spent compiling large programs:
1) Calls to 'runtimeType' (specifically _AbstractType.toString) are expensive and CodegenPhase.name calls this 2/3 times per member in the target program.
2) ModularNamer._jsVariableReservedCache is a late final field that gets instantiated for every namer in the program, of which there is one per member in the target program. All the subsets are static and so _jsVariableReservedCache can be static as well. Ideally this would be const but const sets cannot have duplicate strings and the various subsets have some overlaps.

Change-Id: Iefc294145feebe397b2db84a5f49906c6b1372a1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317981
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2023-08-03 19:58:07 +00:00
Aske Simon Christensen 698b5448e1 [dart2wasm] Use new br_on_cast[_fail] encoding with input type
Change-Id: Ie00cdaf30b97f009b4474a032a6b00bddb848ff7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317541
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2023-08-03 16:56:15 +00:00
Srujan Gaddam b5fe6be0bd [dart:js_interop] toJSBox should use foreign function for set
Using setProperty triggers assertInterop, which prevents a Dart
Function from being boxed.

Change-Id: Ifa8a068abb7191ccb1c50f2733e6d85df411c945
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317847
Commit-Queue: Joshua Litt <joshualitt@google.com>
Auto-Submit: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2023-08-03 15:59:30 +00:00
Derek Xu 17d59bf657 [package:vm_service] Update generator to always include required parent class fields in constructors
Change-Id: I3c37668788721735fac58c28e3b9ad15ef364fbd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317980
Commit-Queue: Derek Xu <derekx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-08-03 15:54:36 +00:00
Alexander Thomas 5484bbcbb3 [infra] Update chrome to version 115.0.5790.170
Change-Id: I561a87b7cac16f13b680337bbef3d53a18ee9041
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317962
Commit-Queue: Jackson Gardner <jacksongardner@google.com>
Auto-Submit: Alexander Thomas <athom@google.com>
Reviewed-by: Jackson Gardner <jacksongardner@google.com>
2023-08-03 15:44:48 +00:00
Johnni Winther f25e656ddb [cfe] Check for non-covariant type parameters in representation type
Change-Id: I548831780e039d2f885c0ccef1b48a1675e3be21
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317900
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-08-03 14:04:40 +00:00
Johnni Winther 4243547391 [cfe] Check and add non-extension types in implements clause
Closes #51564

Change-Id: I555c367f3650ddb435908a72b78069ceb6d07814
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317881
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2023-08-03 13:16:48 +00:00
Johnni Winther ca3cd5e0f1 [cfe] Avoid resolving through this variable in formals
Change-Id: Ia03bea53d09350dc55780636116aa8c5fe713df2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317882
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2023-08-03 12:19:48 +00:00
Paul Berry 191752dc00 Front end: add unchecked "as" nodes for promoted getter accesses.
These nodes are necessary to inform the back ends that the static type
of the getter access is different from the static type of the
field. Without them, some back ends may make unsound assumptions about
the generated code, leading to runtime failures.

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

Change-Id: Iad32c9b660d6e3e3106c3143c5139c8a6bd0b67b
Bug: https://github.com/dart-lang/sdk/issues/50499
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317260
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2023-08-03 12:07:45 +00:00
William Hesse 3024bfdde2 [test] Skip two dartdevc tests that are timing out
Issue is currently open to fix these tests.

Bug: https://github.com/dart-lang/sdk/issues/49622
Change-Id: I22c21437461f7b9bf757e6ed5935b4eeba4f52d4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317761
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: William Hesse <whesse@google.com>
2023-08-03 11:31:35 +00:00
Jens Johansen efec227591 [CFE] Fix weekly tester not finishing
Change-Id: I6b62f25d4c62c1adf641e6bd1b85377a3a54476f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317740
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2023-08-03 09:22:58 +00:00
Johnni Winther 9987c437de [dart2js] Enable verification of compilation with errors
Change-Id: I02ea869b1ef07df910820edbf87da6e3b10d02e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310100
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-08-03 08:14:19 +00:00
Konstantin Shcheglov 3a8e74cdcb Extension types. Fix a logical merge conflict.
Change-Id: I1e2f3a3daf942aa558c5816edcd3b7e95be3b4c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317860
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-08-03 03:48:09 +00:00
Ludi Zhan 0b28bc704c [analyzer] Apply @visibleOutsideTemplate to enclosed elements of annotated element
Currently if a class method is annotated with @visibleOutsideTemplate,
only the method declaration can be referred outside template files, but
not the enclosed method parameters.
Meanwhile, a method parameter is not a valid target for
@visibleOutsideTemplate, because it's not a member of Class, Enum or
Mixin.
Update the logic so that enclosed elements of a @visibleOutsideTemplate
element will also be @visibleOutsideTemplate.

Change-Id: Ifcfaa47a154fe6e2b15fae07f3a30e8a543916a2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317846
Commit-Queue: Ludi Zhan <ludizhan@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2023-08-03 03:39:47 +00:00
Konstantin Shcheglov 7323c8af51 Extension types. Tests for using in object pattern.
Change-Id: I3a6bd166cde3dfd6ea664310fdb524b379448e87
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317842
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-08-03 02:44:59 +00:00
Konstantin Shcheglov b035af2fdf Extension types. Build type erasures.
Change-Id: Ief3090ddef317468d66daf4cf8b245bdb0fb896d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317840
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-08-03 02:44:18 +00:00
Kenzie Schmoll 168ebd9ba9 Bump tools_rev in DEPS so that we can depend on the new package:extension_discovery from devtools_shared, which is a dependency of DDS.
Change-Id: Ifba7a2efa92e57738cdc752945e6fd9d0b72b424
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317804
Commit-Queue: Kenzie Davisson <kenzieschmoll@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
2023-08-02 21:46:51 +00:00
Konstantin Shcheglov 64e8d044fa Extension types. Report WRONG_NUMBER_OF_TYPE_ARGUMENTS and TYPE_ARGUMENT_NOT_MATCHING_BOUNDS.
Change-Id: I63528eb793c87094bd3eb41363d6516fb4997475
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317801
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-08-02 20:33:02 +00:00
Sam Rawlins 734ba443a7 Prepare analyzer_plugin 0.11.3
My plan is to checkout the SDK when analyzer 6.0.0 was published,
then cherry-pick this commit, and publish analyzer_plugin.

In a test run, the package analyzes cleanly and all tests pass.

Bug: https://github.com/dart-lang/sdk/issues/52769
Change-Id: I10661dd665c612eeb82977bdf2f8432e022044b6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317802
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2023-08-02 19:37:58 +00:00
Kallen Tu 3bc25b6d01 [analyzer] Add tests for issue 31835 for imported static const methods.
Behaviour seems to be as expected. In the examples, `new B(A.instance);` can be made const and don't produce any errors, meaning that the `prefer_const_constructors` lint can trigger.

The regression doesn't exist anymore.
Added some tests to prevent future regression.

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

Bug: https://github.com/dart-lang/sdk/issues/31835
Change-Id: I0e192709a17d12eb6395f4585b65fce4628f7d12
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316844
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-08-02 19:15:20 +00:00
Danny Tuppeny 02c99b40ab [analysis_server] Handle "Extract Method" in static field declarations
Fixes https://github.com/Dart-Code/Dart-Code/issues/4564

Change-Id: I9119941232cf17af7115fe5476ac1c4faa95cddb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317780
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-08-02 18:17:38 +00:00
Slava Egorov 83000c689f Revert "[vm/service] Use getline to read /proc/self/smaps"
This reverts commit 95474f44f1.

Reason for revert: getline seems to be missing on some platforms we target (e.g. Android).

Original change's description:
> [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.
>
> TEST=manually
>
> Change-Id: I1d23df4a79b04721d3a812e19eae9b8ad0e955fa
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317683
> Commit-Queue: Slava Egorov <vegorov@google.com>
> Reviewed-by: Ben Konyi <bkonyi@google.com>

Change-Id: Iaa6886f318884f9ac17487b2ab59621bb44fcb3b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317781
Auto-Submit: Slava Egorov <vegorov@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2023-08-02 18:02:24 +00:00
Vyacheslav Egorov 95474f44f1 [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.

TEST=manually

Change-Id: I1d23df4a79b04721d3a812e19eae9b8ad0e955fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317683
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-08-02 17:13:30 +00:00
Nate Bosch de85b75eb7 Bump test to 92eb0f7c3df8f3f089eb3962b46d55b00cf0e51c
Changes:
```
> git log --format="%C(auto) %h %s" 7f81dee..92eb0f7
 https://dart.googlesource.com/test.git/+/92eb0f7c Allow frame to send the message port (2068)

```

Diff: https://dart.googlesource.com/test.git/+/7f81deeac294a1120917aeaa35d5b670146c4529..92eb0f7c3df8f3f089eb3962b46d55b00cf0e51c/
Change-Id: I0ae921dc653abbac7329a09973aa6e78d5440f9d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317280
Auto-Submit: Nate Bosch <nbosch@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
2023-08-02 16:22:03 +00:00
Sam Rawlins cabe213d91 Fix constructor initializer with invalid assignment expression
Fixes https://github.com/dart-lang/sdk/issues/52670

Change-Id: Ic28600c1b6c8cf309462ed28ed73ab0249c08844
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317143
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-08-02 14:43:58 +00:00
Johnni Winther 042229c514 [cfe] Add test for super-extension-types in the hierarchy nodes
Change-Id: I16a95c1b162e5ad8c72422721db008576a95a0df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317720
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-08-02 14:14:48 +00:00
Sergey G. Grekhov 7bc0663cfc [co19] Roll co19_2 to 3756b19f79b85b7640a6805dd2c819792a13041c
2023-08-02 sgrekhov22@gmail.com Fixes dart-lang/co19#2158. Fix flaky co19_2/LibTest/isolate/Isolate/pause_A01_t01, _02 tests (dart-lang/co19#2159)

Change-Id: I3aa4ad9e2e42a4c552329c0ff511309c672895f7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317682
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2023-08-02 13:05:21 +00:00
Paul Berry 2ccade258c Front end: remove getFunctionTypeForImplicitCall (and unnecessary invocations).
The method `InferenceVisitorBase.getFunctionTypeForImplicitCall` was
only being in one circumstance: when a method invocation resolves to a
field or getter which needs a runtime covariance check, it was being
used to determine what type should be used for the covariance
check. Its effect was to either return the type unchanged (in the case
where it was already a function type) or, in the case where the type
was an interface, to look up the type of the interface's `.call`
method.

But this is not the behavior we want. For a covariance check, the
right thing to do is simply to verify that the result of the getter
invocation satisfies the getter's static type (with appropriate
substitutions). It doesn't matter whether the type in question is an
interface type, a function type, or some other type.

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

Change-Id: I064bea0fdf0ba3695f6ce51e9b84cc1421061a2e
Bug: https://github.com/dart-lang/sdk/issues/53089
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317360
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2023-08-02 12:03:27 +00:00
Paul Berry 1e0e12052c Add language test to reproduce #53089.
Change-Id: Ia77a7336a9f5abd73a7575d7833ce0e3ee3453a8
Bug: https://github.com/dart-lang/sdk/issues/53089
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317441
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2023-08-02 12:02:38 +00:00
Ömer Sinan Ağacan a1d7f7284b [dart2wasm] Give descriptive names to tear-off and trampoline functions
Currently a function, its tear-off generator, and the trampolines of the
tear-offs have the same Wasm name. This makes it difficult to
distinguish them in .wat outputs.

This CL gives them separate names:

- Function names are same as before: "f".

- Tear-off generators have the suffix "tear-off": "f tear-off".

- Trampolines have the suffix "tear-off trampoline":
  "f tear-off trampoline".

Change-Id: I2459f7d2fd359e72ace7cc4e7790a3e6e64d1f31
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317640
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2023-08-02 11:24:06 +00:00
Chloe Stefantsova bd951bb5ad [cfe] Treat promitions from T? to non-nullable as two-step
This CL introduces handling of promotions of the form `x is T` where
`x` has static type `X?`, `X` is a type variable, and `T` is
non-nullable. They are treated as an equivalent of `x == null || x is
T`, effectively resulting in the static type of `x` being `X & T` in
the promoted code.

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

Change-Id: Ibfa6e32e14202651db09cfb4fbbdec864552b96a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316381
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2023-08-02 09:51:31 +00:00
Kallen Tu 291f6d803a [analyzer] Make sure the error check avoidance on InvalidTypes use hasInvalidType()
Avoid throwing `CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH` for any type of `InvalidType`s since we don't want to do any type checking if we don't actually know the types.

This is another fix for breakages in g3.

b/294003447

Change-Id: Id38de02cfd0317dc6771944bec0f54efb2614494
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317500
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-08-02 00:38:10 +00:00
Konstantin Shcheglov 9bf4af0049 Extension types. Report FINAL_NOT_INITIALIZED_CONSTRUCTOR and FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER.
Change-Id: Ifd18b5014b984a91a1f2a7ab662f937f9f6591ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317447
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-08-02 00:24:12 +00:00
Ben Konyi 5ef423d55c [ DDS ] Prepare for 2.9.4 release
Change-Id: I393ce964bce316592f78c0ea1de45ac1b34ddefd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317620
Reviewed-by: Kenzie Davisson <kenzieschmoll@google.com>
2023-08-01 22:59:17 +00:00
Kenzie Schmoll c96ea516f7 Serve devtools extension assets from devtools_server.
This change cannot be landed until a new version of devtools_shared is published and rolled into the SDK so that it can be depended upon here.

Change-Id: Ia7196fb8c12e980220ee2c2749a979f6359452a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/305043
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Kenzie Davisson <kenzieschmoll@google.com>
2023-08-01 22:30:34 +00:00
Konstantin Shcheglov ddb4c28b40 Extension types. Tests for resolving method invocations.
Change-Id: Idbe4d172ec40152a5725dfc53acaeb6bb2980240
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317520
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-08-01 22:26:55 +00:00
Ryan Macnak 1f87e88a97 [build] Fix MSVC build.
Change-Id: I0336a501e81392ce8e416958242e61d6b3226a9f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317560
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-08-01 22:09:08 +00:00
Konstantin Shcheglov 08f2bc1e60 Extension type. Tests for resolving property access.
Change-Id: I536394862c1f92ca33fa368de9466d96b02d4d1b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317580
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2023-08-01 21:59:48 +00:00
Sam Rawlins 5c9b4ed2cb [analyzer] Remove support for pre-const-update-2018 code
Dart 3's minimum language version is 2.12. google3's is 2.9.

Change-Id: Icd892b0fcec7f2ce9fa813a108519c0bbbd29a52
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317040
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-08-01 21:31:52 +00:00
Kenzie Schmoll d792438829 Roll DevTools 2.26.1 into the SDK
Change-Id: I5206ced2deab27841f49c4f1272b0266ed14487b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317445
Commit-Queue: Kenzie Davisson <kenzieschmoll@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-08-01 21:03:16 +00:00
Konstantin Shcheglov eb705b8636 Extension types. Resolve secondary constructors.
Change-Id: Ie0fd1ce1c368afe4d5c29f07b2674b208870daf9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317523
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2023-08-01 20:45:39 +00:00
Ryan Macnak 5e49ea5ad8 [vm, service] Fix discrepancy between VM generating kind _TypeParameters and service.md claiming the existence of kind TypeParameters.
Fix the service type `TypeParameters` to recognize it is a heap object.

Exhaustively test that the service client libraries can handle inflating all types produced by the VM. Compare vm/cc/PrintJSON, which exhaustively tests the VM can generate any type.

TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/52893
Change-Id: Id1f080656ef6e999e69f2ebb5b9961fa3b461e4a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316862
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-08-01 20:34:21 +00:00
Konstantin Shcheglov c346b78f62 Extension types. Use 'Interface.redeclared' instead of 'overridden'.
Change-Id: Ibabd36e339d3f5258697985853c3d8d8fa3541a2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317442
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-08-01 20:02:21 +00:00