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

Unified Diff: src/compiler/bytecode-graph-builder.cc

Issue 2221833002: [Interpreter] Collect type feedback for subtract operation and pass it to turbofan. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comments from Benedikt: Duplicate SubtractStub for Numbers that collects type feedback an… 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
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));
}

Powered by Google App Engine
This is Rietveld 408576698