| 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 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 481 Handle<Code> GenerateCode() override; \ | 481 Handle<Code> GenerateCode() override; \ |
| 482 DEFINE_CODE_STUB(NAME, SUPER) | 482 DEFINE_CODE_STUB(NAME, SUPER) |
| 483 | 483 |
| 484 #define DEFINE_CALL_INTERFACE_DESCRIPTOR(NAME) \ | 484 #define DEFINE_CALL_INTERFACE_DESCRIPTOR(NAME) \ |
| 485 public: \ | 485 public: \ |
| 486 typedef NAME##Descriptor Descriptor; \ | 486 typedef NAME##Descriptor Descriptor; \ |
| 487 CallInterfaceDescriptor GetCallInterfaceDescriptor() const override { \ | 487 CallInterfaceDescriptor GetCallInterfaceDescriptor() const override { \ |
| 488 return Descriptor(isolate()); \ | 488 return Descriptor(isolate()); \ |
| 489 } | 489 } |
| 490 | 490 |
| 491 #define DEFINE_ON_STACK_CALL_INTERFACE_DESCRIPTOR(PARAMETER_COUNT) \ | |
| 492 public: \ | |
| 493 CallInterfaceDescriptor GetCallInterfaceDescriptor() const override { \ | |
| 494 return OnStackArgsDescriptorBase::ForArgs(isolate(), PARAMETER_COUNT); \ | |
| 495 } | |
| 496 | |
| 497 // There are some code stubs we just can't describe right now with a | 491 // There are some code stubs we just can't describe right now with a |
| 498 // CallInterfaceDescriptor. Isolate behavior for those cases with this macro. | 492 // CallInterfaceDescriptor. Isolate behavior for those cases with this macro. |
| 499 // An attempt to retrieve a descriptor will fail. | 493 // An attempt to retrieve a descriptor will fail. |
| 500 #define DEFINE_NULL_CALL_INTERFACE_DESCRIPTOR() \ | 494 #define DEFINE_NULL_CALL_INTERFACE_DESCRIPTOR() \ |
| 501 public: \ | 495 public: \ |
| 502 CallInterfaceDescriptor GetCallInterfaceDescriptor() const override { \ | 496 CallInterfaceDescriptor GetCallInterfaceDescriptor() const override { \ |
| 503 UNREACHABLE(); \ | 497 UNREACHABLE(); \ |
| 504 return CallInterfaceDescriptor(); \ | 498 return CallInterfaceDescriptor(); \ |
| 505 } | 499 } |
| 506 | 500 |
| (...skipping 1605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2112 | 2106 |
| 2113 DEFINE_NULL_CALL_INTERFACE_DESCRIPTOR(); | 2107 DEFINE_NULL_CALL_INTERFACE_DESCRIPTOR(); |
| 2114 DEFINE_PLATFORM_CODE_STUB(JSEntry, PlatformCodeStub); | 2108 DEFINE_PLATFORM_CODE_STUB(JSEntry, PlatformCodeStub); |
| 2115 }; | 2109 }; |
| 2116 | 2110 |
| 2117 | 2111 |
| 2118 class RegExpExecStub: public PlatformCodeStub { | 2112 class RegExpExecStub: public PlatformCodeStub { |
| 2119 public: | 2113 public: |
| 2120 explicit RegExpExecStub(Isolate* isolate) : PlatformCodeStub(isolate) { } | 2114 explicit RegExpExecStub(Isolate* isolate) : PlatformCodeStub(isolate) { } |
| 2121 | 2115 |
| 2122 DEFINE_ON_STACK_CALL_INTERFACE_DESCRIPTOR(4); | 2116 DEFINE_CALL_INTERFACE_DESCRIPTOR(RegExpExec); |
| 2123 DEFINE_PLATFORM_CODE_STUB(RegExpExec, PlatformCodeStub); | 2117 DEFINE_PLATFORM_CODE_STUB(RegExpExec, PlatformCodeStub); |
| 2124 }; | 2118 }; |
| 2125 | 2119 |
| 2126 | 2120 |
| 2127 class RegExpConstructResultStub final : public HydrogenCodeStub { | 2121 class RegExpConstructResultStub final : public HydrogenCodeStub { |
| 2128 public: | 2122 public: |
| 2129 explicit RegExpConstructResultStub(Isolate* isolate) | 2123 explicit RegExpConstructResultStub(Isolate* isolate) |
| 2130 : HydrogenCodeStub(isolate) { } | 2124 : HydrogenCodeStub(isolate) { } |
| 2131 | 2125 |
| 2132 DEFINE_CALL_INTERFACE_DESCRIPTOR(RegExpConstructResult); | 2126 DEFINE_CALL_INTERFACE_DESCRIPTOR(RegExpConstructResult); |
| (...skipping 977 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3110 | 3104 |
| 3111 DEFINE_NULL_CALL_INTERFACE_DESCRIPTOR(); | 3105 DEFINE_NULL_CALL_INTERFACE_DESCRIPTOR(); |
| 3112 DEFINE_PLATFORM_CODE_STUB(StoreBufferOverflow, PlatformCodeStub); | 3106 DEFINE_PLATFORM_CODE_STUB(StoreBufferOverflow, PlatformCodeStub); |
| 3113 }; | 3107 }; |
| 3114 | 3108 |
| 3115 | 3109 |
| 3116 class SubStringStub : public PlatformCodeStub { | 3110 class SubStringStub : public PlatformCodeStub { |
| 3117 public: | 3111 public: |
| 3118 explicit SubStringStub(Isolate* isolate) : PlatformCodeStub(isolate) {} | 3112 explicit SubStringStub(Isolate* isolate) : PlatformCodeStub(isolate) {} |
| 3119 | 3113 |
| 3120 DEFINE_ON_STACK_CALL_INTERFACE_DESCRIPTOR(3); | 3114 DEFINE_CALL_INTERFACE_DESCRIPTOR(SubString); |
| 3121 DEFINE_PLATFORM_CODE_STUB(SubString, PlatformCodeStub); | 3115 DEFINE_PLATFORM_CODE_STUB(SubString, PlatformCodeStub); |
| 3122 }; | 3116 }; |
| 3123 | 3117 |
| 3124 class ToStringStub final : public PlatformCodeStub { | 3118 class ToStringStub final : public PlatformCodeStub { |
| 3125 public: | 3119 public: |
| 3126 explicit ToStringStub(Isolate* isolate) : PlatformCodeStub(isolate) {} | 3120 explicit ToStringStub(Isolate* isolate) : PlatformCodeStub(isolate) {} |
| 3127 | 3121 |
| 3128 DEFINE_CALL_INTERFACE_DESCRIPTOR(TypeConversion); | 3122 DEFINE_CALL_INTERFACE_DESCRIPTOR(TypeConversion); |
| 3129 DEFINE_PLATFORM_CODE_STUB(ToString, PlatformCodeStub); | 3123 DEFINE_PLATFORM_CODE_STUB(ToString, PlatformCodeStub); |
| 3130 }; | 3124 }; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 3143 #undef DEFINE_HYDROGEN_CODE_STUB | 3137 #undef DEFINE_HYDROGEN_CODE_STUB |
| 3144 #undef DEFINE_CODE_STUB | 3138 #undef DEFINE_CODE_STUB |
| 3145 #undef DEFINE_CODE_STUB_BASE | 3139 #undef DEFINE_CODE_STUB_BASE |
| 3146 | 3140 |
| 3147 extern Representation RepresentationFromMachineType(MachineType type); | 3141 extern Representation RepresentationFromMachineType(MachineType type); |
| 3148 | 3142 |
| 3149 } // namespace internal | 3143 } // namespace internal |
| 3150 } // namespace v8 | 3144 } // namespace v8 |
| 3151 | 3145 |
| 3152 #endif // V8_CODE_STUBS_H_ | 3146 #endif // V8_CODE_STUBS_H_ |
| OLD | NEW |