Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(411)

Side by Side Diff: src/code-stubs.h

Issue 2352163004: [stubs] ApiCallbackDescriptor cleanup - make it independent on the number of JS parameters. (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/arm64/interface-descriptors-arm64.cc ('k') | src/compiler/code-assembler.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « src/arm64/interface-descriptors-arm64.cc ('k') | src/compiler/code-assembler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698