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

Unified Diff: src/interpreter/interpreter.cc

Issue 2250513005: [interpreter] Record type feedback in the handlers for Inc and Dec. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Added tests. 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') | test/cctest/interpreter/test-interpreter.cc » ('j') | 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 dc9af07be843d5bafde4196341610d6ce6aad82c..d5b0a9e93346d56da0e60872e9ff025bee0bf990 100644
--- a/src/interpreter/interpreter.cc
+++ b/src/interpreter/interpreter.cc
@@ -1119,6 +1119,18 @@ void Interpreter::DoUnaryOp(InterpreterAssembler* assembler) {
__ Dispatch();
}
+template <class Generator>
+void Interpreter::DoUnaryOpWithFeedback(InterpreterAssembler* assembler) {
+ Node* value = __ GetAccumulator();
+ Node* context = __ GetContext();
+ Node* slot_index = __ BytecodeOperandIdx(0);
+ Node* type_feedback_vector = __ LoadTypeFeedbackVector();
+ Node* result = Generator::Generate(assembler, value, context,
+ type_feedback_vector, slot_index);
+ __ SetAccumulator(result);
+ __ Dispatch();
+}
+
// ToName
//
// Cast the object referenced by the accumulator to a name.
@@ -1150,14 +1162,14 @@ void Interpreter::DoToObject(InterpreterAssembler* assembler) {
//
// Increments value in the accumulator by one.
void Interpreter::DoInc(InterpreterAssembler* assembler) {
- DoUnaryOp<IncStub>(assembler);
+ DoUnaryOpWithFeedback<IncStub>(assembler);
}
// Dec
//
// Decrements value in the accumulator by one.
void Interpreter::DoDec(InterpreterAssembler* assembler) {
- DoUnaryOp<DecStub>(assembler);
+ DoUnaryOpWithFeedback<DecStub>(assembler);
}
// LogicalNot
« no previous file with comments | « src/interpreter/interpreter.h ('k') | test/cctest/interpreter/test-interpreter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698