Commit Graph

56 Commits

Author SHA1 Message Date
Stephen Adams 630a3aafb0 [dart2js] Slightly smaller constant lists
Move the setArrayType call into the makeConstantList helper.

Shaves ~8k of small Flutter apps.

Change-Id: I8ff17e93ad3ad9e09292e294e2c2ddcbe66c5d33
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428560
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
2025-05-15 14:48:49 -07:00
Mayank Patke 553ac951b3 [dart2js] Add indexable bits to powerset.
Change-Id: I5d4c0b4d15a05cfc30d87003785ca841c46b1a0f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/426583
Reviewed-by: Stephen Adams <sra@google.com>
2025-05-07 19:18:38 -07:00
Mayank Patke b941f6f0f4 [dart2js] Add modifiable/growable bits to powerset.
Change-Id: Ic8abbe3729a4c3b41fde0a37d8b6afe84bd9ba48
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/407920
Reviewed-by: Stephen Adams <sra@google.com>
2025-05-07 19:18:38 -07:00
Mayank Patke 7103d43876 [dart2js] Add powerset bits for interceptor domain.
Change-Id: Id9509c6b6eb8143263763e508512c0703d4aa493
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/404500
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2025-04-16 18:14:21 -07:00
Mayank Patke 34d674ba19 [dart2js] Remove cyclic throw
Change-Id: I1ae53d055786cec70a0a3999e04016a085c85e4e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/417324
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2025-03-27 13:46:20 -07:00
Mayank Patke 77cd774d08 [dart2js] Remove legacy type test specializations.
Bug: #60327
Change-Id: Ie9b1b86c0f7695e0b9d377004a082f56f44bd57f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/416160
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
2025-03-18 19:09:54 -07:00
Mayank Patke d0e09ea091 [dart2js] Print powerset value in typemask toString methods.
We may find it useful later to add a more verbose stringification that
writes out the properties expressed by the powerset. For now, just
printing the int value is sufficient to debug e.g. test failures, and
it's relatively straightforward to manually convert an int to a set of
properties by looking at the definitions of the powerset domains.

Change-Id: I2397ffd83a6e86830f67c7f1ef811e33c0b7ff3c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405567
Reviewed-by: Nate Biggs <natebiggs@google.com>
2025-03-07 04:20:04 -08:00
Mayank Patke b1849f5fcc [dart2js] Delete regression test for unused dump-info mode
Change-Id: I491fd7c47f33ef900ab3189dee224291c7b2d73f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/414165
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
2025-03-06 16:47:29 -08:00
Nate Biggs 237742feab [dart2js] Remove '--no-sound-null-safety' flag and make '--sound-null-safety' flag a no-op with warning.
Change-Id: I0225f9306aa2a84494f3fc17c9f7191214404249
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/406081
Reviewed-by: Ivan Inozemtsev <iinozemtsev@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2025-03-03 15:46:16 -08:00
Stephen Adams 32082be3eb [dart2js] invariance optimization for field setters under -O2
Calls to the implicit setters for fields are replaced with field assignments (HFieldSet). This is inhibited when the setter needs to check its argument, which happens when the field type is covariant and the checks not 'trusted', i.e. at optimizations level `-O2` and lower (aka 'spec' mode).

This optimization detects when the check is unnecessary due to invariance. If the receiver of a setter instance call to the the implicit setter has `this` as a receiver and the setter does not have an explicit `covariant` declaration, then the check will always pass, so the setter call can be replaced with HFieldSet.

This optimization works well for Iterators for generic collections at the assignment to the `_current` field, with some iteration-heavy benchmarks improved by 20-50% at `-O2`.

Change-Id: I4f3ffd08b45ba28de721535afc3c7a6d1e486a3d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405448
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2025-01-27 16:24:09 -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
Kallen Tu 1bf5482e1e Enable 'wildcard-variables' feature flag.
This CL enables the wildcard variables feature by default in Dart 3.7.

Local variables and parameters named `_` are now non-binding and they can be declared multiple times without collisions. All wildcard variable declaration types that have this behavior are described in the
wildcard variables specification: https://github.com/dart-lang/language/blob/main/accepted/future-releases/wildcard-variables/feature-specification.md.

Top-level variables, top-level function names, type names, member names, etc.
are unchanged. They can be named `_` and used as they are today.

These are a few examples of where wildcard variables can be used:
```dart
Foo(_, this._, super._, void _()) {}

typedef T = void Function(String _, String _);

main() {
  var _ = 1;
  int _ = 2;

  list.where((_) => true);
}
```

