From 6be4e9455e1b6564e41cde84cb3bd299f7cde02e Mon Sep 17 00:00:00 2001 From: "jkummerow@chromium.org" Date: Tue, 27 Aug 2013 14:09:26 +0000 Subject: [PATCH] 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 . git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16364 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/hydrogen-instructions.cc | 1 + src/property-details.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc index 77ce859..70197cf 100644 --- a/src/hydrogen-instructions.cc +++ b/src/hydrogen-instructions.cc @@ -1243,6 +1243,7 @@ HValue* HMod::Canonicalize() { HValue* HDiv::Canonicalize() { + if (IsIdentityOperation(left(), right(), 1)) return left(); return this; } diff --git a/src/property-details.h b/src/property-details.h index 6b62ddb..7f44b79 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; -- 2.7.4