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

Unified Diff: src/interpreter/interpreter.cc

Issue 1902823002: [ignition] Inline the binary op TurboFan code stubs in the bytecode handlers. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Update 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') | 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 d24750aaf24dd5591115a30e6f2e54b742da12f4..a8d491f35d25ba9fe3f34acc977cb6ed2fc21c7c 100644
--- a/src/interpreter/interpreter.cc
+++ b/src/interpreter/interpreter.cc
@@ -707,12 +707,22 @@ void Interpreter::DoBinaryOp(Runtime::FunctionId function_id,
__ Dispatch();
}
+template <class Generator>
+void Interpreter::DoBinaryOp(InterpreterAssembler* assembler) {
+ Node* reg_index = __ BytecodeOperandReg(0);
+ Node* lhs = __ LoadRegister(reg_index);
+ Node* rhs = __ GetAccumulator();
+ Node* context = __ GetContext();
+ Node* result = Generator::Generate(assembler, lhs, rhs, context);
+ __ SetAccumulator(result);
+ __ Dispatch();
+}
// Add <src>
//
// Add register <src> to accumulator.
void Interpreter::DoAdd(InterpreterAssembler* assembler) {
- DoBinaryOp(CodeFactory::Add(isolate_), assembler);
+ DoBinaryOp<AddStub>(assembler);
}
@@ -720,7 +730,7 @@ void Interpreter::DoAdd(InterpreterAssembler* assembler) {
//
// Subtract register <src> from accumulator.
void Interpreter::DoSub(InterpreterAssembler* assembler) {
- DoBinaryOp(CodeFactory::Subtract(isolate_), assembler);
+ DoBinaryOp<SubtractStub>(assembler);
}
@@ -728,7 +738,7 @@ void Interpreter::DoSub(InterpreterAssembler* assembler) {
//
// Multiply accumulator by register <src>.
void Interpreter::DoMul(InterpreterAssembler* assembler) {
- DoBinaryOp(CodeFactory::Multiply(isolate_), assembler);
+ DoBinaryOp<MultiplyStub>(assembler);
}
@@ -736,7 +746,7 @@ void Interpreter::DoMul(InterpreterAssembler* assembler) {
//
// Divide register <src> by accumulator.
void Interpreter::DoDiv(InterpreterAssembler* assembler) {
- DoBinaryOp(CodeFactory::Divide(isolate_), assembler);
+ DoBinaryOp<DivideStub>(assembler);
}
@@ -744,7 +754,7 @@ void Interpreter::DoDiv(InterpreterAssembler* assembler) {
//
// Modulo register <src> by accumulator.
void Interpreter::DoMod(InterpreterAssembler* assembler) {
- DoBinaryOp(CodeFactory::Modulus(isolate_), assembler);
+ DoBinaryOp<ModulusStub>(assembler);
}
@@ -752,7 +762,7 @@ void Interpreter::DoMod(InterpreterAssembler* assembler) {
//
// BitwiseOr register <src> to accumulator.
void Interpreter::DoBitwiseOr(InterpreterAssembler* assembler) {
- DoBinaryOp(CodeFactory::BitwiseOr(isolate_), assembler);
+ DoBinaryOp<BitwiseOrStub>(assembler);
}
@@ -760,7 +770,7 @@ void Interpreter::DoBitwiseOr(InterpreterAssembler* assembler) {
//
// BitwiseXor register <src> to accumulator.
void Interpreter::DoBitwiseXor(InterpreterAssembler* assembler) {
- DoBinaryOp(CodeFactory::BitwiseXor(isolate_), assembler);
+ DoBinaryOp<BitwiseXorStub>(assembler);
}
@@ -768,7 +778,7 @@ void Interpreter::DoBitwiseXor(InterpreterAssembler* assembler) {
//
// BitwiseAnd register <src> to accumulator.
void Interpreter::DoBitwiseAnd(InterpreterAssembler* assembler) {
- DoBinaryOp(CodeFactory::BitwiseAnd(isolate_), assembler);
+ DoBinaryOp<BitwiseAndStub>(assembler);
}
@@ -779,7 +789,7 @@ void Interpreter::DoBitwiseAnd(InterpreterAssembler* assembler) {
// before the operation. 5 lsb bits from the accumulator are used as count
// i.e. <src> << (accumulator & 0x1F).
void Interpreter::DoShiftLeft(InterpreterAssembler* assembler) {
- DoBinaryOp(CodeFactory::ShiftLeft(isolate_), assembler);
+ DoBinaryOp<ShiftLeftStub>(assembler);
}
@@ -790,7 +800,7 @@ void Interpreter::DoShiftLeft(InterpreterAssembler* assembler) {
// accumulator to uint32 before the operation. 5 lsb bits from the accumulator
// are used as count i.e. <src> >> (accumulator & 0x1F).
void Interpreter::DoShiftRight(InterpreterAssembler* assembler) {
- DoBinaryOp(CodeFactory::ShiftRight(isolate_), assembler);
+ DoBinaryOp<ShiftRightStub>(assembler);
}
@@ -801,7 +811,7 @@ void Interpreter::DoShiftRight(InterpreterAssembler* assembler) {
// uint32 before the operation 5 lsb bits from the accumulator are used as
// count i.e. <src> << (accumulator & 0x1F).
void Interpreter::DoShiftRightLogical(InterpreterAssembler* assembler) {
- DoBinaryOp(CodeFactory::ShiftRightLogical(isolate_), assembler);
+ DoBinaryOp<ShiftRightLogicalStub>(assembler);
}
void Interpreter::DoCountOp(Runtime::FunctionId function_id,
« 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