Bug: https://github.com/dart-lang/sdk/issues/55673
Fixes: https://github.com/dart-lang/sdk/issues/55654
Change-Id: I80e904d39b364f5e54b8406b4db02ec40ecc9db0
TEST=Existing tests, language tests for wildcards.
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/381311
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2024-10-15 19:12:31 +00:00
Nate Biggs b28913c7e1 [dart2js] Make 'load-priority' pragma pass an arbitrary option string.
Change-Id: I4d9fb69dfb4ec040b0e63893e4ace33c6a5dd454
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/384360
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2024-09-09 19:47:48 +00: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
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 849459109a [dart2js] Remove dump info metadata memory overhead from emitter phase.
We recently added the ability to pass a `--write-dump-info-data=` flag to Dart2JS's emitter phase which will serialize the necessary metadata to run dump info as a standalone phase of the compiler.

This extra metadata was incurring an overhead since we were maintaining JS AST nodes longer in order to extract metadata out of them. With this change we get rid of that overhead. The nodes are only retained until they printed and then any references to them are freed.

After this change the memory usage of the emitter phase is the same with or without the `--write-dump-info-data=` flag. There is still however some additional overhead in runtime. This is of course unavoidable as we are doing extra work to serialize the data.

Change-Id: Ib45a0e1de96d41503cbd76217b841ff013ac0655
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/331000
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2023-10-21 02:18:48 +00:00
Sigmund Cherem cd959f4b45 [dart2js] cleanup golden test.
Unfortuantely this golden test is set up to test two configurations, the
default dump-info and a experimental kernel-first dump-info. The latter
wants to reuse the same expectations to ensure the output is the same,
but it's configuration confuses how `dump_info_test.dart -g` works. If
it sees a discrepancy it will duplicate the expectation and add a new
one instead of updating the old one.

I haven't investigated the best way to fix that, but for now, this CL
remerges the expectation so that we continue to only have one copy of
the expectations.

Change-Id: I5d2781b85ae92e8e83b6a4c395a7353bcbcca17a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/331321
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Auto-Submit: Sigmund Cherem <sigmund@google.com>
2023-10-20 00:06:18 +00:00
なつき e285a57248 [dart2js] Fix compatiblity with Node.js 21
Closes https://github.com/dart-lang/sdk/pull/53796

GitOrigin-RevId: caeeb52bb832c401a22d7ba3410f42cb50d6c8c6
Change-Id: I145ecca62875a82f348ce1ea78fb935880d10688
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330987
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2023-10-19 03:46:18 +00:00
Nate Biggs b6e3c5cffd [dart2js] Sort holders before emitting them.
When serializing JS, we can sometimes end up changing the order we visit ModularExpressions. This can mean their indices are not stable against serialization and so the emitted code (and as a result hashes for that code) can change if the compiler did any serializing during the compilation.

We can make the order stable by sorting the holders before we process them.

This removes diff in hashes when running this (`--test-mode` forces serialization):
```
out/ReleaseX64/dart-sdk/bin/dart compile js benchmarks/OmnibusDeferred/dart/OmnibusDeferred.dart --out=om1a/m.js
out/ReleaseX64/dart-sdk/bin/dart compile js benchmarks/OmnibusDeferred/dart/OmnibusDeferred.dart --test-mode --out=om1b/m.js
```

Bug: https://github.com/dart-lang/sdk/issues/53466
Change-Id: Ibec88ff6acb71f1e96cbdb1d5ef4200d370cc3c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325100
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2023-09-09 01:50:52 +00:00
Nate Biggs 1f61b1d521 [dart2js] Clean up old IndexedSink/Source logic.
We've been using the Unordered version (which support deferred serialization) of these for a while now. Removing the ordered version (and associated flags) since they're essentially dead code at this point.

Change-Id: I522682b8e0688deda6784628b65d41389cdb9791
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/322161
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2023-08-22 21:18:33 +00:00
Nate Biggs 37fba7b9dc [dart2js] Add alias mapping for deferred import IDs.
Today the deferred import mapping is missing a way to match a specific user-defined deferred load alias to a corresponding runtime load ID. This adds a new field, "importPrefixToLoadId", under each library entry, which is keyed by library URI, which maps from the user-defined deferred load ID to the Dart2JS runtime load ID.

