Commit Graph

170 Commits

Author SHA1 Message Date
Johnni Winther c4eb880cac [cfe] Rename LibraryBuilder getters to [libraryBuilder]
Change-Id: I13ebe337ee3c032b02c6a4e437762ccc2ddfedde
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237692
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-03-21 08:41:37 +00:00
Nate Bosch 33e174084a Replace Uri.scheme == with Uri.isScheme
Use `hasScheme` in place of comparing against the empty string, and
`isScheme` to compare against all other schemes.

TEST=No behavior changes.

Change-Id: Ifc9fd13c6cf37933ebd4a754c4b500dedbcb291b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231185
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2022-02-08 21:38:57 +00:00
Aske Simon Christensen 8df763f266 Prepare for sharing TFA and patch files between the VM and dart2wasm.
The VM patch files contain many annotations that guide the TFA and the
VM compilation pipeline. Most of these are not relevant to dart2wasm,
and having the TFA look at these when running inside dart2wasm leads to
sub-optimal, and sometimes even unsound, results.

In order to enable sharing of patch files between the VM and dart2wasm,
the annotation parser is given a target flag to control which
annotations it should recognize and how to parse them. The annotation
parser thus becomes an abstraction layer between the concrete
annotations in the patch files and the parsed annotations that the TFA
sees.

Additionally, external members used by dart2wasm don't always have
external names. To support this, the signature shaker must skip all
external members, not just the ones with an external name. This makes no
difference for the VM, since all of its external members either have an
external name or are implemented in a patch file, making them no longer
external.

TEST=ci + upcoming dart2wasm CL
Change-Id: Id425dd1ccc5560721034ae83c8cdc1593801a4e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231102
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2022-02-01 21:08:46 +00:00
Jens Johansen 441dca77fd [CFE][kernel] Use .of instead of .from
This CL replaces most usages of `.from` (e.g.
`List<String>.from(variable)`) to use `.of` instead.

This is done because code like
`List<String> foo = new List<String>.from([null])`
is valid and gives no warnings or errors.

Using `.of` instead will give an error.
Also `.of` appears to be slightly faster.

Change-Id: I1b4327be228b77e6a3e9faa283f8ce64f0565608
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/228642
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2022-01-24 14:38:36 +00:00
Johnni Winther 8510f27d37 [cfe] Change encoding of supported dart: libraries
This CL changes the way dart: libraries are considered supported when
used in conditional imports or bool.fromEnvironment constant using
the "dart.library.*" values.

Library nodes now has an isUnsupported flag which is set according to
the "supported" property in the libraries specification. Furthermore
the Target now supplies a DartLibrarySupport interface that allows
targets to override whether dart: libraries are unsupported.

This allows the JIT/AOT to use the same platform file but still
consider dart:mirrors unsupported in AOT mode, and dart2js to consider
the internal library `dart:_dart2js_runtime_metrics` supported.

Furthermore, the internal handling is changed so that condition imports
and bool.fromEnvironments constants are computed through the same logic
for "dart.library.*" values, avoiding the need for passing these values
through the environment.

TEST=pkg/front_end/testcases/general/supported_libraries/main

Closes https://github.com/dart-lang/sdk/issues/48057
Closes https://github.com/dart-lang/sdk/issues/47814
Closes https://github.com/dart-lang/sdk/issues/47243
Closes https://github.com/dart-lang/sdk/issues/32657
Closes https://github.com/dart-lang/sdk/issues/36460

Change-Id: Ie8f8dff99167de64ced51b71d89918bf0f3bbd13
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/227020
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2022-01-11 14:52:38 +00:00
Johnni Winther 81ee883c98 [cfe] Separate entry-point read from imports/exports/parts
This separates the reading of entry-points, which do not have an
accessor library, from reading of imports, exports and parts, which must
have an access library.

This change also disallows access to platform private libraries, like
dart:_internal, as entry-points.

