Commit Graph

45 Commits

Author SHA1 Message Date
Nate Biggs 3d2d6492c1 Add 'external-effect' pragma support to all the backends.
Call sites targeting a procedure annotated with `external-effect` will
not produce any code, including the argument which will not be
evaluated.

However, the single parameter will be treated as 'live' for the purposes
of any global analysis the backends do. This is useful for things like
protobuf shaking where a user may want to retain certain protobuf
messages without actually emitting the code that retains those messages.

Today this functionality is available internally in the vm and wasm SDK
libraries. dart2js has similar functionality represented via the
opaqueTrue and opaqueFalse booleans (which will cause conditional
branches to get shaken after analysis). This will replace dart2js's
opaque(True/False).

This also adds validation to the frontend to ensure a method annotated
with 'external-effect' is well-formed.

Change-Id: If1c4096673e655c58fe7638840a16125003e7809
Tested: Backend tests for codegen were added. A frontend test was added for the validation. A language test was added to confirm the behavior.
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/476020
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2026-04-27 09:42:38 -07:00
Stephen Adams 063b3c12a5 [dart2js] Add missing case of updating call attributes
When an indirect call is replaced by a direct call, the direct call
(HInvokeStatic) should have the correct attributes for the target.

Change-Id: I950b6ed4f1537e2420905ac45d89a2bd6f2fa2c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/448442
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
2025-09-05 11:56:32 -07:00
Stephen Adams 3f2a6963fb [dart2js] Improve algorithm for condition targets
1. Use a work queue to avoid recursion on deep trees.

2. Use a visited set to avoid cycles and repeated work on conditions like `b && b`.

Bug: #60801
Change-Id: If20de27b1ddd157feee2391289ec781c03f741ae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/431704
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2025-05-30 18:05:54 -07:00
Stephen Adams b00c777f79 [dart2js] allow-cse and allow-dce annotations
Add `@pragma('dart2js:allow-cse')` and `@pragma('dart2js:allow-dce')`.

These annotations allow the compiler to do common subexpression
elimination and dead code elimination on calls to getters and methods.

Change-Id: Ie4091466e4782a4d28a7f9bfbfdb60a5de45a384
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/426360
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2025-05-21 23:02:06 -07:00
Tim Maffett 4a821b4046 simple typo fix
Closes https://github.com/dart-lang/sdk/pull/60485

GitOrigin-RevId: efef9e67c7e2bb2ab8146f852bed98eb3590f360
Change-Id: I062510b397e368da9de195b50e332b25f52196c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/420620
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
2025-04-06 20:27:31 -07:00
Stephen Adams 9505e957e1 [dart2js] Add more refinements for null-test and type-tests.
Bug: #26835 #28330
Change-Id: I2ea5d3022901a67b10fdb7ca0a6233a22ca233bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/417328
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2025-03-25 17:30:21 -07:00
Stephen Adams 57f177210a [dart2js] Test for complex condition strengthening
Bug: #26835 #28330
Change-Id: Ic3bc05f1b5525e58173c335c5f3f4f91dd09e2f3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/417329
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2025-03-24 15:29:23 -07:00
Mayank Patke 66fa0e2a49 [dart2js] Clean up nullability adjustments in interface sufficiency test
Now that https://github.com/dart-lang/sdk/issues/60076 has been
addressed, we no longer need to widen the nullability ourselves.

Change-Id: I4bc5a1767d9e2d98bcf0ca4c24171482e0f600ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/409162
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2025-02-13 01:49:09 -08:00
Stephen Adams e962350dd6 [dart2js] Simply is-test when type parameters not needed
Sometimes the type expression of a is-test can be widened to one that
does not use type variables:

```dart
void addAll(Iterable<E> items) {
  if (items is List<E>) {
    ... items[i] ...  // code specialized to lists
  }
  ...
}
```

Changing `is List<E>` to `is List` is more efficient, but not possible
at the source level since the explicit type parameter is needed for
type promotion.

This change uses a predicate provided by the Kernel package to widen
an interface type when generating the CFG instructions for the
is-test. This can lead to knock-on optimizations like compiling `is X`
to `instanceof`.



Bug: #54998
Change-Id: I956b9d9b8a31ae40aee86e31def475baa9ab5cfe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/408124
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2025-02-06 16:54:50 -08:00
Stephen Adams a1c54855a6 [dart2js] Detect larger no-op regions
Change-Id: Id4ced6f3a54d40a3775b77fde8453e45a6383ee2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/404800
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
2025-01-24 14:35:55 -08:00
Stephen Adams b3502f17cb [dart2js] Reduce redundant phis with refinements
Redundant phi elimination removes phis that join the same value.
However, this does not work when one or more of the inputs has a refinement (HTypeKnown). This change adds redundant phi elimination when the phi inputs have refinements.

The need for this optimization shows up when static js_interop needs a dispatch on type for conversion:

```
final JSAny? jsValue;
if (value is String) {
  jsValue = value.toJS;
} else if (value is bool) {
  jsValue = value.toJS;
...
```

(The `.toJS` calls become no-ops since, for dart2js, we are already in JavaScript, and so leave an otherwise pointless if-then-else chain).

Change-Id: If1a94856592163a81ac36c686cee04232c16d197
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/403950
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2025-01-16 11:16:31 -08:00
Mayank Patke c878108cc8 [dart2js] Update pubspec to Dart 3.7 and reformat.
All non-pubspec changes generated by `dart format pkg/compiler`.

Change-Id: Iadaa70974816d96ccb47813fe72d5a2bb83d6bda
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/400181
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2024-12-13 11:24:50 -08:00
Stephen Adams 9162f0f9c9 Reapply "[dart2js] Make more use of kernel's static type"
This reverts commit f9aec1c997.

Change-Id: I731b29714797fbea38da09ed48a0dd4852af986b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/379669
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2024-08-15 18:58:55 +00:00
Stephen Adams f9aec1c997 Revert "[dart2js] Make more use of kernel's static type"
This reverts commit 1057e5575f.

Reason for revert: Breakage in product test

Original change's description:
> [dart2js] Make more use of kernel's static type
>
> This change helps with one hang-over from Dart 1.
>
> In code like `a[i] == 1`, the type of the indexed element was inferred
> as the element type of `a`. This was great if `a` was a traced List,
> but too general if the provenance of `a` is unknown, since the general
> element type over all lists is 'top'.
>
> Dart 3 gives much better guarantees than Dart 1. We can now rely on
> the front-end inferred type for `a[i]`. To do so, we track the
> abstract value contraint for the type through SSA so that SSA-level
> type propagation can re-apply the constraint.
>
> This removes about 100 interceptor calls from the main unit of some
> large ACX apps.
>
> Change-Id: I6839a6045d9341633c08678affb35fdb2998a96d
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/379145
> Reviewed-by: Mayank Patke <fishythefish@google.com>
> Commit-Queue: Stephen Adams <sra@google.com>

Change-Id: I5e2b9fde9ffd7d79332fd493649e8f342219c8ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/379667
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2024-08-08 22:14:38 +00:00
Stephen Adams 1057e5575f [dart2js] Make more use of kernel's static type
This change helps with one hang-over from Dart 1.

In code like `a[i] == 1`, the type of the indexed element was inferred
as the element type of `a`. This was great if `a` was a traced List,
but too general if the provenance of `a` is unknown, since the general
element type over all lists is 'top'.

Dart 3 gives much better guarantees than Dart 1. We can now rely on
the front-end inferred type for `a[i]`. To do so, we track the
abstract value contraint for the type through SSA so that SSA-level
type propagation can re-apply the constraint.

This removes about 100 interceptor calls from the main unit of some
large ACX apps.

Change-Id: I6839a6045d9341633c08678affb35fdb2998a96d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/379145
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2024-08-08 00:30:48 +00:00
Stephen Adams 15792df87e [dart2js] Use indexes for operation names and verbs
Change-Id: Ic954a7e20062aa8bf1c0f622ee9b0656bc563ba5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/375024
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2024-07-15 02:18:52 +00:00
Stephen Adams e66a0cbde8 [dart2js] Unmodifiable Array and typed data using flags
- Add SSA HArrayFlags{Check,Get,Set} instructions to check for
  fixed-length and unmodifiable JSArray and JavaScript typed data
  instances.

