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

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: 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 20b0e14624bac2264e91e8c03af7740d2a2d3ba2..d9a674586f9c608410be637b38aac79078ba5094 100644
--- a/src/interpreter/interpreter.cc
+++ b/src/interpreter/interpreter.cc
@@ -707,12 +707,23 @@ void Interpreter::DoBinaryOp(Runtime::FunctionId function_id,
__ Dispatch();
}
+void Interpreter::DoBinaryOp(Node* (*generator)(CodeStubAssembler*, Node*,
Benedikt Meurer 2016/04/20 08:42:33 Please no naked function pointers here, as discuss
epertoso 2016/04/20 08:59:49 Done.
+ Node*, Node*),
+ InterpreterAssembler* assembler) {
+ Node* reg_index = __ BytecodeOperandReg(0);
+ Node* lhs = __ LoadRegister(reg_index);
+ Node* rhs = __ GetAccumulator();
+ Node* context = __ GetContext();
+ Node* result = generator(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::Generate, assembler);
}
@@ -720,7 +731,7 @@ void Interpreter::DoAdd(InterpreterAssembler* assembler) {
//
// Subtract register <src> from accumulator.
void Interpreter::DoSub(InterpreterAssembler* assembler) {
- DoBinaryOp(CodeFactory::Subtract(isolate_), assembler);
+ DoBinaryOp(SubtractStub::Generate, assembler);
}
@@ -728,7 +739,7 @@ void Interpreter::DoSub(InterpreterAssembler* assembler) {
//
// Multiply accumulator by register <src>.
void Interpreter::DoMul(InterpreterAssembler* assembler) {
- DoBinaryOp(CodeFactory::Multiply(isolate_), assembler);
+ DoBinaryOp(MultiplyStub::Generate, assembler);
}
@@ -736,7 +747,7 @@ void Interpreter::DoMul(InterpreterAssembler* assembler) {
//
// Divide register <src> by accumulator.
void Interpreter::DoDiv(InterpreterAssembler* assembler) {
- DoBinaryOp(CodeFactory::Divide(isolate_), assembler);
+ DoBinaryOp(DivideStub::Generate, assembler);
}
@@ -744,7 +755,7 @@ void Interpreter::DoDiv(InterpreterAssembler* assembler) {
//
// Modulo register <src> by accumulator.
void Interpreter::DoMod(InterpreterAssembler* assembler) {
- DoBinaryOp(CodeFactory::Modulus(isolate_), assembler);
+ DoBinaryOp(ModulusStub::Generate, assembler);
}
@@ -752,7 +763,7 @@ void Interpreter::DoMod(InterpreterAssembler* assembler) {
//
// BitwiseOr register <src> to accumulator.
void Interpreter::DoBitwiseOr(InterpreterAssembler* assembler) {
- DoBinaryOp(CodeFactory::BitwiseOr(isolate_), assembler);
+ DoBinaryOp(BitwiseOrStub::Generate, assembler);
}
@@ -760,7 +771,7 @@ void Interpreter::DoBitwiseOr(InterpreterAssembler* assembler) {
//
// BitwiseXor register <src> to accumulator.
void Interpreter::DoBitwiseXor(InterpreterAssembler* assembler) {
- DoBinaryOp(CodeFactory::BitwiseXor(isolate_), assembler);
+ DoBinaryOp(BitwiseXorStub::Generate, assembler);
}
@@ -768,7 +779,7 @@ void Interpreter::DoBitwiseXor(InterpreterAssembler* assembler) {
//
// BitwiseAnd register <src> to accumulator.
void Interpreter::DoBitwiseAnd(InterpreterAssembler* assembler) {
- DoBinaryOp(CodeFactory::BitwiseAnd(isolate_), assembler);
+ DoBinaryOp(BitwiseAndStub::Generate, assembler);
}
@@ -779,7 +790,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::Generate, assembler);
}
@@ -790,7 +801,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::Generate, assembler);
}
@@ -801,7 +812,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::Generate, 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