Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(105)

Unified Diff: src/ast/ast.cc

Issue 2286273002: [interpreter] Make the comparison bytecode handlers collect type feedback. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ast/ast.h ('k') | src/ast/ast-numbering.cc » ('j') | src/globals.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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()
« no previous file with comments | « src/ast/ast.h ('k') | src/ast/ast-numbering.cc » ('j') | src/globals.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698