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

Unified Diff: src/hydrogen-instructions.cc

Issue 16240003: Improve smi support in crankshaft (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 7 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 | « src/hydrogen-instructions.h ('k') | src/lithium-allocator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen-instructions.cc
diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc
index d4938e5c3848d9509b7d0603ae19c2cf253a4373..b276cb20c77ba9e8595ebdd5c85fad7eb28ac9c7 100644
--- a/src/hydrogen-instructions.cc
+++ b/src/hydrogen-instructions.cc
@@ -3565,6 +3565,7 @@ void HPhi::InferRepresentation(HInferRepresentation* h_infer) {
Representation HPhi::RepresentationFromInputs() {
+ bool tagged_smi_occurred = false;
Jakob Kummerow 2013/05/31 16:39:40 I don't think we should treat tagged_smi different
bool double_occurred = false;
bool int32_occurred = false;
bool smi_occurred = false;
@@ -3574,10 +3575,18 @@ Representation HPhi::RepresentationFromInputs() {
HPhi* hint_value = HUnknownOSRValue::cast(value)->incoming_value();
if (hint_value != NULL) {
Representation hint = hint_value->representation();
- if (hint.IsTagged()) return hint;
- if (hint.IsDouble()) double_occurred = true;
- if (hint.IsInteger32()) int32_occurred = true;
- if (hint.IsSmi()) smi_occurred = true;
+ if (hint.IsTagged()) {
+ if (!hint_value->type().IsSmi()) return hint;
+ if (double_occurred) return hint;
+ if (int32_occurred) return hint;
+ tagged_smi_occurred = true;
+ } else if (tagged_smi_occurred) {
+ if (!hint.IsSmi()) return Representation::Tagged();
+ } else {
+ if (hint.IsDouble()) double_occurred = true;
+ if (hint.IsInteger32()) int32_occurred = true;
+ if (hint.IsSmi()) smi_occurred = true;
+ }
}
continue;
}
@@ -3587,7 +3596,9 @@ Representation HPhi::RepresentationFromInputs() {
if (value->representation().IsTagged()) {
if (value->IsConstant()) {
HConstant* constant = HConstant::cast(value);
- if (constant->IsConvertibleToInteger()) {
+ if (constant->HasSmiValue()) {
+ smi_occurred = true;
+ } else if (constant->IsConvertibleToInteger()) {
int32_occurred = true;
} else if (constant->HasNumberValue()) {
double_occurred = true;
@@ -3596,12 +3607,16 @@ Representation HPhi::RepresentationFromInputs() {
}
} else {
if (value->IsPhi() && !IsConvertibleToInteger()) {
- return Representation::Tagged();
+ if (!value->type().IsSmi()) return Representation::Tagged();
+ if (double_occurred) return Representation::Tagged();
+ if (int32_occurred) return Representation::Tagged();
+ tagged_smi_occurred = true;
}
}
}
}
+ if (tagged_smi_occurred) return Representation::Smi();
if (double_occurred) return Representation::Double();
if (int32_occurred) return Representation::Integer32();
if (smi_occurred) return Representation::Smi();
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/lithium-allocator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698