Example using https://github.com/dart-lang/sdk/blob/main/tests/language/deferred/split_constants_canonicalization_test.dart:
```
{
  "_comment": "This mapping shows which compiled `.js` files are needed for a given deferred library import.",
  "split_constants_canonicalization_test.dart": {
    "name": "<unnamed>",
    "imports": {
      "1": [
        "out.js_1.part.js"
      ],
      "4": [
        "out.js_2.part.js"
      ]
    },
    "importPrefixToLoadId": {
      "a": "1",
      "b": "4"
    }
  },
  "split_constants_canonicalization_a.dart": {
    "name": "<unnamed>",
    "imports": {
      "2": [
        "out.js_4.part.js",
        "out.js_3.part.js"
      ],
      "3": [
        "out.js_4.part.js",
        "out.js_5.part.js"
      ]
    },
    "importPrefixToLoadId": {
      "a_1": "2",
      "a_2": "3"
    }
  },
  "split_constants_canonicalization_b.dart": {
    "name": "<unnamed>",
    "imports": {
      "5": [
        "out.js_4.part.js",
        "out.js_6.part.js"
      ],
      "6": [
        "out.js_4.part.js",
        "out.js_7.part.js"
      ]
    },
    "importPrefixToLoadId": {
      "b_1": "5",
      "b_2": "6"
    }
  }
}
```

Change-Id: Ia6a6f8e45613c0081485e3fe5ddc84627749ee8e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317222
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2023-08-03 22:13:40 +00:00
Nate Biggs fe73f0cf5d [dart2js] Reduce size of Dart2JS deferred loading event logs.
- Only include the script tag src if it differs from the previous log entry.
- Use single letters for each event field's key.
- Fix some typos.
- Remove 'uri' from download event as it can be inferred from script tag src and part file name.

Change-Id: Ib7916ea5e92720a10c7e1e1cab2e535fae2bbf49
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311180
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2023-06-26 20:43:32 +00:00
Nate Biggs eb7dc8494a [dart2js] Fix event log init logic.
The bug can be occur when 2 Dart2JS apps load on the same page but 1 uses a version of the Dart2JS runtime prior to https://dart-review.googlesource.com/c/sdk/+/309361 and the other uses the runtime from after 309361. If the one from before 309361 loads onto the page first, the `$__dart_deferred_initializers__` will be initialized without `eventLog`. Then the second app will load and see that `$__dart_deferred_initializers__` is present and try to add to `eventLog`, but `eventLog` will not be present.

This would cause an exception in the Dart2JS runtime and probably prevent the page form loading correctly.

Change-Id: I05b17867e24ae80cb4d7cdc615c8b985321912f5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/309761
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2023-06-15 21:58:34 +00:00
Nate Biggs df0382c900 Reland "[dart2js] Simplify event log initialization logic in each part file prologue."
This is a reland of commit 7b2d5baa48

Original change's description:
> [dart2js] Simplify event log initialization logic in each part file prologue.
>
> Change-Id: I0731b78f5b0437f5e5026ee6d9f2511698968804
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/308201
> Commit-Queue: Nate Biggs <natebiggs@google.com>
> Reviewed-by: Sigmund Cherem <sigmund@google.com>

Change-Id: I0bc53c9d0745ea01af638f47e503c9570dec266b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/309361
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2023-06-14 18:26:55 +00:00
Ilya Yanok 042952ef9b Revert "[dart2js] Simplify event log initialization logic in each part file prologue."
This reverts commit 7b2d5baa48.

Reason for revert: breaks ~600 tests in G3 (though it looks to be just one JS file that got broken), b/287219647

Original change's description:
> [dart2js] Simplify event log initialization logic in each part file prologue.
>
> Change-Id: I0731b78f5b0437f5e5026ee6d9f2511698968804
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/308201
> Commit-Queue: Nate Biggs <natebiggs@google.com>
> Reviewed-by: Sigmund Cherem <sigmund@google.com>

Change-Id: Iedd1b0a4909f490bc54eebde3462e6bd57c3c1a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/309283
Reviewed-by: Alexander Thomas <athom@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Ilya Yanok <yanok@google.com>
2023-06-14 15:53:07 +00:00
Nate Biggs 7b2d5baa48 [dart2js] Simplify event log initialization logic in each part file prologue.
Change-Id: I0731b78f5b0437f5e5026ee6d9f2511698968804
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/308201
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2023-06-13 00:50:49 +00:00
Nate Biggs ac6150c4c0 [dart2js] Improve deferred part file logging.
Adds an "eventLog" property to the global "$__dart_deferred_initializers__" object. The event log is just a JS Array that gets initialized alongside $__dart_deferred_initializers__.

Each event entry is a String->String JS object. I unified the format of these event objects for easier parsing.

