Commit graph

2161 commits

Author SHA1 Message Date
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
Johnni Winther 6b5c722712 [cfe] Update ast-to-text for extension type declarations
Includes a fix for the serialization of the representation name found
through the update of the ast-to-text.

TEST=existing

Change-Id: Id741d66d8f43b5dc1d5e79f967b9625579539404
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/318941
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2023-08-08 14:53:20 +00:00
Johnni Winther b6409c0f04 [cfe] Check superbounded extension types
Closes #53139

Change-Id: I2f13d77454e2a7bac70d19afa1fb321815aac3bc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/318641
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-08-08 09:13:51 +00:00
Johnni Winther 7a2f49a3fa [cfe] Check cyclic representation dependency
Change-Id: Ic0da6d4af5c16c1460add140bbffcb21c5a2139d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/318280
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-08-07 08:58:28 +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
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
Alexander Markov dc2abf0a80 [kernel] Add missing visitors for RecordNameGet.receiverType and RecordIndexGet.receiverType
Fixes https://github.com/dart-lang/sdk/issues/53070

Change-Id: If3a687626af6671b657eb034cf24685ba587f08f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317142
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2023-08-01 14:50:39 +00:00
Johnni Winther de20ac1447 [cfe] Fix ExtensionType.==
DartType.== was declared abstract, expecting subtypes to call
the `equals` method, but this was accidentally omitted for
ExtensionType.

This CL moves the implementation to DartType.== since it was called
with the same arguments in all subtypes, thus ensuring that new
DartType classes will get the correct equals by default.

Closes #53046

Change-Id: Ieaaf33ecb569ea7361ac338066a3a5760391e424
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316583
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2023-08-01 11:04:22 +00:00
Johnni Winther a76f4d5c34 [cfe] Rename InlineClass to ExtensionTypeDeclaration
This renames InlineClass to ExtensionTypeDeclaration, and InlineType
to ExtensionType. Members of extension type declarations are called
extension type members instead of extension type declaration members
for "brevity".

TEST=existing

Change-Id: I91ed62533ddd345644492f04dc3310d007460288
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316780
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2023-08-01 09:04:38 +00:00
Johnni Winther 4efcda0fd2 [cfe] Generate statements for trivial pattern assignments
Closes #52960

Change-Id: I868a7ef5867ad955072ae5425da82c007ca1d73c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/315902
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2023-07-28 11:11:37 +00:00
Johnni Winther bf9ea56ff7 [kernel] Remove nodes used for the old 'extension-types' experiment
This removes ExtensionType, ExtensionTypeShowHideClause and
CallSiteAccessKind from package:kernel which where only used by the now
removed 'extension-types' experiment.

A follow-up CL will rename InlineClass/InlineType to
ExtensionTypeDeclaration/ExtensionType to match the names of the
Extension Type feature currently being implemented.

TEST=existing

Change-Id: I58d2e8b0a92ac61329ee161cc6884a2c0e6f87ae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316420
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2023-07-27 10:47:08 +00:00
Alexander Thomas a3d48885e7 [release] Bump version on main to 3.2
Tested: CQ
Change-Id: I16210697b47dd85aec8743b457e773b044cab81f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316200
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2023-07-25 15:12:49 +00:00
Chloe Stefantsova 2c86500e36 [cfe] Adjust nullability of UP of intersection type and another type
Closes https://github.com/dart-lang/sdk/issues/52993

Change-Id: Id7c18f98d2422264ca69e275505d4977b8b59a99
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/315900
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2023-07-25 10:12:58 +00:00
Chloe Stefantsova cc5ba81491 [cfe] Use term equality in place of identity in UP and DOWN
Closes https://github.com/dart-lang/sdk/issues/52997

Change-Id: I8b15ca1c4d2e3efbc8d7cdebeed1b16fe92d542b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/315443
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2023-07-24 14:54:34 +00:00
Martin Kustermann 11d820890e Use utf8.encode() instead of longer const Utf8Encoder.convert()
The change in [0] has propagated now everywhere, so we can use
`utf8.encode()` instead of the longer `const Utf8Encoder.convert()`.

As the checked-in SDK has been rolled to include [0] we can now rely on
the better return type.

[0] https://github.com/dart-lang/sdk/issues/52801

TEST=ci

