Commit Graph

4914 Commits

Author SHA1 Message Date
Joshua Litt efe573401d [dart2js] Merge CommonElementsImpl into CommonElements.
Change-Id: I35fae9cd7e97f3782b8c091b7524a10388d57aff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231531
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-02-04 02:36:06 +00:00
Joshua Litt 58e577da15 [dart2js] Move common_elements.dart to common/elements.dart.
Change-Id: Idaed02bb747670413f63e7f7b0797eb591e12f57
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231523
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-02-03 21:21:39 +00:00
Joshua Litt 848e106346 [Dart2js] Remove unnecessary abstract interface on Enqueuer.
Change-Id: Ia9c2e329fb83eeb77f399c43ae5725ccb9b602c9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231381
Auto-Submit: Joshua Litt <joshualitt@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2022-02-03 18:55:47 +00:00
Joshua Litt 6a4cb1a3a7 [dart2js] Move native_basic_data.dart into its own library.
Change-Id: I2aa257cb6b53d7e3cbf32efdfd0605df6fe4021e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231382
Auto-Submit: Joshua Litt <joshualitt@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2022-02-03 17:58:06 +00:00
Mayank Patke 99d49dca95 [dart2js] Remove dependency on package:expect in RTI-need emission
tests.

Change-Id: I8be03f22c3b7195a2d10050c622415379c8b7563
Bug: #48087
Fixes: #48087
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/230883
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2022-02-01 23:42:25 +00:00
Mayank Patke 0163ef0d3b [dart2js] Remove dependency on package:expect in RTI-need unit tests.
Bug: #48087
Change-Id: I9729abea021945c66671f74805c4878aa04ade2a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/227903
Reviewed-by: Stephen Adams <sra@google.com>
2022-02-01 23:42:25 +00:00
Joshua Litt 69bc43a531 [dart2js] Statically type unnecessary dynamic type.
Change-Id: Ib188257cb2d218beaabc66851f12fa18850c0969
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/230824
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-02-01 01:52:24 +00:00
Stephen Adams 5a291a28e7 [dart2js] Avoid using 'at' as a minified instance method name.
This CL fixes one part of #48118 by no longer accidentally calling
String.prototype.at.

- Update the list of names that should not be used for minified instance
  method names.
- Expand comment.
- Add a script in tools for finding all the names from within a browser.



Bug: 48118
Change-Id: Iac41bd707d7b447a998d0d94a8b37576dc7d1493
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/228300
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2022-01-29 01:03:52 +00:00
Joshua Litt 5bf2e76329 [dart2js] Cleanup dead code.
Change-Id: I640dc4da677ab3ba4644985aa790625aae36283a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/230827
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-01-28 23:51:19 +00:00
Stephen Adams b4f0b58cb2 [dart2js] HStringify can generally throw but some uses are pure.
This is something I noticed when 'gardening': HStringify can throw but
the node was using the default 'canThrow' which returns 'false'. This
has the potential for bad codegen, though I am not aware of an instance
of it happening.

This CL makes the default for `HStringify.canThrow` be `true`.

Stringification for primitive types is pure, so this is added as an
optimization. There are a few improvements from this, including removing
an unused stringification.


Change-Id: I9285d91ec906fb544f8793944578b7e3feb8a634
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/230221
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2022-01-28 23:31:32 +00:00
Joshua Litt f6ebe80d26 [dart2js] Refactor program split constraint's Fuse node.
This cl makes Fuse an unnamed ordering node, and allows ors / ands
within the fuse. For examples of the benefits of this new Fuse, please
see:
pkg/compiler/test/custom_split/data/fuse_with_and/main.dart
and
pkg/compiler/test/custom_split/data/fuse_with_or/main.dart

Change-Id: I5076abcd617d138b03dc8944737c61645e42e038
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/228685
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-01-26 18:03:58 +00:00
Sigmund Cherem 6bcba2529d [dart2js] minor tweaks to dart2js help message.
These changes make the help message more aligned with other
dart command line tools.

Fixes https://github.com/dart-lang/sdk/issues/47515

