Index: src/code-stubs.h |
diff --git a/src/code-stubs.h b/src/code-stubs.h |
index 7379ff489c2bf534224ab39d99a427f8a8a55e9d..baad56bce94f1d6d983922a1a4f915fb6e6c2901 100644 |
--- a/src/code-stubs.h |
+++ b/src/code-stubs.h |
@@ -401,6 +401,18 @@ class CodeStub BASE_EMBEDDED { |
void GenerateAssembly(CodeStubAssembler* assembler) const override; \ |
DEFINE_CODE_STUB(NAME, SUPER) |
+#define DEFINE_TURBOFAN_BINARY_OP_CODE_STUB(NAME, SUPER) \ |
+ public: \ |
+ static compiler::Node* Generate(CodeStubAssembler* assembler, \ |
+ compiler::Node* left, compiler::Node* right, \ |
+ compiler::Node* context); \ |
+ void GenerateAssembly(CodeStubAssembler* assembler) const override { \ |
+ assembler->Return(Generate(assembler, assembler->Parameter(0), \ |
+ assembler->Parameter(1), \ |
+ assembler->Parameter(2))); \ |
+ } \ |
+ DEFINE_CODE_STUB(NAME, SUPER) |
+ |
#define DEFINE_HANDLER_CODE_STUB(NAME, SUPER) \ |
public: \ |
Handle<Code> GenerateCode() override; \ |
@@ -680,7 +692,7 @@ class AddStub final : public TurboFanCodeStub { |
explicit AddStub(Isolate* isolate) : TurboFanCodeStub(isolate) {} |
DEFINE_CALL_INTERFACE_DESCRIPTOR(BinaryOp); |
- DEFINE_TURBOFAN_CODE_STUB(Add, TurboFanCodeStub); |
+ DEFINE_TURBOFAN_BINARY_OP_CODE_STUB(Add, TurboFanCodeStub); |
}; |
class SubtractStub final : public TurboFanCodeStub { |
@@ -688,7 +700,7 @@ class SubtractStub final : public TurboFanCodeStub { |
explicit SubtractStub(Isolate* isolate) : TurboFanCodeStub(isolate) {} |
DEFINE_CALL_INTERFACE_DESCRIPTOR(BinaryOp); |
- DEFINE_TURBOFAN_CODE_STUB(Subtract, TurboFanCodeStub); |
+ DEFINE_TURBOFAN_BINARY_OP_CODE_STUB(Subtract, TurboFanCodeStub); |
}; |
class MultiplyStub final : public TurboFanCodeStub { |
@@ -696,7 +708,7 @@ class MultiplyStub final : public TurboFanCodeStub { |
explicit MultiplyStub(Isolate* isolate) : TurboFanCodeStub(isolate) {} |
DEFINE_CALL_INTERFACE_DESCRIPTOR(BinaryOp); |
- DEFINE_TURBOFAN_CODE_STUB(Multiply, TurboFanCodeStub); |
+ DEFINE_TURBOFAN_BINARY_OP_CODE_STUB(Multiply, TurboFanCodeStub); |
}; |
class DivideStub final : public TurboFanCodeStub { |
@@ -704,7 +716,7 @@ class DivideStub final : public TurboFanCodeStub { |
explicit DivideStub(Isolate* isolate) : TurboFanCodeStub(isolate) {} |
DEFINE_CALL_INTERFACE_DESCRIPTOR(BinaryOp); |
- DEFINE_TURBOFAN_CODE_STUB(Divide, TurboFanCodeStub); |
+ DEFINE_TURBOFAN_BINARY_OP_CODE_STUB(Divide, TurboFanCodeStub); |
}; |
class ModulusStub final : public TurboFanCodeStub { |
@@ -712,7 +724,7 @@ class ModulusStub final : public TurboFanCodeStub { |
explicit ModulusStub(Isolate* isolate) : TurboFanCodeStub(isolate) {} |
DEFINE_CALL_INTERFACE_DESCRIPTOR(BinaryOp); |
- DEFINE_TURBOFAN_CODE_STUB(Modulus, TurboFanCodeStub); |
+ DEFINE_TURBOFAN_BINARY_OP_CODE_STUB(Modulus, TurboFanCodeStub); |
}; |
class ShiftRightStub final : public TurboFanCodeStub { |
@@ -720,7 +732,7 @@ class ShiftRightStub final : public TurboFanCodeStub { |
explicit ShiftRightStub(Isolate* isolate) : TurboFanCodeStub(isolate) {} |
DEFINE_CALL_INTERFACE_DESCRIPTOR(BinaryOp); |
- DEFINE_TURBOFAN_CODE_STUB(ShiftRight, TurboFanCodeStub); |
+ DEFINE_TURBOFAN_BINARY_OP_CODE_STUB(ShiftRight, TurboFanCodeStub); |
}; |
class ShiftRightLogicalStub final : public TurboFanCodeStub { |
@@ -729,7 +741,7 @@ class ShiftRightLogicalStub final : public TurboFanCodeStub { |
: TurboFanCodeStub(isolate) {} |
DEFINE_CALL_INTERFACE_DESCRIPTOR(BinaryOp); |
- DEFINE_TURBOFAN_CODE_STUB(ShiftRightLogical, TurboFanCodeStub); |
+ DEFINE_TURBOFAN_BINARY_OP_CODE_STUB(ShiftRightLogical, TurboFanCodeStub); |
}; |
class ShiftLeftStub final : public TurboFanCodeStub { |
@@ -737,7 +749,7 @@ class ShiftLeftStub final : public TurboFanCodeStub { |
explicit ShiftLeftStub(Isolate* isolate) : TurboFanCodeStub(isolate) {} |
DEFINE_CALL_INTERFACE_DESCRIPTOR(BinaryOp); |
- DEFINE_TURBOFAN_CODE_STUB(ShiftLeft, TurboFanCodeStub); |
+ DEFINE_TURBOFAN_BINARY_OP_CODE_STUB(ShiftLeft, TurboFanCodeStub); |
}; |
class BitwiseAndStub final : public TurboFanCodeStub { |
@@ -745,7 +757,7 @@ class BitwiseAndStub final : public TurboFanCodeStub { |
explicit BitwiseAndStub(Isolate* isolate) : TurboFanCodeStub(isolate) {} |
DEFINE_CALL_INTERFACE_DESCRIPTOR(BinaryOp); |
- DEFINE_TURBOFAN_CODE_STUB(BitwiseAnd, TurboFanCodeStub); |
+ DEFINE_TURBOFAN_BINARY_OP_CODE_STUB(BitwiseAnd, TurboFanCodeStub); |
}; |
class BitwiseOrStub final : public TurboFanCodeStub { |
@@ -753,7 +765,7 @@ class BitwiseOrStub final : public TurboFanCodeStub { |
explicit BitwiseOrStub(Isolate* isolate) : TurboFanCodeStub(isolate) {} |
DEFINE_CALL_INTERFACE_DESCRIPTOR(BinaryOp); |
- DEFINE_TURBOFAN_CODE_STUB(BitwiseOr, TurboFanCodeStub); |
+ DEFINE_TURBOFAN_BINARY_OP_CODE_STUB(BitwiseOr, TurboFanCodeStub); |
}; |
class BitwiseXorStub final : public TurboFanCodeStub { |
@@ -761,7 +773,7 @@ class BitwiseXorStub final : public TurboFanCodeStub { |
explicit BitwiseXorStub(Isolate* isolate) : TurboFanCodeStub(isolate) {} |
DEFINE_CALL_INTERFACE_DESCRIPTOR(BinaryOp); |
- DEFINE_TURBOFAN_CODE_STUB(BitwiseXor, TurboFanCodeStub); |
+ DEFINE_TURBOFAN_BINARY_OP_CODE_STUB(BitwiseXor, TurboFanCodeStub); |
}; |
class LessThanStub final : public TurboFanCodeStub { |