CoreLibraryReviewExempt: Minor cleanup.
Change-Id: I2c0144023e03b2c265582d83a7fb9469b02f1570
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313563
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-07-24 09:28:38 +00:00
Chloe Stefantsova d3b2b764a1 [cfe] Remove 'value-class' experimental flag
Change-Id: I9bcb9e30732503c9da4e723ded863949f5f0f1b1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/315200
Reviewed-by: Michael Thomsen <mit@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2023-07-21 11:16:24 +00:00
Johnni Winther 911b376f7e [cfe] Handle inline class representation field in object pattern
Closes #52667

Change-Id: I9c6d51597ff27ae3a7cdeed29d75755c18a2d530
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311742
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2023-07-10 11:02:50 +00:00
Chloe Stefantsova b36fbaef2c [cfe] Update both sides of intersection types in GUB
In computation of GUB both the left-hand and the right-hand sides of
the intersection should be updated as nullable when the other operator
to GUB is Null.

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

Change-Id: I4b616a94a3e7bf149205ba1b90732453c19ace47
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311845
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2023-07-10 09:51:56 +00:00
Nicholas Shahan be6a560ca1 [kernel] Fix record type equivalence
- Increment index to avoid infinite loop when the first named elements
  in the two record types are equivalent.
- Add some test cases for record types.

Fixes: https://github.com/dart-lang/sdk/issues/52817
Change-Id: Ifbf3505c74a1f130c9c90ddbb6b1d96d9641e51e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311929
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2023-07-06 16:37:49 +00:00
Johnni Winther 0c8ded72dc [cfe] Add FileUriConstantExpression
This adds FileUriConstantExpression, a subclass of ConstantExpression, to support correct file offset of annotations for augmentations and patches.
The FileUriExpression is used to carry the file uri of the expression
before constant evaluation.

TEST=general/patch_annotations

Change-Id: I0dc8a0cb97dd530fd1960785d38c2d5e4883c3dd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311660
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2023-06-28 07:52:09 +00:00
Johnni Winther 545b7c02f7 [cfe] Support redirecting factories in inline classes
Closes #52525

TEST=inline_class/issue52525

Change-Id: Ia2f6e3aa92ddd053f5736150713d9267b89f401c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/308621
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-06-14 10:31:42 +00:00
Johnni Winther 7226c7245e [kernel] Remove RedirectingFactory node
Closes #28421
Closes #29169

TEST=existing

Change-Id: Iee7d84fadc10981648cb327589fd7aa15b9b3e12
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/308140
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-06-14 06:38:32 +00:00
Johnni Winther 90d5a99c15 [cfe] Remove redirecting factory field
TEST=existing

Change-Id: Ic9f51693d0cc75cbe745dcaa0f4feb26d7005a9e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307941
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-06-13 09:24:28 +00:00
Johnni Winther c308c9327d [cfe] Ensure Member.isInlineClassMember is set
TEST=existing

Change-Id: I16fbeb0bbe431e3f85ed11c21e0506e6aa4abf58
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/302206
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2023-06-08 15:02:03 +00:00
Johnni Winther 82e3a751a9 [cfe] Remove unnecessary_null_comparison code
The frontend is now run with sound null safety so these are no longer needed.

TEST=existing

Change-Id: I6c1776845854695ff34e310a3bb5bc9d86715f06
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307901
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-06-08 08:46:47 +00:00
Johnni Winther ccb21bd54b [kernel] Add RedirectingFactoryTarget to FunctionNode
This replaces the RedirectingFactoryBody with a dedicated
RedirectingFactoryTarget object on FunctionNode.

TEST=existing

Change-Id: I3cc8b9f8abf938c6d60fdbc91b1f4210686fc359
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307082
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2023-06-08 08:04:15 +00:00
Johnni Winther 36641368bb [cfe] Treat NonNullableByDefault as default in ast-to-text
This changes ast-to-text to mark legacy libraries instead of
non-nullable-by-default libraries.

TEST=existing

Change-Id: Ib01147e4ef48c2c5b2ffc6b23547998344dfdf2e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307121
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2023-06-08 06:28:50 +00:00
Alexander Markov 5ff0821b27 [kernel,vm] First-class kernel serialization of FutureOrType and NullType
TEST=ci
Fixes https://github.com/dart-lang/sdk/issues/52565

Change-Id: I9906f2d10c7ed51d11a0c402b51c8189ac3b6298
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/306901
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2023-06-05 21:24:35 +00:00
Johnni Winther 8091581e72 [cfe] Use unchecked AsExpression instead of promoted VariableGet
This changes the pattern lowering to use unchecked AsExpression
instead of promoted VariableGet when this occurs within a late
cache variable initializer. This is done to avoid promoted variables
that violate the (otherwise used) conservative reasoning about the
execution order of closures.

