9b16b3409b
For example turn 'i = i + 1' into '++i' and 'i = i / 0.2' into
'i /= 0.2'.
Additionally, only move equivalent instructions to a dominator block
if there is more than one successor. There is no reason to move if
there is only one in any case. This has the added benefit that the
update part of a simple for-loop stays in the update part in the
generated code.
Before:
for (var i = 0; i < 10; ) {
i = i + 1;
}
Now:
for (var i = 0; i < 10; ++i) {
}
This code is a bit hackish. Please let me know if you have suggestions
for better structure of the cod.
R=ngeoffray@google.com,kasperl@google.com
BUG=
TEST=
Review URL: https://chromiumcodereview.appspot.com//10520003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8250 260f80e4-7a28-3924-810f-c04153c831b5
Leg is an experimental add-on to the Frog compiler that aims to explore areas of long-term interest: * high-performance extensible scanner and parser * concrete type inferencing * fancy language tool support * programming environment integration * SSA-based intermediate representation * adaptive compilation on the client * ... Some of the things listed above are very experimental of nature and may prove themselves infeasible or unnecesary, so we want to work on them in a way that guarantees we will not disrupt the work being done to make Frog a fantastic compiler for Dart in its default setup. To keep things simple and allow quick experimentation, Leg will only support a subset of Dart and fall back on using the default Frog compiler for the remaining parts of the language. We expect Leg to be a complete and correct implementation of the supported subset throughout the implementation and experimentation so you should always be able to try Leg on any Dart project. The plan is to share code between the default Frog compiler and Leg where it makes sense and to learn from both code bases along the way.