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

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: Rebase 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
« no previous file with comments | « src/interpreter/interpreter.h ('k') | src/mips/interface-descriptors-mips.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 b61fcf2621ad231e59e23a64adc0f7a910c99993..74d47c45d4d01e6f6be145810d3f3d10d661b3b0 100644
--- a/src/interpreter/interpreter.cc
+++ b/src/interpreter/interpreter.cc
@@ -814,12 +814,12 @@ void Interpreter::DoShiftRightLogical(InterpreterAssembler* assembler) {
DoBinaryOp<ShiftRightLogicalStub>(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();
}
@@ -829,7 +829,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);
}
@@ -837,7 +837,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);
}
« no previous file with comments | « src/interpreter/interpreter.h ('k') | src/mips/interface-descriptors-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698