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

Unified Diff: src/interpreter/interpreter.cc

Issue 1980463003: [Interpreter] Inline Inc/Dec code stubs into bytecode handlers. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 4 years, 7 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 6eee48a045574c1a336cf6297105a348df164c95..853483081f543ee9fc6b7b5035671b85540b36d2 100644
--- a/src/interpreter/interpreter.cc
+++ b/src/interpreter/interpreter.cc
@@ -836,30 +836,27 @@ void Interpreter::DoShiftRightLogical(InterpreterAssembler* assembler) {
DoBinaryOp<ShiftRightLogicalStub>(assembler);
}
-void Interpreter::DoCountOp(Callable callable,
- InterpreterAssembler* assembler) {
- Node* target = __ HeapConstant(callable.code());
+template <class Generator>
+void Interpreter::DoUnaryOp(InterpreterAssembler* assembler) {
Node* value = __ GetAccumulator();
Node* context = __ GetContext();
- Node* result = __ CallStub(callable.descriptor(), target, context, value);
+ Node* result = Generator::Generate(assembler, value, context);
__ SetAccumulator(result);
__ Dispatch();
}
-
// Inc
//
// Increments value in the accumulator by one.
void Interpreter::DoInc(InterpreterAssembler* assembler) {
- DoCountOp(CodeFactory::Inc(isolate_), assembler);
+ DoUnaryOp<IncStub>(assembler);
}
-
// Dec
//
// Decrements value in the accumulator by one.
void Interpreter::DoDec(InterpreterAssembler* assembler) {
- DoCountOp(CodeFactory::Dec(isolate_), assembler);
+ DoUnaryOp<DecStub>(assembler);
}
void Interpreter::DoLogicalNotOp(Node* value, InterpreterAssembler* assembler) {
« 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