Each printed event is now valid JSON (passed through JSON.stringify) so we can more easily post-process the logs if necessary.

Fully replacing the existing "_eventLog" field makes the logging logic simpler. Having a single array allows us to not include a timestamp because the array captures the event ordering (actual timing doesn't matter). It also makes it easier to stringify the logs when there's only 1 data source/format.

Sample output:
```

{"hunkName":"out.js_1.part.js","event":"loadHunk"}
{"uri":"path_to/out.js_1.part.js","hunkName":"out.js_1.part.js","event":"downloadHunk"}
{"file":"out.js_1","event":"beginLoadPart"}
{"file":"out.js_1","event":"endPartLoad","hash":"aCscY7yv4EHodRPmCqYn5BqMelA="}
{"uri":"path_to/out.js_1.part.js","hunkName":"out.js_1.part.js","event":"downloadHunkSuccess"}
{"hunkName":"out.js_1.part.js","hash":"aCscY7yv4EHodRPmCqYn5BqMelA=","event":"initialize"}

```

Change-Id: Ifee73be0bf7dc53a0e7710ff033dd2b0fae9fb0e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307240
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2023-06-09 17:05:11 +00:00
Nate Biggs a8e7db5deb [dart2js] Consolidate type narrowing logic.
Currently _narrowType for TypeInformation nodes has logic to process DartTypes. This logic is a simplified version of the logic in createFromStaticType. We can consolidate the two and just use createFromStaticType directly.

And since the static type is only ever used for this type narrowing (and its immutable) we can create the AbstractValue up front and store that instead of the DartType.

There was no difference in the emitted JS when tested on 2 large programs.

Change-Id: I432279684580edf64ff52254653bd26501d461b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/304160
Reviewed-by: Mayank Patke <fishythefish@google.com>
2023-05-22 18:38:23 +00:00
Nate Biggs 545ee13cd4 [dart2js] Clean up usages of 'new' keyword.
Change-Id: I193e19581d29a9c4b343ae0a681d1ff530cfce1d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/281309
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2023-02-14 02:36:38 +00:00
Nate Biggs e48df2f7f3 [dart2js] Carry library load priorty through to script tag creation.
Change-Id: Ie05b5ffe0f2e1638faf8b784a2e8c5535ec0d76a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272760
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2022-12-02 05:19:53 +00:00
Mark Zhou aef5a347c0 [dart2js] Re-adding dump info kernel regression tests.
These tests should the in the options file to enable them, but they should only be regenerated from the non-kernel dump info tests.

Change-Id: I4baf7459eb0ffce88363f1a791a585c78af73dbc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272701
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2022-11-30 06:42:58 +00:00
Nate Biggs 3121b8e3ed [dart2js] Fix goldens for dump info tests (bots failing).
Change-Id: I2c4a56f7e9f7073705b56ebe7a7b819458a1f794
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272400
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2022-11-28 20:19:37 +00:00
Kevin Moore d359e07aad [dart2js] Fix test breaks from dump-info change
Follow-up to 67015b7175

Change-Id: I6ead83e66a6dda23029b89fbec509861fa9dadd7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/271861
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Auto-Submit: Kevin Moore <kevmoo@google.com>
2022-11-24 03:28:28 +00:00
Stephen Adams b8d85b7ad3 [dart2js] loadLibrary priority annotation
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>
2022-11-18 19:22:29 +00:00
Mayank Patke 581db69c7a [dart2js] Avoid adding empty type rules.
The fragment emitter already tries to skip the call to `addRules` if the
ruleset is empty, but this occurs too early. The ruleset encoder strips
tautologies like `T <: T` and `InterfaceType <: Object`, but this occurs
after the empty check.

This CL removes the preprocessing from the encoder and instead performs
checks when entries are added to the ruleset, fixing the issue.

Change-Id: I62f937e0ff6abac12973f82b2c89d8ea6f3162b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258040
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2022-09-08 19:25:43 +00:00
Nate Biggs 4b78f1b6c7 Reland "[dart2js] Enable flag (canary -> shipping) to intern dart type values."
This reverts commit 0e1d24ae80.

Reason for revert: Interning bug fixed by https://dart-review.googlesource.com/c/sdk/+/255257

Original change's description:
> Revert "[dart2js] Enable flag (canary -> shipping) to intern dart type values."
>
> This reverts commit e833510bc5.
>
> Reason for revert: breaks many tests in G3, see b/242822389
>
> Original change's description:
> > [dart2js] Enable flag (canary -> shipping) to intern dart type values.
> >
> > Change-Id: Iebac3a7c57665eccd100146f892b891a4591f554
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255201
> > Reviewed-by: Stephen Adams <sra@google.com>
> > Commit-Queue: Stephen Adams <sra@google.com>
>
> TBR=sra@google.com,natebiggs@google.com
>
> Change-Id: I9b2be8fc119f84f33181245cdfce416d13660daf
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255401
> Reviewed-by: Ilya Yanok <yanok@google.com>
> Reviewed-by: Alexander Thomas <athom@google.com>
> Commit-Queue: Ilya Yanok <yanok@google.com>

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I51336c2e53dd58fed6216e9a5c818f05e8795a8f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255663
Reviewed-by: Nate Biggs <natebiggs@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2022-08-18 21:30:54 +00:00
Ilya Yanok 0e1d24ae80 Revert "[dart2js] Enable flag (canary -> shipping) to intern dart type values."
This reverts commit e833510bc5.

Reason for revert: breaks many tests in G3, see b/242822389

Original change's description:
> [dart2js] Enable flag (canary -> shipping) to intern dart type values.
>
> Change-Id: Iebac3a7c57665eccd100146f892b891a4591f554
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255201
> Reviewed-by: Stephen Adams <sra@google.com>
> Commit-Queue: Stephen Adams <sra@google.com>

TBR=sra@google.com,natebiggs@google.com

Change-Id: I9b2be8fc119f84f33181245cdfce416d13660daf
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255401
Reviewed-by: Ilya Yanok <yanok@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Ilya Yanok <yanok@google.com>
2022-08-17 12:29:03 +00:00
Nate Biggs e833510bc5 [dart2js] Enable flag (canary -> shipping) to intern dart type values.
Change-Id: Iebac3a7c57665eccd100146f892b891a4591f554
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255201
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2022-08-17 02:50:42 +00:00
Nate Biggs f7afab742a [dart2js] Reland deferred-serialization flag
Change-Id: I5774a271b4197945682439de6fe59771895547ef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/251882
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2022-07-19 18:02:06 +00:00
Mark Zhou 0ee0fba728 [dart2js] Adding supertype hierarchy to dump info
Note: this info is not added to the proto format

Change-Id: Ic7407405dea7bcd7b9d3328cfe0850609dc007a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250785
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2022-07-19 00:55:53 +00:00
Nate Biggs 386ad2ff46 [dart2js] Unland deferredSerialization flag
Change-Id: Id04cab15d8e81df9661390b1d4cc48d2767abded
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/251243
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-07-14 01:00:43 +00:00
Nate Biggs 397c8d26dd [dart2js] Enable deferred-serialization flag by default.
Change-Id: I7f462a6a944abbf9eea4381ff72f9ebdf74fae61
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250201
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2022-07-07 20:38:13 +00:00
Mark Zhou b40969ea57 [dart2js] Adding function kind info to closure call methods
Change-Id: Ibb78a41c8e414c909999591c8d667a7697af32ef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250147
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2022-07-01 00:30:46 +00:00
Mark Zhou d76e36fbcb [dart2js] Adding kernel dump info regression tests
Ensures that kernel dump info doesn't break the original dump info's behavior.

Change-Id: I9bfe22cea0d1a5597db9c98fe736f20369b80c82
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247122
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2022-06-06 22:35:29 +00:00
Nate Biggs aad436cc53 [dart2js] Migrate first round of dart2js_info to nnbd.
Change-Id: Ifc3f97eb6dad6e785263346f1d41ed5a78705bac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/245924
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2022-05-27 15:31:40 +00:00
Mark Zhou 1c27154f41 [dart2js] Adding closure dump info tests + fixing sibling logic in kernel dump info
- Reconciles some logic for closure/LocalFunction name resolution between dump info and the element model
- Handles closure disambiguation (j world <-> k world) by assuming fixed visit order

Change-Id: Ic9a61208ed93372633e118541b71f20543e250a3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/245600
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2022-05-24 01:04:41 +00:00
Mark Zhou bf5690dd0c [dart2js] Removing size checks from main output unit dump info tests
These were far too sensitive to code size changes and causing unhelpful failures.

Change-Id: I5293c7d281a5db2d36af35f67966f4d47413a78a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243561
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2022-05-03 23:14:04 +00:00
Mark Zhou 9c572f08ca [dart2js] Adding closure tests for dump info members
Change-Id: I73d6e262941fa1b8278f32c3e17689e45dea4ebd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243383
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2022-05-03 20:53:34 +00:00