- Add optimizations to remove redundant checks.

- Added HOutputConstrained interface for instructions that must have
  the input and output in the same JavaScript variable. This
  generalizes some code generation logic already applied to HCheck.

Bug: #53785
Change-Id: I61750dd03aa3a964eed3bc76e1656c5f60f77109
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/372002
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2024-07-10 01:39:58 +00:00
Stephen Adams 3a91bcb39e [dart2js] SSA - pre-assign variable to reduce phi assignments
Introducing a partial redundancy with a variable with a longer
live-range can reduce the size of the emitted code.

Flute.complex (-O4): -0.377%
cm_shell (-O4): -0.029%

Change-Id: I0d03119b17f4b58d61f277bf8bb0e57d8e7c47c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/360360
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2024-06-17 22:47:57 +00:00
Stephen Adams 77496338dc [dart2js] Constant-fold const record accesses
I noticed that dart2js generated poor code for `(a, b) = (1, 2)`.
This is due to an oversight in not constant-folding record field loads.

Change-Id: Iac110d8c3373d7673c21494fc467f7fcb400de1d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371505
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2024-06-17 19:47:34 +00:00
Stephen Adams cc3b3f4976 [dart2js] Reduce x - 0.
25 hits in FluteComplex.
Many come from APIs with `[start, end)` range arguments that are unused so `length = end - start` is now optimized to `end`.

Change-Id: I59527f85323bed717d62249f0c1d69b477645ec2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/360444
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
2024-04-01 09:23:19 +00:00
Stephen Adams 4df361c3c3 Reapply "[dart2js] Replace phi with controlling condition"
This reverts commit aec3ec0244.

- Corrected 'controlling condition' detection.
- Added test that is incorrectly compiled to infinite loop with incorrect controlling condition detection.

See https://github.com/dart-lang/sdk/issues/54115#issuecomment-1944285230 for an image of part of the CFG for `doWhileLoop` where the condition in B4 was previously mis-identified as controlling `phi(true,false)` at B12.

Issue: #54115
Change-Id: I0d2c2ff83b202071f6d7050d34de8ff25d05cb22
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352443
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2024-02-15 01:02:39 +00:00
Mayank Patke aec3ec0244 Revert "[dart2js] Replace phi with controlling condition"
This reverts commit 75b1973041.

Reason for revert: Breaks g3 tests

Original change's description:
> [dart2js] Replace phi with controlling condition
>
> Rewrite `phi(true, false)` to the controlling condition.
>
> This patchset comparison shows the general effect: https://dart-review.googlesource.com/c/sdk/+/340065/2..3/pkg/compiler/test/codegen/data/phi_to_condition_test.dart
>
> This change is a partial remedy for http://dartbug.com/54115
>
> Issue: #54115
> Change-Id: Ibcc5d17f6c4c8ad9600840ec106f84edcd008e4a
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/340065
> Reviewed-by: Nate Biggs <natebiggs@google.com>
> Commit-Queue: Stephen Adams <sra@google.com>

Issue: #54115
Change-Id: Id717ef469b09a5b07e43b3ffafc54bc6b409f0df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350006
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2024-02-03 00:56:15 +00:00
Stephen Adams 75b1973041 [dart2js] Replace phi with controlling condition
Rewrite `phi(true, false)` to the controlling condition.

This patchset comparison shows the general effect: https://dart-review.googlesource.com/c/sdk/+/340065/2..3/pkg/compiler/test/codegen/data/phi_to_condition_test.dart

This change is a partial remedy for http://dartbug.com/54115

Issue: #54115
Change-Id: Ibcc5d17f6c4c8ad9600840ec106f84edcd008e4a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/340065
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2024-01-25 01:11:03 +00:00
Mayank Patke f79ed9301b [dart2js] Remove remaining language version overrides
Now that dart2js only takes migrated files as input, all tests should
use the current language version.

Change-Id: I6c84850f5786aeac04154b67bd7a3c19083c8bba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345344
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2024-01-23 01:26:09 +00:00
Nate Biggs ef75007c2f [dart2js] Fix as-check type registration.
We would expect failing as checks to throw in all modes (unless --omit-as-casts is provided). However, the new test program fails in production mode. This is because we are not registering the type usage of the function's type parameter. This leads us to drop the as check completely later on.

