Index: src/compiler/bytecode-graph-builder.cc |
diff --git a/src/compiler/bytecode-graph-builder.cc b/src/compiler/bytecode-graph-builder.cc |
index 621ca104d880ab2ecdb43bddb3f194e5815c2d5e..ea185637e8783db2df4698d93524bb4cfd815dd1 100644 |
--- a/src/compiler/bytecode-graph-builder.cc |
+++ b/src/compiler/bytecode-graph-builder.cc |
@@ -1141,7 +1141,16 @@ void BytecodeGraphBuilder::VisitAdd() { |
} |
void BytecodeGraphBuilder::VisitSub() { |
- BinaryOperationHints hints = BinaryOperationHints::Any(); |
+ // TODO(mythria): Move this to a helper function, once more binary operations |
+ // record type feedback. |
+ FeedbackVectorSlot slot = |
+ feedback_vector()->ToSlot(bytecode_iterator().GetIndexOperand(1)); |
+ DCHECK_EQ(FeedbackVectorSlotKind::GENERAL, feedback_vector()->GetKind(slot)); |
+ Object* feedback = feedback_vector()->Get(slot); |
+ DCHECK(feedback->IsSmi()); |
+ BinaryOperationHints::Hint hint = |
+ BinaryOperationHintFromFeedback((Smi::cast(feedback))->value()); |
+ BinaryOperationHints hints(hint, hint, hint); |
BuildBinaryOp(javascript()->Subtract(hints)); |
} |