The unchecked AsExpressions are now shown in the ast-to-text.

Change-Id: I4fa6813f3b5cc73d9cdac17054de59e5d4b8ce7d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307044
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
2023-06-02 16:37:17 +00:00
Johnni Winther 5476e3bd6e [kernel] Rename InterfaceType.className to classReference
+ Name.libraryName -> libraryReference

Change-Id: I25b5022ea87f92fb5837f03d29f1671f0e68261b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/304740
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2023-06-01 06:43:46 +00:00
Chloe Stefantsova 9fecc29dbb [cfe] Adjust the resulting nullabilities in 'flatten'
Closes https://github.com/dart-lang/sdk/issues/52485

Change-Id: I428933193611ffc68c750e6dc91f54ee2385036b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/306400
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2023-05-31 07:33:37 +00:00
Sam Rawlins f292b20dfd Replace deprecated lint rules in front-end packages
Two rules, `iterable_contains_unrelated_type` and
`list_remove_unrelated_type` are deprecated (which fails the CI) and
replaced with `collection_methods_unrelated_type`.

See https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket/8780614474452305057/+/u/analyze_pkg_/stdout for the failures resulting from referencing deprecated rules.

Change-Id: I00087e684bfb230b5dc94ab832c969ed67a631f7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/304780
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2023-05-23 14:01:49 +00:00
Johnni Winther 4d37cc40ff [cfe] Support redirecting initializers in inline classes
Closes #52119

Change-Id: Id9322ba7c4571786c8c07b6a36c3b1e3ef94aec9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/303740
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-05-17 12:35:07 +00:00
Jens Johansen 4fd173a43e [CFE] Various small optimizations
Looking at instructions this seems to speedup compilation of
`compile.dart` with about 1.00% in AOT mode.

Occasionally there's also a measurable time improvement, e.g.

```
msec task-clock:u: -1.3447% +/- 1.1644%
seconds time elapsed: -1.3438% +/- 1.1638%
seconds user: -1.8838% +/- 1.4478%
```

Change-Id: I98866740b00bc01c70dd82d7591864bcb278394d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/303701
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2023-05-17 12:20:08 +00:00
Mayank Patke ea84221100 Fix nullability of cast to FunctionType.
Fixes: #52403
Change-Id: I6eeaad51f45b8dabfd61132d2deae0893b01e99b
Fixed: 52403
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/303420
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Auto-Submit: Mayank Patke <fishythefish@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-05-16 06:43:09 +00:00
Johnni Winther 0767670779 [cfe] Don't create tear-offs for sealed class constructors
Closes #52359

Change-Id: Iaa8d64f01978c201165242dd0b0a3b18890de833
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/302920
Reviewed-by: Kallen Tu <kallentu@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-05-15 06:32:34 +00:00
Johnni Winther 9b42e2d166 [cfe] Generate covariant checks in pattern matching
Closes #52192

Change-Id: Iaac816273fb80eaf166fc300b2b3367f1a592d3f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/302223
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2023-05-09 11:02:45 +00:00
Johnni Winther 13c4ad23c5 [kernel] Add SwitchStatement.expressionType
This adds the static type of the switch statement expression to
the AST to better support optimizations based on the possible
runtime values of the switch expression.

TEST=existing

Change-Id: Ief35b687150401100d8c96721a026e9f0911b3b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/301063
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2023-05-08 07:39:02 +00:00
Chloe Stefantsova e3275641a3 [cfe] Remove spurious ".this" in IntersectionType.withDeclaredNullability
Change-Id: Id5428658ebdccca4385a700725218ee5551495f7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/300660
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2023-05-03 06:20:24 +00:00
Johnni Winther ff0079b94b Reland "[cfe] Enable verification in platform compilation"
This relands https://dart-review.googlesource.com/c/sdk/+/299100

The fix is in patchset 2

Change-Id: I505f3d9c67625cac24ecf60f0eb3d0617d2e847d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/298821
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-05-01 07:35:41 +00:00
Johnni Winther cb7546f58d [cfe] Handle unevaluated constants in enums for exhaustiveness checking
If enum values have used defined fields that use fromEnvironment constants
the enum values themselves are seen as unevaluated constants when
compiling with dart2js. This means that the enum value are not recognized
correctly in exhaustiveness checking.

