OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_CODE_STUBS_H_ | 5 #ifndef V8_CODE_STUBS_H_ |
6 #define V8_CODE_STUBS_H_ | 6 #define V8_CODE_STUBS_H_ |
7 | 7 |
8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/assembler.h" | 9 #include "src/assembler.h" |
10 #include "src/code-stub-assembler.h" | 10 #include "src/code-stub-assembler.h" |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 V(AllocateUint8x16) \ | 115 V(AllocateUint8x16) \ |
116 V(AllocateBool8x16) \ | 116 V(AllocateBool8x16) \ |
117 V(ArrayNoArgumentConstructor) \ | 117 V(ArrayNoArgumentConstructor) \ |
118 V(ArraySingleArgumentConstructor) \ | 118 V(ArraySingleArgumentConstructor) \ |
119 V(ArrayNArgumentsConstructor) \ | 119 V(ArrayNArgumentsConstructor) \ |
120 V(CreateAllocationSite) \ | 120 V(CreateAllocationSite) \ |
121 V(CreateWeakCell) \ | 121 V(CreateWeakCell) \ |
122 V(StringLength) \ | 122 V(StringLength) \ |
123 V(Add) \ | 123 V(Add) \ |
124 V(Subtract) \ | 124 V(Subtract) \ |
| 125 V(SubtractWithFeedback) \ |
125 V(Multiply) \ | 126 V(Multiply) \ |
126 V(Divide) \ | 127 V(Divide) \ |
127 V(Modulus) \ | 128 V(Modulus) \ |
128 V(ShiftRight) \ | 129 V(ShiftRight) \ |
129 V(ShiftRightLogical) \ | 130 V(ShiftRightLogical) \ |
130 V(ShiftLeft) \ | 131 V(ShiftLeft) \ |
131 V(BitwiseAnd) \ | 132 V(BitwiseAnd) \ |
132 V(BitwiseOr) \ | 133 V(BitwiseOr) \ |
133 V(BitwiseXor) \ | 134 V(BitwiseXor) \ |
134 V(Inc) \ | 135 V(Inc) \ |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 static compiler::Node* Generate(CodeStubAssembler* assembler, \ | 426 static compiler::Node* Generate(CodeStubAssembler* assembler, \ |
426 compiler::Node* left, compiler::Node* right, \ | 427 compiler::Node* left, compiler::Node* right, \ |
427 compiler::Node* context); \ | 428 compiler::Node* context); \ |
428 void GenerateAssembly(CodeStubAssembler* assembler) const override { \ | 429 void GenerateAssembly(CodeStubAssembler* assembler) const override { \ |
429 assembler->Return(Generate(assembler, assembler->Parameter(0), \ | 430 assembler->Return(Generate(assembler, assembler->Parameter(0), \ |
430 assembler->Parameter(1), \ | 431 assembler->Parameter(1), \ |
431 assembler->Parameter(2))); \ | 432 assembler->Parameter(2))); \ |
432 } \ | 433 } \ |
433 DEFINE_CODE_STUB(NAME, SUPER) | 434 DEFINE_CODE_STUB(NAME, SUPER) |
434 | 435 |
| 436 #define DEFINE_TURBOFAN_BINARY_OP_CODE_STUB_WITH_FEEDBACK(NAME, SUPER) \ |
| 437 public: \ |
| 438 static compiler::Node* Generate( \ |
| 439 CodeStubAssembler* assembler, compiler::Node* left, \ |
| 440 compiler::Node* right, compiler::Node* context, \ |
| 441 compiler::Node* type_feedback_vector, compiler::Node* slot_id); \ |
| 442 void GenerateAssembly(CodeStubAssembler* assembler) const override { \ |
| 443 assembler->Return( \ |
| 444 Generate(assembler, assembler->Parameter(0), assembler->Parameter(1), \ |
| 445 assembler->Parameter(2), assembler->Parameter(3), \ |
| 446 assembler->Parameter(4))); \ |
| 447 } \ |
| 448 DEFINE_CODE_STUB(NAME, SUPER) |
| 449 |
435 #define DEFINE_TURBOFAN_UNARY_OP_CODE_STUB(NAME, SUPER) \ | 450 #define DEFINE_TURBOFAN_UNARY_OP_CODE_STUB(NAME, SUPER) \ |
436 public: \ | 451 public: \ |
437 static compiler::Node* Generate(CodeStubAssembler* assembler, \ | 452 static compiler::Node* Generate(CodeStubAssembler* assembler, \ |
438 compiler::Node* value, \ | 453 compiler::Node* value, \ |
439 compiler::Node* context); \ | 454 compiler::Node* context); \ |
440 void GenerateAssembly(CodeStubAssembler* assembler) const override { \ | 455 void GenerateAssembly(CodeStubAssembler* assembler) const override { \ |
441 assembler->Return(Generate(assembler, assembler->Parameter(0), \ | 456 assembler->Return(Generate(assembler, assembler->Parameter(0), \ |
442 assembler->Parameter(1))); \ | 457 assembler->Parameter(1))); \ |
443 } \ | 458 } \ |
444 DEFINE_CODE_STUB(NAME, SUPER) | 459 DEFINE_CODE_STUB(NAME, SUPER) |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
742 }; | 757 }; |
743 | 758 |
744 class SubtractStub final : public TurboFanCodeStub { | 759 class SubtractStub final : public TurboFanCodeStub { |
745 public: | 760 public: |
746 explicit SubtractStub(Isolate* isolate) : TurboFanCodeStub(isolate) {} | 761 explicit SubtractStub(Isolate* isolate) : TurboFanCodeStub(isolate) {} |
747 | 762 |
748 DEFINE_CALL_INTERFACE_DESCRIPTOR(BinaryOp); | 763 DEFINE_CALL_INTERFACE_DESCRIPTOR(BinaryOp); |
749 DEFINE_TURBOFAN_BINARY_OP_CODE_STUB(Subtract, TurboFanCodeStub); | 764 DEFINE_TURBOFAN_BINARY_OP_CODE_STUB(Subtract, TurboFanCodeStub); |
750 }; | 765 }; |
751 | 766 |
| 767 class SubtractWithFeedbackStub final : public TurboFanCodeStub { |
| 768 public: |
| 769 explicit SubtractWithFeedbackStub(Isolate* isolate) |
| 770 : TurboFanCodeStub(isolate) {} |
| 771 |
| 772 DEFINE_CALL_INTERFACE_DESCRIPTOR(BinaryOp); |
| 773 DEFINE_TURBOFAN_BINARY_OP_CODE_STUB_WITH_FEEDBACK(SubtractWithFeedback, |
| 774 TurboFanCodeStub); |
| 775 }; |
| 776 |
752 class MultiplyStub final : public TurboFanCodeStub { | 777 class MultiplyStub final : public TurboFanCodeStub { |
753 public: | 778 public: |
754 explicit MultiplyStub(Isolate* isolate) : TurboFanCodeStub(isolate) {} | 779 explicit MultiplyStub(Isolate* isolate) : TurboFanCodeStub(isolate) {} |
755 | 780 |
756 DEFINE_CALL_INTERFACE_DESCRIPTOR(BinaryOp); | 781 DEFINE_CALL_INTERFACE_DESCRIPTOR(BinaryOp); |
757 DEFINE_TURBOFAN_BINARY_OP_CODE_STUB(Multiply, TurboFanCodeStub); | 782 DEFINE_TURBOFAN_BINARY_OP_CODE_STUB(Multiply, TurboFanCodeStub); |
758 }; | 783 }; |
759 | 784 |
760 class DivideStub final : public TurboFanCodeStub { | 785 class DivideStub final : public TurboFanCodeStub { |
761 public: | 786 public: |
(...skipping 2374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3136 #undef DEFINE_HYDROGEN_CODE_STUB | 3161 #undef DEFINE_HYDROGEN_CODE_STUB |
3137 #undef DEFINE_CODE_STUB | 3162 #undef DEFINE_CODE_STUB |
3138 #undef DEFINE_CODE_STUB_BASE | 3163 #undef DEFINE_CODE_STUB_BASE |
3139 | 3164 |
3140 extern Representation RepresentationFromType(Type* type); | 3165 extern Representation RepresentationFromType(Type* type); |
3141 | 3166 |
3142 } // namespace internal | 3167 } // namespace internal |
3143 } // namespace v8 | 3168 } // namespace v8 |
3144 | 3169 |
3145 #endif // V8_CODE_STUBS_H_ | 3170 #endif // V8_CODE_STUBS_H_ |
OLD | NEW |