Type propagation, shrinking reductions, and let sinking each took
more than 2 minutes on a stress test, where now they take a few
seconds.
Huge hash tables (Map/Set) were a big problem, especially when used as
worklists.
Let sinking had an issue with a linear-time search for the enclosing
continuation of an expression. This has been replaced with a visitor
state.
The stress test was:
tests/co19/src/LibTest/collection/ListBase/ListBase_class_A01_t02
This was only slow because negative constants get translated to
intercepted calls. That itself should be fixed, but the IR should
still be able to handle the stress.
The change in shrinking reductions altered the redex priority from
FIFO to LIFO which has a negative effect on code quality in
unwrapException (in any test case with a try/catch). It seems like
an existing issue that has surfaced.
Since I am going on vacation, I ask that someone would please
commit this on my behalf (assuming things are looking good).
--asgerf
BUG=
R=karlklose@google.com
Review URL: https://codereview.chromium.org//1252883003 .
The CPS RecursiveVisitor now uses an explicit stack of things to do
on the way out of a term. Every CPS pass has been hacked to fit the
new visitor paradigm.
The tree visitors now iterate over chains of ExpressionStatements.
This seems to do the trick, mostly because direct-style rewriting
significantly reduces the height of the tree.
The IR tracers still use deep recursion, but they are disabled by
default anyway so they are not critical.
BUG=
R=floitsch@google.com, karlklose@google.com
Review URL: https://codereview.chromium.org//1251083002.
Without reflection, redirecting factory constructor invocations are shortcut at the instantiation site. With reflection, code like
reflectClass(Foo).newInstance(const Symbol(''), [])
can hit a redirecting factory constructor and we need to emit a function that does the redirection and type substitution.
R=asgerf@google.com
Review URL: https://codereview.chromium.org//1227873004 .
length, forEach, [], and []= are rewritten to direct array access nodes.
There are more methods to specialize, which will be added in separate
CLs.
This CL also contains a class CpsFragment to help build CPS code.
BUG=
R=karlklose@google.com
Review URL: https://codereview.chromium.org//1223813006.
The world will refuse to emit getters and setters for field it thinks
will be accessed directly.
Rewriting getter/setter calls to field accesses must happen at
build-time so we do not rely on an optimization for correctness.
BUG=
R=karlklose@google.com
Review URL: https://codereview.chromium.org//1227543008.
Tear-offs are constructed by building a fresh constructor on the fly. However, that constructor is unnamed and didn't have the 'builtin$cls' property set. As such, the runtime-type system was unable to extract a good name and wasn't able to provide a good 'toString' for it. With this CL the constructor has a good 'name' set.
Also removes the 'builtin$cls' property that was a duplicate of 'name'. Whenever we defined a new Dart class, we added a 'builtin$cls' property on the constructor which was a duplicate of the name. This was necessary, because IE doesn't store the function name on the constructor. However, there we can just assign the 'name' field, and don't need to introduce a new field-name ('builtin$cls'). As such, we can always use the 'name' property.
R=sra@google.com
Review URL: https://codereview.chromium.org//1213033002.