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

Unified 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 side-by-side diff with in-line comments
Download patch
« src/ic/ic-compiler.cc ('K') | « src/ic/ic-inl.h ('k') | src/type-info.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ic/ic-state.h
diff --git a/src/ic/ic-state.h b/src/ic/ic-state.h
index 9bb877a3835761448072ae65ec68be73e5109d95..4a1a2cfc46302f23946ca28af02a85f3f26bca20 100644
--- a/src/ic/ic-state.h
+++ b/src/ic/ic-state.h
@@ -236,6 +236,32 @@ class LoadICState FINAL BASE_EMBEDDED {
const ExtraICState state_;
};
+
+
+class KeyedLoadICState FINAL BASE_EMBEDDED {
Jakob Kummerow 2014/12/10 15:21:18 I see that you're just following an existing patte
+ public:
+ explicit KeyedLoadICState(ExtraICState extra_ic_state)
+ : state_(extra_ic_state) {}
+
+ explicit KeyedLoadICState(IcCheckType key_type)
+ : state_(IcCheckTypeField::encode(key_type)) {}
+
+ ExtraICState GetExtraICState() const { return state_; }
+
+ IcCheckType key_type() const {
+ return IcCheckTypeField::decode(state_);
+ }
+
+ static IcCheckType GetKeyType(ExtraICState state) {
+ return KeyedLoadICState(state).key_type();
+ }
+
+ private:
+ // Offset is just to make sure that LoadICState is not conflicting with us
+ class IcCheckTypeField : public BitField<IcCheckType, 1, 1> {};
+
+ const ExtraICState state_;
+};
}
}
« 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