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" |
| (...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 407 static compiler::Node* Generate(CodeStubAssembler* assembler, \ | 407 static compiler::Node* Generate(CodeStubAssembler* assembler, \ |
| 408 compiler::Node* left, compiler::Node* right, \ | 408 compiler::Node* left, compiler::Node* right, \ |
| 409 compiler::Node* context); \ | 409 compiler::Node* context); \ |
| 410 void GenerateAssembly(CodeStubAssembler* assembler) const override { \ | 410 void GenerateAssembly(CodeStubAssembler* assembler) const override { \ |
| 411 assembler->Return(Generate(assembler, assembler->Parameter(0), \ | 411 assembler->Return(Generate(assembler, assembler->Parameter(0), \ |
| 412 assembler->Parameter(1), \ | 412 assembler->Parameter(1), \ |
| 413 assembler->Parameter(2))); \ | 413 assembler->Parameter(2))); \ |
| 414 } \ | 414 } \ |
| 415 DEFINE_CODE_STUB(NAME, SUPER) | 415 DEFINE_CODE_STUB(NAME, SUPER) |
| 416 | 416 |
| 417 #define DEFINE_TURBOFAN_COUNT_OP_CODE_STUB(NAME, SUPER) \ | |
|
epertoso
2016/05/17 15:21:52
nit: UNARY_OP instead of COUNT_OP.
rmcilroy
2016/05/17 19:59:17
Done.
| |
| 418 public: \ | |
| 419 static compiler::Node* Generate(CodeStubAssembler* assembler, \ | |
| 420 compiler::Node* value, \ | |
| 421 compiler::Node* context); \ | |
| 422 void GenerateAssembly(CodeStubAssembler* assembler) const override { \ | |
| 423 assembler->Return(Generate(assembler, assembler->Parameter(0), \ | |
| 424 assembler->Parameter(1))); \ | |
| 425 } \ | |
| 426 DEFINE_CODE_STUB(NAME, SUPER) | |
| 427 | |
| 417 #define DEFINE_HANDLER_CODE_STUB(NAME, SUPER) \ | 428 #define DEFINE_HANDLER_CODE_STUB(NAME, SUPER) \ |
| 418 public: \ | 429 public: \ |
| 419 Handle<Code> GenerateCode() override; \ | 430 Handle<Code> GenerateCode() override; \ |
| 420 DEFINE_CODE_STUB(NAME, SUPER) | 431 DEFINE_CODE_STUB(NAME, SUPER) |
| 421 | 432 |
| 422 #define DEFINE_CALL_INTERFACE_DESCRIPTOR(NAME) \ | 433 #define DEFINE_CALL_INTERFACE_DESCRIPTOR(NAME) \ |
| 423 public: \ | 434 public: \ |
| 424 CallInterfaceDescriptor GetCallInterfaceDescriptor() const override { \ | 435 CallInterfaceDescriptor GetCallInterfaceDescriptor() const override { \ |
| 425 return NAME##Descriptor(isolate()); \ | 436 return NAME##Descriptor(isolate()); \ |
| 426 } | 437 } |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 775 | 786 |
| 776 DEFINE_CALL_INTERFACE_DESCRIPTOR(BinaryOp); | 787 DEFINE_CALL_INTERFACE_DESCRIPTOR(BinaryOp); |
| 777 DEFINE_TURBOFAN_BINARY_OP_CODE_STUB(BitwiseXor, TurboFanCodeStub); | 788 DEFINE_TURBOFAN_BINARY_OP_CODE_STUB(BitwiseXor, TurboFanCodeStub); |
| 778 }; | 789 }; |
| 779 | 790 |
| 780 class IncStub final : public TurboFanCodeStub { | 791 class IncStub final : public TurboFanCodeStub { |
| 781 public: | 792 public: |
| 782 explicit IncStub(Isolate* isolate) : TurboFanCodeStub(isolate) {} | 793 explicit IncStub(Isolate* isolate) : TurboFanCodeStub(isolate) {} |
| 783 | 794 |
| 784 DEFINE_CALL_INTERFACE_DESCRIPTOR(CountOp); | 795 DEFINE_CALL_INTERFACE_DESCRIPTOR(CountOp); |
| 785 DEFINE_TURBOFAN_CODE_STUB(Inc, TurboFanCodeStub); | 796 DEFINE_TURBOFAN_COUNT_OP_CODE_STUB(Inc, TurboFanCodeStub); |
| 786 }; | 797 }; |
| 787 | 798 |
| 788 class DecStub final : public TurboFanCodeStub { | 799 class DecStub final : public TurboFanCodeStub { |
| 789 public: | 800 public: |
| 790 explicit DecStub(Isolate* isolate) : TurboFanCodeStub(isolate) {} | 801 explicit DecStub(Isolate* isolate) : TurboFanCodeStub(isolate) {} |
| 791 | 802 |
| 792 DEFINE_CALL_INTERFACE_DESCRIPTOR(CountOp); | 803 DEFINE_CALL_INTERFACE_DESCRIPTOR(CountOp); |
| 793 DEFINE_TURBOFAN_CODE_STUB(Dec, TurboFanCodeStub); | 804 DEFINE_TURBOFAN_COUNT_OP_CODE_STUB(Dec, TurboFanCodeStub); |
| 794 }; | 805 }; |
| 795 | 806 |
| 796 class InstanceOfStub final : public TurboFanCodeStub { | 807 class InstanceOfStub final : public TurboFanCodeStub { |
| 797 public: | 808 public: |
| 798 explicit InstanceOfStub(Isolate* isolate) : TurboFanCodeStub(isolate) {} | 809 explicit InstanceOfStub(Isolate* isolate) : TurboFanCodeStub(isolate) {} |
| 799 | 810 |
| 800 private: | 811 private: |
| 801 DEFINE_CALL_INTERFACE_DESCRIPTOR(Compare); | 812 DEFINE_CALL_INTERFACE_DESCRIPTOR(Compare); |
| 802 DEFINE_TURBOFAN_CODE_STUB(InstanceOf, TurboFanCodeStub); | 813 DEFINE_TURBOFAN_CODE_STUB(InstanceOf, TurboFanCodeStub); |
| 803 }; | 814 }; |
| (...skipping 2445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3249 #undef DEFINE_HYDROGEN_CODE_STUB | 3260 #undef DEFINE_HYDROGEN_CODE_STUB |
| 3250 #undef DEFINE_CODE_STUB | 3261 #undef DEFINE_CODE_STUB |
| 3251 #undef DEFINE_CODE_STUB_BASE | 3262 #undef DEFINE_CODE_STUB_BASE |
| 3252 | 3263 |
| 3253 extern Representation RepresentationFromType(Type* type); | 3264 extern Representation RepresentationFromType(Type* type); |
| 3254 | 3265 |
| 3255 } // namespace internal | 3266 } // namespace internal |
| 3256 } // namespace v8 | 3267 } // namespace v8 |
| 3257 | 3268 |
| 3258 #endif // V8_CODE_STUBS_H_ | 3269 #endif // V8_CODE_STUBS_H_ |
| OLD | NEW |