diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc index e28b9efd8f..50f2f6df6c 100644 --- a/src/hydrogen-instructions.cc +++ b/src/hydrogen-instructions.cc @@ -784,6 +784,21 @@ void HChange::PrintDataTo(StringStream* stream) { } +HValue* HCheckInstanceType::Canonicalize() { + if (check_ == IS_STRING && + !value()->type().IsUninitialized() && + value()->type().IsString()) { + return NULL; + } + if (check_ == IS_SYMBOL && + value()->IsConstant() && + HConstant::cast(value())->handle()->IsSymbol()) { + return NULL; + } + return this; +} + + void HCheckInstanceType::GetCheckInterval(InstanceType* first, InstanceType* last) { ASSERT(is_interval_check()); diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h index 599035220c..401c2e4a03 100644 --- a/src/hydrogen-instructions.h +++ b/src/hydrogen-instructions.h @@ -2003,14 +2003,7 @@ class HCheckInstanceType: public HUnaryOperation { virtual void Verify(); #endif - virtual HValue* Canonicalize() { - if (!value()->type().IsUninitialized() && - value()->type().IsString() && - check_ == IS_STRING) { - return NULL; - } - return this; - } + virtual HValue* Canonicalize(); bool is_interval_check() const { return check_ <= LAST_INTERVAL_CHECK; } void GetCheckInterval(InstanceType* first, InstanceType* last);