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

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..03a785d0c40f1cbf5547019580127bfc82733bcc 100644
--- a/src/hydrogen-instructions.cc
+++ b/src/hydrogen-instructions.cc
@@ -124,20 +124,9 @@ void HValue::UpdateRepresentation(Representation new_rep,
const char* reason) {
Representation r = representation();
if (new_rep.is_more_general_than(r)) {
- // When an HConstant is marked "not convertible to integer", then
- // never try to represent it as an integer.
- if (new_rep.IsInteger32() && !IsConvertibleToInteger()) {
- new_rep = Representation::Tagged();
- if (FLAG_trace_representation) {
- PrintF("Changing #%d %s representation %s -> %s because it's NCTI"
- " (%s want i)\n",
- id(), Mnemonic(), r.Mnemonic(), new_rep.Mnemonic(), reason);
- }
- } else {
- if (FLAG_trace_representation) {
- PrintF("Changing #%d %s representation %s -> %s based on %s\n",
- id(), Mnemonic(), r.Mnemonic(), new_rep.Mnemonic(), reason);
- }
+ if (FLAG_trace_representation) {
+ PrintF("Changing #%d %s representation %s -> %s based on %s\n",
+ id(), Mnemonic(), r.Mnemonic(), new_rep.Mnemonic(), reason);
}
ChangeRepresentation(new_rep);
AddDependantsToWorklist(h_infer);
@@ -1926,7 +1915,6 @@ void HPhi::PrintTo(StringStream* stream) {
int32_non_phi_uses() + int32_indirect_uses(),
double_non_phi_uses() + double_indirect_uses(),
tagged_non_phi_uses() + tagged_indirect_uses());
- if (!IsConvertibleToInteger()) stream->Add("_ncti");
PrintRangeTo(stream);
PrintTypeTo(stream);
stream->Add("]");
@@ -3565,48 +3553,12 @@ void HPhi::InferRepresentation(HInferRepresentation* h_infer) {
Representation HPhi::RepresentationFromInputs() {
- bool double_occurred = false;
- bool int32_occurred = false;
- bool smi_occurred = false;
+ Representation r = Representation::None();
for (int i = 0; i < OperandCount(); ++i) {
- HValue* value = OperandAt(i);
- if (value->IsUnknownOSRValue()) {
- 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;
- }
- continue;
- }
- if (value->representation().IsDouble()) double_occurred = true;
- if (value->representation().IsInteger32()) int32_occurred = true;
- if (value->representation().IsSmi()) smi_occurred = true;
- if (value->representation().IsTagged()) {
- if (value->IsConstant()) {
- HConstant* constant = HConstant::cast(value);
- if (constant->IsConvertibleToInteger()) {
- int32_occurred = true;
- } else if (constant->HasNumberValue()) {
- double_occurred = true;
- } else {
- return Representation::Tagged();
- }
- } else {
- if (value->IsPhi() && !IsConvertibleToInteger()) {
- return Representation::Tagged();
- }
- }
- }
+ r = r.generalize(OperandAt(i)->KnownOptimalRepresentation());
}
- if (double_occurred) return Representation::Double();
- if (int32_occurred) return Representation::Integer32();
- if (smi_occurred) return Representation::Smi();
-
- return Representation::None();
+ return r;
}
« 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