Index: src/ic/ic-state.cc |
diff --git a/src/ic/ic-state.cc b/src/ic/ic-state.cc |
index 79e2f1401ffc92edeec83d02178cec238fc90edd..bc03d7d4870c29d4ba158dc69be103727c85920a 100644 |
--- a/src/ic/ic-state.cc |
+++ b/src/ic/ic-state.cc |
@@ -358,6 +358,8 @@ const char* CompareICState::GetStateName(State state) { |
switch (state) { |
case UNINITIALIZED: |
return "UNINITIALIZED"; |
+ case BOOLEAN: |
+ return "BOOLEAN"; |
case SMI: |
return "SMI"; |
case NUMBER: |
@@ -384,6 +386,8 @@ Type* CompareICState::StateToType(Zone* zone, State state, Handle<Map> map) { |
switch (state) { |
case UNINITIALIZED: |
return Type::None(zone); |
+ case BOOLEAN: |
+ return Type::Boolean(zone); |
case SMI: |
return Type::SignedSmall(zone); |
case NUMBER: |
@@ -410,6 +414,7 @@ CompareICState::State CompareICState::NewInputState(State old_state, |
Handle<Object> value) { |
switch (old_state) { |
case UNINITIALIZED: |
+ if (value->IsBoolean()) return BOOLEAN; |
if (value->IsSmi()) return SMI; |
if (value->IsHeapNumber()) return NUMBER; |
if (value->IsInternalizedString()) return INTERNALIZED_STRING; |
@@ -417,6 +422,9 @@ CompareICState::State CompareICState::NewInputState(State old_state, |
if (value->IsSymbol()) return UNIQUE_NAME; |
if (value->IsJSObject()) return OBJECT; |
break; |
+ case BOOLEAN: |
+ if (value->IsBoolean()) return BOOLEAN; |
+ break; |
case SMI: |
if (value->IsSmi()) return SMI; |
if (value->IsHeapNumber()) return NUMBER; |
@@ -454,6 +462,7 @@ CompareICState::State CompareICState::TargetState( |
bool has_inlined_smi_code, Handle<Object> x, Handle<Object> y) { |
switch (old_state) { |
case UNINITIALIZED: |
+ if (x->IsBoolean() && y->IsBoolean()) return BOOLEAN; |
if (x->IsSmi() && y->IsSmi()) return SMI; |
if (x->IsNumber() && y->IsNumber()) return NUMBER; |
if (Token::IsOrderedRelationalCompareOp(op)) { |
@@ -500,6 +509,7 @@ CompareICState::State CompareICState::TargetState( |
return Token::IsEqualityOp(op) ? OBJECT : GENERIC; |
} |
return GENERIC; |
+ case BOOLEAN: |
case STRING: |
case UNIQUE_NAME: |
case OBJECT: |
@@ -509,5 +519,6 @@ CompareICState::State CompareICState::TargetState( |
UNREACHABLE(); |
return GENERIC; // Make the compiler happy. |
} |
+ |
} // namespace internal |
} // namespace v8 |