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

Unified Diff: src/hydrogen-instructions.cc

Issue 16134003: Support Smi in CompareIDAndBranch (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
Index: src/hydrogen-instructions.cc
diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc
index bd33f1a2b7ee38eb0998d783445066d902abe59c..6a1cad27f15c2dcb3c6c6a7b419f00501efafe60 100644
--- a/src/hydrogen-instructions.cc
+++ b/src/hydrogen-instructions.cc
@@ -2460,10 +2460,16 @@ void HCompareIDAndBranch::InferRepresentation(HInferRepresentation* h_infer) {
bool observed_integers =
observed_input_representation(0).IsInteger32() &&
observed_input_representation(1).IsInteger32();
- bool inputs_are_not_doubles =
- !left_rep.IsDouble() && !right_rep.IsDouble();
+ bool inputs_are_not_doubles = !left_rep.IsDouble() && !right_rep.IsDouble();
+
if (observed_integers && inputs_are_not_doubles) {
- rep = Representation::Integer32();
+ rep = Representation::Smi();
+ if (left_rep.is_more_general_than(rep) && !left_rep.IsTagged()) {
+ rep = Representation::Integer32();
+ }
+ if (right_rep.is_more_general_than(rep) && !right_rep.IsTagged()) {
+ rep = Representation::Integer32();
+ }
} else {
rep = Representation::Double();
// According to the ES5 spec (11.9.3, 11.8.5), Equality comparisons (==, ===
« no previous file with comments | « src/hydrogen.cc ('k') | src/ia32/lithium-codegen-ia32.cc » ('j') | src/ia32/lithium-ia32.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698