I'm afraid this approach fundamentally won't work. You're trying to do GVN
without doing GVN, and that's going to give you incorrect code... e.g.
you're
not considering all of the DependsOn/Changes relationships, etc. That's why
I am
very, very wary of any approach that doesn't use the full infrastructure
that is
in place for dependencies, and Change/DependsOn.
https://chromiumcodereview.appspot.com/11414201/diff/1/src/hydrogen.cc
File src/hydrogen.cc (right):
https://chromiumcodereview.appspot.com/11414201/diff/1/src/hydrogen.cc#newcode734
src/hydrogen.cc:734: // First, find the set of HJSArrayLength insts that
operate on the same
please don't use abbreviations, "insts" should be "instructions"
everywhere in your CL.
https://chromiumcodereview.appspot.com/11414201/diff/1/src/hydrogen.cc#newcode741
src/hydrogen.cc:741: while (group_end_index < array_lengths_.length() &&
This algorithm is a no-go. It is quadratic with respect to
array_lengths_.length().
https://chromiumcodereview.appspot.com/11414201/diff/1/src/hydrogen.cc#newcode764
src/hydrogen.cc:764: map_check = current_map_check;
This is not sufficient and leads to incorrect code. If an intervening
operation changes array lengths, you will combine one or more length
operations that are not equivalent. That's why we have DependsOn and
Changes in GVN in the first place.
https://chromiumcodereview.appspot.com/11414201/
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev