Change heuristics for deciding phi-representation types to use int32 more frequently.
authorfschneider@chromium.org <fschneider@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 3 May 2011 08:31:35 +0000 (08:31 +0000)
committerfschneider@chromium.org <fschneider@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 3 May 2011 08:31:35 +0000 (08:31 +0000)
commit3e94ac952da9a56ec8f7829871d7ae3b12bb8e00
tree9b24ce376977e0c1263819a130b1c87845f8e975
parentd0fcbb4ece539fd897dc2b8e03c10bb6f468b528
Change heuristics for deciding phi-representation types to use int32 more frequently.

Until now we conservatively chose a double representation if
at least one use occurs in a double operation. This causes performance
degradation in many cases where there are mixes uses (integer and double)

e.g.:

for (int i = 0; i < 10; i++) {
  var t = i / 3.5;
  a[i] = t;
}

where the use in i/3 requires a double, where as the keyed store requires i
as an integer.

For these cases we want to have i as an integer and convert it only before the
double division.

In order to avoid unconditional deoptimization in some rare cases, we check
phis if there is any conversion that will always fail when converting a
heap-number constant to int32.
Review URL: http://codereview.chromium.org/6905166

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7757 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
src/hydrogen-instructions.h
src/hydrogen.cc