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..a02a41e29832618a874facb2239aabd6f0f5fb53 100644 |
--- a/src/compiler/bytecode-graph-builder.cc |
+++ b/src/compiler/bytecode-graph-builder.cc |
@@ -1141,7 +1141,17 @@ 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. |
rmcilroy
2016/08/08 08:27:31
Could you just do this now so that it's reused whe
mythria
2016/08/09 00:51:59
Done.
|
+ FeedbackVectorSlot slot = |
+ feedback_vector()->ToSlot(bytecode_iterator().GetIndexOperand(1)); |
+ DCHECK_EQ(FeedbackVectorSlotKind::GENERAL, feedback_vector()->GetKind(slot)); |
+ Object* feedback = feedback_vector()->Get(slot); |
+ BinaryOperationHints::Hint hint = BinaryOperationHints::Hint::kAny; |
+ if (feedback->IsSmi()) { |
+ hint = BinaryOperationHintFromFeedback((Smi::cast(feedback))->value()); |
+ } |
+ BinaryOperationHints hints(hint, hint, hint); |
BuildBinaryOp(javascript()->Subtract(hints)); |
} |