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_IC_STATE_H_ | 5 #ifndef V8_IC_STATE_H_ |
6 #define V8_IC_STATE_H_ | 6 #define V8_IC_STATE_H_ |
7 | 7 |
8 #include "src/macro-assembler.h" | 8 #include "src/macro-assembler.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 static State NewInputState(State old_state, Handle<Object> value); | 192 static State NewInputState(State old_state, Handle<Object> value); |
193 | 193 |
194 static const char* GetStateName(CompareICState::State state); | 194 static const char* GetStateName(CompareICState::State state); |
195 | 195 |
196 static State TargetState(Isolate* isolate, State old_state, State old_left, | 196 static State TargetState(Isolate* isolate, State old_state, State old_left, |
197 State old_right, Token::Value op, | 197 State old_right, Token::Value op, |
198 bool has_inlined_smi_code, Handle<Object> x, | 198 bool has_inlined_smi_code, Handle<Object> x, |
199 Handle<Object> y); | 199 Handle<Object> y); |
200 }; | 200 }; |
201 | 201 |
202 | 202 class LoadGlobalICState final BASE_EMBEDDED { |
203 class LoadICState final BASE_EMBEDDED { | |
204 private: | 203 private: |
205 class TypeofModeBits : public BitField<TypeofMode, 0, 1> {}; | 204 class TypeofModeBits : public BitField<TypeofMode, 0, 1> {}; |
206 STATIC_ASSERT(static_cast<int>(INSIDE_TYPEOF) == 0); | 205 STATIC_ASSERT(static_cast<int>(INSIDE_TYPEOF) == 0); |
207 const ExtraICState state_; | 206 const ExtraICState state_; |
208 | 207 |
209 public: | 208 public: |
210 static const uint32_t kNextBitFieldOffset = TypeofModeBits::kNext; | 209 static const uint32_t kNextBitFieldOffset = TypeofModeBits::kNext; |
211 | 210 |
212 explicit LoadICState(ExtraICState extra_ic_state) : state_(extra_ic_state) {} | 211 explicit LoadGlobalICState(ExtraICState extra_ic_state) |
| 212 : state_(extra_ic_state) {} |
213 | 213 |
214 explicit LoadICState(TypeofMode typeof_mode) | 214 explicit LoadGlobalICState(TypeofMode typeof_mode) |
215 : state_(TypeofModeBits::encode(typeof_mode)) {} | 215 : state_(TypeofModeBits::encode(typeof_mode)) {} |
216 | 216 |
217 ExtraICState GetExtraICState() const { return state_; } | 217 ExtraICState GetExtraICState() const { return state_; } |
218 | 218 |
219 TypeofMode typeof_mode() const { return TypeofModeBits::decode(state_); } | 219 TypeofMode typeof_mode() const { return TypeofModeBits::decode(state_); } |
220 | 220 |
221 static TypeofMode GetTypeofMode(ExtraICState state) { | 221 static TypeofMode GetTypeofMode(ExtraICState state) { |
222 return LoadICState(state).typeof_mode(); | 222 return LoadGlobalICState(state).typeof_mode(); |
223 } | 223 } |
224 }; | 224 }; |
225 | 225 |
226 | 226 |
227 class StoreICState final BASE_EMBEDDED { | 227 class StoreICState final BASE_EMBEDDED { |
228 public: | 228 public: |
229 explicit StoreICState(ExtraICState extra_ic_state) : state_(extra_ic_state) {} | 229 explicit StoreICState(ExtraICState extra_ic_state) : state_(extra_ic_state) {} |
230 | 230 |
231 explicit StoreICState(LanguageMode mode) | 231 explicit StoreICState(LanguageMode mode) |
232 : state_(LanguageModeState::encode(mode)) {} | 232 : state_(LanguageModeState::encode(mode)) {} |
(...skipping 17 matching lines...) Expand all Loading... |
250 << LanguageModeState::kShift; | 250 << LanguageModeState::kShift; |
251 | 251 |
252 private: | 252 private: |
253 const ExtraICState state_; | 253 const ExtraICState state_; |
254 }; | 254 }; |
255 | 255 |
256 } // namespace internal | 256 } // namespace internal |
257 } // namespace v8 | 257 } // namespace v8 |
258 | 258 |
259 #endif // V8_IC_STATE_H_ | 259 #endif // V8_IC_STATE_H_ |
OLD | NEW |