With constant-update-2018 enabled, ConstantExpression nodes are added to the AST. The defaultNode() implementation increments each node count by 1 whenever we see a ConstantExpression and then does it again when we visit the child DartType, resulting in each ConstantExpression being counted twice. Instead, we should just increment the node counts when we see a ConstantExpression and not visit the children.
Change-Id: Ifdbda2913420eea1463790cab2e477e7552d1394
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106727
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
Emit as-casts and type-checks.
The recipes and environments are dummy values, and there is no
propagation of type information, so the code is pretty terrible.
Change-Id: Iea8b7d7dddd4538187d88f12e9ed81439f74d0e1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106428
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
In anticipation of adding type metadata for --experiment-new-rti, move the embedded
globals earlier so they are available for generating constants.
The metadata for custom elements is split out since it depends on constants.
Change-Id: Ic99895bd1a1f7bf42a1f41948733ea001df8a8e2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106007
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
* move names to Identifiers
* move resolution parts to front end strategy
* move codegen parts to backend strategy
* remove now unneeded methods from FrontendStrategy and BackendStrategy
Change-Id: I0675d56045dd212ad195177ecd23b27b0d849a80
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105742
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Eventually it should be handled by Procedure.isRedirectingFactoryConstructor, but that is
currently broken for patch files.
It appears the VM has no patches of that kind, but dart2js does.
Change-Id: I0b64379f16089ad0d98ecd4df1ed9282ed6bc0e7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98523
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Closes#37153
Isolate.resolvePackageUri was the only API which had an implementation
across DDC and dart2js. The implementation in dart2js has been broken by
default since Dart 2.0.0 without a user implemented hook that is not
used on any public repo on github. Our current supported path for
invoking the compilers on projects disallows the import altogether on
the web and it is only usable with an older version of the
`build_web_compilers` package, or by invoking the compiler manually
outside of the build system. This CL does not break the ability to have
the import when invoking outside of the build system.
- Drop implementation for `Isolate.resolvePackageUri` from the dart2js
and DDC patch files.
- Drop all references to `defaultPackagesBase` since it is not used.
- Drop all tests under `isolate/browser` since we do not expect any
support on the web. Most of these tests would have already been
failing. Remove status file entries that refer to the deleted tests.
Change-Id: I4a19213b0946d835c00e9c107a714f3bc5672f86
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105080
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
Introduce HPrimitiveCheck for checking the receiver or argument of
primitive operations. These will eventually go away with NNBD since it
will be a call-site type error to invoke `+` with a null receiver or
operand.
Change-Id: I54bf64f8231a234341c1ddf5ad4dba26909d613d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104185
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Merges InlineWeeder and InlineReductive into one visitor and computes
an InlineData object from which all decisions can be made.
Next step is to compute InlineData in the scope visitor (the first visitor
of the first modular phase).
Change-Id: I0c435ae1b3d7afdff1cee7abac657c9362995a67
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103632
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
This avoids (yet another) inconsistency from the imprecision of
called once. In this case the inlining of some methods that are
called once is dependent on whether we meet their call-site directly
or indirectly first, effectively making the inlining decision subject
to the enqueuing order.
Change-Id: I8d6b9c18fdb82f6d1b566e6bb58344211678daf2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103631
Reviewed-by: Sigmund Cherem <sigmund@google.com>
To use for modular codegen. Creates ModularName and ModularVariableUse
for naming decisions that need to be deferred to world-impact application
time.
The class is still unused, awaiting refactoring of world-impact application.
Change-Id: I7d4d30da587ccf814b2d879b26f76de2eb3ca276
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101525
Reviewed-by: Sigmund Cherem <sigmund@google.com>
We don't support that currently and if we want to at some point in the future,
I'd rather implement it from scratch, and the current implementation tightly
couples various parts of the compiler to the `Compiler` object.
Change-Id: I6934df41bb363ea9a693a8181b5a0355774ba4b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101286
Reviewed-by: Sigmund Cherem <sigmund@google.com>