Commit Graph

3267 Commits

Author SHA1 Message Date
Nicholas Shahan a92ac0237a [ddc] Delete tests requiring the old type system
These are tests for the specific apis of the old runtime type system
and they will never pass in the new type system.

Change-Id: I740fc06411cdc621b072782d22ec630c5b6bf96a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/341784
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2024-02-14 00:13:57 +00:00
Sigmund Cherem 955c8d63f6 [ddc] shard runtime_debugger_api_test.
This test appears to be timing out consistently in windows.

We split the test in two shards (sound vs unsound null safety)
as an attempt to address this issue.

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

Change-Id: I2230be95b1685ef1e5656eae2e740a94a0eeb320
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352049
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2024-02-13 20:10:17 +00:00
Martin Kustermann c0371169b0 Cleanup some code regarding deprecated native syntax
The VM target no longer supports the `foo() native "foo";` syntax. See
final removal in [0].

Dart2Wasm has never really been using it.

* In the sdk dart2wasm uses `external` functions with
  recognizion in the compiler based on the name of the method.
* JS interop is using `@JS` based mechanism.
* Wasm to Wasm interop is based on `@Native<>()` annotations.

This means that only dart2js/ddc are remaining users of the
`foo() native;` syntax (without following string).

So we can clean up some code.

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

Issue https://github.com/dart-lang/sdk/issues/28791
TEST=ci

Change-Id: I929789f7a1ea5ed5423b0db0c6a306406e2db2af
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/351083
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2024-02-13 10:41:32 +00:00
Mayank Patke 85037bf96d [dart2js, ddc] Clean up conditional imports in dart2js_runtime_metrics
This CL:
* adds empty dart:_dart2js_only and dart:_ddc_only libraries for use in
  conditional imports,
* updates pkg/dart2js_runtime_metrics to use the new libraries rather
  than dart:_dart2js_runtime_metrics and dart:js,
* and removes some unnecessary libraries, including VM-specific
  implementations in pkg/dart2js_runtime_metrics and the DDC
  implementation of dart:_dart2js_runtime_metrics.

Change-Id: I9500aa303fa5ad8aba0e1d413f69957c268f3f11
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350681
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2024-02-09 18:38:55 +00:00
Johnni Winther fe52b9bfe5 [macros] Add dart:_macros
This adds the dart:_macros library to the SDK and adds support for accessing dart:_macros from package:macros. The library is not used yet.

This change is needed as a prestep to adding the package:macros and using it in the CFE and analyzer, and needs to be rolled in as the checked in sdk before package:macros can be supported.

TEST=ci

Change-Id: Ife3ffd48527e3a196048d2ddf7387b8b7818f3a3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348680
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2024-02-02 07:47:59 +00:00
MarkZ 91d22a7e40 [ddc] Renaming dart_library.js to ddc_module_loader.js
This also removes deprecated references to the DDC module system as the "legacy" module system.

This is part of an ongoing effort to deprecate the AMD module system: https://github.com/dart-lang/sdk/issues/52361

Change-Id: Ic32c6c6a0b7bf2c3bf0326be42cc9a88db8e303e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348183
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
2024-01-30 19:43:49 +00:00
Nicholas Shahan 29f5b4141f [ddc] Don't emit old type system variance
The variance information emitted here is only used in the old
type system so it can be skipped when using the new representation.

Change-Id: I43093c1742f9a89ef018dd76ec7a0bcd477414c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348801
Reviewed-by: Kallen Tu <kallentu@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2024-01-29 20:08:28 +00:00
Srujan Gaddam 3b294fdab2 [dart:js_interop] Add isA helper
Closes https://github.com/dart-lang/sdk/issues/54138

