Commit Graph

26 Commits

Author SHA1 Message Date
Johnni Winther 34fb48bb8a [kernel,front_end] Migrate first wave of pkg/kernel and pkg/front_end
Migrates libraries dependent only on already migrated libraries.

Change-Id: I0e85ee8dbc2afce031b92e0009e71c206a55af28
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179502
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2021-01-18 15:40:21 +00:00
Johnni Winther 23d70f6f23 Reland: [cfe] Embed and use allowed experiments in CFE
This CL embeds the sdk_nnbd/lib/_internal/allowed_experiments.json
into the CFE and uses this to allow experiments enabled on a
per library basis. The file is embedded through generated code to
avoid reliance on access to the file itself.

A presubmit check is also added to ensure that the json file and
the generated code are in sync.

This work is in preparation for https://github.com/dart-lang/sdk/issues/41538

This was reverted in https://dart-review.googlesource.com/c/sdk/+/149620
because flutter wasn't prepared for auto-enabling nnbd in dart:* libraries.
This has now been fixed in https://github.com/flutter/engine/pull/18714

Closes #42162

Change-Id: I686ed6feaef8ee066b426068fe2a0f5080bf1713
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149588
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-06-03 08:15:49 +00:00
Johnni Winther aec6a3529e Revert "[cfe] Embed and use allowed experiments in CFE"
This reverts commit a936f3019e as it broke
flutter hhh fuchsia build: https://ci.chromium.org/p/dart/builders/ci.sandbox/flutter-engine-linux/10876

Change-Id: I0a83e5edf8d53fc648a4f548529e456a5e6bcfc9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149620
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-06-02 08:48:51 +00:00
Johnni Winther a936f3019e [cfe] Embed and use allowed experiments in CFE
This CL embeds the sdk_nnbd/lib/_internal/allowed_experiments.json
into the CFE and uses this to allow experiments enabled on a
per library basis. The file is embedded through generated code to
avoid reliance on access to the file itself.

A presubmit check is also added to ensure that the json file and
the generated code are in sync.

This work is in preparation for https://github.com/dart-lang/sdk/issues/41538


Change-Id: Ic03c0fc69684d124c685f2fe6e80423a7e751530
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149064
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2020-05-30 09:47:02 +00:00
Johnni Winther eb4880beca [cfe] Don't include Function in Class.supertype and Class.implementedTypes
Change-Id: Ib510080a331915a66a0ca51507f8f2bcd29940c0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140042
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2020-03-20 16:48:09 +00:00
Johnni Winther 5829fc7829 [analyzer,cfe,dart2js] Add marker.options files to automate running id tests on all configurations
Change-Id: Ib5eb7f3967634721047f8dcc57b9e6c350b91a41
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136226
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-02-21 08:34:26 +00:00
Johnni Winther 5e389080a4 [cfe] Test supertypes computed from ClassHierarchyBuilder
Change-Id: Ia079754bd8272d7b5689a3bdab1e69d5188082be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132342
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-01-22 07:08:36 +00:00
Johnni Winther e3a20bf361 [analyzer,cfe,dart2js] Support annotated code generation
Add support for generating annotations from actual data using
option -g

Change-Id: I88d9cdb62a38d579234b15097c9e9bb3d81ebe8c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129708
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-01-03 13:57:39 +00:00
Johnni Winther 9c983d2ee3 [cfe] Support extensions via prefix
Change-Id: I6c1e69e5a5c83f5177754a350f5efbca9384972b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124540
Auto-Submit: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-11-08 19:53:00 +00:00
Paul Berry c4b6df5009 Move ID testing infrastructure into _fe_analyzer_shared.
Change-Id: I9f2692dbe750f3c31f8c86e86fe732f34e166517
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123860
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-11-01 12:39:00 +00:00
Johnni Winther 0ee78fac98 [cfe] Rename declaration.dart and procedure_builder.dart
to builder.dart and function_builder.dart to reflect their primary content.

