Labeling nodes as direct / indirect seems to have been unstable and
unused, so this cl removes that logic. Also removed logic to process
_RtiNode._literalState which ssems to have been unused as well.
Change-Id: Ic463149ee353abcd55c22684f12ba11eb92cc91d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/235722
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
Unfortunately we have to give up on eager initialization of many maps
and sets due to unknown dependencies and effects in the hashCode
implemenation. Eager initialization of some cases could be recovered
as they are eligible to be `const` maps and sets.
Fixed: https://github.com/dart-lang/sdk/issues/48442
Change-Id: I6500123ff9d1fe42bacb53718a4b9e4e969ebc3f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/233942
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
At this point we only have one backend. Maybe in the future we will have
a second backend, but that will be far enough in the future that it
makes sense to 'rediscover' the value of this pattern.
Change-Id: Ic4f5d3494c48325ea73ea2e64f923a9c532e9c52
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/233764
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
1) KernelElementMapImpl is inlined into KernelElementMap.
2) KernelBehaviorBuilder is inlined into BehaviorBuilder.
3) KernelClassQueries / ClassQueries are removed.
4) NativeMemberResolver is inlined into KernelNativeMemberResolver.
5) NativeClassFinder is inlined into BaseNativeClassFinder.
Change-Id: I04d14a64155de54aafc2abe8579304c018ad9490
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/233658
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
GVN pure stringifiers and string concatenation.
I removed the comment regarding #9293. I could not understand it.
Removing the 'setDependsOnSomething()' does occasionally produce
worse-looking code, but at the application level, the code is
marginally smaller.
https://github.com/dart-lang/sdk/issues/48243 is a more general
description of the 'looks better' problem that pure operations tend to
sink to their use, increasing live-ranges of the operands. The
sinking is sometimes advantageous - e.g. when the new location is on
an error path.
I see common subexpression elimination often in the pattern of
constructing default strings for Intl.plural:
Intl.plural(...,
one: '$first (+$howManyMore language)',
other: '$first (+$howManyMore languages)',
...);
--> old JavaScript
var
t1 = A.S(first) + " (+" + howManyMore + " language)",
t2 = A.S(first) + " (+" + howManyMore + " languages)";
return A.Intl__plural(..., t1, t2, ...);
--> new JavaScript
var
t1 = A.S(first) + " (+" + howManyMore;
return A.Intl__plural(..., t1 + " language)", t1 + " languages)", ...);
Change-Id: I56aff26c9e5e31954fef224378f3723a05b318ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/233641
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
The bad codegen reported in #48383 was due to an unused phi confusing
the expression-tree construction algorithm. It was trying to generate
data = cond ? callWithSideEffects() : null;
but `data` is unused, so somehow we generated only
cond;
We should not have unused phis at this point so I put a safety check
in the above code to not try to build an unused conditional, and
changed the dead-code eliminator to eliminate dead phis.
Now we get
if (cond)
callWithSideEffects();
I compared the output for some large apps and there were about a dozen
changes. All looked like improvements, e.g. not assigning to an unused
variable. There was some code missing that is now present, but luckily
for the large apps, it was all code that did not have real-world side
effects.
Fixed: 48383
Change-Id: Id7b32cfa0cbfb47a4d9eff174ad9ae52da99f6a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/232781
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
* Add team "groups" in tools/OWNERS_<group name>.
* Add top-level OWNERS as a fallback.
* Add OWNERS for all top-level directories.
* Add OWNERS to all packages.
For additional background information see go/dart-sdk-owners.
TEST=No op until code-owners is enabled.
Bug: b/200915407
Change-Id: I7fe6116cc599c749cd50ca16151d6d6a801d99d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/229147
Reviewed-by: Jonas Termansen <sortie@google.com>
This is a reland of e77ea8a17b. I've
undone the change to the name of the platformScript setter, restoring
the previous behavior of accepting anything and casting.
TEST=Existing tests.
Change-Id: I7e36935ef3784035769527dc5624191f38faaa40
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/232487
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Leaf Petersen <leafp@google.com>
Tighten types to eliminate some dynamic calls from the core libraries.
Also remove some unnecessary abstraction from the json parser.
TEST=Existing tests for the library.
Change-Id: Ieb4cdec5b8c26709b5f70774c392bd373a203113
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231800
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Leaf Petersen <leafp@google.com>
Most of these tools have been replaced by better tools.
We may re-add some of these in the future, but if so then maybe they should live in pkg/compiler/tool.
Change-Id: I673dd27dafad59cc01b0be0705c2032c11fca713
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231980
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
This cl mostly just removes indirection around clearing the Impact cache.
However, there is one minor logic change, today we clear the impact cache
before calling DeferredLoadTask._buildResult, but after this cl the
impact cache is cleared by its owner(Compiler) in the compiler pipeline
itself.
Change-Id: I5845b786887f861c61a0ac79a3c8f2de2a3a2a14
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/232026
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
Use `hasScheme` in place of comparing against the empty string, and
`isScheme` to compare against all other schemes.
TEST=No behavior changes.
Change-Id: Ifc9fd13c6cf37933ebd4a754c4b500dedbcb291b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231185
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>