Adds a helper to do better type-checks so that users don't
accidentally using is checks or have to manually do the right
typeof or instanceof checks. In order to do this, there is
some refactoring to make ExportCreator a SharedInteropTransformer
(as it's shared across all backends) so that we can reuse an
existing visitor. In the same class, we remove unnecessary setting
of parent pointers. We should clean up the fileOffsets as well,
but dart2js verifies that those are set, so we keep them as is
for now. Also adds some static errors for edge cases.

CoreLibraryReviewExempt: Helper for web-specific library.
Change-Id: I34d818ada1349b69afd15d170d3fafa0460f65fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/347225
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2024-01-25 18:52:45 +00:00
Oleh Prypin 0da8f7a7b4 Remove unnecessary imports of 'package:collection' IterableExtension
* Replace `.whereNotNull()` with `.nonNulls` which is now in Dart core.
* `.firstOrNull`, `.lastOrNull`, `.singleOrNull` and `.elementAtOrNull(i)` are also in Dart core and even under the same name, so simply drop the import of 'package:collection' whenever possible.

Bug: b/322159291
Change-Id: I81eb93426680dc78a608bbcc714eb26c0eca5c62
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348260
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Oleh Prypin <oprypin@google.com>
2024-01-25 11:07:28 +00:00
MarkZ dd680e3b35 [ddc] Fixing failing expression evaluation tests due to renamed legacy dirs.
Fix for breaks introduced in https://dart-review.googlesource.com/c/sdk/+/348085

Change-Id: I9876ad590161ebad6146954ae837d9beb1c2d2ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348184
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2024-01-24 22:30:07 +00:00
MarkZ 8edbcacfb0 [ddc] Removing some references to "legacy" DDC modules.
"DDC" is now the accepted name for the module system.

Change-Id: I655219ccc7cff7ff99b1311518ef6ed6e7d1b2a6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348085
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2024-01-24 21:22:25 +00:00
Anna Gringauze 389d66a515 Fix inner DDC types display
Closes: https://github.com/dart-lang/sdk/issues/54694
Change-Id: Ie141959eedc9cdbb5c675d33da985eb1ac5588e1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/347761
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Anna Gringauze <annagrin@google.com>
2024-01-23 18:26:43 +00:00
Nicholas Shahan b811ab5b04 [ddc] Reset all initialized consts on hot restart
Clear local caches storing const values in each module.

Change-Id: I7766e92df6b8d1f91bad5fbb2addb8ace7763646
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/347220
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2024-01-22 23:25:18 +00:00
Anna Gringauze 67e052d7e9 [dev_compiler] Fix incorrect debugger information on record types.
Closes: https://github.com/dart-lang/sdk/issues/54609
Change-Id: Ib8a24974ab1a5865d00ee361a151afebdf8a5e65
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345825
Commit-Queue: Anna Gringauze <annagrin@google.com>
Reviewed-by: Elliott Brooks <elliottbrooks@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2024-01-19 18:13:39 +00:00
Chloe Stefantsova 970885b879 [cfe] Use TypeParameter in DDCTypeEnvironment, TypeParameterFinder
This CL is a part of the clean up for
https://dart-review.googlesource.com/c/sdk/+/312264

Change-Id: If9d892496af5498943694ad266ee6eb151fdc3e1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346401
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2024-01-17 11:00:17 +00:00
Nicholas Shahan 95cad9c8a6 [ddc] Fix semantics of capturing loop variables
Fixes the for loop lowering to JavaScript when there are function
expressions in the loop initialization, condition, or updates.

Manually assign source mapping information on js_ast nodes to 
make stepping in the Dart debugger make as much sense as possible.
With these mappings three steps are required on each loop variable 
on each iteration but it ensures that the mapping always points to the
variable instead of some random line of code in or around the original
for loop.

Fixes the failure on language/loop/for_variable_capture_test.

Issue: https://github.com/dart-lang/language/issues/3539
Change-Id: I755b88faef11804986fb3d1b2c328da3dd08fe8d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345145
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2024-01-12 20:04:52 +00:00
Jens Johansen 7e792e7a8b [kernel/DDC] Fix failing DDC tests; if finding no scope for offset find for a close previous offset instead
When landing https://dart-review.googlesource.com/c/sdk/+/342400
the ddc-mac builder (but not Linux and Windows) started failing.
I could reproduce on Linux though so I'm not sure why those builders
didn't fail (nor why it wasn't caught by the try bot), either way this
fixes the issues:

* Test update: E.g. a breakpoint at the end of the scope doesn't work
  because it will not be inside the (wanted) scope.
* Test update: Evalating "this" now actually works.
* Scope finding update: DDC adds sourcemapping entries for the *end* of
  things so e.g. the getter "c" will have offset and offset+1 added as
  source mappings. When translating from javascript position to dart
  position we might pick that and thus ask for the scope of offset+1,
  but nothing will be found because no node has that offset.
  Here I add a fall-back saying that if we get no results we ask again
  for the nearest lower offset.

Change-Id: I7e4430d9954466494b514cf51d999358483c9f8c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345501
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Anna Gringauze <annagrin@google.com>
2024-01-12 08:21:00 +00:00
Nicholas Shahan 1572bb563f [ddc] Delete typeRep() and legacyTypeRep()
Replaces all uses with the equivalent `TYPE_REF()` and 
`LEGACY_TYPE_REF()` because they are used in the shared dart:_rti 
library and there is no need to support both.

