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

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: Addressed comments 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.cc ('k') | src/ia32/lithium-codegen-ia32.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 bd33f1a2b7ee38eb0998d783445066d902abe59c..eadac83ed1be76f57d5dfef1c01e151702874a00 100644
--- a/src/hydrogen-instructions.cc
+++ b/src/hydrogen-instructions.cc
@@ -2454,18 +2454,18 @@ void HGoto::PrintDataTo(StringStream* stream) {
void HCompareIDAndBranch::InferRepresentation(HInferRepresentation* h_infer) {
- Representation rep = Representation::None();
Representation left_rep = left()->representation();
Representation right_rep = right()->representation();
- bool observed_integers =
- observed_input_representation(0).IsInteger32() &&
- observed_input_representation(1).IsInteger32();
- bool inputs_are_not_doubles =
- !left_rep.IsDouble() && !right_rep.IsDouble();
- if (observed_integers && inputs_are_not_doubles) {
- rep = Representation::Integer32();
- } else {
- rep = Representation::Double();
+ Representation observed_left = observed_input_representation(0);
+ Representation observed_right = observed_input_representation(1);
+
+ Representation rep = Representation::Smi();
+ if (!left_rep.IsTagged()) rep = rep.generalize(left_rep);
+ if (!right_rep.IsTagged()) rep = rep.generalize(right_rep);
+ if (!observed_left.IsTagged()) rep = rep.generalize(observed_left);
+ if (!observed_right.IsTagged()) rep = rep.generalize(observed_right);
+
+ if (rep.IsDouble()) {
// According to the ES5 spec (11.9.3, 11.8.5), Equality comparisons (==, ===
// and !=) have special handling of undefined, e.g. undefined == undefined
// is 'true'. Relational comparisons have a different semantic, first
« no previous file with comments | « src/hydrogen.cc ('k') | src/ia32/lithium-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698