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

Unified Diff: src/hydrogen.cc

Issue 7857033: Refactored HInferRepresenation::TryChange a bit, making the heuristics a bit clearer. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years, 3 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen.cc
===================================================================
--- src/hydrogen.cc (revision 9208)
+++ src/hydrogen.cc (working copy)
@@ -1649,18 +1649,20 @@
int non_tagged_count = double_count + int32_count;
// If a non-loop phi has tagged uses, don't convert it to untagged.
- if (value->IsPhi() && !value->block()->IsLoopHeader()) {
- if (tagged_count > 0) return Representation::None();
+ if (value->IsPhi() && !value->block()->IsLoopHeader() && tagged_count > 0) {
+ return Representation::None();
}
- if (non_tagged_count >= tagged_count) {
- if (int32_count > 0) {
- if (!value->IsPhi() || value->IsConvertibleToInteger()) {
- return Representation::Integer32();
- }
- }
- if (double_count > 0) return Representation::Double();
+ // Prefer unboxing over boxing, the latter is more expensive.
+ if (tagged_count > non_tagged_count) Representation::None();
+
+ // Prefer Integer32 over Double, if possible.
+ if (int32_count > 0 && value->IsConvertibleToInteger()) {
+ return Representation::Integer32();
}
+
+ if (double_count > 0) return Representation::Double();
+
return Representation::None();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698