This reverts commit e6f779bcdd.
Reason for revert: Broke expression compilation in google3
Original change's description:
> Cache expression compilers in incremental DDC mode
>
> - cache expression compilers in expression compiler worker
> to improve performance of exression compilation.
> - pass module format in expression compiler worker
> (the ddc format tests were not running!)
> - fix an issue where the same library was imported twice
> in module_builder.dart
> - add verbose mode timeline logging to ProgramCompiler.
> - update tests.
>
> Closes: https://github.com/dart-lang/sdk/issues/49944
> Change-Id: Ie7408dcd42e757b1eb5e7f5ccbc1b078b6417011
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/268361
> Reviewed-by: Johnni Winther <johnniwinther@google.com>
> Reviewed-by: Mark Zhou <markzipan@google.com>
> Commit-Queue: Anna Gringauze <annagrin@google.com>
> Reviewed-by: Nicholas Shahan <nshahan@google.com>
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: I6c7209ffb03416dbb8d34c1a6f520f21766d9190
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/270840
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Anna Gringauze <annagrin@google.com>
Reviewed-by: Anna Gringauze <annagrin@google.com>
Adds checks that if the derived class does not have a `@staticInterop`
annotation, none of the classes it implements or immediately extends can
have it either. Also cleans up some redundant abstract class tests for
readability.
Change-Id: I2e8528b0fb02d9ce39003d00ee0b3da88ce75d44
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/268109
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Riley Porter <rileyporter@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
These have always been able to return non-Instances.
TEST=ci
Change-Id: I13e46aae8705ea1f79ec0618cdb815a8ed9c0fdb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/270461
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
The info dump processor ends up deserializing most of the deferred data anyway so there is no benefit to the deferred logic. This saves ~600MB on info dump.
Change-Id: Ib9a1154b38594a3f046d5da96b477de9f2c90b9d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/271041
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
To prepare for the eventual removal of Observatory, we plan on disabling
Observatory by default while providing an escape hatch to manually serve
the tool for some period of time before completely removing Observatory
from the SDK. This change adds flags that can be used to configure
whether or not Observatory is served.
Currently, '--serve-observatory' is the default behavior, but will be
changed to '--no-serve-observatory' once tooling is ready to support the
escape hatch behavior.
Part of https://github.com/dart-lang/sdk/issues/50233
TEST=run_test.dart
Change-Id: Ib6d1e1587d9fbd3c61d4a4c75d90635052835844
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/267720
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
In
ce01d330d7,
the patterns spec was changed so that if an object pattern's type
resolves to `dynamic` or `Never`, no getters are looked up during
static analysis, and the getter type is simply presumed to be
`dynamic` or `Never`, respectively.
Also, the parameter `requiredType` of `analyzeObjectPattern` is
removed (is was not needed, and the caller always passed `null`).
Finally, the test artifact `ObjectPatternRequiredType` is removed in
favor of just using a PrimaryType directly. This makes the tests a
little bit more compact.
Change-Id: I6fcef8dab8250905e1d37308bbdc82a4fd65f52c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/270982
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
The name was misleading because it only models types whose names take
the form `IDENTIFIER` or `IDENTIFIER<ARGS>`; it doesn't model record
types, promoted type variable types, "question"/"star" types, or the
"unknown" type, which aren't function types either.
"PrimaryType" seems like a good name because it's at the base of the
type grammar.
Change-Id: I6e1916931892f2ef670bc89cfebb198b596b0173
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/270981
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Rename `TypeAnalyzer.analyzeInitializedVariableDeclaration` to
`analyzePatternVariableDeclarationStatement`, since the corresponding
grammar construct is called `patternVariableDeclaration`.
Change-Id: I5819a4434349b85974252f8e4da35adeffbc3d7d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/270980
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
This made the docker build work for me locally. The "updates" list was
probably needed on jessie but isn't needed on bullseye anymore.
Change-Id: I88f257b928f6ef690dac9e7d450eaa4c2ea12b2f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/271102
Reviewed-by: William Hesse <whesse@google.com>
Extend the runtime representation of function types with a list of
type parameter bounds and take these into account when doing subtype
comparisons on function types.
The implementation has a number of limitations for now:
- When converting a function type to a string, the type does not know
its nesting depth. Function types on all nesting levels thus follow
the same naming scheme for their type parameters (`X0`, `X1`, ...),
which can lead to name clashes between type parameters in the case
of nested generic function types.
- When a generic function is instantiated, the type arguments are not
substituted for the function type parameters in the type of the
resulting function object, which therefore has an incorrect type.
- The default types of function type parameters are not explicitly
represented in function types. When we implement automatic
instantiation of missing type arguments in dynamic function calls,
we need to either add the default types to the representation
somehow or compute them from the bounds.
Change-Id: Ib756d9f8f2b6959efd7ef2e6bc79c7e4793ca3e8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/269761
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
Since we normalize types at every step of runtime type construction
(in `Types.makeType` and `ConstantCreator.visitTypeLiteralConstant`)
we don't need to normalize types recursively, except in the case of
`FutureOrType`.
This change avoids creating new type parameters for function types,
which would interfere with construction of generic function types.
Change-Id: I8f7c0ec4348e962ca6e67a9c1224107f73f75474
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/270001
Reviewed-by: Joshua Litt <joshualitt@google.com>
Some other changes:
- Variable `id` renamed to `classId` in a few places. In this code there
are two types of IDs: class IDs and selector IDs, and they have the
same type. So just "id" is ambiguous to the reader.
- `SelectorInfo.sortWeight` and `SelectorInfo.isAlive` getters moved to
`DispatchTable.build` as local functions
- Most of the members are made private.
- List of selector IDs of a class is now a Set. These lists used to have
duplicate selector IDs coming from superclasses.
- `DynamicDispatcher.maybeCalledDynamically` special case for
`noSuchMethod` moved to `SelectorInfo.isAlive`, as the only reason why
we had that special case is to keep selector for `noSuchMethod` alive.
`maybeCalledDynamically` inlined in the use site.
Change-Id: Iff650862d57e376913bda67db74bc67466d45e87
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/269461
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
This makes things nicer to read in places that display implementation names, such as stack traces, debuggers, profilers and inspectors.
TEST=ci
Change-Id: I959f70d9e51be59801c4455f8c5ccac3c214c21a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/270502
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Based on Martin Kustermann and Slava Egorov's versions of memory mapped views.
This feature is disabled by default and even if the flag is enabled, it will fall back to the current strategy if the platform is not Linux or the new strategy fails.
Phase 1 stats from 50 runs:
---Before---
Max memory: 8786.766
Median memory: 8116.242
Average memory: 8327.404081632654
---After---=
Max memory: 7805.691
Median memory: 7137.203
Average memory: 7305.301122448978
Phase 2 stats from 50 runs:
---Before---
Max memory: 9273.359
Median memory: 8742.133
Average memory: 8868.929124999999
---After---
Max memory: 9409.672
Median memory: 7500.148
Average memory: 7650.154000000001
Phase 3b stats from 50 runs:
---Before---
Max memory: 8979.367
Median memory: 8705.215
Average memory: 8703.982755102037
---After---
Max memory: 7809.898
Median memory: 7455.609
Average memory: 7449.96102040816
Change-Id: I73d73cfb26218399367c72c886f247836b89925c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/269640
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Add annotations
@pragma('dart2js:load-priority:normal')
@pragma('dart2js:load-priority:high')
The test shows that these annotations are scoped.
This CL is just plumbing the annotation through as an argument to the runtime call to the code that implements `loadLibrary()`. Actual prioritization is not yet implemented.
Change-Id: Iff1404baf34192139dab95e2dbb01c2d4e8dae45
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/270283
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>