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

Unified Diff: src/ast/ast.cc

Issue 2209633002: [Interpreter] Assign feedback slots for binary operations and use them in ignition. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebased the patch. 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') | no next file with comments »
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 12e6f206711dba957124c7639a25b4c1c9e89dcd..44f2d1263a5e958df8e370f0ba8898cf00c6a558 100644
--- a/src/ast/ast.cc
+++ b/src/ast/ast.cc
@@ -289,6 +289,9 @@ void CountOperation::AssignFeedbackVectorSlots(Isolate* isolate,
FeedbackVectorSpec* spec,
FeedbackVectorSlotCache* cache) {
AssignVectorSlots(expression(), spec, &slot_);
+ // Assign a slot to collect feedback about binary operations. Used only in
+ // ignition. Fullcodegen uses AstId to record type feedback.
+ binary_operation_slot_ = spec->AddGeneralSlot();
}
@@ -734,6 +737,22 @@ void BinaryOperation::RecordToBooleanTypeFeedback(TypeFeedbackOracle* oracle) {
set_to_boolean_types(oracle->ToBooleanTypes(right()->test_id()));
}
+void BinaryOperation::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()) {
+ // Comma, logical_or and logical_and do not collect type feedback.
+ case Token::COMMA:
+ case Token::AND:
+ case Token::OR:
+ return;
+ default:
+ type_feedback_slot_ = spec->AddGeneralSlot();
+ return;
+ }
+}
static bool IsTypeof(Expression* expr) {
UnaryOperation* maybe_unary = expr->AsUnaryOperation();
« no previous file with comments | « src/ast/ast.h ('k') | src/ast/ast-numbering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698