Change-Id: I017ca30231eb99dc8463266dca0973a02f6f0e30
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/223423
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2021-12-15 11:42:42 +00:00
Joshua Litt 3d1f6a48b7 [dart2js] Add dart2js target to build summaries.
Change-Id: I1ef0b3f87124333e44cb15001c556b1767ddf28f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219841
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-11-18 00:58:40 +00:00
Johnni Winther bc1c71fd9b [cfe] Handle un-inlined fields/locals in eager instantiation constantification
Closes #47108

TEST=existing

Change-Id: I590939161cde1316eede7d828dff5fe6ac2790fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212577
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2021-09-07 15:14:36 +00:00
Daco Harkes 2b5adb7231 [vm] Implement constant Maps in the VM
This CL changes the frontend to emit map and set constants which are
then processed by the constant reader in the VM.

This CL also introduces support for sending the const maps and sets
in messages between isolates and saving it in snapshots.

TEST=tests/language/const/map_test.dart (et al, for lookups)
TEST=tests/lib/isolate/message3_test.dart (et al, for isolate messages)
TEST=tools/test.py -c dartkp (for consts from clustered snapshot)
TEST=tools/test.py -n app_jitk-linux-debug-x64 (for consts from app
     jit snapshots)
TEST=Building the SDK which uses const Maps in clustered snapshots.

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

Change-Id: I1f8150a8aba8298c4e64d2571dd147743526135a
Cq-Include-Trybots: luci.dart.try:analyzer-nnbd-linux-release-try,app-kernel-linux-debug-x64-try,dart-sdk-linux-try,front-end-nnbd-linux-release-x64-try,pkg-linux-debug-try,vm-canary-linux-debug-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-checked-linux-release-x64-try,vm-kernel-linux-debug-x64c-try,vm-kernel-linux-debug-x64-try,vm-kernel-linux-debug-simarm64c-try,vm-kernel-nnbd-linux-release-simarm-try,vm-kernel-optcounter-threshold-linux-release-x64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64c-try,vm-kernel-reload-linux-debug-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-kernel-precomp-linux-debug-simarm_x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-tsan-linux-release-x64-try,vm-kernel-tsan-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/203765
Reviewed-by: Martin Kustermann <kustermann@google.com>
2021-09-06 06:28:59 +00:00
Johnni Winther 93c531f1a0 [cfe] Move force* flags from TargetFlags to TestTargetFlags
TEST=existing

Change-Id: I3db6f5bdd72ca6303766b6524df19e66b1ba1cc7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212001
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2021-09-01 13:29:26 +00:00
Johnni Winther 097a511d9f [kernel] Add annotate_overrides lint
Change-Id: I1fffd60eeb14ecd6d5ba30cd584a75ddd4a8acfc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212005
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2021-09-01 11:45:17 +00:00
Johnni Winther cb3a9b0043 [cfe] Remove old method invocation encoding nodes
TEST=existing

Change-Id: I05ee649ecfa7945e2e0f5e5d09441d8916a9c46e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/208185
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2021-07-28 15:44:04 +00:00
Johnni Winther ca8ea1d936 [cfe] Reimplement typedef tearoff lowering
Using top level procedures generated for each constructor in the
targeted class.

Closes #46676

Change-Id: I42e98254e5cdb8922fafd29e0170dd70ef3e693e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/207961
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2021-07-23 14:29:37 +00:00
Alexander Markov 3a96674d3d Migrate pkg/vm to null safety, part 2
TEST=ci
Issue: https://github.com/dart-lang/sdk/issues/46620

Change-Id: I18bab8755bfa937b6de07a738e3f22309240da22
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/207365
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-07-22 17:30:49 +00:00
Alexander Markov 8e1fbc9ab3 Migrate pkg/vm to null safety, part 1
TEST=ci
Issue: https://github.com/dart-lang/sdk/issues/46620

Change-Id: I2ad3f3aac03c8c13d2562a385a5b6636675401f5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/207362
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-07-20 06:49:20 +00:00
Johnni Winther 8ea5fc2773 [cfe] Add flag for lowering redirecting factories
+ handle constructor tear offs in part files

