Some optimizations would assume that null.toString and null.noSuchMethod
would throw because these selectors were not whitelisted as non-throwing.
BUG=
Review URL: https://codereview.chromium.org/1570813003 .
There was previously an optimization in type propagation that replaced
getInterceptor(x) with x, but this depends on the set of intercepted
classes (since null may or may not need interception).
That optimization is now handled at the use-site of the interceptor,
since each use knows if it needs null to be intercepted.
BUG=
R=kmillikin@google.com, sra@google.com
Review URL: https://codereview.chromium.org/1571433002 .
Do not inline in functions containing try, do not inline functions
containing try. V8 does not optimize functions containing try, so
inlining in such functions or inlining such functions will make
potentially optimizable code become unoptimizable.
This repairs a large performance regression on the Angular 2 change
detection benchmarks.
R=sra@google.com
BUG=
Review URL: https://codereview.chromium.org/1554083002 .
Perform a depth-first postorder traversal of the call graph of known
functions. Make an inlining decision based on the vector of argument
types at the call site, and cache inlining decisions. For positive
inlining decisions, cache the optimized function body specialized to
the receiver and argument types at the call site.
Future work:
* Real inlining heuristics.
* Propagate result types of inlined calls.
* Specialized for constant arguments when it makes sense.
* Performance improvements.
R=asgerf@google.com, sra@google.com
Committed: https://github.com/dart-lang/sdk/commit/d63053fea8731d2fb380022c1c3d296489d1c017
Review URL: https://codereview.chromium.org/1537663002 .
Unminified: each property goes on a new line.
minified: ignore the isOneLiner directive until a function is seen.
This makes unminified static functions easier to read, and makes minified swarm 0.3% smaller (but almost no different after gzip).
R=sigmund@google.com
Review URL: https://codereview.chromium.org/1548793002 .
Perform a depth-first postorder traversal of the call graph of known
functions. Make an inlining decision based on the vector of argument
types at the call site, and cache inlining decisions. For positive
inlining decisions, cache the optimized function body specialized to
the receiver and argument types at the call site.
Future work:
* Real inlining heuristics.
* Propagate result types of inlined calls.
* Specialized for constant arguments when it makes sense.
* Performance improvements.
R=asgerf@google.com, sra@google.com
Review URL: https://codereview.chromium.org/1537663002 .
1. Help type inference infer constant maps have a .length that is a non-null subtype of int. On some programs this means dynamic.length can be inferred as non-null int.
2. Make arity dispatch interceptor free by comparing constants-first (via a switch statement).
R=sigmund@google.com
Review URL: https://codereview.chromium.org/1539033002 .
- short-circuit cases where join yields dynamic
- improve performance of some queries like `hasOnlySubclasses` and how `contains` is implemented in `flatten`. We could also add caching for `length`, but not sure if we want to just have a static map or precompute the data in the class-hierarchy nodes.
On my experiments this reduces inference times more than 50% on a large customer app, while small apps have almost no change.
R=johnniwinther@google.com, sra@google.com
Review URL: https://codereview.chromium.org/1528953002 .
If the index/key is not a number it is unlikely that the receiver is an Array-like JavaScript object.
This suggests that we should have a version of the one-shot with no fast-path to use at call sites where we can prove the (receiver, argument) combination does not benefit from the fast path.
BUG=
R=sigmund@google.com
Review URL: https://codereview.chromium.org/1531453004 .
In response to dartbug.com/18661 and dartbug.com/21651.
Dart2js doesn't know pubspec.yaml or the directory structure but pub does. Next step is to pass arguments from pub.
BUG=
R=sigmund@google.com
Review URL: https://codereview.chromium.org/1513263002.
- Choose between single and double quotes to reduce number of escapes.
- With "uft8: true", leave most characters for the file encoding.
- LINE SEPARATOR and PAGE SEPARATOR must always be \uXXXX encoded.
- Unpaired surrogates must be encoded as \uXXXX.
- Use \xXX rather than \u00XX where possible.
R=sigmund@google.com
Review URL: https://codereview.chromium.org/1520033002 .
Refinement nodes are retained throughout the optimization pipeline.
GVN can improve refinements, so a new pass after GVN updated references
to use the best refinement in scope. For example:
x.f.g();
x.f.h();
==>
v0 = x.f;
v0.g();
v0.h();
The receiver of h() is known to be non-null after GVN because the two
uses of x.f were proven to be the same value.
BUG=
R=sra@google.com
Review URL: https://codereview.chromium.org/1519513002 .
The new instruction is expanded into low-level operations
in a new pass Finalize. The Finalize pass is mandatory.
The BoundsCheck returns the indexable object being checked
so it can be used to restrict code motion.
BUG=
R=sra@google.com
Review URL: https://codereview.chromium.org/1512303002 .
Currently we only instantiate the instruction for the null
checks inserted for numeric operators.
The corresponding instruction also exists in the tree IR,
partly because there is no way to say "x.toString" with the
current instruction set.
BUG=
R=sra@google.com
Review URL: https://codereview.chromium.org/1507313006 .