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 #include "src/parsing/token.h" | 9 #include "src/parsing/token.h" |
10 | 10 |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 explicit LoadGlobalICState(TypeofMode typeof_mode) | 228 explicit LoadGlobalICState(TypeofMode typeof_mode) |
229 : state_(TypeofModeBits::encode(typeof_mode)) {} | 229 : state_(TypeofModeBits::encode(typeof_mode)) {} |
230 | 230 |
231 ExtraICState GetExtraICState() const { return state_; } | 231 ExtraICState GetExtraICState() const { return state_; } |
232 | 232 |
233 TypeofMode typeof_mode() const { return TypeofModeBits::decode(state_); } | 233 TypeofMode typeof_mode() const { return TypeofModeBits::decode(state_); } |
234 | 234 |
235 static TypeofMode GetTypeofMode(ExtraICState state) { | 235 static TypeofMode GetTypeofMode(ExtraICState state) { |
236 return LoadGlobalICState(state).typeof_mode(); | 236 return LoadGlobalICState(state).typeof_mode(); |
237 } | 237 } |
| 238 |
| 239 // For convenience, a statically declared encoding of typeof mode |
| 240 // IC state. |
| 241 static const ExtraICState kInsideTypeOfState = INSIDE_TYPEOF |
| 242 << TypeofModeBits::kShift; |
| 243 static const ExtraICState kNotInsideTypeOfState = NOT_INSIDE_TYPEOF |
| 244 << TypeofModeBits::kShift; |
238 }; | 245 }; |
239 | 246 |
240 | 247 |
241 class StoreICState final BASE_EMBEDDED { | 248 class StoreICState final BASE_EMBEDDED { |
242 public: | 249 public: |
243 explicit StoreICState(ExtraICState extra_ic_state) : state_(extra_ic_state) {} | 250 explicit StoreICState(ExtraICState extra_ic_state) : state_(extra_ic_state) {} |
244 | 251 |
245 explicit StoreICState(LanguageMode mode) | 252 explicit StoreICState(LanguageMode mode) |
246 : state_(LanguageModeState::encode(mode)) {} | 253 : state_(LanguageModeState::encode(mode)) {} |
247 | 254 |
(...skipping 16 matching lines...) Expand all Loading... |
264 << LanguageModeState::kShift; | 271 << LanguageModeState::kShift; |
265 | 272 |
266 private: | 273 private: |
267 const ExtraICState state_; | 274 const ExtraICState state_; |
268 }; | 275 }; |
269 | 276 |
270 } // namespace internal | 277 } // namespace internal |
271 } // namespace v8 | 278 } // namespace v8 |
272 | 279 |
273 #endif // V8_IC_STATE_H_ | 280 #endif // V8_IC_STATE_H_ |
OLD | NEW |