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

Unified Diff: src/interpreter/interpreter.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 Ross. 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
« no previous file with comments | « src/interpreter/interpreter.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
« no previous file with comments | « src/interpreter/interpreter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698