Fixed HMul::Canonicalize() to support SMI

Same idea for HDiv when the right oeprand is 1

BUG=
R=jkummerow@chromium.org

Review URL: https://codereview.chromium.org/23176002

Patch from Weiliang Lin <weiliang.lin2@gmail.com>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16364 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 6b760b92
...@@ -1243,6 +1243,7 @@ HValue* HMod::Canonicalize() { ...@@ -1243,6 +1243,7 @@ HValue* HMod::Canonicalize() {
HValue* HDiv::Canonicalize() { HValue* HDiv::Canonicalize() {
if (IsIdentityOperation(left(), right(), 1)) return left();
return this; return this;
} }
......
...@@ -148,7 +148,7 @@ class Representation { ...@@ -148,7 +148,7 @@ class Representation {
bool IsHeapObject() const { return kind_ == kHeapObject; } bool IsHeapObject() const { return kind_ == kHeapObject; }
bool IsExternal() const { return kind_ == kExternal; } bool IsExternal() const { return kind_ == kExternal; }
bool IsSpecialization() const { bool IsSpecialization() const {
return kind_ == kInteger32 || kind_ == kDouble; return kind_ == kInteger32 || kind_ == kDouble || kind_ == kSmi;
} }
const char* Mnemonic() const; const char* Mnemonic() const;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment