Because we search for new redexes while performing reductions, we can't
always assert that a term is well-formed.
In this case, it's not true that all invocations of a continuation will have
the same number of arguments while we are in the middle of performing a dead
parameter reduction.
BUG=
R=asgerf@google.com
Review URL: https://codereview.chromium.org/1641073003 .
Shrinking reductions uses a null parent of a potential redex to detect that
the redex occurs in an already-deleted subterm, to avoid performing such
reductions. (They are not safe because the term structure of deleted
subterms, e.g., use lists, might not be consistent.)
R=asgerf@google.com
BUG=
Review URL: https://codereview.chromium.org/1645933002 .
There is a 'const' Symbol constructor that is not expressible as a Dart
const constructor because it performs validation of its input. This is
implemented in the libraries by using a dummy const constructor definition
that does not validate its input and replacing calls to 'new Symbol' with
calls to 'new Symbol.validated' in the compiler.
Without replacing calls to 'new Symbol', the non-validating dummy
implementation will be used, which is not correct.
Closes#24878.
R=asgerf@google.com
BUG=https://github.com/dart-lang/sdk/issues/24878
Review URL: https://codereview.chromium.org/1639313002 .
JSArray<E>.typed has a specially generated body. We should be able to inline this. This makes all of the "new List.xxx()" paths work.
Literal lists are treated like maps - we generate a call to JSArray<E>.typed. I need to change that to JSArray<E>.markGrowable.
R=asgerf@google.com
Review URL: https://codereview.chromium.org/1642493002 .
Use TypeExpression to create the 'headless flat' type term that is used for the instance's reified type.
This is a step towards placing the type term on JSArray.
There is also some modest GVN benefits where repeated terms are shared.
R=asgerf@google.com
Review URL: https://codereview.chromium.org/1637843002 .
Treating the values double.INFINITY and -double.INFINITY as if they were int
at compile time also affects the SSA compiler's range analysis pass. This
change restores the former behavior that those values were unbounded ranges.
R=floitsch@google.com
BUG=
Review URL: https://codereview.chromium.org/1639193003 .
Shrinking reductions would miss some redexes that were created during
a reduction. It now finds more redexes and has a self-checking mode
that can be enabled when working on the pass.
Also adds some general debugging utility functions to the CPS IR.
The root class Node now has "debugString" and "debugPrint" methods for
conveniently getting its SExpression.
The CpsFunctionCompiler now has a method "debugCpsPass" which runs
a CPS pass while checking that it is idempotent for that input. Most passes
are not yet idempotent, but this utility should help us get there.
BUG=
Review URL: https://codereview.chromium.org/1616673002 .
The predicate would answer incorrectly when asked if subclasses of A
is disjoint from subtypes of B, where B is a subtype of A.
Example from the compiler:
abstract class _MinifiedFieldNamer implements Namer
class MinifyNamer extends Namer with _MinifiedFieldNamer
[subclass=Namer] vs [subtype=_MinifiedFieldNamer] were found to be
disjoint, even though the MinifyNamer class exists.
BUG=
R=kmillikin@google.com
Review URL: https://codereview.chromium.org/1631093004 .
The variable merger pass now prioritizes register allocations that
remove a moving assignment "v1 = v2" or enable a compoundable assignment
"v1 = v2 + E" to become "v1_2 += E".
When minifying, we now allow merging differently named variables.
Previously, preserving the variable names was important to get a good
register allocation, but that heuristic is no longer needed.
BUG=
R=kmillikin@google.com
Review URL: https://codereview.chromium.org/1625643002 .
Implement switches with continue to their labels by a first 'non-recursive'
switch followed by a second (only) 'recursive' switch inside a loop.
Continue is implemented by assignment to a state variable that the second
switch switches over.
R=asgerf@google.com
Review URL: https://codereview.chromium.org/1585503002 .
Cache function definition terms just before specializing them for their
arguments. Use these cached terms for subsequent specializations and for
generic (non-specialized) compilation.
BUG=
R=asgerf@google.com
Review URL: https://codereview.chromium.org/1608953002 .
Compound assignments are now generated for:
- SetStatic, previously only supported for SetField, SetIndex, and
variable uses.
- SetField and SetIndex when the receiver is 'this', previously only
supported for variable uses.
- String concatenation with >2 arguments, previously only supported
with exactly 2 arguments.
BUG=
R=sra@google.com
Review URL: https://codereview.chromium.org/1613853003 .
The Dart arity adaptor was adding default arguments to the call instead of calling with the given number of arguments.
The best way to fix this is to implement Issue 25548.
R=sigmund@google.com
Review URL: https://codereview.chromium.org/1612773002 .