This CL changes the enum value representation of the CFE to use the
enum class and the name of the enum element, derived either from the
instance constant or the unevaluated constant expression.

Change-Id: I7d5791a41349dacd20b588f5dbfca37d8755ef79
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/299100
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2023-04-28 06:52:59 +00:00
Jens Johansen d7b70f94e3 [kernel] Short-circut 'computeNonNull' when already nonNullable
When compiling "compile.dart" the type given to computeNonNull
is already non-nullable in ~42% of the cases, meaning it spends
time not doing anything.

Change-Id: I94598efceb3b46f0ac81ec36814c216d01a9e38b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/298823
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2023-04-28 06:38:30 +00:00
Oleh Prypin 7bbf7ff43e Revert "[cfe] Enable verification in platform compilation"
This reverts commit 20e0ddf130.

Reason for revert: breakages in google3

Original change's description:
> [cfe] Enable verification in platform compilation
>
> Closes #32530
>
> Change-Id: I5a44e211a4b203e4879dbc8f6bf4bbec5abf51f3
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/298820
> Reviewed-by: Jens Johansen <jensj@google.com>
> Commit-Queue: Johnni Winther <johnniwinther@google.com>
> Reviewed-by: Nicholas Shahan <nshahan@google.com>

Change-Id: Idb2c30d93ad385431734c4a4e884d3d53be76b2b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/299040
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Oleh Prypin <oprypin@google.com>
Auto-Submit: Oleh Prypin <oprypin@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2023-04-27 08:43:00 +00:00
Johnni Winther 20e0ddf130 [cfe] Enable verification in platform compilation
Closes #32530

Change-Id: I5a44e211a4b203e4879dbc8f6bf4bbec5abf51f3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/298820
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2023-04-27 07:34:39 +00:00
Johnni Winther 009cbfbeac [kernel] Merge front_end and kernel verifiers
This merges the front_end and kernel verifiers into one Target based
kernel verifier. The RedirectingFactoryBody work-around is moved to
package:kernel to support its verification.

TEST=existing

Change-Id: I0adf4d2c22c4009cf439b3b23fa14192253a2846
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280161
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2023-04-26 14:14:36 +00:00
Jens Johansen 43b499cf9a [kernel] Optimize computeThisFunctionType
When compiling compile.dart:
148,192 FunctionType are created via `computeThisFunctionType`.
133,085 of them have no named parameters; 141,507 of them have no type
parameters; 128,357 of them have neither.

This CL makes it not create new lists when not needed
(or create empty iterators and sort empty lists), and makes the lists
it do create not growable.

Change-Id: Ibd5fef458b8a1254aa2f1fab80d0449a2f0bfd94
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/298541
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2023-04-26 11:29:28 +00:00
Jens Johansen dc77baa5a8 [kernel] Call Reference.node less; make it inlinable
This CL splits up `Reference.node` in to the most-often fast-case and the
has-to-load case, making the procedure smaller which makes the VM inline
it. This was "verified" by looking at the VMs optimized flow graph for
`Reference.asClass`.

This CL furthermore reduces the number of "calls" to `Reference.node`
by almost half (a reduction of over 3 mio calls when compiling
`compile.dart`) by "caching" the `.node` call in the `as*` methods.

Change-Id: I7b5497397a11f05fdeaf05d6cc420072d98dc030
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/298101
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2023-04-25 10:21:46 +00:00
Johnni Winther fe01a2068d [cfe] Implement least upper bound for inline types
Closes #51556

Change-Id: I44f2ae947b5316d21d23b39b88f1515702525955
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/294983
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2023-04-24 09:14:07 +00:00
William Hesse 7bac8ed687 [Release] Bump minor version of main to version 3.1.
Change-Id: Icf489686d790be195e37db37727782227d2f3704
TEST=Version bump autogenerated by scripts
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/294600
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: William Hesse <whesse@google.com>
2023-04-12 16:36:20 +00:00
Nate Biggs 2551fa9b62 [kernel] Add option to skip including source bytes in dill file.
There is an `includeSources` option today to skip writing both source bytes as well as the line starts. Dart2JS needs the line starts to generate source maps from its modified dill. But the actual bytes aren't used passed a certain point. This new option would allow us to exclude the information we don't need from the dill.

For large applications this can reduce the size of the dill by close to 50%.

Change-Id: I5e69370ee30b2fb856320c346b12662893cb595b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/293761
Reviewed-by: Jens Johansen <jensj@google.com>
2023-04-11 15:20:43 +00:00