Index: src/interpreter/interpreter.cc |
diff --git a/src/interpreter/interpreter.cc b/src/interpreter/interpreter.cc |
index cee05b7e2d1472d1ff12e46bd1d7a343633f8f6e..de7a0bd0264894755c6d3f02d9baaadbff37e1f6 100644 |
--- a/src/interpreter/interpreter.cc |
+++ b/src/interpreter/interpreter.cc |
@@ -727,22 +727,12 @@ |
__ 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<AddStub>(assembler); |
+ DoBinaryOp(CodeFactory::Add(isolate_), assembler); |
} |
@@ -750,7 +740,7 @@ |
// |
// Subtract register <src> from accumulator. |
void Interpreter::DoSub(InterpreterAssembler* assembler) { |
- DoBinaryOp<SubtractStub>(assembler); |
+ DoBinaryOp(CodeFactory::Subtract(isolate_), assembler); |
} |
@@ -758,7 +748,7 @@ |
// |
// Multiply accumulator by register <src>. |
void Interpreter::DoMul(InterpreterAssembler* assembler) { |
- DoBinaryOp<MultiplyStub>(assembler); |
+ DoBinaryOp(CodeFactory::Multiply(isolate_), assembler); |
} |
@@ -766,7 +756,7 @@ |
// |
// Divide register <src> by accumulator. |
void Interpreter::DoDiv(InterpreterAssembler* assembler) { |
- DoBinaryOp<DivideStub>(assembler); |
+ DoBinaryOp(CodeFactory::Divide(isolate_), assembler); |
} |
@@ -774,7 +764,7 @@ |
// |
// Modulo register <src> by accumulator. |
void Interpreter::DoMod(InterpreterAssembler* assembler) { |
- DoBinaryOp<ModulusStub>(assembler); |
+ DoBinaryOp(CodeFactory::Modulus(isolate_), assembler); |
} |
@@ -782,7 +772,7 @@ |
// |
// BitwiseOr register <src> to accumulator. |
void Interpreter::DoBitwiseOr(InterpreterAssembler* assembler) { |
- DoBinaryOp<BitwiseOrStub>(assembler); |
+ DoBinaryOp(CodeFactory::BitwiseOr(isolate_), assembler); |
} |
@@ -790,7 +780,7 @@ |
// |
// BitwiseXor register <src> to accumulator. |
void Interpreter::DoBitwiseXor(InterpreterAssembler* assembler) { |
- DoBinaryOp<BitwiseXorStub>(assembler); |
+ DoBinaryOp(CodeFactory::BitwiseXor(isolate_), assembler); |
} |
@@ -798,7 +788,7 @@ |
// |
// BitwiseAnd register <src> to accumulator. |
void Interpreter::DoBitwiseAnd(InterpreterAssembler* assembler) { |
- DoBinaryOp<BitwiseAndStub>(assembler); |
+ DoBinaryOp(CodeFactory::BitwiseAnd(isolate_), assembler); |
} |
@@ -809,7 +799,7 @@ |
// before the operation. 5 lsb bits from the accumulator are used as count |
// i.e. <src> << (accumulator & 0x1F). |
void Interpreter::DoShiftLeft(InterpreterAssembler* assembler) { |
- DoBinaryOp<ShiftLeftStub>(assembler); |
+ DoBinaryOp(CodeFactory::ShiftLeft(isolate_), assembler); |
} |
@@ -820,7 +810,7 @@ |
// 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<ShiftRightStub>(assembler); |
+ DoBinaryOp(CodeFactory::ShiftRight(isolate_), assembler); |
} |
@@ -831,7 +821,7 @@ |
// 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<ShiftRightLogicalStub>(assembler); |
+ DoBinaryOp(CodeFactory::ShiftRightLogical(isolate_), assembler); |
} |
void Interpreter::DoCountOp(Callable callable, |