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/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
820 DEFINE_CALL_INTERFACE_DESCRIPTOR(StoreWithVector); | 820 DEFINE_CALL_INTERFACE_DESCRIPTOR(StoreWithVector); |
821 DEFINE_TURBOFAN_CODE_STUB(KeyedStoreSloppyArguments, TurboFanCodeStub); | 821 DEFINE_TURBOFAN_CODE_STUB(KeyedStoreSloppyArguments, TurboFanCodeStub); |
822 }; | 822 }; |
823 | 823 |
824 class CallApiCallbackStub : public PlatformCodeStub { | 824 class CallApiCallbackStub : public PlatformCodeStub { |
825 public: | 825 public: |
826 static const int kArgBits = 3; | 826 static const int kArgBits = 3; |
827 static const int kArgMax = (1 << kArgBits) - 1; | 827 static const int kArgMax = (1 << kArgBits) - 1; |
828 | 828 |
829 // CallApiCallbackStub for regular setters and getters. | 829 // CallApiCallbackStub for regular setters and getters. |
830 CallApiCallbackStub(Isolate* isolate, bool is_store, bool call_data_undefined, | 830 CallApiCallbackStub(Isolate* isolate, bool is_store, bool is_lazy) |
831 bool is_lazy) | 831 : CallApiCallbackStub(isolate, is_store ? 1 : 0, is_store, is_lazy) {} |
832 : CallApiCallbackStub(isolate, is_store ? 1 : 0, is_store, | |
833 call_data_undefined, is_lazy) {} | |
834 | 832 |
835 // CallApiCallbackStub for callback functions. | 833 // CallApiCallbackStub for callback functions. |
836 CallApiCallbackStub(Isolate* isolate, int argc, bool call_data_undefined, | 834 CallApiCallbackStub(Isolate* isolate, int argc, bool is_lazy) |
837 bool is_lazy) | 835 : CallApiCallbackStub(isolate, argc, false, is_lazy) {} |
838 : CallApiCallbackStub(isolate, argc, false, call_data_undefined, | |
839 is_lazy) {} | |
840 | 836 |
841 private: | 837 private: |
842 CallApiCallbackStub(Isolate* isolate, int argc, bool is_store, | 838 CallApiCallbackStub(Isolate* isolate, int argc, bool is_store, bool is_lazy) |
843 bool call_data_undefined, bool is_lazy) | |
844 : PlatformCodeStub(isolate) { | 839 : PlatformCodeStub(isolate) { |
845 CHECK(0 <= argc && argc <= kArgMax); | 840 CHECK(0 <= argc && argc <= kArgMax); |
846 minor_key_ = IsStoreBits::encode(is_store) | | 841 minor_key_ = IsStoreBits::encode(is_store) | |
847 CallDataUndefinedBits::encode(call_data_undefined) | | |
848 ArgumentBits::encode(argc) | | 842 ArgumentBits::encode(argc) | |
849 IsLazyAccessorBits::encode(is_lazy); | 843 IsLazyAccessorBits::encode(is_lazy); |
850 } | 844 } |
851 | 845 |
852 bool is_store() const { return IsStoreBits::decode(minor_key_); } | 846 bool is_store() const { return IsStoreBits::decode(minor_key_); } |
853 bool is_lazy() const { return IsLazyAccessorBits::decode(minor_key_); } | 847 bool is_lazy() const { return IsLazyAccessorBits::decode(minor_key_); } |
854 bool call_data_undefined() const { | |
855 return CallDataUndefinedBits::decode(minor_key_); | |
856 } | |
857 int argc() const { return ArgumentBits::decode(minor_key_); } | 848 int argc() const { return ArgumentBits::decode(minor_key_); } |
858 | 849 |
859 class IsStoreBits: public BitField<bool, 0, 1> {}; | 850 class IsStoreBits: public BitField<bool, 0, 1> {}; |
860 class CallDataUndefinedBits: public BitField<bool, 1, 1> {}; | 851 class IsLazyAccessorBits : public BitField<bool, 1, 1> {}; |
861 class ArgumentBits : public BitField<int, 2, kArgBits> {}; | 852 class ArgumentBits : public BitField<int, 2, kArgBits> {}; |
862 class IsLazyAccessorBits : public BitField<bool, 3 + kArgBits, 1> {}; | |
863 | 853 |
864 DEFINE_CALL_INTERFACE_DESCRIPTOR(ApiCallback); | 854 DEFINE_CALL_INTERFACE_DESCRIPTOR(ApiCallback); |
865 DEFINE_PLATFORM_CODE_STUB(CallApiCallback, PlatformCodeStub); | 855 DEFINE_PLATFORM_CODE_STUB(CallApiCallback, PlatformCodeStub); |
866 }; | 856 }; |
867 | 857 |
868 | 858 |
869 class CallApiGetterStub : public PlatformCodeStub { | 859 class CallApiGetterStub : public PlatformCodeStub { |
870 public: | 860 public: |
871 explicit CallApiGetterStub(Isolate* isolate) : PlatformCodeStub(isolate) {} | 861 explicit CallApiGetterStub(Isolate* isolate) : PlatformCodeStub(isolate) {} |
872 | 862 |
(...skipping 817 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1690 #undef DEFINE_PLATFORM_CODE_STUB | 1680 #undef DEFINE_PLATFORM_CODE_STUB |
1691 #undef DEFINE_HANDLER_CODE_STUB | 1681 #undef DEFINE_HANDLER_CODE_STUB |
1692 #undef DEFINE_HYDROGEN_CODE_STUB | 1682 #undef DEFINE_HYDROGEN_CODE_STUB |
1693 #undef DEFINE_CODE_STUB | 1683 #undef DEFINE_CODE_STUB |
1694 #undef DEFINE_CODE_STUB_BASE | 1684 #undef DEFINE_CODE_STUB_BASE |
1695 | 1685 |
1696 } // namespace internal | 1686 } // namespace internal |
1697 } // namespace v8 | 1687 } // namespace v8 |
1698 | 1688 |
1699 #endif // V8_CODE_STUBS_H_ | 1689 #endif // V8_CODE_STUBS_H_ |
OLD | NEW |