Change-Id: Id012400dc9b441b796c7437858e8ea4f29b57a90
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/229340
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2022-01-21 21:05:00 +00:00
Sigmund Cherem 8415b70e75 [dart2js] recommend using 'dart compile js'.
This is the first deprecation step, moving towards having dart2js
under the more general dart command line interface.

Going forward 'dart compile js' is the recommended way to invoke
dart2js.

This CL adds:
* an internal flag used to detect how was dart2js invoked and
  provide a warning when invoked in an unsupported way.
* ensures the flag is provided in the dart cli, as well as our
  (developer's only) scripts. These scripts will likely move to a
  different location in the future. Note that the `dart2js_sdk*`
  scripts are not providing this flag (these are the script that get
  eventually shipped with our built SDK), as such, invokations of the
  dart2js binary will show the new warning.

Change-Id: I96e40ecf01598eadab20dfc59114f5fff7438084
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/229062
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2022-01-21 16:42:40 +00:00
Srujan Gaddam d17205184a [dart2js] Handle Object members of dart:html types
`dart:html` types have changed to inherit `JavaScriptObject`. Therefore,
the dart2js runtime needs to be changed so that interceptors are still
created for those types, and they're properly handled in `toString`
calculations. Includes tests on `Object` members that are currently
inconsistent between both compilers.

This test passes on dart2js with and without making the types in `dart:html`
extend `JavaScriptObject`. This test fails in DDC for the following reasons:

- `toString` of native types calls the native `toString`
- `hashCode` for interop objects are random and not 0
- `runtimeType` of interop objects is `LegacyJavaScriptObject` not `JSObject`

Change-Id: Ibf80109174615120df9e64995fa13016f7a1677b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/228741
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2022-01-21 01:04:10 +00:00
Mark Zhou 74b57a69bd [dart2js] Extending experimental allocations collection to code fragments.
Required for upcoming runtime code usage tools.

Change-Id: Ie8417d03c9e60f3f97f536eb6e96ea56b7f0a817
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/229260
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2022-01-20 21:37:27 +00:00
Sigmund Cherem ba23762d2a dart2js: add missing check before reading argument list.
This causes a crash when invoking dart2js.dart with no arguments.

This is however minor, turns out that all environments invoking
dart2js always include an argument (and by default our snapshots
include the parameter to find the platform.dill file, for example).

Change-Id: I1c830768427f0c95e94100d092df445fee4224b6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/228262
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2022-01-14 20:56:13 +00:00
Johnni Winther 8510f27d37 [cfe] Change encoding of supported dart: libraries
This CL changes the way dart: libraries are considered supported when
used in conditional imports or bool.fromEnvironment constant using
the "dart.library.*" values.

Library nodes now has an isUnsupported flag which is set according to
the "supported" property in the libraries specification. Furthermore
the Target now supplies a DartLibrarySupport interface that allows
targets to override whether dart: libraries are unsupported.

This allows the JIT/AOT to use the same platform file but still
consider dart:mirrors unsupported in AOT mode, and dart2js to consider
the internal library `dart:_dart2js_runtime_metrics` supported.

Furthermore, the internal handling is changed so that condition imports
and bool.fromEnvironments constants are computed through the same logic
for "dart.library.*" values, avoiding the need for passing these values
through the environment.

TEST=pkg/front_end/testcases/general/supported_libraries/main

Closes https://github.com/dart-lang/sdk/issues/48057
Closes https://github.com/dart-lang/sdk/issues/47814
Closes https://github.com/dart-lang/sdk/issues/47243
Closes https://github.com/dart-lang/sdk/issues/32657
Closes https://github.com/dart-lang/sdk/issues/36460

Change-Id: Ie8f8dff99167de64ced51b71d89918bf0f3bbd13
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/227020
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2022-01-11 14:52:38 +00:00
Stephen Adams 8bdd732e08 [dart2js] Add --utf8 canary option
Change-Id: I98078be0fe07b1037d0bb70986be8769e170708a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/225520
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2022-01-06 05:24:25 +00:00
Stephen Adams 91b69ef7b7 [js_ast] Split VariableInitialization from Assignment
Change-Id: Iefe989e824fcd504391f607135486025e170313e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/225425
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2022-01-05 17:50:04 +00:00
Johnni Winther 4e283a7e08 [_fe_analyzer_shared] Support 'include' tag in libraries specification
This adds support for an 'include' tag in libraries specifications
that enable composite declarations. With this, we can avoid relying on
copied portions of (other) specifications.

Closes https://github.com/dart-lang/sdk/issues/47998

Change-Id: I694d5c006741e6625feb7cdd5898946cc6caee50
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/224952
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-01-05 08:13:23 +00:00
Stephen Adams b053f2c355 [dart2js] Use reporter.withCurrentElement in createClosureEntities
This should help investigation of #47916.

Change-Id: I1db9d97e963593ab7f8778c8470328419633155d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/226220
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2022-01-05 00:41:04 +00:00
Stephen Adams 770969e25c [js_ast] Prepare visitors for null-safety
`BaseVisitor<R>` has two methods that return `null`, which will not
match the generic return type with NNBD.

The fix is to make the methods abstract, and provide a convenience
specialization `BaseVisitorVoid` with the default methods.

Change-Id: I62cd69c5ed1c912b2804da5044e2cda93d70b878
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/224460
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2021-12-17 01:16:49 +00:00
Joshua Litt 59979dc973 [dart2js] Cleanup old holders code.
Change-Id: I5eafeb06cf2d6e32e9fdd1abee19ea18e1091ace
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221991
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2021-12-15 16:53:36 +00:00
Joshua Litt 47646ff6c7 [dart2js] Avoid trimming entryLibrary from components.
Change-Id: I28d1c36279ed7407bb6a82d100bf062d327bc7d3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/223220
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2021-12-14 17:50:34 +00:00
Stephen Adams b628d00b00 [dart2js] Correct evaluation order of named arguments in redirecting/super initializers
Minor refactoring to share building the map from argument names to
compiled instructions.

Fixes #47047

Change-Id: I20b8d37673bd4cb18aa8b2091af79e40ec498370
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/223381
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2021-12-14 00:27:24 +00:00
Srujan Gaddam 45c350052d [dart2js/ddc] Rename BaseJavaScriptObject to JavaScriptObject
Part 2 of the renaming to create the new parent type. Also modifies
some existing tests to reflect the change in name and function of
JavaScriptObject.

Change-Id: If37f34dd8477b7fc1fe459d3225ecf2537fb9f1a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217156
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2021-12-10 18:36:00 +00:00
Srujan Gaddam da01ce02fc [dart2js/ddc] Rename JavaScriptObject to LegacyJavaScriptObject
Changes in type hierarchy will have JavaScriptObject as the new
parent class of interop and native types instead. Also modifies
js_interop_constructor_name tests to reflect addition of static
interop.

Change-Id: I74957ca89aea1726a01e0677548fbb3c5c981323
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215949
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2021-12-10 18:36:00 +00:00
Srujan Gaddam 758cb462f5 [pkg:js] Erase static interop types
Closes https://github.com/dart-lang/sdk/issues/47324

Erases static interop class types in favor of `BaseJavaScriptObject`.
Types are erased everywhere except for constructors, whose invocations
are instead wrapped with a cast. Constructor type erasure is avoided
to ensure the AST is still type-valid. Factories with bodies have
static stubs added instead, and tests are added for this change.

Change-Id: I7231aaaf32d22bc6261adb672a602e8a9e6c86a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215948
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Riley Porter <rileyporter@google.com>
2021-12-10 18:36:00 +00:00
Srujan Gaddam 17b2e3a893 [dart2js/ddc] Add new base JS interceptor type
Creates "BaseJavaScriptObject" (which will be renamed) which will
represent the interceptor type that static interop classes will be
renamed to. The CL also adds some logic to handle this new interceptor
class in dart2js' handling of `is` checks and various dart2js tests.

Change-Id: Ie72994137772eb87e1831e3c2228450d535ac3b2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215947
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2021-12-10 18:36:00 +00:00
Joshua Litt 2da9688cfb [modular] Create repro of issue building full dills from summaries.
Change-Id: I67db9eefe508ddbe072238e8773109c7b7f25d1a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/222560
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2021-12-10 17:00:00 +00:00
Johnni Winther 2b4934a54d [cfe,dart2js] Reuse field reference for static late lowering
In response to https://github.com/flutter/flutter/issues/89740 and
https://github.com/flutter/flutter/issues/94561

Change-Id: I22c100a575b91e70a2c5835b8db6dd450f319ce7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221947
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-12-07 21:12:17 +00:00
Michael Thomsen 71e3dac037 Remove deprecated packageRoot API, which doesn't work in Dart 2
Bug: https://github.com/dart-lang/sdk/issues/47769
Change-Id: I1cbd7761e7119c07f2697d7624bec703ba4c4641
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221340
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Michael Thomsen <mit@google.com>
2021-12-07 14:44:49 +00:00
Joshua Litt 3bfb2db3d0 [dart2js] Add a flag to dump unused dill libraries.
Change-Id: I27c3fd8121c2744212afab70a827d515e45666ae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220062
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2021-12-04 20:34:15 +00:00
Joshua Litt 001441ec42 [dart2js] Fix modular analysis test.
Change-Id: I066149a6ae052acf7ec2db90cdeec378f73dcfb3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221142
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2021-12-02 22:13:47 +00:00
Stephen Adams fd4fd54c9d [dart2js] Replace recursion with loop
This does not fix #42641, but removes a recursion that can make #42641
look different.

Change-Id: Id070cea0eb10501f1750b2719ed710a938170038
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221480
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2021-12-01 20:04:36 +00:00
Joshua Litt bebc692e93 [dart2js] Add 'shipped' state to feature options.
Change-Id: I2be91636f0e32d00c9dbc92cf7b514454040754f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221020
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
2021-11-30 18:03:39 +00:00
Stephen Adams 4c31413f1a [dart2js] Insert HNullCheck ahead of HGetLength
HNullCheck is inserted before HGetLength when the receiver might be null.
This makes HGetLength and HFieldGet use the same pattern.
HNullCheck supports strengthening of dominated uses, which allows
specialization of string and array interceptors, leading to better code
in some cases. An example improvement is:

      if (aLocale.length < 2)
        return aLocale;
      return J.substring$2$s(aLocale, 0, 2).toLowerCase();

-->

      if (aLocale.length < 2)
        return aLocale;
      return B.JSString_methods.substring$2(aLocale, 0, 2).toLowerCase();

Here `aLocale` has the type String*, and the explicit null check before
`aLocale.length` strengthens the receiver at the call to `substring`.

There is very little code size change.

The inconsistency between the handling of HFieldGet and HGetlength came
to light when investigating an unexpected difference in Uri.parse between two
apps.

Change-Id: I6e76de2070ab2c0058a109896c738ea2a09b322a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221028
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2021-11-23 21:11:31 +00:00
Joshua Litt 7a277a8979 [dart2js] Cleanup old serialization logic.
Change-Id: Ib43b5d7c5cb4234deb0bf026bfe7aaf7e1fced7f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220800
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2021-11-23 18:37:51 +00:00
Mayank Patke 6dbbd4b7d7 [dart2js] Handle ir.DynamicType in StaticTypeVisitor.visitForInStatement
Fixes: https://github.com/dart-lang/sdk/issues/47691
Change-Id: Ic584bfe10aa240361f149660151cb2a19bea0833
Fixed: 47691
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220781
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2021-11-18 20:37:36 +00:00
Joshua Litt 3d1f6a48b7 [dart2js] Add dart2js target to build summaries.
Change-Id: I1ef0b3f87124333e44cb15001c556b1767ddf28f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219841
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-11-18 00:58:40 +00:00
Stephen Adams 405734f18b [dart2js] lazyFinal can use a variable for the result.
Returning the value is faster than reading the holder slot on V8.
Some benchmarks which read a lazy final in a tight loop are up to
40% faster.
JSC and SM unchanged.

Change-Id: I72afa456160469e4ccfe6ab80f8a53694133d794
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220132
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2021-11-15 22:25:31 +00:00
Joshua Litt 489ac923e2 [dart2js] Add a bit more error checking to the constraint builder.
Change-Id: I78eaea1163860a71245e7879b7b47bd3443ab34c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219502
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2021-11-09 21:01:53 +00:00
Stephen Adams 0afb365804 [dart2js] Fix #47566 by disabling optimization
The JavaScript-to-JavaScript async transform had an inconsisent
handling of switch statements that contained an await, but only in the
expression.

For now the special handling of the expression-only case is disabled.

Change-Id: Ia79ff3951d681ba933df638da7e0e518d401ed9a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219746
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2021-11-09 00:43:02 +00:00
Joshua Litt 0310c8e233 Reland "[dart2js] Address some feedback on constraints API."
This is a reland of 851d821556

Original change's description:
> [dart2js] Address some feedback on constraints API.
>
> * Changes default namer to use the always unique uri#prefix of a
> deferred import.
> * Changes builder api for combiner nodes to take sets.
>
> Change-Id: Iab23db94a166560682a8c2bd4a78ebfd3e734353
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/218880
> Reviewed-by: Sigmund Cherem <sigmund@google.com>
> Commit-Queue: Joshua Litt <joshualitt@google.com>

Change-Id: I6394166be1f3ddebe19cc71f70fa5f5b26e05231
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219128
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2021-11-04 21:47:46 +00:00
Joshua Litt efa5a003f0 Revert "[dart2js] Address some feedback on constraints API."
This reverts commit 851d821556.

Reason for revert: Breaks release

Original change's description:
> [dart2js] Address some feedback on constraints API.
>
> * Changes default namer to use the always unique uri#prefix of a
> deferred import.
> * Changes builder api for combiner nodes to take sets.
>
> Change-Id: Iab23db94a166560682a8c2bd4a78ebfd3e734353
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/218880
> Reviewed-by: Sigmund Cherem <sigmund@google.com>
> Commit-Queue: Joshua Litt <joshualitt@google.com>

TBR=sigmund@google.com,joshualitt@google.com

Change-Id: Idb0d79221ff005127276c0d616c9a6a04ad09f44
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219127
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2021-11-03 22:19:15 +00:00
Stephen Adams 7fd4f25b62 [dart2js] Add generated JavaScript to --dump-ssa output.
At the end of codegen, 'trace' the generated JavaScript to the `.cfg`
file, and 'trace' the JavaScript after the generator rewrite when this
happens.  This gives an easy way to see the non-final JavaScript from
before the transform. The 'trace' of the JavaScript is a little bit of
an abuse of the `.cfg` file format, but it is convenient to see the
SSA CFG and JavaScript with the same tool.

For this to work, js_ast printing needs to work for pre-finalized
ASTs. Most of this change is implementing `isFinalized` for every AST
node, and printing something indicative of the non-finalized nodes. For
example, unfinalized holders are printed as `Holder"<something>"`.

Change-Id: I30b3f141a876f1dc3539132d65f3aafc722589e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/218883
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2021-11-03 19:48:03 +00:00
Joshua Litt 851d821556 [dart2js] Address some feedback on constraints API.
* Changes default namer to use the always unique uri#prefix of a
deferred import.
* Changes builder api for combiner nodes to take sets.

Change-Id: Iab23db94a166560682a8c2bd4a78ebfd3e734353
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/218880
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2021-11-03 18:47:17 +00:00
Joshua Litt 2f02bf90c0 [dart2js] Cull dill files of unnecessary libraries.
Change-Id: I2522fb2cc457a2f60cd2c09500861ec509f21be1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/218361
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2021-11-01 21:51:53 +00:00
Joshua Litt 9054f38ab4 [dart2js] Make dart2js.main async.
Change-Id: I8bd7e00245ec2709d95c536c807566f66697a669
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/218786
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2021-11-01 20:18:51 +00:00
Joshua Litt 39386e58d4 [dart2js] Create building blocks for programmatic constraint api.
Change-Id: Ida50217c48c39fe222589aa227ac65691a8fc982
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216684
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2021-10-26 19:38:31 +00:00