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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
229 static ContextualMode GetContextualMode(ExtraICState state) { | 229 static ContextualMode GetContextualMode(ExtraICState state) { |
230 return LoadICState(state).contextual_mode(); | 230 return LoadICState(state).contextual_mode(); |
231 } | 231 } |
232 | 232 |
233 private: | 233 private: |
234 class ContextualModeBits : public BitField<ContextualMode, 0, 1> {}; | 234 class ContextualModeBits : public BitField<ContextualMode, 0, 1> {}; |
235 STATIC_ASSERT(static_cast<int>(NOT_CONTEXTUAL) == 0); | 235 STATIC_ASSERT(static_cast<int>(NOT_CONTEXTUAL) == 0); |
236 | 236 |
237 const ExtraICState state_; | 237 const ExtraICState state_; |
238 }; | 238 }; |
239 | |
240 | |
241 class KeyedLoadICState FINAL BASE_EMBEDDED { | |
Jakob Kummerow
2014/12/10 15:21:18
I see that you're just following an existing patte
| |
242 public: | |
243 explicit KeyedLoadICState(ExtraICState extra_ic_state) | |
244 : state_(extra_ic_state) {} | |
245 | |
246 explicit KeyedLoadICState(IcCheckType key_type) | |
247 : state_(IcCheckTypeField::encode(key_type)) {} | |
248 | |
249 ExtraICState GetExtraICState() const { return state_; } | |
250 | |
251 IcCheckType key_type() const { | |
252 return IcCheckTypeField::decode(state_); | |
253 } | |
254 | |
255 static IcCheckType GetKeyType(ExtraICState state) { | |
256 return KeyedLoadICState(state).key_type(); | |
257 } | |
258 | |
259 private: | |
260 // Offset is just to make sure that LoadICState is not conflicting with us | |
261 class IcCheckTypeField : public BitField<IcCheckType, 1, 1> {}; | |
262 | |
263 const ExtraICState state_; | |
264 }; | |
239 } | 265 } |
240 } | 266 } |
241 | 267 |
242 #endif // V8_IC_STATE_H_ | 268 #endif // V8_IC_STATE_H_ |
OLD | NEW |