Change-Id: I8c04eb12856cf6933a168f3e63351a45cd5d704e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344608
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2024-01-12 00:45:47 +00:00
Nicholas Shahan 1f35476e63 [ddc] Delete compileTimeFlag()
Replaces all uses with the equivalent `JS_GET_FLAG` because it is
used in the shared dart:_rti library and there is no need to support
both.

Change-Id: I4e347d568444caab63e4217845c14353c429cb10
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344607
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
2024-01-12 00:12:35 +00:00
Jens Johansen 39d68052a9 [frontend_server/DDC] Expression compilation for JavaScript can pass scriptUri
This allows using the new scope finder and facilitates expression
compilation with and in extension types.

For now the script uri is optional (and only passable in the new json
input via package:frontend_server), and only if the script uri is passed
we'll use the new scope finder.

Flutter etc should be updated to pass the new data.

Change-Id: I36eed1ea76a825e63e4c5b9ea60daf18aee39f3d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/342400
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Anna Gringauze <annagrin@google.com>
2024-01-10 10:12:22 +00:00
Nicholas Shahan ced57aa549 [ddc] Handle extension types in more locations
Either erased the extension type or documented why it seems erasure is 
not needed.

Issue: https://github.com/dart-lang/sdk/issues/49735
Change-Id: Ic6c2fcaebaf10570691b95a383b8ad2e40d2061a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/343720
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2023-12-27 23:38:42 +00:00
Kallen Tu febdd14b3d [ddc] Add type parameter variance to ddc canary.
Updated the ddc canary implementation to handle variance subtyping.

Variance subtyping is currently broken on DDC. This CL emits a runtime call to `addTypeParameterVariances` from `rti.dart` to annotate the type parameter variances of each interface that's appeared in type recipes. The rest of the subtyping algorithm already exists from the Dart2JS implementation, so the variance feature should be working correctly now in DDC with these changes and after the switch to canary by default.

Existing tests now pass: language/variance/variance_in_subtyping_test, language/variance/variance_inout_subtyping_test

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

Change-Id: I8483570184de61f2a6d365f89446720ef2349608
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/338651
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2023-12-27 18:19:10 +00:00
Nicholas Shahan e339deff3a [ddc] Cleanup use of Nullability.legacy
These uses all flow to code that ignores the nullability so `.nonNullable`
works just as well.