Change-Id: Ib0f9c2970b6a88e4381b0cd7532e4410b72c2a2a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120791
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-10-10 08:11:27 +00:00
Johnni Winther 431509ba8e [cfe] Remove builder/builder.dart
Change-Id: I471e2c9a0875c4ff14169a935758f53a74655f25
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120642
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-10-08 20:24:38 +00:00
Johnni Winther dd028547ce [cfe] Support patching of extension methods
Change-Id: I453e17e63f97a0ca2477371541c6a9602bee2404
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119322
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-09-30 09:51:31 +00:00
Johnni Winther 6f2c3977cc [cfe] Add available extensions to Scope.
Change-Id: Ibe087e48c2313fc7b830bac75dcdb51da175edea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114324
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-08-26 20:54:56 +00:00
Johnni Winther 9d4e778cde [cfe] Support getters, setters, fields and operators in extensions
Change-Id: Ic84380ea767691bbbb802c65cb72fe43893f78a5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112257
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-08-15 12:12:00 +00:00
Johnni Winther 271ad96813 [cfe] Create Extension nodes for extensions
Adds Extension node to kernel/ast, currently with serialization. This
is needed to support resolution of extension methods through dill
boundaries.

Adds (Source)ExtensionBuilder for build Extension nodes and
DeclarationBuilder as common superclass of ClassBuilder and
ExtensionBuilder.

Change-Id: Id945a40452f2729f9a4f390477dd6c76f9030eaa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112256
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-08-09 20:46:01 +00:00
Johnni Winther 19654f30d0 [cfe+vm+ddc] Return ClassHierarchy and CoreTypes together with Component
Users of the CFE often need the ClassHierarchy and may CoreTypes after
invoking the CFE. This CL extends the result of `kernelForProgram` and
`kernelForComponent` to a `CompilerResult` that includes these objects.

Change-Id: I08491198fe876b6514e49993ad794388d6662c9c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112259
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-08-09 13:02:12 +00:00
Johnni Winther e9a9d9452e [cfe] Build extension methods as toplevel members
+ add an 'isExtensionMethod' property to Procedure.

Change-Id: I8fb1af1802570c827bf3ccbbb9d710eb2a6981ab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112081
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-08-08 12:51:40 +00:00
Johnni Winther 68e4eeee12 [cfe] Handle property access, update and method invocation on explicit/implicit this in extension methods
Handles property access, update and method invocation on explicit and
implicit this in extension methods. Also use ReadOnlyAccessGenerator
instead of ThisAccessGenerator to handle explicit this.

Change-Id: Ifd6861b1f931f854a39ddfb9ddae35ebf6094327
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110904
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-08-01 12:04:59 +00:00
Johnni Winther 3992be71c7 [cfe] Add this parameter to extension methods
Change-Id: I25326e755d63b5707f8f7ce52b3d80c3965372aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110725
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-07-29 15:58:08 +00:00
Johnni Winther 1e43d65d4a [cfe] Merge KernelFunctionBuilder into ProcedureBuilder
+ rename ProcedureBuilder to FunctionBuilder
+ rename KernelProcedureBuilder to ProcedureBuilder
+ rename KernelConstructorBuilder to ConstructorBuilder
+ rename KernelRedirectingFactoryBuilder to RedirectingFactoryBuilder
+ move all classes to procedure_builder.dart

Change-Id: Ia139b36730f8dafa151e19a08637d17363262c77
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/109962
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-07-28 18:19:00 +00:00
Johnni Winther 5357056a20 [cfe] Report errors when extension declarations are used as types
Change-Id: Iad0c7df54fac476c2f23af2fe4ba30ee5bf49167
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110222
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-07-25 17:20:54 +00:00
Johnni Winther 82f657d7cb [cfe] Support error testing in annotated tests
Change-Id: I545ded4d82147f22efc80f4ed8ee833cd75a9be7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/109963
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-07-24 07:10:23 +00:00
Johnni Winther 948b60f8dc [cfe] Add test for extension member parameters
Change-Id: I6ceb66bbef561b0c86e6f529e9d90a35dd82f628
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/109705
Reviewed-by: Dan Rubel <danrubel@google.com>
2019-07-22 16:00:28 +00:00
Johnni Winther 11755e537c [cfe] Add tests for extension members
+ Avoid creating default constructors.

Change-Id: Ie0ed967d9be4cf31a2eb6991767887de1f88149a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/109702
Reviewed-by: Dan Rubel <danrubel@google.com>
2019-07-22 16:00:28 +00:00
Johnni Winther b3b6533c3d [cfe] Create ClassBuilder for extension declarations
Change-Id: Ic372b89588ed9ec3afc43f7db7e3d38a81846ad5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/109264
Reviewed-by: Dan Rubel <danrubel@google.com>
2019-07-22 16:00:28 +00:00