Support try/catch/finally by pretending it is macro-expanded into
try/catch and try/finally:
try S0 catch (ex, st) S1 finally S2
==>
try { try S0 catch (ex, st) S1 } finally S2
The duplicated code for try/catch and try/finally is abstracted into a
function parameterized over translations for all the parts that
differed.
R=asgerf@google.com
Review URL: https://codereview.chromium.org//1207703002.
Try/finally is implemented by inlining. There is a try/catch to catch
exceptions in the try block. The catch body contains the finally code
followed by a rethrow. The code for finally is translated again after the
normal exit of the try block. Break, continue, and return exits in the try
block have the finally code inlined just before the exit is taken.
Try/catch/finally is not yet supported, it requires some changes to the
assigned variables analysis.
R=asgerf@google.com
Review URL: https://codereview.chromium.org//1201983002.
Identical is now a built-in operator instead of a separate primitive.
Interceptor is now its own expression in the Tree IR instead of a static
invocation. This matches the CPS IR (where it is a primitive), and
should fix a problem it was causing for frequency-based naming.
The JS-specific subclass of the Tree IR builder no longer depended on
the backend, emitter, namer, glue, compiler, or anything so it has
been merged into the superclass.
BUG=
R=kmillikin@google.com
Review URL: https://codereview.chromium.org//1204733002.
Get the correct receiver in noSuchMethod stubs.
noSuchMethod stubs for selectors with Interceptor calling convention should pass the receiver to noSuchMethod (not 'this'). The actual receiver is selected by Object.noSuchMethod and Interceptor.noSuchMethod.
R=floitsch@google.com
Review URL: https://codereview.chromium.org//1181063005.
The ConcatenateStrings IR node has been removed. It was a leftover from
dart2dart.
Expressions inside string interpolations are now stringified explicitly
and we concatenate strings with a pure StringConcat operator.
ConstantExpressions have also been removed from the IR. They were also
an artifact from dart2dart and were complicating the optimizer.
BUG=
R=kmillikin@google.com
Review URL: https://codereview.chromium.org//1195573003.
When a term is deleted, the algorithm searches for new redexes created
by the term's deletion. Continuation beta redexes search up the term
between the redex and the continuation's binding to ensure that the
continuation is not moved into the scope of an exception handler.
This search fails if it first encounters the root of the deleted
subterm (i.e., the newly-created redex is in the deleted term). Just
ignore the redex in that case, since the term is being deleted.
Also, update some triaged test expectations with their bug numbers.
R=asgerf@google.com
Review URL: https://codereview.chromium.org//1196323002.
.length on JS arrays are not introduced yet because that is not
seen as field accesses by our class hierarchy.
I've changed the contract on Primitives so they can have side effects,
depend on state, diverge, throw, anything goes. GetField on possibly
null receivers would not be allowed otherwise.
AFAIK there are no optimizations that actually used the contract on
primitives, it just seemed like a good idea at one point in the past,
so that change only affects a single doc comment.
I'll migrate some of the classes that can now be primitives in another
CL.
BuiltinOperators are still required to be pure, although that too may
possibly change soon.
BUG=
R=kmillikin@google.com
Review URL: https://codereview.chromium.org//1188253006.
Fixes a bug where it would pull impure expressions out of branches.
It now uses a slightly more precise analysis to pull more things into
the initializer block (but never out of branch).
BUG=
R=kmillikin@google.com
Review URL: https://codereview.chromium.org//1188783002.
The generated code uses different helpers than the SSA. In SSA, there are calls to buildFunctionType and _isTest. The CPS uses checkSubtypeOfRuntimeType, the "one size fits all" method we also use to test against type variable types.
When the function type has no type variables in it we could hoist the function type into a constant, but the constant system does not support type representation constants at the moment. But it seems like an optimization we may want to add later.
BUG=
R=karlklose@google.com
Review URL: https://codereview.chromium.org//1180973003.
There are also a number of somewhat unrelated changes to get
better type information out of the global type inference.
The dependency on TypedSelector is causing a lot of problems there.
BUG=
R=kmillikin@google.com
Review URL: https://codereview.chromium.org//1175973005.