Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Issue 6905166: Change heuristics for deciding phi-representation types to use int32 more frequently. (Closed)

Created:
9 years, 7 months ago by fschneider
Modified:
9 years, 6 months ago
CC:
v8-dev
Visibility:
Public.

Description

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. Committed: http://code.google.com/p/v8/source/detail?r=7757

Patch Set 1 #

Patch Set 2 : fixed lint/spelling errors #

Patch Set 3 : '' #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+45 lines, -7 lines) Patch
M src/hydrogen.cc View 1 2 3 chunks +24 lines, -6 lines 3 comments Download
M src/hydrogen-instructions.h View 1 2 5 chunks +21 lines, -1 line 0 comments Download

Messages

Total messages: 2 (0 generated)
fschneider
9 years, 7 months ago (2011-05-02 15:06:02 UTC) #1
Kevin Millikin (Chromium)
9 years, 7 months ago (2011-05-03 07:58:31 UTC) #2
LGTM.

http://codereview.chromium.org/6905166/diff/4/src/hydrogen.cc
File src/hydrogen.cc (right):

http://codereview.chromium.org/6905166/diff/4/src/hydrogen.cc#newcode1578
src/hydrogen.cc:1578: if (int32_count > 0 && value->IsPhi()) {
if (int32_count > 0) {
  if (!value->IsPhi() || value->IsConvertibleToInteger()) {
    return Representation::Integer32();
  }
}
if (double_count > 0) ...

http://codereview.chromium.org/6905166/diff/4/src/hydrogen.cc#newcode1643
src/hydrogen.cc:1643: for (int i = 0; i < phi_count; i++) {
All the other loops in this function use new-school ++i :)

http://codereview.chromium.org/6905166/diff/4/src/hydrogen.cc#newcode1645
src/hydrogen.cc:1645: for (int i = 0; i < phi->OperandCount(); i++) {
Please don't shadow the outer loop index even if you don't need it in the inner
loop!

Powered by Google App Engine
This is Rietveld 408576698