Index: src/ast.cc |
diff --git a/src/ast.cc b/src/ast.cc |
index a94feb88e56412aeeb4ea0c97f58a4f90e864de4..0ebbd35be886cdef66de2bb459226000d41750a3 100644 |
--- a/src/ast.cc |
+++ b/src/ast.cc |
@@ -503,19 +503,7 @@ void CountOperation::RecordTypeFeedback(TypeFeedbackOracle* oracle, |
void CaseClause::RecordTypeFeedback(TypeFeedbackOracle* oracle) { |
- TypeInfo info = oracle->SwitchType(this); |
- if (info.IsUninitialized()) info = TypeInfo::Unknown(); |
- if (info.IsSmi()) { |
- compare_type_ = SMI_ONLY; |
- } else if (info.IsInternalizedString()) { |
- compare_type_ = NAME_ONLY; |
- } else if (info.IsNonInternalizedString()) { |
- compare_type_ = STRING_ONLY; |
- } else if (info.IsNonPrimitive()) { |
- compare_type_ = OBJECT_ONLY; |
- } else { |
- ASSERT(compare_type_ == NONE); |
- } |
+ compare_type_ = oracle->ClauseType(CompareId()); |
} |
@@ -685,17 +673,11 @@ void BinaryOperation::RecordTypeFeedback(TypeFeedbackOracle* oracle) { |
} |
+// TODO(rossberg): this function (and all other RecordTypeFeedback functions) |
+// should disappear once we use the common type field in the AST consistently. |
void CompareOperation::RecordTypeFeedback(TypeFeedbackOracle* oracle) { |
- oracle->CompareType(this, &left_type_, &right_type_, &overall_type_); |
- if (!overall_type_.IsUninitialized() && overall_type_.IsNonPrimitive() && |
- (op_ == Token::EQ || op_ == Token::EQ_STRICT)) { |
- map_ = oracle->GetCompareMap(this); |
- } else { |
- // May be a compare to nil. |
- map_ = oracle->CompareNilMonomorphicReceiverType(this); |
- if (op_ != Token::EQ_STRICT) |
- compare_nil_types_ = oracle->CompareNilTypes(this); |
- } |
+ oracle->CompareTypes(CompareOperationFeedbackId(), |
+ &left_type_, &right_type_, &overall_type_, &compare_nil_type_); |
} |
@@ -1072,7 +1054,7 @@ CaseClause::CaseClause(Isolate* isolate, |
: label_(label), |
statements_(statements), |
position_(pos), |
- compare_type_(NONE), |
+ compare_type_(Type::None(), isolate), |
compare_id_(AstNode::GetNextId(isolate)), |
entry_id_(AstNode::GetNextId(isolate)) { |
} |