Index: src/ast/ast.cc |
diff --git a/src/ast/ast.cc b/src/ast/ast.cc |
index 06037f4e6d35edad4b5a142c10473a977d3ce6f3..d89ec793bdcb6dcd9bbec44ecfdea8db3fe37671 100644 |
--- a/src/ast/ast.cc |
+++ b/src/ast/ast.cc |
@@ -741,6 +741,20 @@ static bool IsTypeof(Expression* expr) { |
return maybe_unary != NULL && maybe_unary->op() == Token::TYPEOF; |
} |
+void CompareOperation::AssignFeedbackVectorSlots( |
+ Isolate* isolate, FeedbackVectorSpec* spec, |
+ FeedbackVectorSlotCache* cache_) { |
+ // Feedback vector slot is only used by interpreter for binary operations. |
+ // Full-codegen uses AstId to record type feedback. |
+ switch (op()) { |
+ // instanceof and in do not collect type feedback. |
+ case Token::INSTANCEOF: |
+ case Token::IN: |
+ return; |
+ default: |
+ type_feedback_slot_ = spec->AddGeneralSlot(); |
+ } |
+} |
// Check for the pattern: typeof <expression> equals <string literal>. |
static bool MatchLiteralCompareTypeof(Expression* left, |
@@ -942,6 +956,12 @@ CaseClause::CaseClause(Expression* label, ZoneList<Statement*>* statements, |
statements_(statements), |
compare_type_(Type::None()) {} |
+void CaseClause::AssignFeedbackVectorSlots(Isolate* isolate, |
+ FeedbackVectorSpec* spec, |
+ FeedbackVectorSlotCache* cache) { |
+ type_feedback_slot_ = spec->AddGeneralSlot(); |
+} |
+ |
uint32_t Literal::Hash() { |
return raw_value()->IsString() |
? raw_value()->AsString()->hash() |