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

Unified Diff: src/interpreter/interpreter.cc

Issue 1901083002: [Interpreter] Introduce IncStub and DecStub. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address review comments Created 4 years, 8 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/interpreter/interpreter.cc
diff --git a/src/interpreter/interpreter.cc b/src/interpreter/interpreter.cc
index 20b0e14624bac2264e91e8c03af7740d2a2d3ba2..709c1c9b3ea4d49bc5844a20d8c7262cf3cc2d3b 100644
--- a/src/interpreter/interpreter.cc
+++ b/src/interpreter/interpreter.cc
@@ -804,12 +804,12 @@ void Interpreter::DoShiftRightLogical(InterpreterAssembler* assembler) {
DoBinaryOp(CodeFactory::ShiftRightLogical(isolate_), assembler);
}
-void Interpreter::DoCountOp(Runtime::FunctionId function_id,
+void Interpreter::DoCountOp(Callable callable,
InterpreterAssembler* assembler) {
+ Node* target = __ HeapConstant(callable.code());
Node* value = __ GetAccumulator();
- Node* one = __ NumberConstant(1);
Node* context = __ GetContext();
- Node* result = __ CallRuntime(function_id, context, value, one);
+ Node* result = __ CallStub(callable.descriptor(), target, context, value);
__ SetAccumulator(result);
__ Dispatch();
}
@@ -819,7 +819,7 @@ void Interpreter::DoCountOp(Runtime::FunctionId function_id,
//
// Increments value in the accumulator by one.
void Interpreter::DoInc(InterpreterAssembler* assembler) {
- DoCountOp(Runtime::kAdd, assembler);
+ DoCountOp(CodeFactory::Inc(isolate_), assembler);
}
@@ -827,7 +827,7 @@ void Interpreter::DoInc(InterpreterAssembler* assembler) {
//
// Decrements value in the accumulator by one.
void Interpreter::DoDec(InterpreterAssembler* assembler) {
- DoCountOp(Runtime::kSubtract, assembler);
+ DoCountOp(CodeFactory::Dec(isolate_), assembler);
}

Powered by Google App Engine
This is Rietveld 408576698