Change-Id: Id3100ebbabb1c125b18c52cca7cb06871ed0f726
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/206621
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-07-19 14:25:39 +00:00
Johnni Winther a0d57b0a4d [cfe] Initial implementation for constructor tear off lowering
TEST=pkg/front_end/testcases/constructor_tearoffs/lowering/*

Change-Id: Ie8a36df4068093dc4d239b48c31f47d03054ba2b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/206080
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2021-07-08 11:05:04 +00:00
Johnni Winther 49e2148dea [cfe] Migrate wave 10 aka the big one
Change-Id: I77a1996fe3ebd3605efc5afc6ff3308f6ebc3cac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/205580
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2021-07-07 15:18:02 +00:00
Lasse R.H. Nielsen 3e9cdc5644 Seal typed-data types.
Change-Id: Ic20b68fc258ddbf5c007f9d357366d8a41d1f1e2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192186
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2021-05-05 18:04:05 +00:00
Johnni Winther 9d80c4db57 [kernel,vm] Migrate vm transformations in package:kernel
TEST=existing

Change-Id: I86dfda23fa32ecb924fa6c202e7142cb8a258dc6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192145
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2021-04-07 08:30:47 +00:00
Johnni Winther 9e23810b77 [kernel] Migrate more libraries in package:kernel
Change-Id: I249c9fa9f2727544f940b3d954ce49bf38ee4918
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191402
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-03-18 11:06:18 +00:00
Johnni Winther c6e068aff0 [kernel,front_end] Part 1 of migration wave 2
Change-Id: I4c6413c2011da55ad1d82739130be750cc2b8b37
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185380
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2021-02-18 20:04:40 +00:00
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 5dbb6e245b [kernel,cfe,ddc] Add new method invocation node to package:kernel
This adds
* InstanceInvocation, DynamicInvocation, FunctionInvocation, and
   LocalFunctionInvocation, EqualsCall, and EqualsNull as a future
   replacement for MethodInvocation.
* InstanceGet, DynamicGet, InstanceTearOff, and FunctionTearOff as a
   future replacement for PropertyGet
* InstanceSet and DynamicSet as a future replacement of PropertySet
* StaticTearOff as an addition to StaticGet

TEST=pkg/front_end/test/binary_md_vm_tags_and_version_test.dart

This CL combines
* https://dart-review.googlesource.com/c/sdk/+/171729
* https://dart-review.googlesource.com/c/sdk/+/172649
* https://dart-review.googlesource.com/c/sdk/+/172650
* https://dart-review.googlesource.com/c/sdk/+/172651

using the initial encoding fo EqualsCall and EqualsNull

Change-Id: I98e020b5f2b405a812663bdcd2c05aba8efa74c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175480
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-12-14 10:55:48 +00:00
Johnni Winther c19225224b [cfe] Handle lowered Map/Set/List constants in constant evaluation
Change-Id: Ib3b3a39478fe0927fc0168a9916684fd9ac09f77
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175247
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2020-12-08 10:42:43 +00:00
Johnni Winther 7b89827956 [cfe] Support bit mask for enabling specific late lowerings
TEST=pkg/front_end/testcases/late_lowering/late_lowering_bitmasks.dart

Closes #43993

Change-Id: I47d238dd7cf0ea22983a38bed86e415330070596
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171580
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-11-11 14:06:30 +00:00
Johnni Winther 5d8a9340ae [cfe] Add support for using backend defined sentinels in late lowering
Change-Id: Iabcd0c79fb8f09c9de99856e50518eb7ace38464
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163860
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-09-23 08:07:26 +00:00
Johnni Winther 082295a61e [cfe] Support lowering of static fields with initializers
This adds support lowering the encoding of top-level/static fields
with initializers as if they were marked as late fields. This ensures
that LateInitialization is thrown if final fields are written to during
initialization.

Closes #42956

Change-Id: I488fdddd87ebd935a0cdaf82a724e9b87d5f91ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160724
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-09-01 07:20:58 +00:00
Johnni Winther e637f7054e [cfe] Add support for keeping const locals during constant evaluation
With this CL backends can opt in to retain constant local variables
in the AST that would otherwise have been removed through inlining.

Change-Id: I377a8679c89fe012d2ec4c7e087274a8052979ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153965
Reviewed-by: Anna Gringauze <annagrin@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-07-14 12:17:39 +00:00
Johnni Winther 6708394f03 [cfe] Add predicates to detect late lowered fields.
Needed for https://github.com/dart-lang/sdk/issues/41892

Change-Id: I049e76655cf62a5558c18319e80ab9702c7a3c22
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148321
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-05-19 08:55:20 +00:00
Johnni Winther 6c21ed6314 [cfe] Support class hierarchy changes in ChangedStructureNotifier
Closes #40707

Change-Id: I0a9e0b11d0f597dfed7182dd869382057d04e5dc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144821
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-04-26 19:51:29 +00:00
Jens Johansen e8c58a7a3d [CFE] Add ability to compare CompilerOptions
This is (intended to be) a small step towards removing the batch compiler.

Change-Id: I201c56b6d33420f91d2f4b989682670cd8d6a387
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138508
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-03-09 09:11:57 +00:00
Alexander Aprelev 612728f970 [frontend-server] Only set VM environment defines for VM compilation target.
Fixes https://github.com/dart-lang/sdk/issues/40669.

Change-Id: I9e58deed5d2c67c953de7dae10ccbf9c46ab6fd5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136411
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2020-02-20 03:05:25 +00:00
Johnni Winther a9485e8b14 [cfe] Encode getter/field invocation as .call on property get
Current semantics with respect to evaluation order is retained.

Change-Id: I6794c8a720237536696afab2fe056042f8464ec8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129702
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-02-17 13:52:45 +00:00
Jens Johansen 3d5530ff22 [CFE] Transformations can now tell of they changed the structure of a class
By allowing a transformation to tell if it change dthe structure of a
class we can make sure to update the class hierarchy accordingly,
making sure it's up to date for the next computeDelta call in the
incremental compiler.

Change-Id: Iefed3bb1ecbd17b142266ce4a9e1e477f9d2fc87
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133222
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-01-31 13:45:12 +00:00
Johnni Winther 00dc17687a [cfe] Handle late variables in for loops
Closes #40093

Change-Id: I6ed558884f2cf6b10f2d011a80e3f3e15d64b00d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133068
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-01-24 12:41:19 +00:00
Jens Johansen 128771af8a [CFE] Version 2 of incremental compiler invalidation strategy
Change-Id: Iff860e2665dee64fc005a50237ae890986ddb0f1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127896
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-01-16 07:50:39 +00:00
Nicholas Shahan 7974f3f899 [dartdevc] Reduce the number of SDK libraries in the platform
We are temporarily building a smaller SDK platform to make progress building
applications against the forked sdk_nnbd sources. This is because some of the
libraries have not yet been ported and they don't compose well.

I needed to thread the status of the non-nullable experiment through the front
end entry point and into the target options, and native types.

Also includes some standardization of the flag name in DDC.

https://github.com/dart-lang/sdk/issues/39698

Change-Id: I4bdd503be694b28d7f95828d4af28d1d5fb3691f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127486
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-12-09 22:25:48 +00:00
Alexander Markov f56b0f6907 [vm/aot/tfa] Whole-program constant propagation
Size:
flutter_gallery total size -2.48% (arm), -2.3% (arm64)
flutter_gallery instructions size -2.91% (arm), -2.77% (arm64)
velocity_tracker_bench total size -7.5% (arm), -7.1% (arm64)

Performance:
SkeletalAnimation +46.02% (Intel Core i5), +37.75% (Intel Xeon), +24.86% (arm), +39.75% (arm64).
FfiMemory.Pointer* +44-64% (x64)
FfiMemory.PointerPointer +436-465% (x64), +443% (arm64).

Issue: https://github.com/dart-lang/sdk/issues/37710

Change-Id: I6221bfa02b165ccc17d4ee8b857bb89212febaff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125936
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-12-04 19:19:29 +00:00
Johnni Winther 45996ee170 [cfe] Add late field lowering for static/top-level fields
Change-Id: I16625257251b0badbcdfc1c9504899421db8b83f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124681
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-11-15 13:29:45 +00:00
Johnni Winther 2c6f779a76 [cfe] Remove legacyMode
Change-Id: I9384631af94feaf1a345958ff23e6d35c2ba4049
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116202
Reviewed-by: Jens Johansen <jensj@google.com>
2019-09-13 07:38:25 +00:00
Jens Johansen a01dd3655f [CFE] Let compile platform include more required libraries"
That should allow us to "implement"
6f85cb83cf again in two steps:
* first we remove the dart:profiler as a required library, but retain it in the platform
* (we wait for stuff to roll, both in flutter and in google3)
* we remove it completely (i.e. not retaining it in the platform, removing the source etc)

Change-Id: Ieb77c2ba909300c05f3923c2edba7cab7d34fae6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115244
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-09-04 06:57:10 +00:00
Aske Simon Christensen a6596cfd40 [cfe] Allow backend target to specify extra libraries to be indexed.
Change-Id: I35e1857bee3a9cc237da7e8bc70d90a1c83e2b1b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112345
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-08-27 14:07:55 +00:00
Aske Simon Christensen 5121a2e831 [cfe] Read product mode directly from environment in async transform.
When we perform constant evaluation in the CFE, the async transform
runs after constant evaluation. Thus, it can no longer use const
bool.fromEnvironment("dart.vm.product") to query whether the VM is
in product mode.

Instead, it can read the product mode define directly from the
environment defines given to the CFE and generate different code
depending on the value.

Change-Id: I2aabc4a84b50a940d35d5664ff4ebdf0680ed5c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111645
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-08-07 08:28:25 +00:00
Johnni Winther bcfe26cba0 [cfe] Fail early on unsupported evaluated constants
The many different entrypoints to the CFE have repeatedly shown problems
with targets that do not support unevaluated constants being used
without providing an environment.

Making the targets opt-in to supporting unevaluated constants will
give the users of CFE early notice that CFE is used inconsistently
(as opposed to the backends failing when they happen to see an
UnevaluatedConstant node that they don't support).

Change-Id: I98c80df3a551823598e413e2895f5649f22f7c22
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110561
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-07-26 16:57:51 +00:00
Johnni Winther d16c0a127e [cfe] Change supportSetLiterals default value to true
This aligns the NoneTarget with the raw output of the CFE.

Change-Id: Ic3a0a3de46dac389d0ade581192e392fdaba9553
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108721
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-07-11 08:54:19 +00:00
Aske Simon Christensen 25033cee32 [CFE] Control inlining of const variables from backend.
Needed for https://github.com/dart-lang/sdk/issues/36535

Also preserve StaticGet of unavailable constants not in const context,
rather than wrapping it in an unevaluated constant.

Change-Id: Ifac6f251ea9a90a17d06014be12c0d387a32d757
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99020
Reviewed-by: Vijay Menon <vsm@google.com>
2019-05-27 11:45:08 +00:00
Jacob Richman e2976acd22 Add --track-widget-creation flag to frontend_server.
This is needed to activate the kernel transformer embedded with the kernel package from the flutter engine.

Change-Id: I3253e01723b662eb48b4b3743ac5bcc1b44c7d46
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102920
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Jacob Richman <jacobr@google.com>
2019-05-20 22:47:28 +00:00
Aske Simon Christensen 8754351283 [CFE] Run widget transformer before constant evaluation.
Change-Id: I51ded35ecb95cb5cfbac5ecf8967e0918a48269a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101987
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Jacob Richman <jacobr@google.com>
2019-05-10 11:02:49 +00:00
Aske Simon Christensen c10ee9971f [CFE] Move constant evaluator to Fasta.
Reland of https://dart-review.googlesource.com/c/sdk/+/96081

Change-Id: Ie9e6a0d26703469396fa6ea4803f49ce387f495b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97224
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-03-18 15:42:05 +00:00