Issue: https://github.com/dart-lang/sdk/issues/49996
Change-Id: I5363b8f7f757d421866b60c9a9308bf2370f4e50
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/342723
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2023-12-19 23:28:27 +00:00
Sigmund Cherem 29d0a7296e [ddc] Properly locate d8 in ddb script.
A recent change added an architecture subfolder to the distribution
of d8 binaries (see
https://dart-review.googlesource.com/c/sdk/+/336200). In the process
a lookup for the 'arch' was added in most uses of d8 in the repo,
but the changed missed the one in ddb (probably because this has no
test coverage).

Change-Id: I2a7639fb19f8fa0131fc636f31b233aef701e8c2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/342660
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2023-12-19 22:03:59 +00:00
Chloe Stefantsova 3eeba4a4e2 [cfe] Refactor FunctionNode.futureValueType into emitted value type
Previously we would encode the type of the value returned in `async`
functions as the field `futureValueType` on `FunctionNode`. For all
other kinds of functions, such as `sync`, `sync*`, and `async*`, that
field would be null. This CL renames `futureValueType` into
`emittedVAlueType`, and for functions of kinds `async`, `sync*`, and
`async*` that is expected to be the type of values emitted via
`return` or `yield` statements. For `sync` functions that field is
supposed to contain `null`.

In response to https://github.com/dart-lang/sdk/issues/54159

TEST=existing

Change-Id: I1efdbcc4e75d150f5618c7ca50cfe49a0e54fce6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/341662
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2023-12-19 08:44:43 +00:00
Nicholas Shahan 38e2d34424 [ddc] Erase extension types in as expressions
Ensures the same optimizations to expressions statically typed as
extension types.

Issue: https://github.com/dart-lang/sdk/issues/49735
Change-Id: If85f17203cb4c07c06da0e2e1712fea15c39c444
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/342106
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2023-12-18 20:56:54 +00:00
Nicholas Shahan 8d24f7ebd4 [ddc] Erase extension types in string concats
Ensures the same optimizations to expressions statically typed as
extension types.

Issue: https://github.com/dart-lang/sdk/issues/49735
Change-Id: I981859562bdd81cf34bd5ed4160a270e6fdff9f3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/342105
Reviewed-by: Mark Zhou <markzipan@google.com>
2023-12-18 20:56:54 +00:00
Nicholas Shahan b2cd914227 [ddc] Erase extension types in assertions
Ensures the same optimizations to expressions statically typed as
extension types.

Issue: https://github.com/dart-lang/sdk/issues/49735
Change-Id: Id9b944d3f716faf38bb4770eb9b90ccc708056ce
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/342104
Reviewed-by: Mark Zhou <markzipan@google.com>
2023-12-18 20:56:54 +00:00
Nicholas Shahan 83ba9fe0a8 [ddc] Enable new runtime types by default
Fixes: https://github.com/dart-lang/sdk/issues/48585
Change-Id: I7b0cfd70c4ada42e094e6ecbfbd077aebf16a490
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/341329
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2023-12-18 18:35:29 +00:00
Kallen Tu ee3ee59012 [ddc] Re-enable 'variance' experiment flag.
We want to be able to emit variance information in DDC and this flag was gating the variance checking logic in `rti.dart`.

Set to `true` by default since we can't use the feature without the experiment enabled anyways.

Change-Id: I69a0691e9fbe6f0f355fc7319151c19bbffc1961
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/341640
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2023-12-14 21:01:10 +00:00
Nicholas Shahan d5d8486c25 [ddc] Remove legacy code from tests
Stop running expression evaluation and module symbols tests on legacy
code. These still run with unsound null safety, just on migrated code.

Change-Id: Ifb602c058ebcc3fbd8254e8c2f431f8b18146a64
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/337615
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Anna Gringauze <annagrin@google.com>
2023-12-14 00:34:15 +00:00
Nicholas Shahan dcb03af9e1 [ddc] Fix legacy type appearing modules migrated to null safety
Since we are no longer testing legacy mode this can be changed to
be non-nullable.

Change-Id: I092b24e055f8fa0f9c183477699a301ffb176660
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/337920
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2023-12-13 17:22:41 +00:00
Nicholas Shahan 5530d82467 [ddc] Cleanup unused legacy types
These types are all used in placed where the nullability is ignored
so this is mainly just for sanity sake and in preparation for a future
where the getters/methods no longer exist.

Issue: https://github.com/dart-lang/sdk/issues/49996
Change-Id: I4e6489ea859176e30ee8508ad252f4c9b68159b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/337921
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2023-12-13 16:02:38 +00:00
David Morgan 11e29a7d9e [ddc] Add macro flags, add test coverage for basic compile.
Support and test coverage for other modes to follow.

R=cstefantsova@google.com, jakemac@google.com

Change-Id: Ic715f43317364955b3b2341134cf3cf576cebd00
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/339321
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Morgan :) <davidmorgan@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Auto-Submit: Morgan :) <davidmorgan@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2023-12-12 10:07:42 +00:00
MarkZ 5d4e742a67 Updating dart_library.js to be consistent with its internal version.
Change-Id: Ia90393022cf43a713bf9f6efb36f3f29b13aa456
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/338422
Reviewed-by: Anna Gringauze <annagrin@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2023-12-06 21:50:54 +00:00
Jens Johansen 6c9f95bd15 [CFE/DDC] Scope test adds context for type parameters; more testing
Change-Id: I218cc473ae2e48944b268094e08cf0da19a09bbd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/337740
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2023-11-28 07:52:32 +00:00
Nicholas Shahan 84aa0207cf [ddc] Remove legacy from nullable inference test
Update source code in tests to be migrated to null safety. Tests are
still running in unsound null safety.

In most cases types are now inferred to be non-nullable so the code that
makes expressions to be seen as nullable now require `as dynamic` to
allow them to compile.

Update nullable inference logic to recognize `.toString()` on a String
as non-nullable in code that has been migrated to null safety.

Change-Id: Id0771cc5317e3dafbf10e766b80d2994752bacc8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/337700
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
2023-11-23 20:03:22 +00:00
Ryan Macnak c1143082fe Include ARM64 when uploading d8.
Change-Id: I613ca948734a849c43f6f6d02cfd678d18fe7e03
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336200
Reviewed-by: Alexander Thomas <athom@google.com>
2023-11-21 17:15:20 +00:00
Nicholas Shahan a45fc14739 [ddc] Update debugger field signatures
Erases extension types to their representation type for field
signatures. This is the best representation we have at runtime for
the field. Note this isn't necessarily the runtime type of the
field value.

