Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(251)

Side by Side Diff: src/ic/ic-state.h

Issue 755513003: Hydrogen: fix keyed loads with string keys (Closed) Base URL: gh:v8/v8@master
Patch Set: better fix Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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_
OLDNEW
« src/ic/ic-compiler.cc ('K') | « src/ic/ic-inl.h ('k') | src/type-info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698