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 1938 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1949 class LoadGlobalICTrampolineStub : public TurboFanCodeStub { | 1949 class LoadGlobalICTrampolineStub : public TurboFanCodeStub { |
1950 public: | 1950 public: |
1951 explicit LoadGlobalICTrampolineStub(Isolate* isolate, | 1951 explicit LoadGlobalICTrampolineStub(Isolate* isolate, |
1952 const LoadGlobalICState& state) | 1952 const LoadGlobalICState& state) |
1953 : TurboFanCodeStub(isolate) { | 1953 : TurboFanCodeStub(isolate) { |
1954 minor_key_ = state.GetExtraICState(); | 1954 minor_key_ = state.GetExtraICState(); |
1955 } | 1955 } |
1956 | 1956 |
1957 Code::Kind GetCodeKind() const override { return Code::LOAD_GLOBAL_IC; } | 1957 Code::Kind GetCodeKind() const override { return Code::LOAD_GLOBAL_IC; } |
1958 | 1958 |
| 1959 TypeofMode typeof_mode() const { |
| 1960 LoadGlobalICState state(GetExtraICState()); |
| 1961 return state.typeof_mode(); |
| 1962 } |
| 1963 |
1959 ExtraICState GetExtraICState() const final { | 1964 ExtraICState GetExtraICState() const final { |
1960 return static_cast<ExtraICState>(minor_key_); | 1965 return static_cast<ExtraICState>(minor_key_); |
1961 } | 1966 } |
1962 | 1967 |
1963 DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadGlobal); | 1968 DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadGlobal); |
1964 DEFINE_TURBOFAN_CODE_STUB(LoadGlobalICTrampoline, TurboFanCodeStub); | 1969 DEFINE_TURBOFAN_CODE_STUB(LoadGlobalICTrampoline, TurboFanCodeStub); |
1965 }; | 1970 }; |
1966 | 1971 |
1967 class KeyedLoadICTrampolineTFStub : public LoadICTrampolineStub { | 1972 class KeyedLoadICTrampolineTFStub : public LoadICTrampolineStub { |
1968 public: | 1973 public: |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2015 DEFINE_PLATFORM_CODE_STUB(KeyedStoreICTrampoline, PlatformCodeStub); | 2020 DEFINE_PLATFORM_CODE_STUB(KeyedStoreICTrampoline, PlatformCodeStub); |
2016 }; | 2021 }; |
2017 | 2022 |
2018 class KeyedStoreICTrampolineTFStub : public StoreICTrampolineStub { | 2023 class KeyedStoreICTrampolineTFStub : public StoreICTrampolineStub { |
2019 public: | 2024 public: |
2020 KeyedStoreICTrampolineTFStub(Isolate* isolate, const StoreICState& state) | 2025 KeyedStoreICTrampolineTFStub(Isolate* isolate, const StoreICState& state) |
2021 : StoreICTrampolineStub(isolate, state) {} | 2026 : StoreICTrampolineStub(isolate, state) {} |
2022 | 2027 |
2023 Code::Kind GetCodeKind() const override { return Code::KEYED_STORE_IC; } | 2028 Code::Kind GetCodeKind() const override { return Code::KEYED_STORE_IC; } |
2024 | 2029 |
| 2030 LanguageMode language_mode() const { |
| 2031 return StoreICState(GetExtraICState()).language_mode(); |
| 2032 } |
| 2033 |
2025 DEFINE_TURBOFAN_CODE_STUB(KeyedStoreICTrampolineTF, StoreICTrampolineStub); | 2034 DEFINE_TURBOFAN_CODE_STUB(KeyedStoreICTrampolineTF, StoreICTrampolineStub); |
2026 }; | 2035 }; |
2027 | 2036 |
2028 class CallICTrampolineStub : public PlatformCodeStub { | 2037 class CallICTrampolineStub : public PlatformCodeStub { |
2029 public: | 2038 public: |
2030 CallICTrampolineStub(Isolate* isolate, const CallICState& state) | 2039 CallICTrampolineStub(Isolate* isolate, const CallICState& state) |
2031 : PlatformCodeStub(isolate) { | 2040 : PlatformCodeStub(isolate) { |
2032 minor_key_ = state.GetExtraICState(); | 2041 minor_key_ = state.GetExtraICState(); |
2033 } | 2042 } |
2034 | 2043 |
(...skipping 17 matching lines...) Expand all Loading... |
2052 explicit LoadICStub(Isolate* isolate) : TurboFanCodeStub(isolate) {} | 2061 explicit LoadICStub(Isolate* isolate) : TurboFanCodeStub(isolate) {} |
2053 | 2062 |
2054 Code::Kind GetCodeKind() const override { return Code::LOAD_IC; } | 2063 Code::Kind GetCodeKind() const override { return Code::LOAD_IC; } |
2055 | 2064 |
2056 DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadWithVector); | 2065 DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadWithVector); |
2057 DEFINE_TURBOFAN_CODE_STUB(LoadIC, TurboFanCodeStub); | 2066 DEFINE_TURBOFAN_CODE_STUB(LoadIC, TurboFanCodeStub); |
2058 }; | 2067 }; |
2059 | 2068 |
2060 class LoadICProtoArrayStub : public TurboFanCodeStub { | 2069 class LoadICProtoArrayStub : public TurboFanCodeStub { |
2061 public: | 2070 public: |
2062 explicit LoadICProtoArrayStub(Isolate* isolate) : TurboFanCodeStub(isolate) {} | 2071 explicit LoadICProtoArrayStub(Isolate* isolate, |
| 2072 bool throw_reference_error_if_nonexistent) |
| 2073 : TurboFanCodeStub(isolate) { |
| 2074 minor_key_ = ThrowReferenceErrorIfNonexistentBits::encode( |
| 2075 throw_reference_error_if_nonexistent); |
| 2076 } |
| 2077 |
| 2078 bool throw_reference_error_if_nonexistent() const { |
| 2079 return ThrowReferenceErrorIfNonexistentBits::decode(minor_key_); |
| 2080 } |
| 2081 |
| 2082 ExtraICState GetExtraICState() const final { |
| 2083 return static_cast<ExtraICState>(minor_key_); |
| 2084 } |
| 2085 |
| 2086 private: |
| 2087 class ThrowReferenceErrorIfNonexistentBits : public BitField<bool, 0, 1> {}; |
2063 | 2088 |
2064 DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadICProtoArray); | 2089 DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadICProtoArray); |
2065 DEFINE_TURBOFAN_CODE_STUB(LoadICProtoArray, TurboFanCodeStub); | 2090 DEFINE_TURBOFAN_CODE_STUB(LoadICProtoArray, TurboFanCodeStub); |
2066 }; | 2091 }; |
2067 | 2092 |
2068 class LoadGlobalICStub : public TurboFanCodeStub { | 2093 class LoadGlobalICStub : public TurboFanCodeStub { |
2069 public: | 2094 public: |
2070 explicit LoadGlobalICStub(Isolate* isolate, const LoadGlobalICState& state) | 2095 explicit LoadGlobalICStub(Isolate* isolate, const LoadGlobalICState& state) |
2071 : TurboFanCodeStub(isolate) { | 2096 : TurboFanCodeStub(isolate) { |
2072 minor_key_ = state.GetExtraICState(); | 2097 minor_key_ = state.GetExtraICState(); |
2073 } | 2098 } |
2074 | 2099 |
2075 Code::Kind GetCodeKind() const override { return Code::LOAD_GLOBAL_IC; } | 2100 Code::Kind GetCodeKind() const override { return Code::LOAD_GLOBAL_IC; } |
2076 | 2101 |
| 2102 TypeofMode typeof_mode() const { |
| 2103 LoadGlobalICState state(GetExtraICState()); |
| 2104 return state.typeof_mode(); |
| 2105 } |
| 2106 |
2077 ExtraICState GetExtraICState() const final { | 2107 ExtraICState GetExtraICState() const final { |
2078 return static_cast<ExtraICState>(minor_key_); | 2108 return static_cast<ExtraICState>(minor_key_); |
2079 } | 2109 } |
2080 | 2110 |
2081 DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadGlobalWithVector); | 2111 DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadGlobalWithVector); |
2082 DEFINE_TURBOFAN_CODE_STUB(LoadGlobalIC, TurboFanCodeStub); | 2112 DEFINE_TURBOFAN_CODE_STUB(LoadGlobalIC, TurboFanCodeStub); |
2083 }; | 2113 }; |
2084 | 2114 |
2085 class KeyedLoadICTFStub : public LoadICStub { | 2115 class KeyedLoadICTFStub : public LoadICStub { |
2086 public: | 2116 public: |
2087 explicit KeyedLoadICTFStub(Isolate* isolate) : LoadICStub(isolate) {} | 2117 explicit KeyedLoadICTFStub(Isolate* isolate) : LoadICStub(isolate) {} |
2088 | 2118 |
2089 Code::Kind GetCodeKind() const override { return Code::KEYED_LOAD_IC; } | 2119 Code::Kind GetCodeKind() const override { return Code::KEYED_LOAD_IC; } |
2090 | 2120 |
2091 DEFINE_TURBOFAN_CODE_STUB(KeyedLoadICTF, LoadICStub); | 2121 DEFINE_TURBOFAN_CODE_STUB(KeyedLoadICTF, LoadICStub); |
2092 }; | 2122 }; |
2093 | 2123 |
2094 class StoreICStub : public TurboFanCodeStub { | 2124 class StoreICStub : public TurboFanCodeStub { |
2095 public: | 2125 public: |
2096 StoreICStub(Isolate* isolate, const StoreICState& state) | 2126 StoreICStub(Isolate* isolate, const StoreICState& state) |
2097 : TurboFanCodeStub(isolate) { | 2127 : TurboFanCodeStub(isolate) { |
2098 minor_key_ = state.GetExtraICState(); | 2128 minor_key_ = state.GetExtraICState(); |
2099 } | 2129 } |
2100 | 2130 |
2101 Code::Kind GetCodeKind() const override { return Code::STORE_IC; } | 2131 Code::Kind GetCodeKind() const override { return Code::STORE_IC; } |
| 2132 |
| 2133 LanguageMode language_mode() const { |
| 2134 return StoreICState(GetExtraICState()).language_mode(); |
| 2135 } |
| 2136 |
2102 ExtraICState GetExtraICState() const final { | 2137 ExtraICState GetExtraICState() const final { |
2103 return static_cast<ExtraICState>(minor_key_); | 2138 return static_cast<ExtraICState>(minor_key_); |
2104 } | 2139 } |
2105 | 2140 |
2106 DEFINE_CALL_INTERFACE_DESCRIPTOR(StoreWithVector); | 2141 DEFINE_CALL_INTERFACE_DESCRIPTOR(StoreWithVector); |
2107 DEFINE_TURBOFAN_CODE_STUB(StoreIC, TurboFanCodeStub); | 2142 DEFINE_TURBOFAN_CODE_STUB(StoreIC, TurboFanCodeStub); |
2108 }; | 2143 }; |
2109 | 2144 |
2110 class KeyedStoreICStub : public PlatformCodeStub { | 2145 class KeyedStoreICStub : public PlatformCodeStub { |
2111 public: | 2146 public: |
(...skipping 17 matching lines...) Expand all Loading... |
2129 void GenerateImpl(MacroAssembler* masm, bool in_frame); | 2164 void GenerateImpl(MacroAssembler* masm, bool in_frame); |
2130 }; | 2165 }; |
2131 | 2166 |
2132 class KeyedStoreICTFStub : public StoreICStub { | 2167 class KeyedStoreICTFStub : public StoreICStub { |
2133 public: | 2168 public: |
2134 KeyedStoreICTFStub(Isolate* isolate, const StoreICState& state) | 2169 KeyedStoreICTFStub(Isolate* isolate, const StoreICState& state) |
2135 : StoreICStub(isolate, state) {} | 2170 : StoreICStub(isolate, state) {} |
2136 | 2171 |
2137 Code::Kind GetCodeKind() const override { return Code::KEYED_STORE_IC; } | 2172 Code::Kind GetCodeKind() const override { return Code::KEYED_STORE_IC; } |
2138 | 2173 |
| 2174 LanguageMode language_mode() const { |
| 2175 return StoreICState(GetExtraICState()).language_mode(); |
| 2176 } |
| 2177 |
2139 DEFINE_TURBOFAN_CODE_STUB(KeyedStoreICTF, StoreICStub); | 2178 DEFINE_TURBOFAN_CODE_STUB(KeyedStoreICTF, StoreICStub); |
2140 }; | 2179 }; |
2141 | 2180 |
2142 class DoubleToIStub : public PlatformCodeStub { | 2181 class DoubleToIStub : public PlatformCodeStub { |
2143 public: | 2182 public: |
2144 DoubleToIStub(Isolate* isolate, Register source, Register destination, | 2183 DoubleToIStub(Isolate* isolate, Register source, Register destination, |
2145 int offset, bool is_truncating, bool skip_fastpath = false) | 2184 int offset, bool is_truncating, bool skip_fastpath = false) |
2146 : PlatformCodeStub(isolate) { | 2185 : PlatformCodeStub(isolate) { |
2147 minor_key_ = SourceRegisterBits::encode(source.code()) | | 2186 minor_key_ = SourceRegisterBits::encode(source.code()) | |
2148 DestinationRegisterBits::encode(destination.code()) | | 2187 DestinationRegisterBits::encode(destination.code()) | |
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2664 #undef DEFINE_PLATFORM_CODE_STUB | 2703 #undef DEFINE_PLATFORM_CODE_STUB |
2665 #undef DEFINE_HANDLER_CODE_STUB | 2704 #undef DEFINE_HANDLER_CODE_STUB |
2666 #undef DEFINE_HYDROGEN_CODE_STUB | 2705 #undef DEFINE_HYDROGEN_CODE_STUB |
2667 #undef DEFINE_CODE_STUB | 2706 #undef DEFINE_CODE_STUB |
2668 #undef DEFINE_CODE_STUB_BASE | 2707 #undef DEFINE_CODE_STUB_BASE |
2669 | 2708 |
2670 } // namespace internal | 2709 } // namespace internal |
2671 } // namespace v8 | 2710 } // namespace v8 |
2672 | 2711 |
2673 #endif // V8_CODE_STUBS_H_ | 2712 #endif // V8_CODE_STUBS_H_ |
OLD | NEW |