Index: src/hydrogen.cc |
=================================================================== |
--- src/hydrogen.cc (revision 7737) |
+++ src/hydrogen.cc (working copy) |
@@ -1575,14 +1575,13 @@ |
} |
if (non_tagged_count >= tagged_count) { |
- // More untagged than tagged. |
- if (double_count > 0) { |
- // There is at least one usage that is a double => guess that the |
- // correct representation is double. |
- return Representation::Double(); |
+ if (int32_count > 0 && value->IsPhi()) { |
Kevin Millikin (Chromium)
2011/05/03 07:58:32
if (int32_count > 0) {
if (!value->IsPhi() || va
|
+ HPhi* phi = HPhi::cast(value); |
+ if (phi->IsConvertibleToInteger()) return Representation::Integer32(); |
} else if (int32_count > 0) { |
return Representation::Integer32(); |
} |
+ if (double_count > 0) return Representation::Double(); |
} |
return Representation::None(); |
} |
@@ -1595,7 +1594,7 @@ |
// bit-vector of length <number of phis>. |
const ZoneList<HPhi*>* phi_list = graph_->phi_list(); |
int phi_count = phi_list->length(); |
- ScopedVector<BitVector*> connected_phis(phi_count); |
+ ZoneList<BitVector*> connected_phis(phi_count); |
for (int i = 0; i < phi_count; ++i) { |
phi_list->at(i)->InitRealUses(i); |
connected_phis[i] = new(zone()) BitVector(phi_count); |
@@ -1636,6 +1635,25 @@ |
} |
} |
+ // (4) Compute phis that definitely can't be converted to integer |
+ // without deoptimization and mark them to avoid unnecessary deoptimization. |
+ change = true; |
+ while (change) { |
+ change = false; |
+ for (int i = 0; i < phi_count; i++) { |
Kevin Millikin (Chromium)
2011/05/03 07:58:32
All the other loops in this function use new-schoo
|
+ HPhi* phi = phi_list->at(i); |
+ for (int i = 0; i < phi->OperandCount(); i++) { |
Kevin Millikin (Chromium)
2011/05/03 07:58:32
Please don't shadow the outer loop index even if y
|
+ if (phi->IsConvertibleToInteger() && |
+ !phi->OperandAt(i)->IsConvertibleToInteger()) { |
+ phi->set_is_convertible_to_integer(false); |
+ change = true; |
+ break; |
+ } |
+ } |
+ } |
+ } |
+ |
+ |
for (int i = 0; i < graph_->blocks()->length(); ++i) { |
HBasicBlock* block = graph_->blocks()->at(i); |
const ZoneList<HPhi*>* phis = block->phis(); |