Chromium Code Reviews| Index: src/ast/ast.cc |
| diff --git a/src/ast/ast.cc b/src/ast/ast.cc |
| index 12e6f206711dba957124c7639a25b4c1c9e89dcd..05117e6117c63ab130c10c0cf19ffbc783948697 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 |
|
rmcilroy
2016/08/03 16:04:29
/s/used/Used
mythria
2016/08/05 07:08:14
Done.
|
| + // 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(); |