We should be doing subtype checks with nullability if we want to consider an as test omitted.

Golem patch results: https://golem.corp.goog/Comparison?repository=dart#targetA%3Ddart2js%3BmachineTypeA%3Dlinux-x64%3BrevisionA%3D107840%3BpatchA%3Dnatebiggs--dart2js--Fix-as-check-type-registration.-7%3BtargetB%3Ddart2js%3BmachineTypeB%3Dlinux-x64%3BrevisionB%3D107839%3BpatchB%3DNone

Fixed: https://github.com/dart-lang/sdk/issues/54419
Change-Id: If93f78a939a690f05f5398c1a5ca971df1fc9243
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/343821
Reviewed-by: Mayank Patke <fishythefish@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2024-01-09 00:04:50 +00:00
Stephen Adams 9864cb2231 [dart2js] Recognize larger no-op regions
Recognize larger regions of no-op control flow. Ideally we would be able to remove these regions from the CFG. Until then, pattern matching larger regions leaves fewer ghost conditions in the generated code.

With pattern matching, we are seeing more examples where this is necessary.

Bug: #29475
Change-Id: Ib0981400883631f56940288f8a32fbc5f3985dfb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/340067
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2023-12-06 19:05:19 +00:00
Stephen Adams 404edd9435 [dart2js] Fix SSA value range analysis bugs
Treat the loop update marker more like an ordinary symbolic value. The old symbolic marker attempted to do widening 'on the fly', which could lead to incorrect results when the update could reset the value to a constant lower than the starting value. The new version moves the widening to a single place, at the loop update.

Fix #53355 by caching intermediate results so that long chains of diamond control flow are not explored exponentially.

There are very few changes in apps. There is one change in a Flutter app that is like the changed codegen/value_range_test where the bounds check can be eliminated because the loop index may be decremented, but not more than the increment, so is still weakly monotonic. There is one change in a large ACX app where a lower bounds check is no longer removed but I *think* it was previously removed incorrectly, though it is hard to tell since it is in a huge function.

Issue: #48465
Issue: #53078
Issue: #53355
Change-Id: Ib125cd6bb30cef52f8dfcd53eaa13e439f26316c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/322594
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2023-08-29 00:52:58 +00:00
Stephen Adams d3da4311c0 [dart2js] Lower String.codeUnitAt to charCodeAt
Change-Id: Id4408a761304fc2fcb7ce3bd353c626958971ffb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/300500
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2023-05-05 15:27:11 +00:00
Stephen Adams 073def1334 [dart2js] Add codegen test for logical operator generation
Change-Id: I5f86fdf4e58122a234dc2c7b16e1e16ec44d0d83
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/297360
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
2023-04-24 18:47:14 +00:00
Stephen Adams 90bba41618 [dart2js] Compile more is tests to instanceof
`o is T` where `T` is an interface implemented by a class hierarchy
can be implemented as `o instanceof R` where `R` is the root of the
hierarchy. The common case is that `R` is a single implementation
class.

`is Record` and `is Type` now generally use `instanceof`.

Fixes: #51366
Change-Id: I1943533bc53024f3199f71910034d49cf6661b22
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/294320
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2023-04-11 21:06:00 +00:00
Stephen Adams de5469376c [dart2js] Use && instead of if-then for late field checks
0.26% reduction in a medium-large sized Angular app.
0.12% on our huge app.

Change-Id: Ifc6b332e420168bc470e6994bf0d1a60e53fdd74
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/248446
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2022-06-15 18:47:49 +00:00
Stephen Adams 3099911746 [dart2js] Add @pragma('dart2js:disable-inlining') annotation
This annotation prevents inlining at call sites within the method that
is annotated.

The main expected use is to control inlining in unit tests.

Change-Id: Ib6652f0b4cb7a34c6bf829b1be5c09e241ffbde2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/248345
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-06-14 18:08:23 +00:00
Stephen Adams 6384eceedc [dart2js] Late instance field optimizations
Late fields start out holding a sentinel value and after they are initialized or assigned, never hold a sentinel value again.
This CL implements some removal of checks and loads based on this monotonic behaviour.

