Index: src/interpreter/interpreter.cc |
diff --git a/src/interpreter/interpreter.cc b/src/interpreter/interpreter.cc |
index 352e0abf7ba220ed53c56f10133656061b69c691..2bfbbb6fb52794d4ae9059c73fb72c32610d60aa 100644 |
--- a/src/interpreter/interpreter.cc |
+++ b/src/interpreter/interpreter.cc |
@@ -750,6 +750,7 @@ void Interpreter::DoPopContext(InterpreterAssembler* assembler) { |
__ Dispatch(); |
} |
+// TODO(mythria): Remove this function once all BinaryOps record type feedback. |
template <class Generator> |
void Interpreter::DoBinaryOp(InterpreterAssembler* assembler) { |
Node* reg_index = __ BytecodeOperandReg(0); |
@@ -761,6 +762,20 @@ void Interpreter::DoBinaryOp(InterpreterAssembler* assembler) { |
__ Dispatch(); |
} |
+template <class Generator> |
+void Interpreter::DoBinaryOpWithFeedback(InterpreterAssembler* assembler) { |
+ Node* reg_index = __ BytecodeOperandReg(0); |
+ Node* lhs = __ LoadRegister(reg_index); |
+ Node* rhs = __ GetAccumulator(); |
+ Node* context = __ GetContext(); |
+ Node* slot_index = __ BytecodeOperandIdx(1); |
+ Node* type_feedback_vector = __ LoadTypeFeedbackVector(); |
+ Node* result = Generator::Generate(assembler, lhs, rhs, context, |
+ type_feedback_vector, slot_index); |
+ __ SetAccumulator(result); |
+ __ Dispatch(); |
+} |
+ |
// Add <src> |
// |
// Add register <src> to accumulator. |
@@ -772,7 +787,7 @@ void Interpreter::DoAdd(InterpreterAssembler* assembler) { |
// |
// Subtract register <src> from accumulator. |
void Interpreter::DoSub(InterpreterAssembler* assembler) { |
- DoBinaryOp<SubtractStub>(assembler); |
+ DoBinaryOpWithFeedback<SubtractWithFeedbackStub>(assembler); |
} |
// Mul <src> |