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

Unified Diff: src/hydrogen.cc

Issue 6905166: Change heuristics for deciding phi-representation types to use int32 more frequently. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/hydrogen-instructions.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « no previous file | src/hydrogen-instructions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698