| 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 1798 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1809 bool is_lazy) | 1809 bool is_lazy) |
| 1810 : CallApiCallbackStub(isolate, is_store ? 1 : 0, is_store, | 1810 : CallApiCallbackStub(isolate, is_store ? 1 : 0, is_store, |
| 1811 call_data_undefined, is_lazy) {} | 1811 call_data_undefined, is_lazy) {} |
| 1812 | 1812 |
| 1813 // CallApiCallbackStub for callback functions. | 1813 // CallApiCallbackStub for callback functions. |
| 1814 CallApiCallbackStub(Isolate* isolate, int argc, bool call_data_undefined, | 1814 CallApiCallbackStub(Isolate* isolate, int argc, bool call_data_undefined, |
| 1815 bool is_lazy) | 1815 bool is_lazy) |
| 1816 : CallApiCallbackStub(isolate, argc, false, call_data_undefined, | 1816 : CallApiCallbackStub(isolate, argc, false, call_data_undefined, |
| 1817 is_lazy) {} | 1817 is_lazy) {} |
| 1818 | 1818 |
| 1819 CallInterfaceDescriptor GetCallInterfaceDescriptor() const override { | |
| 1820 return ApiCallbackDescriptorBase::ForArgs(isolate(), argc()); | |
| 1821 } | |
| 1822 | |
| 1823 private: | 1819 private: |
| 1824 CallApiCallbackStub(Isolate* isolate, int argc, bool is_store, | 1820 CallApiCallbackStub(Isolate* isolate, int argc, bool is_store, |
| 1825 bool call_data_undefined, bool is_lazy) | 1821 bool call_data_undefined, bool is_lazy) |
| 1826 : PlatformCodeStub(isolate) { | 1822 : PlatformCodeStub(isolate) { |
| 1827 CHECK(0 <= argc && argc <= kArgMax); | 1823 CHECK(0 <= argc && argc <= kArgMax); |
| 1828 minor_key_ = IsStoreBits::encode(is_store) | | 1824 minor_key_ = IsStoreBits::encode(is_store) | |
| 1829 CallDataUndefinedBits::encode(call_data_undefined) | | 1825 CallDataUndefinedBits::encode(call_data_undefined) | |
| 1830 ArgumentBits::encode(argc) | | 1826 ArgumentBits::encode(argc) | |
| 1831 IsLazyAccessorBits::encode(is_lazy); | 1827 IsLazyAccessorBits::encode(is_lazy); |
| 1832 } | 1828 } |
| 1833 | 1829 |
| 1834 bool is_store() const { return IsStoreBits::decode(minor_key_); } | 1830 bool is_store() const { return IsStoreBits::decode(minor_key_); } |
| 1835 bool is_lazy() const { return IsLazyAccessorBits::decode(minor_key_); } | 1831 bool is_lazy() const { return IsLazyAccessorBits::decode(minor_key_); } |
| 1836 bool call_data_undefined() const { | 1832 bool call_data_undefined() const { |
| 1837 return CallDataUndefinedBits::decode(minor_key_); | 1833 return CallDataUndefinedBits::decode(minor_key_); |
| 1838 } | 1834 } |
| 1839 int argc() const { return ArgumentBits::decode(minor_key_); } | 1835 int argc() const { return ArgumentBits::decode(minor_key_); } |
| 1840 | 1836 |
| 1841 class IsStoreBits: public BitField<bool, 0, 1> {}; | 1837 class IsStoreBits: public BitField<bool, 0, 1> {}; |
| 1842 class CallDataUndefinedBits: public BitField<bool, 1, 1> {}; | 1838 class CallDataUndefinedBits: public BitField<bool, 1, 1> {}; |
| 1843 class ArgumentBits : public BitField<int, 2, kArgBits> {}; | 1839 class ArgumentBits : public BitField<int, 2, kArgBits> {}; |
| 1844 class IsLazyAccessorBits : public BitField<bool, 3 + kArgBits, 1> {}; | 1840 class IsLazyAccessorBits : public BitField<bool, 3 + kArgBits, 1> {}; |
| 1845 | 1841 |
| 1842 DEFINE_CALL_INTERFACE_DESCRIPTOR(ApiCallback); |
| 1846 DEFINE_PLATFORM_CODE_STUB(CallApiCallback, PlatformCodeStub); | 1843 DEFINE_PLATFORM_CODE_STUB(CallApiCallback, PlatformCodeStub); |
| 1847 }; | 1844 }; |
| 1848 | 1845 |
| 1849 | 1846 |
| 1850 class CallApiGetterStub : public PlatformCodeStub { | 1847 class CallApiGetterStub : public PlatformCodeStub { |
| 1851 public: | 1848 public: |
| 1852 explicit CallApiGetterStub(Isolate* isolate) : PlatformCodeStub(isolate) {} | 1849 explicit CallApiGetterStub(Isolate* isolate) : PlatformCodeStub(isolate) {} |
| 1853 | 1850 |
| 1854 DEFINE_CALL_INTERFACE_DESCRIPTOR(ApiGetter); | 1851 DEFINE_CALL_INTERFACE_DESCRIPTOR(ApiGetter); |
| 1855 DEFINE_PLATFORM_CODE_STUB(CallApiGetter, PlatformCodeStub); | 1852 DEFINE_PLATFORM_CODE_STUB(CallApiGetter, PlatformCodeStub); |
| (...skipping 1290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3146 #undef DEFINE_HYDROGEN_CODE_STUB | 3143 #undef DEFINE_HYDROGEN_CODE_STUB |
| 3147 #undef DEFINE_CODE_STUB | 3144 #undef DEFINE_CODE_STUB |
| 3148 #undef DEFINE_CODE_STUB_BASE | 3145 #undef DEFINE_CODE_STUB_BASE |
| 3149 | 3146 |
| 3150 extern Representation RepresentationFromMachineType(MachineType type); | 3147 extern Representation RepresentationFromMachineType(MachineType type); |
| 3151 | 3148 |
| 3152 } // namespace internal | 3149 } // namespace internal |
| 3153 } // namespace v8 | 3150 } // namespace v8 |
| 3154 | 3151 |
| 3155 #endif // V8_CODE_STUBS_H_ | 3152 #endif // V8_CODE_STUBS_H_ |
| OLD | NEW |