On two large Dart Angular apps, this reduces the number of late-instance-field checks by ~25%.
One app is 0.44% smaller, the other is 0.98% smaller.

The optimization_test.dart no longer forces `--disable-inlining` because that prevents the inlining that exposes the optimization opportunities.
Most tests already use `@pragma('dart2js:noInline')` to prevent inlining where relevant.

Change-Id: I2327a96e69191313ed6c07eabe94aa2962fb2648
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/246881
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-06-07 05:57:59 +00:00
Stephen Adams 5c2ca380a4 [dart2js] Tag all sources with @dart = 2.10
Change-Id: Ie9c7548dc81b58db0c1149124db79e4cf1430cc1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/239723
Reviewed-by: Nate Biggs <natebiggs@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2022-04-06 21:31:45 +00:00
Stephen Adams 6231245e80 [dart2js] Constant-fold indexers of constant Lists and Maps
Change-Id: Id2a15047759d3b1b8230379adff314e9052c922c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/235283
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2022-03-05 02:14:31 +00:00
Joshua Litt 76ac2ee172 [dart2js] Flip 'holder per part' flag.
Change-Id: I1ecf0d2628685738b0631040d6fe61d635164fb6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212340
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2021-09-14 20:31:20 +00:00
Joshua Litt 6604d5be1a [dart2js] Fix bug with prioritizing holders.
Change-Id: I3f7f151e54e5592716138386c962708ea7f50a38
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212621
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2021-09-07 23:07:14 +00:00
Joshua Litt 202277c689 [dart2js] Create holder per output unit.
Change-Id: I3c6083f0732c3533a57c5857b3e69e2dc791ce7e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198580
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2021-06-24 15:38:38 +00:00
Stephen Adams b529afd10a [dart2js] rename setRuntimeTypeInfo to _setArrayType
For a long time now this is used only to put types on JSArray.

Change-Id: I31f15d313d7e131eecac76697a8938c197f83e7d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195940
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2021-04-22 02:06:31 +00:00
William Hesse 0cb6607cf1 [sdk] Bump version to 2.14
TEST=CI presubmit with added tryjobs

Change-Id: I6c4f7de9d3fbe6d1031f6f0161e8ffebcea822a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195062
Commit-Queue: William Hesse <whesse@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2021-04-13 12:47:27 +00:00
Johnni Winther 1eda15854d [cfe] Allow experiments only in current sdk version
Experiments that have not be enabled by default should only be allowed
in the current version of the sdk.

Closes #45460

Change-Id: I159f390ac85fe37943920717ce11a4c817d5b4a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193480
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2021-03-31 15:20:08 +00:00
Stephen Adams 39aa454e7b [dart2js] Implement int.>>> optimizations
Change-Id: I7d54bc523bb81c5ae8d6fed4ec2e6df473206788
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/187340
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2021-03-09 02:20:06 +00:00
Stephen Adams 08f90cad84 [dart2js] Use 'num(ber)' wherever possible instead of 'double'
JSDouble represents doubles that are not integers. It is usually wrong
to use JSDouble, so use JSNumber instead where we mean 'all double
values'.

This fixes #44818 by not mistakenly pretending that division cannot
have an integral result.

Will follow up with a CL to rename JSDouble.

Fixed: 44818
Change-Id: Ic324df2ee1f2c7434bc0b064c0dbd7b6800ad93b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183360
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2021-02-08 22:06:54 +00:00
Leaf Petersen a6faf8f2f9 [Language] Enable null safety in Dart 2.12.
Closes https://github.com/dart-lang/sdk/issues/22

Change-Id: I662dd17fda0ff62a871314896fbf1dbe220f41de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166790
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Leaf Petersen <leafp@google.com>
2020-10-29 18:25:56 +00:00
Stephen Adams d5e790b2b1 [dart2js] Add golden function codegen tests
As with other 'id_equivalence' tests, the information can be generated
via the '-g' flag.

Bug: 43778
Change-Id: I316d539f7575e349dc55ecb564de7b65f0f21575
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/167480
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2020-10-14 22:32:38 +00:00