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
This commit is contained in:
jkummerow@chromium.org 2013-08-27 14:09:26 +00:00
parent 6b760b92a3
commit 6be4e9455e
2 changed files with 2 additions and 1 deletions

View File

@ -1243,6 +1243,7 @@ HValue* HMod::Canonicalize() {
HValue* HDiv::Canonicalize() {
if (IsIdentityOperation(left(), right(), 1)) return left();
return this;
}

View File

@ -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;