Chromium Code Reviews| 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" |
| 11 #include "src/codegen.h" | 11 #include "src/codegen.h" |
| 12 #include "src/globals.h" | 12 #include "src/globals.h" |
| 13 #include "src/ic/ic-state.h" | 13 #include "src/ic/ic-state.h" |
| 14 #include "src/interface-descriptors.h" | 14 #include "src/interface-descriptors.h" |
| 15 #include "src/macro-assembler.h" | 15 #include "src/macro-assembler.h" |
| 16 #include "src/ostreams.h" | 16 #include "src/ostreams.h" |
| 17 #include "src/utils.h" | |
| 17 | 18 |
| 18 namespace v8 { | 19 namespace v8 { |
| 19 namespace internal { | 20 namespace internal { |
| 20 | 21 |
| 21 // List of code stubs used on all platforms. | 22 // List of code stubs used on all platforms. |
| 22 #define CODE_STUB_LIST_ALL_PLATFORMS(V) \ | 23 #define CODE_STUB_LIST_ALL_PLATFORMS(V) \ |
| 23 /* --- PlatformCodeStubs --- */ \ | 24 /* --- PlatformCodeStubs --- */ \ |
| 24 V(ArrayConstructor) \ | 25 V(ArrayConstructor) \ |
| 25 V(BinaryOpICWithAllocationSite) \ | 26 V(BinaryOpICWithAllocationSite) \ |
| 26 V(CallApiCallback) \ | 27 V(CallApiCallback) \ |
| (...skipping 398 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 // TODO(mythria): check where generate assembly is used and if have to pass 6 | |
| 437 // parameters. | |
| 438 #define DEFINE_TURBOFAN_BINARY_OP_CODE_STUB_WITH_FEEDBACK(NAME, SUPER) \ | |
| 439 public: \ | |
| 440 static compiler::Node* Generate(CodeStubAssembler* assembler, \ | |
| 441 compiler::Node* left, compiler::Node* right, \ | |
| 442 compiler::Node* context, \ | |
| 443 compiler::Node* type_feedback_vector = NULL, \ | |
| 444 compiler::Node* slot_id = NULL); \ | |
| 445 void GenerateAssembly(CodeStubAssembler* assembler) const override { \ | |
|
mythria
2016/08/08 04:33:56
I am not sure where GenerateAssembly is used. I di
| |
| 446 assembler->Return(Generate(assembler, assembler->Parameter(0), \ | |
| 447 assembler->Parameter(1), \ | |
| 448 assembler->Parameter(2))); \ | |
| 449 } \ | |
| 450 DEFINE_CODE_STUB(NAME, SUPER) | |
| 451 | |
| 435 #define DEFINE_TURBOFAN_UNARY_OP_CODE_STUB(NAME, SUPER) \ | 452 #define DEFINE_TURBOFAN_UNARY_OP_CODE_STUB(NAME, SUPER) \ |
| 436 public: \ | 453 public: \ |
| 437 static compiler::Node* Generate(CodeStubAssembler* assembler, \ | 454 static compiler::Node* Generate(CodeStubAssembler* assembler, \ |
| 438 compiler::Node* value, \ | 455 compiler::Node* value, \ |
| 439 compiler::Node* context); \ | 456 compiler::Node* context); \ |
| 440 void GenerateAssembly(CodeStubAssembler* assembler) const override { \ | 457 void GenerateAssembly(CodeStubAssembler* assembler) const override { \ |
| 441 assembler->Return(Generate(assembler, assembler->Parameter(0), \ | 458 assembler->Return(Generate(assembler, assembler->Parameter(0), \ |
| 442 assembler->Parameter(1))); \ | 459 assembler->Parameter(1))); \ |
| 443 } \ | 460 } \ |
| 444 DEFINE_CODE_STUB(NAME, SUPER) | 461 DEFINE_CODE_STUB(NAME, SUPER) |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 739 | 756 |
| 740 DEFINE_CALL_INTERFACE_DESCRIPTOR(BinaryOp); | 757 DEFINE_CALL_INTERFACE_DESCRIPTOR(BinaryOp); |
| 741 DEFINE_TURBOFAN_BINARY_OP_CODE_STUB(Add, TurboFanCodeStub); | 758 DEFINE_TURBOFAN_BINARY_OP_CODE_STUB(Add, TurboFanCodeStub); |
| 742 }; | 759 }; |
| 743 | 760 |
| 744 class SubtractStub final : public TurboFanCodeStub { | 761 class SubtractStub final : public TurboFanCodeStub { |
| 745 public: | 762 public: |
| 746 explicit SubtractStub(Isolate* isolate) : TurboFanCodeStub(isolate) {} | 763 explicit SubtractStub(Isolate* isolate) : TurboFanCodeStub(isolate) {} |
| 747 | 764 |
| 748 DEFINE_CALL_INTERFACE_DESCRIPTOR(BinaryOp); | 765 DEFINE_CALL_INTERFACE_DESCRIPTOR(BinaryOp); |
| 749 DEFINE_TURBOFAN_BINARY_OP_CODE_STUB(Subtract, TurboFanCodeStub); | 766 DEFINE_TURBOFAN_BINARY_OP_CODE_STUB_WITH_FEEDBACK(Subtract, TurboFanCodeStub); |
|
mythria
2016/08/08 04:33:56
We can remove this once we migrate all binary ops
| |
| 750 }; | 767 }; |
| 751 | 768 |
| 752 class MultiplyStub final : public TurboFanCodeStub { | 769 class MultiplyStub final : public TurboFanCodeStub { |
| 753 public: | 770 public: |
| 754 explicit MultiplyStub(Isolate* isolate) : TurboFanCodeStub(isolate) {} | 771 explicit MultiplyStub(Isolate* isolate) : TurboFanCodeStub(isolate) {} |
| 755 | 772 |
| 756 DEFINE_CALL_INTERFACE_DESCRIPTOR(BinaryOp); | 773 DEFINE_CALL_INTERFACE_DESCRIPTOR(BinaryOp); |
| 757 DEFINE_TURBOFAN_BINARY_OP_CODE_STUB(Multiply, TurboFanCodeStub); | 774 DEFINE_TURBOFAN_BINARY_OP_CODE_STUB(Multiply, TurboFanCodeStub); |
| 758 }; | 775 }; |
| 759 | 776 |
| (...skipping 2376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3136 #undef DEFINE_HYDROGEN_CODE_STUB | 3153 #undef DEFINE_HYDROGEN_CODE_STUB |
| 3137 #undef DEFINE_CODE_STUB | 3154 #undef DEFINE_CODE_STUB |
| 3138 #undef DEFINE_CODE_STUB_BASE | 3155 #undef DEFINE_CODE_STUB_BASE |
| 3139 | 3156 |
| 3140 extern Representation RepresentationFromType(Type* type); | 3157 extern Representation RepresentationFromType(Type* type); |
| 3141 | 3158 |
| 3142 } // namespace internal | 3159 } // namespace internal |
| 3143 } // namespace v8 | 3160 } // namespace v8 |
| 3144 | 3161 |
| 3145 #endif // V8_CODE_STUBS_H_ | 3162 #endif // V8_CODE_STUBS_H_ |
| OLD | NEW |