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
HValue* HDiv::Canonicalize() {
+ if (IsIdentityOperation(left(), right(), 1)) return left();
return this;
}
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;