Issue: https://github.com/dart-lang/sdk/issues/49735
Change-Id: Ibe064f4fd3829a858fc9fd920e2e91175d9ae0c9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336823
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
2023-11-21 01:55:46 +00:00
Nicholas Shahan 30b530bce7 [ddc] Handle Object members on extension types
Erase extension types when deciding to dispatch directly or to a helper
method for Object members.

Issue: https://github.com/dart-lang/sdk/issues/49735
Change-Id: I31081bf4ec64a0f667c8d40b08b94773e229ebe1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335601
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2023-11-17 22:24:37 +00:00
Robert Nystrom 2ee771a4f6 Remove the legacy "_2" tests. \o/
I also cleaned up a bunch of places that referred to them.

Change-Id: I45f68818c892f8620ea04257885ffa3763374bb5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335863
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2023-11-17 20:17:23 +00:00
Johnni Winther 56a86e599e [cfe,ddc] Add tests for scopes in extensions, extension types and mixins
This adds support using experimental features in id testing in DDC and
uses it to add tests for scopes in extensions, extension types and
mixins.

The tests show that the DartScopeBuilder and DartScopeBuilder2 differ
on the scope on instance members in extensions and extension types for
the synthetic #this variable.

Change-Id: Iec0f3b938da567578b1245ada885370fb2a8b33f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335824
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-11-16 09:37:31 +00:00
Johnni Winther 4eed065859 [cfe] Add CFE test for DartScope
This adds a CFE test for DartScope that shares the data with the
corresponding DDC test. The CFE test uses the DartScopeBuilder2
which is currently in development to replace the DartScopeBuilder.

Change-Id: I0d6c76957e7a5d28babab14110d430935e686b22
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335821
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-11-15 10:17:23 +00:00
Nicholas Shahan 385c0063af [ddc] Cleanup extension type erasure helper
A better API is now available from the kernel nodes directly.

Issue: https://github.com/dart-lang/sdk/issues/49735
Change-Id: I1b4b36e44292cadc3f9d6c495ae93ae20e0db970
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335944
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2023-11-14 22:26:39 +00:00
Nicholas Shahan f1219f2956 [ddc] Make equality optimizations aware of
extension types. This ensures the same optimizations are applied to
extension types and the representation type they are erased to.

Issue: https://github.com/dart-lang/sdk/issues/49735
Change-Id: I630fc8b68e6e86b81ec85495286719ca39f89d14
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335943
Reviewed-by: Mark Zhou <markzipan@google.com>
2023-11-14 22:26:39 +00:00
Nicholas Shahan 60b90b296c [ddc] Add more context to error messages
Some SDK only inline helper methods expect specific types passed to
them. These expectations can't be enforced by the type system and
everything is currently working properly. Extension methods may cause 
confusion in the future so this change adds a bit more context to
the error messages just in case.

Issue: https://github.com/dart-lang/sdk/issues/49735
Change-Id: Idc620993d1a240fa5aaaccd4519433b04f0ba9ad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335942
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
2023-11-14 21:13:49 +00:00
Devon Carew 6917656134 [pkg] remove duplicate config from the analysis options files
Change-Id: I149a97bbe260600a3de664b28c4d212dd9adb889
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335862
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2023-11-14 00:37:53 +00:00
Johnni Winther 1f86f34c5c [dartdevc] Add id-testing support in ddc
This adds id-testing support to dartdevc and uses it to add a
scope_test for the DartScope created for expression compilation.

Change-Id: I861092e17807190880bd20e4e39e012fbf0cbe53
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/334220
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Anna Gringauze <annagrin@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2023-11-10 10:49:56 +00:00
Nicholas Shahan e278c09ab6 [ddc] Erase ExtensionTypes before normalizing
- Update FutureOr normalization to use exhaustive switch statement and
  throw on ExtensionTypes.
- Delete ExtensionTypeEraser in favor of the `.extensionTypeErasure`
  getter provided by Kernel.

Issue: https://github.com/dart-lang/sdk/issues/53566
Change-Id: Id8cd9b85f9f875084080c7c9d0d8b0bb03ee8da7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/334780
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2023-11-08 19:07:38 +00:00
Nicholas Shahan 2ef46a1fff [ddc] Fix custom formatter for classes
Classes were mistakenly being formatted by the function formatter.

Change-Id: I6c513803c7c211f02bb9267914b5988cd6c02c5e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/334005
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2023-11-07 00:48:58 +00:00