Reviewers: Jakob,
Description:
Fixed HMul::Canonicalize() to support SMI
Same idea for HDiv when the right oeprand is 1
BUG=
Please review this at https://codereview.chromium.org/23176002/
SVN Base: https://github.com/v8/v8.git@master
Affected files:
M src/hydrogen-instructions.cc
M src/property-details.h
Index: src/hydrogen-instructions.cc
diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc
index
225b080d6e49150e272eddebcafb8e000697461f..c8e1e76f4ec967d16f84d080b1546db28be43b3b
100644
--- a/src/hydrogen-instructions.cc
+++ b/src/hydrogen-instructions.cc
@@ -1231,6 +1231,7 @@ HValue* HMod::Canonicalize() {
HValue* HDiv::Canonicalize() {
+ if (IsIdentityOperation(left(), right(), 1)) return left();
return this;
}
Index: src/property-details.h
diff --git a/src/property-details.h b/src/property-details.h
index
6b62ddb18e52467e3b8ef3eb80e4450a9fd04a31..7f44b79277c5188596e55b37c66eee4f02ed3199
100644
--- a/src/property-details.h
+++ b/src/property-details.h
@@ -148,7 +148,7 @@ class Representation {
bool IsHeapObject() const { return kind_ == kHeapObject; }
bool IsExternal() const { return kind_ == kExternal; }
bool IsSpecialization() const {
- return kind_ == kInteger32 || kind_ == kDouble;
+ return kind_ == kInteger32 || kind_ == kDouble || kind_ == kSmi;
}
const char* Mnemonic() const;
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.