There will be another update on this embedded global. In fact it is needed for const symbols.
For simplicity I would prefer committing this CL first (to avoid too much merging/rebasing).
R=sigmund@google.com
Review URL: https://codereview.chromium.org//1250023002 .
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.
The builder instead creates a LetCont with an unused continuation to
hold the unreachable code following the non-tail throw.
This removes the cleanup pass after building and removes an awkward
CPS node.
BUG=
R=karlklose@google.com
Review URL: https://codereview.chromium.org//1243063002.
We now only introduce one getInterceptor call per primitive.
(The main use for GVN seemed to be cleaning up these calls, but we
might as well not introduce them in the first place).
To propagate single-used interceptors to their use, propagation of
constant-like expressions has changed.
There is a new CPS pass, let sinking, which sinks single-used pure
primitives to their use when the use is not inside a loop.
Conversely, the tree IR's assignment propagation has been made less
aggressive to compensate for things now handled by let sinking.
R=floitsch@google.com
Review URL: https://codereview.chromium.org//1238163003.
SetStatic, SetField, and SetMutableVariable are now primitives instead
of interior expressions. They are valueless primitives, i.e. they are
bound by LetPrim but their value is never referenced.
This should simplify basic block traversal, since there are now fewer
types of interior expressions.
The four remaining interior expressions are: LetPrim, LetCont,
LetHandler, and LetMutable. Incidentally, these are exactly the four
expressions that can bind definitions.
GetMutableVariable and SetMutableVariable have also been renamed
to GetMutable and SetMutable to be uniform with LetMutable.
BUG=
R=karlklose@google.com
Review URL: https://codereview.chromium.org//1240263002.
When running as a content script in a Chrome extension `document.contentScript` is set to `null`. We should take that value instead of trying to compute another one based on script tags (the work-around we have for IE). Since content-scripts are not part of the page, it might be that there aren't even any other scripts and the work-around mechanism simply fails (thus not starting the main function).
R=karlklose@google.com
Review URL: https://codereview.chromium.org//1224363004 .