A followup change will delete the patches that are no longer needed once
these changes have been "mirrored" :P to the libraries files in the
flutter repos.
Change-Id: I7d255838b97922198248b29311facd4956001e25
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134405
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
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>
The reduction 'return null;' --> 'return;' now happens only at return
statements that do not have an expression.
There is a slight increase in code size, 0.11% for flutter gallery
minified, 0.105% for acx gallery minified, 0.04% CM.
Change-Id: I0723a398267aede5e8dd04d7d45beae2f306c1be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133863
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
A new instruction, HInvokeExternal, codes a variety of calls to JavaScript.
'native' and js-interop calls use this instruction instead of
HForeignCode. This leads to fewer places generating similar JavaScript
patterns, and slightly better scheduling around call sites.
More js-interop calls are now lowered to direct JavaScript calls rather
than interceptor calls.
Change-Id: I8d30827bb099d27f4cc2ad469449769418ccb6da
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133021
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
This seems to happen in a check-chain when the input is unnamed. I'd
rather name something than do this, since it interferes with counting
occurrences for sharing constants.
Fixed: 40349
Change-Id: I6a077707b172cee7505130119e41f856244f9424
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133624
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Add a visitor that checks for invalid JS interop usage and reports
diagnostics. Wire the visitor up to the `DevCompilerTarget` and `Dart2jsTarget`.
- Add a message without an analyzer code for this error. In the long term we may
want to also add it to analyzer.
- Add a new package `_js_interop_checks` to share the kernel visitor between
dart2js and ddc. Some of the code is copied from ddc, and in the long term we
can centralize more of the detection of JS interop annotations to this
package.
- Implement the first check to detect definitions of `operator []` or
`operator []=` which are not allowed in JS interop classes.
Change-Id: I095a4b7f4732796dbc3cae55b32d5fc9bcdbd798
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130733
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
- fixes check_nnbd_sdk.dart to run on dart2js patch files
- splits golden file used by that script by target
- adds it to the old-rti bot (until we get the new nnbd bot)
- adds a suite that runs legacy tests in nnbd weak mode
Change-Id: I0a89534dcd1cf7338849d59ab3e5d989d2ecf3d0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131885
Reviewed-by: Vijay Menon <vsm@google.com>
See: https://github.com/dart-lang/language/pull/779/files
Currently this only handles one or the other configuration via the flag.
We might have to add extra logic to change the default when no flag is provided
depending on how that proposal lands (likely the requirement will be to default
to weak if the main entry point is opted-out, but default to strong otherwise).
Change-Id: Iebf573f251de6a3a9cf93781b76061f41c181f3c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131761
Reviewed-by: Mayank Patke <fishythefish@google.com>
This also reverts the use of indirection for `==` during global inference, as it
turns out the bulk of edges from that selector were added because of the missing
static type data.
Change-Id: I970fea214983c7b2350466fc932ef45d6f7ad96e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130501
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Removes uses in static, constructor, super calls, and closures. Also moves the
mask field to the dynamic call site nodes (direct and indirect) to avoid
confusion.
Change-Id: I97d3217c18d15bad7db1723b2a8b20e4dc616f68
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130560
Reviewed-by: Stephen Adams <sra@google.com>
note: NativeBehavior also has a SideEffect property, which is only used for
foreign helpers. If we add annotations in the future, we could move the effects
there and consume them at this point in inference.
Change-Id: I3e62faa3d80c0ba96a2626972c332c27eb52c142
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130964
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
This reverts commit f6ec68444f.
Reason for revert: the 'isControlFlow()' property did actally have a use orthogonal to 'isJsStatement'.
Original change's description:
> Remove HInstruction.isControlFlow()
>
> The use of this property was confused.
> It was not clear if it referred to HControlFlow instructions (the last instruction in a block),
> or whether it will be generated as JavaScript containing control-flow.
>
> We keep isJsStatement() for HInstructions that must be generated in statement position.
> If the instruction has an output, it must be one of the inputs and variable allocation
> makes the input/output available as a JavaScript variable.
>
>
> Change-Id: I8018335f42787727b14ae26297fd96fbf52adb7d
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130640
> Reviewed-by: Sigmund Cherem <sigmund@google.com>
> Commit-Queue: Stephen Adams <sra@google.com>
TBR=sra@google.com,sigmund@google.com
Change-Id: I175a1112319fcc839076218f97b75425ee72d51b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130888
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
The use of this property was confused.
It was not clear if it referred to HControlFlow instructions (the last instruction in a block),
or whether it will be generated as JavaScript containing control-flow.
We keep isJsStatement() for HInstructions that must be generated in statement position.
If the instruction has an output, it must be one of the inputs and variable allocation
makes the input/output available as a JavaScript variable.
Change-Id: I8018335f42787727b14ae26297fd96fbf52adb7d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130640
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
This change:
* adds the `--use-old-rti` flag to revert to the old behavior
* enables the new behavior by default
* changes the -rti- builders to run the old rti instead of the new rti
* documents the change in CHANGELOG.md
I've kept around the logic as `useNewRti` to avoid swapping all the conditions
in the compiler.
Change-Id: I773ac33b658cb60f72e0b6beef83375abec31bad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127492
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
The resolution-world-builder and impact transformer were holding onto a
class-hierarchy-builder in dart2js, which uses a lot of space.
On a some artificial sample apps with thousands of classes this
reduces the overall memory capacity by 25%. On a large internal app
this reduced the overall memory capacity from 13G to 11G.
Change-Id: I5d0d40764649364f2cd2411ef1346812beb411c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129544
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>