| 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 12 matching lines...) Expand all Loading... |
| 23 V(ArgumentsAccess) \ | 23 V(ArgumentsAccess) \ |
| 24 V(ArrayConstructor) \ | 24 V(ArrayConstructor) \ |
| 25 V(BinaryOpICWithAllocationSite) \ | 25 V(BinaryOpICWithAllocationSite) \ |
| 26 V(CallApiFunction) \ | 26 V(CallApiFunction) \ |
| 27 V(CallApiAccessor) \ | 27 V(CallApiAccessor) \ |
| 28 V(CallApiGetter) \ | 28 V(CallApiGetter) \ |
| 29 V(CallConstruct) \ | 29 V(CallConstruct) \ |
| 30 V(CallFunction) \ | 30 V(CallFunction) \ |
| 31 V(CallIC) \ | 31 V(CallIC) \ |
| 32 V(CallIC_Array) \ | 32 V(CallIC_Array) \ |
| 33 V(CallIC_Round) \ |
| 34 V(CallIC_Floor) \ |
| 35 V(CallIC_Ceil) \ |
| 33 V(CEntry) \ | 36 V(CEntry) \ |
| 34 V(CompareIC) \ | 37 V(CompareIC) \ |
| 35 V(DoubleToI) \ | 38 V(DoubleToI) \ |
| 36 V(FunctionPrototype) \ | 39 V(FunctionPrototype) \ |
| 37 V(Instanceof) \ | 40 V(Instanceof) \ |
| 38 V(InternalArrayConstructor) \ | 41 V(InternalArrayConstructor) \ |
| 39 V(JSEntry) \ | 42 V(JSEntry) \ |
| 40 V(KeyedLoadICTrampoline) \ | 43 V(KeyedLoadICTrampoline) \ |
| 41 V(LoadICTrampoline) \ | 44 V(LoadICTrampoline) \ |
| 42 V(CallICTrampoline) \ | 45 V(CallICTrampoline) \ |
| 43 V(CallIC_ArrayTrampoline) \ | 46 V(CallIC_ArrayTrampoline) \ |
| 47 V(CallIC_RoundTrampoline) \ |
| 48 V(CallIC_FloorTrampoline) \ |
| 49 V(CallIC_CeilTrampoline) \ |
| 44 V(LoadIndexedInterceptor) \ | 50 V(LoadIndexedInterceptor) \ |
| 45 V(LoadIndexedString) \ | 51 V(LoadIndexedString) \ |
| 46 V(MathPow) \ | 52 V(MathPow) \ |
| 47 V(ProfileEntryHook) \ | 53 V(ProfileEntryHook) \ |
| 48 V(RecordWrite) \ | 54 V(RecordWrite) \ |
| 49 V(RegExpExec) \ | 55 V(RegExpExec) \ |
| 50 V(StoreArrayLiteralElement) \ | 56 V(StoreArrayLiteralElement) \ |
| 51 V(StoreBufferOverflow) \ | 57 V(StoreBufferOverflow) \ |
| 52 V(StoreElement) \ | 58 V(StoreElement) \ |
| 53 V(StringCompare) \ | 59 V(StringCompare) \ |
| (...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 839 } | 845 } |
| 840 | 846 |
| 841 Code::Kind GetCodeKind() const override { return Code::CALL_IC; } | 847 Code::Kind GetCodeKind() const override { return Code::CALL_IC; } |
| 842 | 848 |
| 843 InlineCacheState GetICState() const override { return DEFAULT; } | 849 InlineCacheState GetICState() const override { return DEFAULT; } |
| 844 | 850 |
| 845 ExtraICState GetExtraICState() const final { | 851 ExtraICState GetExtraICState() const final { |
| 846 return static_cast<ExtraICState>(minor_key_); | 852 return static_cast<ExtraICState>(minor_key_); |
| 847 } | 853 } |
| 848 | 854 |
| 855 static const int kHasReturnedMinusZeroSentinel = 1; |
| 856 |
| 849 protected: | 857 protected: |
| 850 bool CallAsMethod() const { | 858 bool CallAsMethod() const { |
| 851 return state().call_type() == CallICState::METHOD; | 859 return state().call_type() == CallICState::METHOD; |
| 852 } | 860 } |
| 853 | 861 |
| 854 int arg_count() const { return state().arg_count(); } | 862 int arg_count() const { return state().arg_count(); } |
| 855 | 863 |
| 856 CallICState state() const { | 864 CallICState state() const { |
| 857 return CallICState(static_cast<ExtraICState>(minor_key_)); | 865 return CallICState(static_cast<ExtraICState>(minor_key_)); |
| 858 } | 866 } |
| 859 | 867 |
| 860 // Code generation helpers. | 868 // Code generation helpers. |
| 861 void GenerateMiss(MacroAssembler* masm); | 869 void GenerateMiss(MacroAssembler* masm); |
| 862 | 870 |
| 863 private: | 871 private: |
| 864 void PrintState(std::ostream& os) const override; // NOLINT | 872 void PrintState(std::ostream& os) const override; // NOLINT |
| 865 | 873 |
| 866 DEFINE_CALL_INTERFACE_DESCRIPTOR(CallFunctionWithFeedbackAndVector); | 874 DEFINE_CALL_INTERFACE_DESCRIPTOR(CallFunctionWithFeedbackAndVector); |
| 867 DEFINE_PLATFORM_CODE_STUB(CallIC, PlatformCodeStub); | 875 DEFINE_PLATFORM_CODE_STUB(CallIC, PlatformCodeStub); |
| 868 }; | 876 }; |
| 869 | 877 |
| 870 | 878 |
| 879 class CallIC_RoundStub : public CallICStub { |
| 880 public: |
| 881 CallIC_RoundStub(Isolate* isolate, const CallICState& state_in) |
| 882 : CallICStub(isolate, state_in) {} |
| 883 |
| 884 InlineCacheState GetICState() const final { return MONOMORPHIC; } |
| 885 |
| 886 private: |
| 887 void PrintState(std::ostream& os) const override; // NOLINT |
| 888 |
| 889 DEFINE_PLATFORM_CODE_STUB(CallIC_Round, CallICStub); |
| 890 }; |
| 891 |
| 892 |
| 893 class CallIC_FloorStub : public CallICStub { |
| 894 public: |
| 895 CallIC_FloorStub(Isolate* isolate, const CallICState& state_in) |
| 896 : CallICStub(isolate, state_in) {} |
| 897 |
| 898 InlineCacheState GetICState() const final { return MONOMORPHIC; } |
| 899 |
| 900 private: |
| 901 void PrintState(std::ostream& os) const override; // NOLINT |
| 902 |
| 903 DEFINE_PLATFORM_CODE_STUB(CallIC_Floor, CallICStub); |
| 904 }; |
| 905 |
| 906 |
| 907 class CallIC_CeilStub : public CallICStub { |
| 908 public: |
| 909 CallIC_CeilStub(Isolate* isolate, const CallICState& state_in) |
| 910 : CallICStub(isolate, state_in) {} |
| 911 |
| 912 InlineCacheState GetICState() const final { return MONOMORPHIC; } |
| 913 |
| 914 private: |
| 915 void PrintState(std::ostream& os) const override; // NOLINT |
| 916 |
| 917 DEFINE_PLATFORM_CODE_STUB(CallIC_Ceil, CallICStub); |
| 918 }; |
| 919 |
| 920 |
| 871 class CallIC_ArrayStub: public CallICStub { | 921 class CallIC_ArrayStub: public CallICStub { |
| 872 public: | 922 public: |
| 873 CallIC_ArrayStub(Isolate* isolate, const CallICState& state_in) | 923 CallIC_ArrayStub(Isolate* isolate, const CallICState& state_in) |
| 874 : CallICStub(isolate, state_in) {} | 924 : CallICStub(isolate, state_in) {} |
| 875 | 925 |
| 876 InlineCacheState GetICState() const final { return MONOMORPHIC; } | 926 InlineCacheState GetICState() const final { return MONOMORPHIC; } |
| 877 | 927 |
| 878 private: | 928 private: |
| 879 void PrintState(std::ostream& os) const override; // NOLINT | 929 void PrintState(std::ostream& os) const override; // NOLINT |
| 880 | 930 |
| (...skipping 1157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2038 class CallIC_ArrayTrampolineStub : public CallICTrampolineStub { | 2088 class CallIC_ArrayTrampolineStub : public CallICTrampolineStub { |
| 2039 public: | 2089 public: |
| 2040 CallIC_ArrayTrampolineStub(Isolate* isolate, const CallICState& state) | 2090 CallIC_ArrayTrampolineStub(Isolate* isolate, const CallICState& state) |
| 2041 : CallICTrampolineStub(isolate, state) {} | 2091 : CallICTrampolineStub(isolate, state) {} |
| 2042 | 2092 |
| 2043 private: | 2093 private: |
| 2044 DEFINE_PLATFORM_CODE_STUB(CallIC_ArrayTrampoline, CallICTrampolineStub); | 2094 DEFINE_PLATFORM_CODE_STUB(CallIC_ArrayTrampoline, CallICTrampolineStub); |
| 2045 }; | 2095 }; |
| 2046 | 2096 |
| 2047 | 2097 |
| 2098 class CallIC_RoundTrampolineStub : public CallICTrampolineStub { |
| 2099 public: |
| 2100 CallIC_RoundTrampolineStub(Isolate* isolate, const CallICState& state) |
| 2101 : CallICTrampolineStub(isolate, state) {} |
| 2102 |
| 2103 private: |
| 2104 DEFINE_PLATFORM_CODE_STUB(CallIC_RoundTrampoline, CallICTrampolineStub); |
| 2105 }; |
| 2106 |
| 2107 |
| 2108 class CallIC_FloorTrampolineStub : public CallICTrampolineStub { |
| 2109 public: |
| 2110 CallIC_FloorTrampolineStub(Isolate* isolate, const CallICState& state) |
| 2111 : CallICTrampolineStub(isolate, state) {} |
| 2112 |
| 2113 private: |
| 2114 DEFINE_PLATFORM_CODE_STUB(CallIC_FloorTrampoline, CallICTrampolineStub); |
| 2115 }; |
| 2116 |
| 2117 |
| 2118 class CallIC_CeilTrampolineStub : public CallICTrampolineStub { |
| 2119 public: |
| 2120 CallIC_CeilTrampolineStub(Isolate* isolate, const CallICState& state) |
| 2121 : CallICTrampolineStub(isolate, state) {} |
| 2122 |
| 2123 private: |
| 2124 DEFINE_PLATFORM_CODE_STUB(CallIC_CeilTrampoline, CallICTrampolineStub); |
| 2125 }; |
| 2126 |
| 2127 |
| 2048 class MegamorphicLoadStub : public HydrogenCodeStub { | 2128 class MegamorphicLoadStub : public HydrogenCodeStub { |
| 2049 public: | 2129 public: |
| 2050 MegamorphicLoadStub(Isolate* isolate, const LoadICState& state) | 2130 MegamorphicLoadStub(Isolate* isolate, const LoadICState& state) |
| 2051 : HydrogenCodeStub(isolate) { | 2131 : HydrogenCodeStub(isolate) { |
| 2052 set_sub_minor_key(state.GetExtraICState()); | 2132 set_sub_minor_key(state.GetExtraICState()); |
| 2053 } | 2133 } |
| 2054 | 2134 |
| 2055 Code::Kind GetCodeKind() const override { return Code::LOAD_IC; } | 2135 Code::Kind GetCodeKind() const override { return Code::LOAD_IC; } |
| 2056 | 2136 |
| 2057 InlineCacheState GetICState() const final { return MEGAMORPHIC; } | 2137 InlineCacheState GetICState() const final { return MEGAMORPHIC; } |
| (...skipping 696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2754 | 2834 |
| 2755 #undef DEFINE_CALL_INTERFACE_DESCRIPTOR | 2835 #undef DEFINE_CALL_INTERFACE_DESCRIPTOR |
| 2756 #undef DEFINE_PLATFORM_CODE_STUB | 2836 #undef DEFINE_PLATFORM_CODE_STUB |
| 2757 #undef DEFINE_HANDLER_CODE_STUB | 2837 #undef DEFINE_HANDLER_CODE_STUB |
| 2758 #undef DEFINE_HYDROGEN_CODE_STUB | 2838 #undef DEFINE_HYDROGEN_CODE_STUB |
| 2759 #undef DEFINE_CODE_STUB | 2839 #undef DEFINE_CODE_STUB |
| 2760 #undef DEFINE_CODE_STUB_BASE | 2840 #undef DEFINE_CODE_STUB_BASE |
| 2761 } } // namespace v8::internal | 2841 } } // namespace v8::internal |
| 2762 | 2842 |
| 2763 #endif // V8_CODE_STUBS_H_ | 2843 #endif // V8_CODE_STUBS_H_ |
| OLD | NEW |